{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s090158806", "group_id": "codeNet:p02262", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\ta := []int{}\n\ts := bufio.NewScanner(os.Stdin)\n\tfor i := 0; i < n; i++ {\n\t\ts.Scan()\n\t\taa, _ := strconv.Atoi(s.Text())\n\t\ta = append(a, aa)\n\t}\n\n\tshellSort(n, a)\n}\n\nfunc shellSort(n int, a []int) {\n\tcnt := 0\n\n\tg := []int{}\n\tfor i := 2; i <= n+1; i *= 2 {\n\t\tg = append([]int{i-1}, g...)\n\t}\n\tm := len(g)\n\n\tfor i := 0; i < m; i++ {\n\t\tvar c int\n\t\ta, c = insertionSort(n, a, g[i])\n\t\tcnt += c\n\t}\n\n\tfmt.Println(m)\n\tfmt.Print(g[0])\n\tfor i := 1; i < m; i++ {\n\t\tfmt.Print(\" \")\n\t\tfmt.Print(g[i])\n\t}\n\tfmt.Println()\n\tfmt.Println(cnt)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Println(a[i])\n\t}\n}\n\nfunc insertionSort(n int, a []int, g int) ([]int, int) {\n\tcnt := 0\n\tfor i := g; i < n; i++ {\n\t\tv := a[i]\n\t\tj := i-g\n\t\tfor ; j >= 0; j = j-g {\n\t\t\tif a[j] > v {\n\t\t\t\ta[j+g] = a[j]\n\t\t\t\tcnt++\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\ta[j+g] = v\n\t}\n\treturn a, cnt\n}\n\n", "language": "Go", "metadata": {"date": 1555944796, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02262.html", "problem_id": "p02262", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02262/input.txt", "sample_output_relpath": "derived/input_output/data/p02262/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02262/Go/s090158806.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s090158806", "user_id": "u813563655"}, "prompt_components": {"gold_output": "2\n4 1\n3\n1\n2\n3\n4\n5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\ta := []int{}\n\ts := bufio.NewScanner(os.Stdin)\n\tfor i := 0; i < n; i++ {\n\t\ts.Scan()\n\t\taa, _ := strconv.Atoi(s.Text())\n\t\ta = append(a, aa)\n\t}\n\n\tshellSort(n, a)\n}\n\nfunc shellSort(n int, a []int) {\n\tcnt := 0\n\n\tg := []int{}\n\tfor i := 2; i <= n+1; i *= 2 {\n\t\tg = append([]int{i-1}, g...)\n\t}\n\tm := len(g)\n\n\tfor i := 0; i < m; i++ {\n\t\tvar c int\n\t\ta, c = insertionSort(n, a, g[i])\n\t\tcnt += c\n\t}\n\n\tfmt.Println(m)\n\tfmt.Print(g[0])\n\tfor i := 1; i < m; i++ {\n\t\tfmt.Print(\" \")\n\t\tfmt.Print(g[i])\n\t}\n\tfmt.Println()\n\tfmt.Println(cnt)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Println(a[i])\n\t}\n}\n\nfunc insertionSort(n int, a []int, g int) ([]int, int) {\n\tcnt := 0\n\tfor i := g; i < n; i++ {\n\t\tv := a[i]\n\t\tj := i-g\n\t\tfor ; j >= 0; j = j-g {\n\t\t\tif a[j] > v {\n\t\t\t\ta[j+g] = a[j]\n\t\t\t\tcnt++\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\ta[j+g] = v\n\t}\n\treturn a, cnt\n}\n\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nShell Sort\n\nShell Sort is a generalization of Insertion Sort to arrange a list of $n$ elements $A$.\n\n1 insertionSort(A, n, g)\n2 for i = g to n-1\n3 v = A[i]\n4 j = i - g\n5 while j >= 0 && A[j] > v\n6 A[j+g] = A[j]\n7 j = j - g\n8 cnt++\n9 A[j+g] = v\n10\n11 shellSort(A, n)\n12 cnt = 0\n13 m = ?\n14 G[] = {?, ?,..., ?}\n15 for i = 0 to m-1\n16 insertionSort(A, n, G[i])\n\nA function shellSort(A, n) performs a function insertionSort(A, n, g), which considers every $g$-th elements. Beginning with large values of $g$, it repeats the insertion sort with smaller $g$.\n\nYour task is to complete the above program by filling ?. Write a program which reads an integer $n$ and a sequence $A$, and prints $m$, $G_i (i = 0, 1, ..., m − 1)$ in the pseudo code and the sequence $A$ in ascending order. The output of your program must meet the following requirements:\n\n$1 \\leq m \\leq 100$\n\n$0 \\leq G_i \\leq n$\n\ncnt does not exceed $\\lceil n^{1.5}\\rceil$\n\nInput\n\nIn the first line, an integer $n$ is given. In the following $n$ lines, $A_i (i=0,1,...,n-1)$ are given for each line.\n\nOutput\n\nIn the first line, print an integer $m$. In the second line, print $m$ integers $G_i (i=0,1,...,m-1)$ separated by single space character in a line.\n\nIn the third line, print cnt in a line. In the following $n$ lines, print $A_i (i=0,1,...,n-1)$ respectively.\n\nThis problem has multiple solutions and the judge will be performed by a special validator.\n\nConstraints\n\n$1 \\leq n \\leq 1,000,000$\n\n$0 \\leq A_i \\leq 10^9$\n\nSample Input 1\n\n5\n5\n1\n4\n3\n2\n\nSample Output 1\n\n2\n4 1\n3\n1\n2\n3\n4\n5\n\nSample Input 2\n\n3\n3\n2\n1\n\nSample Output 2\n\n1\n1\n3\n1\n2\n3", "sample_input": "5\n5\n1\n4\n3\n2\n"}, "reference_outputs": ["2\n4 1\n3\n1\n2\n3\n4\n5\n"], "source_document_id": "p02262", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nShell Sort\n\nShell Sort is a generalization of Insertion Sort to arrange a list of $n$ elements $A$.\n\n1 insertionSort(A, n, g)\n2 for i = g to n-1\n3 v = A[i]\n4 j = i - g\n5 while j >= 0 && A[j] > v\n6 A[j+g] = A[j]\n7 j = j - g\n8 cnt++\n9 A[j+g] = v\n10\n11 shellSort(A, n)\n12 cnt = 0\n13 m = ?\n14 G[] = {?, ?,..., ?}\n15 for i = 0 to m-1\n16 insertionSort(A, n, G[i])\n\nA function shellSort(A, n) performs a function insertionSort(A, n, g), which considers every $g$-th elements. Beginning with large values of $g$, it repeats the insertion sort with smaller $g$.\n\nYour task is to complete the above program by filling ?. Write a program which reads an integer $n$ and a sequence $A$, and prints $m$, $G_i (i = 0, 1, ..., m − 1)$ in the pseudo code and the sequence $A$ in ascending order. The output of your program must meet the following requirements:\n\n$1 \\leq m \\leq 100$\n\n$0 \\leq G_i \\leq n$\n\ncnt does not exceed $\\lceil n^{1.5}\\rceil$\n\nInput\n\nIn the first line, an integer $n$ is given. In the following $n$ lines, $A_i (i=0,1,...,n-1)$ are given for each line.\n\nOutput\n\nIn the first line, print an integer $m$. In the second line, print $m$ integers $G_i (i=0,1,...,m-1)$ separated by single space character in a line.\n\nIn the third line, print cnt in a line. In the following $n$ lines, print $A_i (i=0,1,...,n-1)$ respectively.\n\nThis problem has multiple solutions and the judge will be performed by a special validator.\n\nConstraints\n\n$1 \\leq n \\leq 1,000,000$\n\n$0 \\leq A_i \\leq 10^9$\n\nSample Input 1\n\n5\n5\n1\n4\n3\n2\n\nSample Output 1\n\n2\n4 1\n3\n1\n2\n3\n4\n5\n\nSample Input 2\n\n3\n3\n2\n1\n\nSample Output 2\n\n1\n1\n3\n1\n2\n3", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 921, "cpu_time_ms": 1970, "memory_kb": 24508}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s079957326", "group_id": "codeNet:p02262", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tn := 0\n\tsc := bufio.NewScanner(os.Stdin)\n\tif sc.Scan() {\n\t\tn, _ = strconv.Atoi(sc.Text())\n\t}\n\tA := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tif !sc.Scan() {\n\t\t\tbreak\n\t\t}\n\t\tA[i], _ = strconv.Atoi(sc.Text())\n\t}\n\n\tresult, G, count := shellSort(A, n)\n\tfmt.Println(len(G))\n\tfmt.Println(Stringf(G, \" \"))\n\tfmt.Println(count)\n\tfmt.Println(Stringf(result, \"\\n\"))\n}\n\nfunc insertionSort(A []int, n, g int) ([]int, int) {\n\tcnt := 0\n\tfor i := g; i < n; i++ {\n\t\tv := A[i]\n\t\tj := i - g\n\t\tfor j >= 0 && A[j] > v {\n\t\t\tA[j+g] = A[j]\n\t\t\tj = j - g\n\t\t\tcnt++\n\t\t}\n\t\tA[j+g] = v\n\t}\n\treturn A, cnt\n}\n\nfunc shellSort(A []int, n int) ([]int, []int, int) {\n\tcnt, tmp := 0, 0\n\tvar G []int\n\tfor h := 1; h <= n; {\n\t\tG = append(G, 0)\n\t\tcopy(G[1:], G[0:])\n\t\tG[0] = h\n\t\th = 3*h + 1\n\t}\n\tfor i := 0; i < len(G); i++ {\n\t\tA, tmp = insertionSort(A, n, G[i])\n\t\tcnt += tmp\n\t}\n\treturn A, G, cnt\n}\n\nfunc Stringf(A []int, sep string) string {\n\ttext := \"\"\n\tfor i, val := range A {\n\t\tif i > 0 {\n\t\t\ttext += sep\n\t\t}\n\t\ttext += fmt.Sprint(val)\n\t}\n\treturn text\n}\n\n", "language": "Go", "metadata": {"date": 1525187952, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02262.html", "problem_id": "p02262", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02262/input.txt", "sample_output_relpath": "derived/input_output/data/p02262/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02262/Go/s079957326.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s079957326", "user_id": "u071509228"}, "prompt_components": {"gold_output": "2\n4 1\n3\n1\n2\n3\n4\n5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tn := 0\n\tsc := bufio.NewScanner(os.Stdin)\n\tif sc.Scan() {\n\t\tn, _ = strconv.Atoi(sc.Text())\n\t}\n\tA := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tif !sc.Scan() {\n\t\t\tbreak\n\t\t}\n\t\tA[i], _ = strconv.Atoi(sc.Text())\n\t}\n\n\tresult, G, count := shellSort(A, n)\n\tfmt.Println(len(G))\n\tfmt.Println(Stringf(G, \" \"))\n\tfmt.Println(count)\n\tfmt.Println(Stringf(result, \"\\n\"))\n}\n\nfunc insertionSort(A []int, n, g int) ([]int, int) {\n\tcnt := 0\n\tfor i := g; i < n; i++ {\n\t\tv := A[i]\n\t\tj := i - g\n\t\tfor j >= 0 && A[j] > v {\n\t\t\tA[j+g] = A[j]\n\t\t\tj = j - g\n\t\t\tcnt++\n\t\t}\n\t\tA[j+g] = v\n\t}\n\treturn A, cnt\n}\n\nfunc shellSort(A []int, n int) ([]int, []int, int) {\n\tcnt, tmp := 0, 0\n\tvar G []int\n\tfor h := 1; h <= n; {\n\t\tG = append(G, 0)\n\t\tcopy(G[1:], G[0:])\n\t\tG[0] = h\n\t\th = 3*h + 1\n\t}\n\tfor i := 0; i < len(G); i++ {\n\t\tA, tmp = insertionSort(A, n, G[i])\n\t\tcnt += tmp\n\t}\n\treturn A, G, cnt\n}\n\nfunc Stringf(A []int, sep string) string {\n\ttext := \"\"\n\tfor i, val := range A {\n\t\tif i > 0 {\n\t\t\ttext += sep\n\t\t}\n\t\ttext += fmt.Sprint(val)\n\t}\n\treturn text\n}\n\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nShell Sort\n\nShell Sort is a generalization of Insertion Sort to arrange a list of $n$ elements $A$.\n\n1 insertionSort(A, n, g)\n2 for i = g to n-1\n3 v = A[i]\n4 j = i - g\n5 while j >= 0 && A[j] > v\n6 A[j+g] = A[j]\n7 j = j - g\n8 cnt++\n9 A[j+g] = v\n10\n11 shellSort(A, n)\n12 cnt = 0\n13 m = ?\n14 G[] = {?, ?,..., ?}\n15 for i = 0 to m-1\n16 insertionSort(A, n, G[i])\n\nA function shellSort(A, n) performs a function insertionSort(A, n, g), which considers every $g$-th elements. Beginning with large values of $g$, it repeats the insertion sort with smaller $g$.\n\nYour task is to complete the above program by filling ?. Write a program which reads an integer $n$ and a sequence $A$, and prints $m$, $G_i (i = 0, 1, ..., m − 1)$ in the pseudo code and the sequence $A$ in ascending order. The output of your program must meet the following requirements:\n\n$1 \\leq m \\leq 100$\n\n$0 \\leq G_i \\leq n$\n\ncnt does not exceed $\\lceil n^{1.5}\\rceil$\n\nInput\n\nIn the first line, an integer $n$ is given. In the following $n$ lines, $A_i (i=0,1,...,n-1)$ are given for each line.\n\nOutput\n\nIn the first line, print an integer $m$. In the second line, print $m$ integers $G_i (i=0,1,...,m-1)$ separated by single space character in a line.\n\nIn the third line, print cnt in a line. In the following $n$ lines, print $A_i (i=0,1,...,n-1)$ respectively.\n\nThis problem has multiple solutions and the judge will be performed by a special validator.\n\nConstraints\n\n$1 \\leq n \\leq 1,000,000$\n\n$0 \\leq A_i \\leq 10^9$\n\nSample Input 1\n\n5\n5\n1\n4\n3\n2\n\nSample Output 1\n\n2\n4 1\n3\n1\n2\n3\n4\n5\n\nSample Input 2\n\n3\n3\n2\n1\n\nSample Output 2\n\n1\n1\n3\n1\n2\n3", "sample_input": "5\n5\n1\n4\n3\n2\n"}, "reference_outputs": ["2\n4 1\n3\n1\n2\n3\n4\n5\n"], "source_document_id": "p02262", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nShell Sort\n\nShell Sort is a generalization of Insertion Sort to arrange a list of $n$ elements $A$.\n\n1 insertionSort(A, n, g)\n2 for i = g to n-1\n3 v = A[i]\n4 j = i - g\n5 while j >= 0 && A[j] > v\n6 A[j+g] = A[j]\n7 j = j - g\n8 cnt++\n9 A[j+g] = v\n10\n11 shellSort(A, n)\n12 cnt = 0\n13 m = ?\n14 G[] = {?, ?,..., ?}\n15 for i = 0 to m-1\n16 insertionSort(A, n, G[i])\n\nA function shellSort(A, n) performs a function insertionSort(A, n, g), which considers every $g$-th elements. Beginning with large values of $g$, it repeats the insertion sort with smaller $g$.\n\nYour task is to complete the above program by filling ?. Write a program which reads an integer $n$ and a sequence $A$, and prints $m$, $G_i (i = 0, 1, ..., m − 1)$ in the pseudo code and the sequence $A$ in ascending order. The output of your program must meet the following requirements:\n\n$1 \\leq m \\leq 100$\n\n$0 \\leq G_i \\leq n$\n\ncnt does not exceed $\\lceil n^{1.5}\\rceil$\n\nInput\n\nIn the first line, an integer $n$ is given. In the following $n$ lines, $A_i (i=0,1,...,n-1)$ are given for each line.\n\nOutput\n\nIn the first line, print an integer $m$. In the second line, print $m$ integers $G_i (i=0,1,...,m-1)$ separated by single space character in a line.\n\nIn the third line, print cnt in a line. In the following $n$ lines, print $A_i (i=0,1,...,n-1)$ respectively.\n\nThis problem has multiple solutions and the judge will be performed by a special validator.\n\nConstraints\n\n$1 \\leq n \\leq 1,000,000$\n\n$0 \\leq A_i \\leq 10^9$\n\nSample Input 1\n\n5\n5\n1\n4\n3\n2\n\nSample Output 1\n\n2\n4 1\n3\n1\n2\n3\n4\n5\n\nSample Input 2\n\n3\n3\n2\n1\n\nSample Output 2\n\n1\n1\n3\n1\n2\n3", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1087, "cpu_time_ms": 9520, "memory_kb": 55620}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s681889505", "group_id": "codeNet:p02262", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n\t\"strconv\"\n)\n\nfunc main() {\n\n\t// 繰り返し回数\n\tN, _ := strconv.Atoi(readLine())\n\n\t//words := strings.Fields(readLine())\n\n\tintWords := make([]int, 0, 99999)\n\tfor i := 0; i < N; {\n\t\tintWord, _ := strconv.Atoi(readLine())\n\t\tintWords = append(intWords, intWord)\n\t\ti++\n\t}\n\n\t//fmt.Println(reduce(intWords))\n\n\t// スパン\n\tspan_g := getspan(N)\n\n\tfmt.Println(len(span_g))\n\tfmt.Println(reduce(span_g))\n\n\tcnt := 0\n\n\tfor _, g := range span_g {\n\n\t\t/**\n\t\t選択そーと\n\t\t */\n\t\t//for index := 0; index < N; {\n\t\tfor index := g; index < N; {\n\n\t\t\t// ソート済みエリアで入れ替え\n\n\t\t\tfor indexInSorted := index; indexInSorted-g >= 0; {\n\t\t\t\tif intWords[indexInSorted-g] > intWords[indexInSorted] {\n\t\t\t\t\t// 交換\n\t\t\t\t\ttemp := intWords[indexInSorted-g]\n\t\t\t\t\tintWords[indexInSorted-g] = intWords[indexInSorted]\n\t\t\t\t\tintWords[indexInSorted] = temp\n\n\t\t\t\t\t// カウント\n\t\t\t\t\tcnt++\n\t\t\t\t}\n\t\t\t\tindexInSorted -= g\n\t\t\t}\n\t\t\t// 1ずつ増やしていく。\n\t\t\tindex++\n\t\t}\n\t}\n\n\tfmt.Println(cnt)\n\n\tfor _, value := range intWords {\n\t\tfmt.Println(value)\n\t}\n\treturn\n}\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000)\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 100)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc reduce(numArray []int) string {\n\treducedString := \"\"\n\tfor _, num := range numArray {\n\t\treducedString += \" \" + strconv.FormatInt(int64(num), 10)\n\t}\n\treturn strings.Trim(reducedString, \" \")\n}\n\nfunc getspan(N int) []int {\n\tvar spans []int\n\n\tfor span := 1; span <= N; {\n\n\t\tspans = append([]int{span}, spans...)\n\t\tspan = 3*span + 1\n\t}\n\n\treturn spans\n}\n\n", "language": "Go", "metadata": {"date": 1530026799, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02262.html", "problem_id": "p02262", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02262/input.txt", "sample_output_relpath": "derived/input_output/data/p02262/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02262/Go/s681889505.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s681889505", "user_id": "u142244215"}, "prompt_components": {"gold_output": "2\n4 1\n3\n1\n2\n3\n4\n5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n\t\"strconv\"\n)\n\nfunc main() {\n\n\t// 繰り返し回数\n\tN, _ := strconv.Atoi(readLine())\n\n\t//words := strings.Fields(readLine())\n\n\tintWords := make([]int, 0, 99999)\n\tfor i := 0; i < N; {\n\t\tintWord, _ := strconv.Atoi(readLine())\n\t\tintWords = append(intWords, intWord)\n\t\ti++\n\t}\n\n\t//fmt.Println(reduce(intWords))\n\n\t// スパン\n\tspan_g := getspan(N)\n\n\tfmt.Println(len(span_g))\n\tfmt.Println(reduce(span_g))\n\n\tcnt := 0\n\n\tfor _, g := range span_g {\n\n\t\t/**\n\t\t選択そーと\n\t\t */\n\t\t//for index := 0; index < N; {\n\t\tfor index := g; index < N; {\n\n\t\t\t// ソート済みエリアで入れ替え\n\n\t\t\tfor indexInSorted := index; indexInSorted-g >= 0; {\n\t\t\t\tif intWords[indexInSorted-g] > intWords[indexInSorted] {\n\t\t\t\t\t// 交換\n\t\t\t\t\ttemp := intWords[indexInSorted-g]\n\t\t\t\t\tintWords[indexInSorted-g] = intWords[indexInSorted]\n\t\t\t\t\tintWords[indexInSorted] = temp\n\n\t\t\t\t\t// カウント\n\t\t\t\t\tcnt++\n\t\t\t\t}\n\t\t\t\tindexInSorted -= g\n\t\t\t}\n\t\t\t// 1ずつ増やしていく。\n\t\t\tindex++\n\t\t}\n\t}\n\n\tfmt.Println(cnt)\n\n\tfor _, value := range intWords {\n\t\tfmt.Println(value)\n\t}\n\treturn\n}\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000)\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 100)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc reduce(numArray []int) string {\n\treducedString := \"\"\n\tfor _, num := range numArray {\n\t\treducedString += \" \" + strconv.FormatInt(int64(num), 10)\n\t}\n\treturn strings.Trim(reducedString, \" \")\n}\n\nfunc getspan(N int) []int {\n\tvar spans []int\n\n\tfor span := 1; span <= N; {\n\n\t\tspans = append([]int{span}, spans...)\n\t\tspan = 3*span + 1\n\t}\n\n\treturn spans\n}\n\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nShell Sort\n\nShell Sort is a generalization of Insertion Sort to arrange a list of $n$ elements $A$.\n\n1 insertionSort(A, n, g)\n2 for i = g to n-1\n3 v = A[i]\n4 j = i - g\n5 while j >= 0 && A[j] > v\n6 A[j+g] = A[j]\n7 j = j - g\n8 cnt++\n9 A[j+g] = v\n10\n11 shellSort(A, n)\n12 cnt = 0\n13 m = ?\n14 G[] = {?, ?,..., ?}\n15 for i = 0 to m-1\n16 insertionSort(A, n, G[i])\n\nA function shellSort(A, n) performs a function insertionSort(A, n, g), which considers every $g$-th elements. Beginning with large values of $g$, it repeats the insertion sort with smaller $g$.\n\nYour task is to complete the above program by filling ?. Write a program which reads an integer $n$ and a sequence $A$, and prints $m$, $G_i (i = 0, 1, ..., m − 1)$ in the pseudo code and the sequence $A$ in ascending order. The output of your program must meet the following requirements:\n\n$1 \\leq m \\leq 100$\n\n$0 \\leq G_i \\leq n$\n\ncnt does not exceed $\\lceil n^{1.5}\\rceil$\n\nInput\n\nIn the first line, an integer $n$ is given. In the following $n$ lines, $A_i (i=0,1,...,n-1)$ are given for each line.\n\nOutput\n\nIn the first line, print an integer $m$. In the second line, print $m$ integers $G_i (i=0,1,...,m-1)$ separated by single space character in a line.\n\nIn the third line, print cnt in a line. In the following $n$ lines, print $A_i (i=0,1,...,n-1)$ respectively.\n\nThis problem has multiple solutions and the judge will be performed by a special validator.\n\nConstraints\n\n$1 \\leq n \\leq 1,000,000$\n\n$0 \\leq A_i \\leq 10^9$\n\nSample Input 1\n\n5\n5\n1\n4\n3\n2\n\nSample Output 1\n\n2\n4 1\n3\n1\n2\n3\n4\n5\n\nSample Input 2\n\n3\n3\n2\n1\n\nSample Output 2\n\n1\n1\n3\n1\n2\n3", "sample_input": "5\n5\n1\n4\n3\n2\n"}, "reference_outputs": ["2\n4 1\n3\n1\n2\n3\n4\n5\n"], "source_document_id": "p02262", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nShell Sort\n\nShell Sort is a generalization of Insertion Sort to arrange a list of $n$ elements $A$.\n\n1 insertionSort(A, n, g)\n2 for i = g to n-1\n3 v = A[i]\n4 j = i - g\n5 while j >= 0 && A[j] > v\n6 A[j+g] = A[j]\n7 j = j - g\n8 cnt++\n9 A[j+g] = v\n10\n11 shellSort(A, n)\n12 cnt = 0\n13 m = ?\n14 G[] = {?, ?,..., ?}\n15 for i = 0 to m-1\n16 insertionSort(A, n, G[i])\n\nA function shellSort(A, n) performs a function insertionSort(A, n, g), which considers every $g$-th elements. Beginning with large values of $g$, it repeats the insertion sort with smaller $g$.\n\nYour task is to complete the above program by filling ?. Write a program which reads an integer $n$ and a sequence $A$, and prints $m$, $G_i (i = 0, 1, ..., m − 1)$ in the pseudo code and the sequence $A$ in ascending order. The output of your program must meet the following requirements:\n\n$1 \\leq m \\leq 100$\n\n$0 \\leq G_i \\leq n$\n\ncnt does not exceed $\\lceil n^{1.5}\\rceil$\n\nInput\n\nIn the first line, an integer $n$ is given. In the following $n$ lines, $A_i (i=0,1,...,n-1)$ are given for each line.\n\nOutput\n\nIn the first line, print an integer $m$. In the second line, print $m$ integers $G_i (i=0,1,...,m-1)$ separated by single space character in a line.\n\nIn the third line, print cnt in a line. In the following $n$ lines, print $A_i (i=0,1,...,n-1)$ respectively.\n\nThis problem has multiple solutions and the judge will be performed by a special validator.\n\nConstraints\n\n$1 \\leq n \\leq 1,000,000$\n\n$0 \\leq A_i \\leq 10^9$\n\nSample Input 1\n\n5\n5\n1\n4\n3\n2\n\nSample Output 1\n\n2\n4 1\n3\n1\n2\n3\n4\n5\n\nSample Input 2\n\n3\n3\n2\n1\n\nSample Output 2\n\n1\n1\n3\n1\n2\n3", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1707, "cpu_time_ms": 7170, "memory_kb": 4300}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s078452748", "group_id": "codeNet:p02262", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc nextInt(sc *bufio.Scanner) int {\n\tsc.Scan()\n\tt, _ := strconv.Atoi(sc.Text())\n\treturn t\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\ta := make([]int, n)\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = nextInt(sc)\n\t}\n\tr := shellsort(a)\n\tfmt.Println(r)\n\tfor i := 0; i < len(a); i++ {\n\t\tfmt.Println(a[i])\n\t}\n}\n\nfunc isort(a []int, g int) int {\n\trcnt := 0\n\tfor i := g; i < len(a); i++ {\n\t\tv := a[i]\n\t\tj := i - g\n\t\tfor j >= 0 && a[j] > v {\n\t\t\ta[j+g] = a[j]\n\t\t\tj = j - g\n\t\t\trcnt++\n\t\t}\n\t\ta[j+g] = v\n\t}\n\treturn rcnt\n}\n\nfunc shellsort(a []int) int {\n\trcnt := 0\n\tG := make([]int, 0)\n\th := 1\n\tfor {\n\t\tif h > len(a) {\n\t\t\tbreak\n\t\t}\n\t\tG = append(G, h)\n\t\th = 3*h + 1\n\t}\n\tfmt.Println(len(G))\n\tfor i := len(G) - 1; i >= 0; i-- {\n\t\tfmt.Printf(\"%d\", G[i])\n\t\tif i > 0 {\n\t\t\tfmt.Printf(\" \")\n\t\t}\n\t}\n\tfmt.Println()\n\tfor i := len(G) - 1; i >= 0; i-- {\n\t\trcnt += isort(a, G[i])\n\t}\n\treturn rcnt\n}\n\n", "language": "Go", "metadata": {"date": 1572355340, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02262.html", "problem_id": "p02262", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02262/input.txt", "sample_output_relpath": "derived/input_output/data/p02262/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02262/Go/s078452748.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s078452748", "user_id": "u192664973"}, "prompt_components": {"gold_output": "2\n4 1\n3\n1\n2\n3\n4\n5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc nextInt(sc *bufio.Scanner) int {\n\tsc.Scan()\n\tt, _ := strconv.Atoi(sc.Text())\n\treturn t\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\ta := make([]int, n)\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = nextInt(sc)\n\t}\n\tr := shellsort(a)\n\tfmt.Println(r)\n\tfor i := 0; i < len(a); i++ {\n\t\tfmt.Println(a[i])\n\t}\n}\n\nfunc isort(a []int, g int) int {\n\trcnt := 0\n\tfor i := g; i < len(a); i++ {\n\t\tv := a[i]\n\t\tj := i - g\n\t\tfor j >= 0 && a[j] > v {\n\t\t\ta[j+g] = a[j]\n\t\t\tj = j - g\n\t\t\trcnt++\n\t\t}\n\t\ta[j+g] = v\n\t}\n\treturn rcnt\n}\n\nfunc shellsort(a []int) int {\n\trcnt := 0\n\tG := make([]int, 0)\n\th := 1\n\tfor {\n\t\tif h > len(a) {\n\t\t\tbreak\n\t\t}\n\t\tG = append(G, h)\n\t\th = 3*h + 1\n\t}\n\tfmt.Println(len(G))\n\tfor i := len(G) - 1; i >= 0; i-- {\n\t\tfmt.Printf(\"%d\", G[i])\n\t\tif i > 0 {\n\t\t\tfmt.Printf(\" \")\n\t\t}\n\t}\n\tfmt.Println()\n\tfor i := len(G) - 1; i >= 0; i-- {\n\t\trcnt += isort(a, G[i])\n\t}\n\treturn rcnt\n}\n\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nShell Sort\n\nShell Sort is a generalization of Insertion Sort to arrange a list of $n$ elements $A$.\n\n1 insertionSort(A, n, g)\n2 for i = g to n-1\n3 v = A[i]\n4 j = i - g\n5 while j >= 0 && A[j] > v\n6 A[j+g] = A[j]\n7 j = j - g\n8 cnt++\n9 A[j+g] = v\n10\n11 shellSort(A, n)\n12 cnt = 0\n13 m = ?\n14 G[] = {?, ?,..., ?}\n15 for i = 0 to m-1\n16 insertionSort(A, n, G[i])\n\nA function shellSort(A, n) performs a function insertionSort(A, n, g), which considers every $g$-th elements. Beginning with large values of $g$, it repeats the insertion sort with smaller $g$.\n\nYour task is to complete the above program by filling ?. Write a program which reads an integer $n$ and a sequence $A$, and prints $m$, $G_i (i = 0, 1, ..., m − 1)$ in the pseudo code and the sequence $A$ in ascending order. The output of your program must meet the following requirements:\n\n$1 \\leq m \\leq 100$\n\n$0 \\leq G_i \\leq n$\n\ncnt does not exceed $\\lceil n^{1.5}\\rceil$\n\nInput\n\nIn the first line, an integer $n$ is given. In the following $n$ lines, $A_i (i=0,1,...,n-1)$ are given for each line.\n\nOutput\n\nIn the first line, print an integer $m$. In the second line, print $m$ integers $G_i (i=0,1,...,m-1)$ separated by single space character in a line.\n\nIn the third line, print cnt in a line. In the following $n$ lines, print $A_i (i=0,1,...,n-1)$ respectively.\n\nThis problem has multiple solutions and the judge will be performed by a special validator.\n\nConstraints\n\n$1 \\leq n \\leq 1,000,000$\n\n$0 \\leq A_i \\leq 10^9$\n\nSample Input 1\n\n5\n5\n1\n4\n3\n2\n\nSample Output 1\n\n2\n4 1\n3\n1\n2\n3\n4\n5\n\nSample Input 2\n\n3\n3\n2\n1\n\nSample Output 2\n\n1\n1\n3\n1\n2\n3", "sample_input": "5\n5\n1\n4\n3\n2\n"}, "reference_outputs": ["2\n4 1\n3\n1\n2\n3\n4\n5\n"], "source_document_id": "p02262", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nShell Sort\n\nShell Sort is a generalization of Insertion Sort to arrange a list of $n$ elements $A$.\n\n1 insertionSort(A, n, g)\n2 for i = g to n-1\n3 v = A[i]\n4 j = i - g\n5 while j >= 0 && A[j] > v\n6 A[j+g] = A[j]\n7 j = j - g\n8 cnt++\n9 A[j+g] = v\n10\n11 shellSort(A, n)\n12 cnt = 0\n13 m = ?\n14 G[] = {?, ?,..., ?}\n15 for i = 0 to m-1\n16 insertionSort(A, n, G[i])\n\nA function shellSort(A, n) performs a function insertionSort(A, n, g), which considers every $g$-th elements. Beginning with large values of $g$, it repeats the insertion sort with smaller $g$.\n\nYour task is to complete the above program by filling ?. Write a program which reads an integer $n$ and a sequence $A$, and prints $m$, $G_i (i = 0, 1, ..., m − 1)$ in the pseudo code and the sequence $A$ in ascending order. The output of your program must meet the following requirements:\n\n$1 \\leq m \\leq 100$\n\n$0 \\leq G_i \\leq n$\n\ncnt does not exceed $\\lceil n^{1.5}\\rceil$\n\nInput\n\nIn the first line, an integer $n$ is given. In the following $n$ lines, $A_i (i=0,1,...,n-1)$ are given for each line.\n\nOutput\n\nIn the first line, print an integer $m$. In the second line, print $m$ integers $G_i (i=0,1,...,m-1)$ separated by single space character in a line.\n\nIn the third line, print cnt in a line. In the following $n$ lines, print $A_i (i=0,1,...,n-1)$ respectively.\n\nThis problem has multiple solutions and the judge will be performed by a special validator.\n\nConstraints\n\n$1 \\leq n \\leq 1,000,000$\n\n$0 \\leq A_i \\leq 10^9$\n\nSample Input 1\n\n5\n5\n1\n4\n3\n2\n\nSample Output 1\n\n2\n4 1\n3\n1\n2\n3\n4\n5\n\nSample Input 2\n\n3\n3\n2\n1\n\nSample Output 2\n\n1\n1\n3\n1\n2\n3", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 980, "cpu_time_ms": 1960, "memory_kb": 17492}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s601248827", "group_id": "codeNet:p02269", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt(sc)\n\n\tT := make([]int, n)\n\te := []string{}\n\tfor range T {\n\t\tsc.Scan()\n\t\tcmd := sc.Text()\n\t\tsc.Scan()\n\t\tstr := sc.Text()\n\t\tswitch cmd {\n\t\tcase \"insert\":\n\t\t\tinsert(getInt(str), T)\n\t\tcase \"find\":\n\t\t\tif find(getInt(str), T) {\n\t\t\t\te = append(e, \"yes\")\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\te = append(e, \"no\")\n\t\t}\n\t}\n\tt := trimBracket(fmt.Sprint(e))\n\tfmt.Println(strings.Replace(t, \" \", \"\\n\", -1))\n}\n\nfunc trimBracket(s string) string {\n\treturn strings.Trim(s, \"[]\")\n}\n\nfunc nextInt(s *bufio.Scanner) int {\n\ts.Scan()\n\tn, err := strconv.Atoi(s.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n\nfunc getInt(str string) int {\n\tcnt, p := 0, 1\n\tfor _, v := range str {\n\t\tcnt += p * int(v)\n\t\tp *= 5\n\t}\n\treturn cnt\n}\n\nfunc h1(key, n int) int {\n\treturn key % n\n}\n\nfunc h2(key, n int) int {\n\treturn 1 + h1(key, n-1)\n}\n\nfunc h(key, n, i int) int {\n\treturn (h1(key, n) + i*h2(key, n)) % n\n}\n\nfunc insert(key int, T []int) {\n\tn := len(T)\n\tfor i := 0; i < n; i++ {\n\t\tj := h(key, n, i)\n\t\tif T[j] == 0 {\n\t\t\tT[j] = key\n\t\t\tbreak\n\t\t}\n\t}\n}\n\nfunc find(key int, T []int) bool {\n\tsort.Ints(T)\n\tleft, mid, right := 0, 0, len(T)\n\tfor left < right {\n\t\tmid = (left + right) / 2\n\t\tif T[mid] == key {\n\t\t\treturn true\n\t\t} else if key > T[mid] {\n\t\t\tleft = mid + 1\n\t\t\tcontinue\n\t\t}\n\t\tright = mid\n\t}\n\treturn false\n}\n\n", "language": "Go", "metadata": {"date": 1558933964, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02269.html", "problem_id": "p02269", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02269/input.txt", "sample_output_relpath": "derived/input_output/data/p02269/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02269/Go/s601248827.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s601248827", "user_id": "u465189948"}, "prompt_components": {"gold_output": "no\nyes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt(sc)\n\n\tT := make([]int, n)\n\te := []string{}\n\tfor range T {\n\t\tsc.Scan()\n\t\tcmd := sc.Text()\n\t\tsc.Scan()\n\t\tstr := sc.Text()\n\t\tswitch cmd {\n\t\tcase \"insert\":\n\t\t\tinsert(getInt(str), T)\n\t\tcase \"find\":\n\t\t\tif find(getInt(str), T) {\n\t\t\t\te = append(e, \"yes\")\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\te = append(e, \"no\")\n\t\t}\n\t}\n\tt := trimBracket(fmt.Sprint(e))\n\tfmt.Println(strings.Replace(t, \" \", \"\\n\", -1))\n}\n\nfunc trimBracket(s string) string {\n\treturn strings.Trim(s, \"[]\")\n}\n\nfunc nextInt(s *bufio.Scanner) int {\n\ts.Scan()\n\tn, err := strconv.Atoi(s.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n\nfunc getInt(str string) int {\n\tcnt, p := 0, 1\n\tfor _, v := range str {\n\t\tcnt += p * int(v)\n\t\tp *= 5\n\t}\n\treturn cnt\n}\n\nfunc h1(key, n int) int {\n\treturn key % n\n}\n\nfunc h2(key, n int) int {\n\treturn 1 + h1(key, n-1)\n}\n\nfunc h(key, n, i int) int {\n\treturn (h1(key, n) + i*h2(key, n)) % n\n}\n\nfunc insert(key int, T []int) {\n\tn := len(T)\n\tfor i := 0; i < n; i++ {\n\t\tj := h(key, n, i)\n\t\tif T[j] == 0 {\n\t\t\tT[j] = key\n\t\t\tbreak\n\t\t}\n\t}\n}\n\nfunc find(key int, T []int) bool {\n\tsort.Ints(T)\n\tleft, mid, right := 0, 0, len(T)\n\tfor left < right {\n\t\tmid = (left + right) / 2\n\t\tif T[mid] == key {\n\t\t\treturn true\n\t\t} else if key > T[mid] {\n\t\t\tleft = mid + 1\n\t\t\tcontinue\n\t\t}\n\t\tright = mid\n\t}\n\treturn false\n}\n\n", "problem_context": "Search III\n\nYour task is to write a program of a simple dictionary which implements the following instructions:\n\ninsert str: insert a string str in to the dictionary\n\nfind str: if the distionary contains str, then print 'yes', otherwise print 'no'\n\nInput\n\nIn the first line n, the number of instructions is given. In the following n lines, n instructions are given in the above mentioned format.\n\nOutput\n\nPrint yes or no for each find instruction in a line.\n\nConstraints\n\nA string consists of 'A', 'C', 'G', or 'T'\n\n1 ≤ length of a string ≤ 12\n\nn ≤ 1000000\n\nSample Input 1\n\n5\ninsert A\ninsert T\ninsert C\nfind G\nfind A\n\nSample Output 1\n\nno\nyes\n\nSample Input 2\n\n13\ninsert AAA\ninsert AAC\ninsert AGA\ninsert AGG\ninsert TTT\nfind AAA\nfind CCC\nfind CCC\ninsert CCC\nfind CCC\ninsert T\nfind TTT\nfind T\n\nSample Output 2\n\nyes\nno\nno\nyes\nyes\nyes\n\nNotes\n\nTemplate in C", "sample_input": "5\ninsert A\ninsert T\ninsert C\nfind G\nfind A\n"}, "reference_outputs": ["no\nyes\n"], "source_document_id": "p02269", "source_text": "Search III\n\nYour task is to write a program of a simple dictionary which implements the following instructions:\n\ninsert str: insert a string str in to the dictionary\n\nfind str: if the distionary contains str, then print 'yes', otherwise print 'no'\n\nInput\n\nIn the first line n, the number of instructions is given. In the following n lines, n instructions are given in the above mentioned format.\n\nOutput\n\nPrint yes or no for each find instruction in a line.\n\nConstraints\n\nA string consists of 'A', 'C', 'G', or 'T'\n\n1 ≤ length of a string ≤ 12\n\nn ≤ 1000000\n\nSample Input 1\n\n5\ninsert A\ninsert T\ninsert C\nfind G\nfind A\n\nSample Output 1\n\nno\nyes\n\nSample Input 2\n\n13\ninsert AAA\ninsert AAC\ninsert AGA\ninsert AGG\ninsert TTT\nfind AAA\nfind CCC\nfind CCC\ninsert CCC\nfind CCC\ninsert T\nfind TTT\nfind T\n\nSample Output 2\n\nyes\nno\nno\nyes\nyes\nyes\n\nNotes\n\nTemplate in C", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1435, "cpu_time_ms": 4000, "memory_kb": 7944}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s755658828", "group_id": "codeNet:p02269", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar s = bufio.NewScanner(os.Stdin)\nvar w = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\ts.Split(bufio.ScanWords)\n\n\ts.Scan()\n\tn, _ := strconv.Atoi(s.Text())\n\n\tT := make(map[string]int)\n\tfor i := 0; s.Scan() && i < n; i++ {\n\t\tcmd := s.Text()\n\t\tif cmd[0] == 'f' {\n\t\t\ts.Scan()\n\t\t\tif _, ok := T[s.Text()]; ok {\n\t\t\t\tfmt.Fprintln(w, \"yes\")\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfmt.Fprintln(w, \"no\")\n\t\t\tcontinue\n\t\t}\n\t\ts.Scan()\n\t\tT[s.Text()] = 0\n\t}\n\n\tw.Flush()\n}\n\n", "language": "Go", "metadata": {"date": 1559020443, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02269.html", "problem_id": "p02269", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02269/input.txt", "sample_output_relpath": "derived/input_output/data/p02269/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02269/Go/s755658828.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s755658828", "user_id": "u465189948"}, "prompt_components": {"gold_output": "no\nyes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar s = bufio.NewScanner(os.Stdin)\nvar w = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\ts.Split(bufio.ScanWords)\n\n\ts.Scan()\n\tn, _ := strconv.Atoi(s.Text())\n\n\tT := make(map[string]int)\n\tfor i := 0; s.Scan() && i < n; i++ {\n\t\tcmd := s.Text()\n\t\tif cmd[0] == 'f' {\n\t\t\ts.Scan()\n\t\t\tif _, ok := T[s.Text()]; ok {\n\t\t\t\tfmt.Fprintln(w, \"yes\")\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfmt.Fprintln(w, \"no\")\n\t\t\tcontinue\n\t\t}\n\t\ts.Scan()\n\t\tT[s.Text()] = 0\n\t}\n\n\tw.Flush()\n}\n\n", "problem_context": "Search III\n\nYour task is to write a program of a simple dictionary which implements the following instructions:\n\ninsert str: insert a string str in to the dictionary\n\nfind str: if the distionary contains str, then print 'yes', otherwise print 'no'\n\nInput\n\nIn the first line n, the number of instructions is given. In the following n lines, n instructions are given in the above mentioned format.\n\nOutput\n\nPrint yes or no for each find instruction in a line.\n\nConstraints\n\nA string consists of 'A', 'C', 'G', or 'T'\n\n1 ≤ length of a string ≤ 12\n\nn ≤ 1000000\n\nSample Input 1\n\n5\ninsert A\ninsert T\ninsert C\nfind G\nfind A\n\nSample Output 1\n\nno\nyes\n\nSample Input 2\n\n13\ninsert AAA\ninsert AAC\ninsert AGA\ninsert AGG\ninsert TTT\nfind AAA\nfind CCC\nfind CCC\ninsert CCC\nfind CCC\ninsert T\nfind TTT\nfind T\n\nSample Output 2\n\nyes\nno\nno\nyes\nyes\nyes\n\nNotes\n\nTemplate in C", "sample_input": "5\ninsert A\ninsert T\ninsert C\nfind G\nfind A\n"}, "reference_outputs": ["no\nyes\n"], "source_document_id": "p02269", "source_text": "Search III\n\nYour task is to write a program of a simple dictionary which implements the following instructions:\n\ninsert str: insert a string str in to the dictionary\n\nfind str: if the distionary contains str, then print 'yes', otherwise print 'no'\n\nInput\n\nIn the first line n, the number of instructions is given. In the following n lines, n instructions are given in the above mentioned format.\n\nOutput\n\nPrint yes or no for each find instruction in a line.\n\nConstraints\n\nA string consists of 'A', 'C', 'G', or 'T'\n\n1 ≤ length of a string ≤ 12\n\nn ≤ 1000000\n\nSample Input 1\n\n5\ninsert A\ninsert T\ninsert C\nfind G\nfind A\n\nSample Output 1\n\nno\nyes\n\nSample Input 2\n\n13\ninsert AAA\ninsert AAC\ninsert AGA\ninsert AGG\ninsert TTT\nfind AAA\nfind CCC\nfind CCC\ninsert CCC\nfind CCC\ninsert T\nfind TTT\nfind T\n\nSample Output 2\n\nyes\nno\nno\nyes\nyes\nyes\n\nNotes\n\nTemplate in C", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 496, "cpu_time_ms": 410, "memory_kb": 33076}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s185032168", "group_id": "codeNet:p02269", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype hash struct {\n\tss [1000000]string\n}\n\nfunc (h *hash) insert(data string) {\n\tk := toKey(data)\n\ti := 0\n\thValue := h.hash(k, i)\n\tv := h.ss[hValue]\n\tfor v != \"\" && v != data {\n\t\ti++\n\t\thValue = h.hash(k, i)\n\t\tv = h.ss[hValue]\n\t}\n\tif h.ss[hValue] == \"\" {\n\t\th.ss[hValue] = data\n\t}\n}\n\nfunc (h *hash) search(data string) string {\n\tk := toKey(data)\n\ti := 0\n\tv := h.ss[h.hash(k, i)]\n\tfor v != \"\" && v != data {\n\t\ti++\n\t\tv = h.ss[h.hash(k, i)]\n\t}\n\treturn v\n}\n\nfunc (h *hash) hash(k int, i int) int {\n\treturn int(math.Mod(float64((h.h1(k) + i*h.h2(k))), float64(len(h.ss))))\n}\n\nfunc (h *hash) h1(k int) int {\n\treturn int(math.Mod(float64(k), float64(len(h.ss))))\n}\n\nfunc (h *hash) h2(k int) int {\n\treturn 1 + int(math.Mod(float64(k), float64(len(h.ss)-1)))\n}\n\nfunc toKey(s string) int {\n\tresult := 0\n\tfor _, c := range s {\n\t\tswitch c {\n\t\tcase 'A':\n\t\t\tresult = result + 1\n\t\tcase 'C':\n\t\t\tresult = result + 2\n\t\tcase 'G':\n\t\t\tresult = result + 3\n\t\tcase 'T':\n\t\t\tresult = result + 4\n\t\tdefault:\n\t\t}\n\t}\n\treturn result\n}\n\nfunc nextInt(sc *bufio.Scanner) int {\n\tsc.Scan()\n\tn, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n\nfunc nextStr(sc *bufio.Scanner) string {\n\tsc.Scan()\n\ts := sc.Text()\n\treturn s\n}\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\n\t//results := []string{}\n\tvar h hash\n\n\tn := nextInt(sc)\n\tfor n > 0 {\n\t\tcmd := nextStr(sc)\n\t\tv := nextStr(sc)\n\t\tswitch cmd {\n\t\tcase \"insert\":\n\t\t\th.insert(v)\n\t\tcase \"find\":\n\t\t\tres := h.search(v)\n\t\t\tif v == res {\n\t\t\t\t//results = append(results, \"yes\")\n\t\t\t\tfmt.Println(\"yes\")\n\t\t\t} else {\n\t\t\t\t//results = append(results, \"no\")\n\t\t\t\tfmt.Println(\"no\")\n\t\t\t}\n\t\tdefault:\n\t\t}\n\t\tn--\n\t}\n\t//for _, r := range results {\n\t//\tfmt.Println(r)\n\t//}\n}\n\n", "language": "Go", "metadata": {"date": 1517398495, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02269.html", "problem_id": "p02269", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02269/input.txt", "sample_output_relpath": "derived/input_output/data/p02269/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02269/Go/s185032168.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s185032168", "user_id": "u382730661"}, "prompt_components": {"gold_output": "no\nyes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype hash struct {\n\tss [1000000]string\n}\n\nfunc (h *hash) insert(data string) {\n\tk := toKey(data)\n\ti := 0\n\thValue := h.hash(k, i)\n\tv := h.ss[hValue]\n\tfor v != \"\" && v != data {\n\t\ti++\n\t\thValue = h.hash(k, i)\n\t\tv = h.ss[hValue]\n\t}\n\tif h.ss[hValue] == \"\" {\n\t\th.ss[hValue] = data\n\t}\n}\n\nfunc (h *hash) search(data string) string {\n\tk := toKey(data)\n\ti := 0\n\tv := h.ss[h.hash(k, i)]\n\tfor v != \"\" && v != data {\n\t\ti++\n\t\tv = h.ss[h.hash(k, i)]\n\t}\n\treturn v\n}\n\nfunc (h *hash) hash(k int, i int) int {\n\treturn int(math.Mod(float64((h.h1(k) + i*h.h2(k))), float64(len(h.ss))))\n}\n\nfunc (h *hash) h1(k int) int {\n\treturn int(math.Mod(float64(k), float64(len(h.ss))))\n}\n\nfunc (h *hash) h2(k int) int {\n\treturn 1 + int(math.Mod(float64(k), float64(len(h.ss)-1)))\n}\n\nfunc toKey(s string) int {\n\tresult := 0\n\tfor _, c := range s {\n\t\tswitch c {\n\t\tcase 'A':\n\t\t\tresult = result + 1\n\t\tcase 'C':\n\t\t\tresult = result + 2\n\t\tcase 'G':\n\t\t\tresult = result + 3\n\t\tcase 'T':\n\t\t\tresult = result + 4\n\t\tdefault:\n\t\t}\n\t}\n\treturn result\n}\n\nfunc nextInt(sc *bufio.Scanner) int {\n\tsc.Scan()\n\tn, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n\nfunc nextStr(sc *bufio.Scanner) string {\n\tsc.Scan()\n\ts := sc.Text()\n\treturn s\n}\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\n\t//results := []string{}\n\tvar h hash\n\n\tn := nextInt(sc)\n\tfor n > 0 {\n\t\tcmd := nextStr(sc)\n\t\tv := nextStr(sc)\n\t\tswitch cmd {\n\t\tcase \"insert\":\n\t\t\th.insert(v)\n\t\tcase \"find\":\n\t\t\tres := h.search(v)\n\t\t\tif v == res {\n\t\t\t\t//results = append(results, \"yes\")\n\t\t\t\tfmt.Println(\"yes\")\n\t\t\t} else {\n\t\t\t\t//results = append(results, \"no\")\n\t\t\t\tfmt.Println(\"no\")\n\t\t\t}\n\t\tdefault:\n\t\t}\n\t\tn--\n\t}\n\t//for _, r := range results {\n\t//\tfmt.Println(r)\n\t//}\n}\n\n", "problem_context": "Search III\n\nYour task is to write a program of a simple dictionary which implements the following instructions:\n\ninsert str: insert a string str in to the dictionary\n\nfind str: if the distionary contains str, then print 'yes', otherwise print 'no'\n\nInput\n\nIn the first line n, the number of instructions is given. In the following n lines, n instructions are given in the above mentioned format.\n\nOutput\n\nPrint yes or no for each find instruction in a line.\n\nConstraints\n\nA string consists of 'A', 'C', 'G', or 'T'\n\n1 ≤ length of a string ≤ 12\n\nn ≤ 1000000\n\nSample Input 1\n\n5\ninsert A\ninsert T\ninsert C\nfind G\nfind A\n\nSample Output 1\n\nno\nyes\n\nSample Input 2\n\n13\ninsert AAA\ninsert AAC\ninsert AGA\ninsert AGG\ninsert TTT\nfind AAA\nfind CCC\nfind CCC\ninsert CCC\nfind CCC\ninsert T\nfind TTT\nfind T\n\nSample Output 2\n\nyes\nno\nno\nyes\nyes\nyes\n\nNotes\n\nTemplate in C", "sample_input": "5\ninsert A\ninsert T\ninsert C\nfind G\nfind A\n"}, "reference_outputs": ["no\nyes\n"], "source_document_id": "p02269", "source_text": "Search III\n\nYour task is to write a program of a simple dictionary which implements the following instructions:\n\ninsert str: insert a string str in to the dictionary\n\nfind str: if the distionary contains str, then print 'yes', otherwise print 'no'\n\nInput\n\nIn the first line n, the number of instructions is given. In the following n lines, n instructions are given in the above mentioned format.\n\nOutput\n\nPrint yes or no for each find instruction in a line.\n\nConstraints\n\nA string consists of 'A', 'C', 'G', or 'T'\n\n1 ≤ length of a string ≤ 12\n\nn ≤ 1000000\n\nSample Input 1\n\n5\ninsert A\ninsert T\ninsert C\nfind G\nfind A\n\nSample Output 1\n\nno\nyes\n\nSample Input 2\n\n13\ninsert AAA\ninsert AAC\ninsert AGA\ninsert AGG\ninsert TTT\nfind AAA\nfind CCC\nfind CCC\ninsert CCC\nfind CCC\ninsert T\nfind TTT\nfind T\n\nSample Output 2\n\nyes\nno\nno\nyes\nyes\nyes\n\nNotes\n\nTemplate in C", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1787, "cpu_time_ms": 4000, "memory_kb": 5564}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s299662441", "group_id": "codeNet:p02269", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype hash struct {\n\tss [1000000]string\n}\n\nfunc (h *hash) insert(data string) {\n\tk := toKey(data)\n\ti := 0\n\thValue := h.hash(k, i)\n\tv := h.ss[hValue]\n\tfor v != \"\" && v != data {\n\t\ti++\n\t\thValue = h.hash(k, i)\n\t\tv = h.ss[hValue]\n\t}\n\tif h.ss[hValue] == \"\" {\n\t\th.ss[hValue] = data\n\t}\n}\n\nfunc (h *hash) search(data string) bool {\n\tk := toKey(data)\n\ti := 0\n\tv := h.ss[h.hash(k, i)]\n\tfor v != \"\" && v != data {\n\t\ti++\n\t\tv = h.ss[h.hash(k, i)]\n\t}\n\tif v == \"\" {\n\t\treturn false\n\t}\n\treturn true\n}\n\nfunc (h *hash) hash(k int, i int) int {\n\treturn (h1(k) + i*h2(k)) % 1046527\n}\n\nfunc h1(k int) int {\n\treturn k % 1046527\n}\n\nfunc h2(k int) int {\n\treturn 1 + (k % 1046526)\n}\n\nfunc toKey(s string) int {\n\tresult := 0\n\tfor _, c := range s {\n\t\tswitch c {\n\t\tcase 'A':\n\t\t\tresult = result + 1\n\t\tcase 'C':\n\t\t\tresult = result + 2\n\t\tcase 'G':\n\t\t\tresult = result + 3\n\t\tcase 'T':\n\t\t\tresult = result + 4\n\t\tdefault:\n\t\t}\n\t}\n\treturn result\n}\n\nfunc nextInt(sc *bufio.Scanner) int {\n\tsc.Scan()\n\tn, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n\nfunc nextStr(sc *bufio.Scanner) string {\n\tsc.Scan()\n\ts := sc.Text()\n\treturn s\n}\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\n\tvar h hash\n\n\tn := nextInt(sc)\n\tfor n > 0 {\n\t\tcmd := nextStr(sc)\n\t\tv := nextStr(sc)\n\t\tswitch cmd {\n\t\tcase \"insert\":\n\t\t\th.insert(v)\n\t\tcase \"find\":\n\t\t\tif h.search(v) {\n\t\t\t\tfmt.Println(\"yes\")\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"no\")\n\t\t\t}\n\t\tdefault:\n\t\t}\n\t\tn--\n\t}\n}\n\n", "language": "Go", "metadata": {"date": 1517401098, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02269.html", "problem_id": "p02269", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02269/input.txt", "sample_output_relpath": "derived/input_output/data/p02269/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02269/Go/s299662441.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s299662441", "user_id": "u382730661"}, "prompt_components": {"gold_output": "no\nyes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype hash struct {\n\tss [1000000]string\n}\n\nfunc (h *hash) insert(data string) {\n\tk := toKey(data)\n\ti := 0\n\thValue := h.hash(k, i)\n\tv := h.ss[hValue]\n\tfor v != \"\" && v != data {\n\t\ti++\n\t\thValue = h.hash(k, i)\n\t\tv = h.ss[hValue]\n\t}\n\tif h.ss[hValue] == \"\" {\n\t\th.ss[hValue] = data\n\t}\n}\n\nfunc (h *hash) search(data string) bool {\n\tk := toKey(data)\n\ti := 0\n\tv := h.ss[h.hash(k, i)]\n\tfor v != \"\" && v != data {\n\t\ti++\n\t\tv = h.ss[h.hash(k, i)]\n\t}\n\tif v == \"\" {\n\t\treturn false\n\t}\n\treturn true\n}\n\nfunc (h *hash) hash(k int, i int) int {\n\treturn (h1(k) + i*h2(k)) % 1046527\n}\n\nfunc h1(k int) int {\n\treturn k % 1046527\n}\n\nfunc h2(k int) int {\n\treturn 1 + (k % 1046526)\n}\n\nfunc toKey(s string) int {\n\tresult := 0\n\tfor _, c := range s {\n\t\tswitch c {\n\t\tcase 'A':\n\t\t\tresult = result + 1\n\t\tcase 'C':\n\t\t\tresult = result + 2\n\t\tcase 'G':\n\t\t\tresult = result + 3\n\t\tcase 'T':\n\t\t\tresult = result + 4\n\t\tdefault:\n\t\t}\n\t}\n\treturn result\n}\n\nfunc nextInt(sc *bufio.Scanner) int {\n\tsc.Scan()\n\tn, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n\nfunc nextStr(sc *bufio.Scanner) string {\n\tsc.Scan()\n\ts := sc.Text()\n\treturn s\n}\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\n\tvar h hash\n\n\tn := nextInt(sc)\n\tfor n > 0 {\n\t\tcmd := nextStr(sc)\n\t\tv := nextStr(sc)\n\t\tswitch cmd {\n\t\tcase \"insert\":\n\t\t\th.insert(v)\n\t\tcase \"find\":\n\t\t\tif h.search(v) {\n\t\t\t\tfmt.Println(\"yes\")\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"no\")\n\t\t\t}\n\t\tdefault:\n\t\t}\n\t\tn--\n\t}\n}\n\n", "problem_context": "Search III\n\nYour task is to write a program of a simple dictionary which implements the following instructions:\n\ninsert str: insert a string str in to the dictionary\n\nfind str: if the distionary contains str, then print 'yes', otherwise print 'no'\n\nInput\n\nIn the first line n, the number of instructions is given. In the following n lines, n instructions are given in the above mentioned format.\n\nOutput\n\nPrint yes or no for each find instruction in a line.\n\nConstraints\n\nA string consists of 'A', 'C', 'G', or 'T'\n\n1 ≤ length of a string ≤ 12\n\nn ≤ 1000000\n\nSample Input 1\n\n5\ninsert A\ninsert T\ninsert C\nfind G\nfind A\n\nSample Output 1\n\nno\nyes\n\nSample Input 2\n\n13\ninsert AAA\ninsert AAC\ninsert AGA\ninsert AGG\ninsert TTT\nfind AAA\nfind CCC\nfind CCC\ninsert CCC\nfind CCC\ninsert T\nfind TTT\nfind T\n\nSample Output 2\n\nyes\nno\nno\nyes\nyes\nyes\n\nNotes\n\nTemplate in C", "sample_input": "5\ninsert A\ninsert T\ninsert C\nfind G\nfind A\n"}, "reference_outputs": ["no\nyes\n"], "source_document_id": "p02269", "source_text": "Search III\n\nYour task is to write a program of a simple dictionary which implements the following instructions:\n\ninsert str: insert a string str in to the dictionary\n\nfind str: if the distionary contains str, then print 'yes', otherwise print 'no'\n\nInput\n\nIn the first line n, the number of instructions is given. In the following n lines, n instructions are given in the above mentioned format.\n\nOutput\n\nPrint yes or no for each find instruction in a line.\n\nConstraints\n\nA string consists of 'A', 'C', 'G', or 'T'\n\n1 ≤ length of a string ≤ 12\n\nn ≤ 1000000\n\nSample Input 1\n\n5\ninsert A\ninsert T\ninsert C\nfind G\nfind A\n\nSample Output 1\n\nno\nyes\n\nSample Input 2\n\n13\ninsert AAA\ninsert AAC\ninsert AGA\ninsert AGG\ninsert TTT\nfind AAA\nfind CCC\nfind CCC\ninsert CCC\nfind CCC\ninsert T\nfind TTT\nfind T\n\nSample Output 2\n\nyes\nno\nno\nyes\nyes\nyes\n\nNotes\n\nTemplate in C", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1510, "cpu_time_ms": 4000, "memory_kb": 9256}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s407139690", "group_id": "codeNet:p02269", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tA = iota\n\tC\n\tG\n\tT\n)\n\nconst (\n\tM = 1046527\n)\n\nvar (\n\tH [M]string\n\tsc = bufio.NewScanner(os.Stdin)\n\n)\nfunc getChar(s string) int {\n\tswitch s {\n\tcase \"A\":\n\t\treturn A + 1\n\tcase \"C\":\n\t\treturn C + 1\n\tcase \"G\":\n\t\treturn G + 1\n\tcase \"T\":\n\t\treturn T + 1\n\tdefault:\n\t\treturn 0\n\t}\n}\n\nfunc getKey(s string) int {\n\tvar sum int\n\tp := 1\n\tfor i := 0; i < len(s); i++ {\n\t\tchar := string(s[i])\n\t\tsum += p * getChar(char)\n\t\tp *= 5\n\t}\n\treturn sum\n}\n\nfunc h1(key int) int { return key % M }\nfunc h2(key int) int { return 1 + (key % (M - 1)) }\n\nfunc find(s string) bool {\n\tkey := getKey(s)\n\tvar h int\n\tfor i := 0; ; i++ {\n\t\th = (h1(key) + i*h2(key)) % M\n\t\tif H[h] == s {\n\t\t\treturn true\n\t\t} else if len(H[h]) == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn false\n}\n\nfunc insert(s string) bool {\n\tkey := getKey(s)\n\tvar h int\n\tfor i := 0; ; i++ {\n\t\th = (h1(key) + i*h2(key)) % M\n\t\tif H[h] == s {\n\t\t\treturn true\n\t\t} else if len(H[h]) == 0 {\n\t\t\tH[h] = s\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc firstInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\ta := sc.Text()\n\treturn a\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tvar n int\n\tvar str, command string\n\tn = firstInt()\n\tfor i := 0; i < n; i++ {\n\t\t// fmt.Scan(&command, &str)\n\t\tcommand = nextLine()\n\t\tstr = nextLine()\n\t\tif string(command[0]) == \"i\" {\n\t\t\tinsert(str)\n\t\t} else {\n\t\t\tif find(str) {\n\t\t\t\tfmt.Println(\"yes\")\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"no\")\n\t\t\t}\n\t\t}\n\t}\n}\n\n", "language": "Go", "metadata": {"date": 1577718509, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02269.html", "problem_id": "p02269", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02269/input.txt", "sample_output_relpath": "derived/input_output/data/p02269/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02269/Go/s407139690.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s407139690", "user_id": "u312078015"}, "prompt_components": {"gold_output": "no\nyes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tA = iota\n\tC\n\tG\n\tT\n)\n\nconst (\n\tM = 1046527\n)\n\nvar (\n\tH [M]string\n\tsc = bufio.NewScanner(os.Stdin)\n\n)\nfunc getChar(s string) int {\n\tswitch s {\n\tcase \"A\":\n\t\treturn A + 1\n\tcase \"C\":\n\t\treturn C + 1\n\tcase \"G\":\n\t\treturn G + 1\n\tcase \"T\":\n\t\treturn T + 1\n\tdefault:\n\t\treturn 0\n\t}\n}\n\nfunc getKey(s string) int {\n\tvar sum int\n\tp := 1\n\tfor i := 0; i < len(s); i++ {\n\t\tchar := string(s[i])\n\t\tsum += p * getChar(char)\n\t\tp *= 5\n\t}\n\treturn sum\n}\n\nfunc h1(key int) int { return key % M }\nfunc h2(key int) int { return 1 + (key % (M - 1)) }\n\nfunc find(s string) bool {\n\tkey := getKey(s)\n\tvar h int\n\tfor i := 0; ; i++ {\n\t\th = (h1(key) + i*h2(key)) % M\n\t\tif H[h] == s {\n\t\t\treturn true\n\t\t} else if len(H[h]) == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn false\n}\n\nfunc insert(s string) bool {\n\tkey := getKey(s)\n\tvar h int\n\tfor i := 0; ; i++ {\n\t\th = (h1(key) + i*h2(key)) % M\n\t\tif H[h] == s {\n\t\t\treturn true\n\t\t} else if len(H[h]) == 0 {\n\t\t\tH[h] = s\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc firstInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\ta := sc.Text()\n\treturn a\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tvar n int\n\tvar str, command string\n\tn = firstInt()\n\tfor i := 0; i < n; i++ {\n\t\t// fmt.Scan(&command, &str)\n\t\tcommand = nextLine()\n\t\tstr = nextLine()\n\t\tif string(command[0]) == \"i\" {\n\t\t\tinsert(str)\n\t\t} else {\n\t\t\tif find(str) {\n\t\t\t\tfmt.Println(\"yes\")\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"no\")\n\t\t\t}\n\t\t}\n\t}\n}\n\n", "problem_context": "Search III\n\nYour task is to write a program of a simple dictionary which implements the following instructions:\n\ninsert str: insert a string str in to the dictionary\n\nfind str: if the distionary contains str, then print 'yes', otherwise print 'no'\n\nInput\n\nIn the first line n, the number of instructions is given. In the following n lines, n instructions are given in the above mentioned format.\n\nOutput\n\nPrint yes or no for each find instruction in a line.\n\nConstraints\n\nA string consists of 'A', 'C', 'G', or 'T'\n\n1 ≤ length of a string ≤ 12\n\nn ≤ 1000000\n\nSample Input 1\n\n5\ninsert A\ninsert T\ninsert C\nfind G\nfind A\n\nSample Output 1\n\nno\nyes\n\nSample Input 2\n\n13\ninsert AAA\ninsert AAC\ninsert AGA\ninsert AGG\ninsert TTT\nfind AAA\nfind CCC\nfind CCC\ninsert CCC\nfind CCC\ninsert T\nfind TTT\nfind T\n\nSample Output 2\n\nyes\nno\nno\nyes\nyes\nyes\n\nNotes\n\nTemplate in C", "sample_input": "5\ninsert A\ninsert T\ninsert C\nfind G\nfind A\n"}, "reference_outputs": ["no\nyes\n"], "source_document_id": "p02269", "source_text": "Search III\n\nYour task is to write a program of a simple dictionary which implements the following instructions:\n\ninsert str: insert a string str in to the dictionary\n\nfind str: if the distionary contains str, then print 'yes', otherwise print 'no'\n\nInput\n\nIn the first line n, the number of instructions is given. In the following n lines, n instructions are given in the above mentioned format.\n\nOutput\n\nPrint yes or no for each find instruction in a line.\n\nConstraints\n\nA string consists of 'A', 'C', 'G', or 'T'\n\n1 ≤ length of a string ≤ 12\n\nn ≤ 1000000\n\nSample Input 1\n\n5\ninsert A\ninsert T\ninsert C\nfind G\nfind A\n\nSample Output 1\n\nno\nyes\n\nSample Input 2\n\n13\ninsert AAA\ninsert AAC\ninsert AGA\ninsert AGG\ninsert TTT\nfind AAA\nfind CCC\nfind CCC\ninsert CCC\nfind CCC\ninsert T\nfind TTT\nfind T\n\nSample Output 2\n\nyes\nno\nno\nyes\nyes\nyes\n\nNotes\n\nTemplate in C", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1537, "cpu_time_ms": 1450, "memory_kb": 25120}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s248115320", "group_id": "codeNet:p02269", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\tReadString = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\t// r.Buffer(make([]byte, 1024), int(1e+11)) // for AtCoder\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\n\t// Split sets the split function for the Scanner. The default split function is ScanLines.\n\t// Split panics if it is called after scanning has started.\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\nfunc ReadInt2() (int, int) {\n\treturn int(readInt64()), int(readInt64())\n}\nfunc ReadInt3() (int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64())\n}\nfunc ReadInt4() (int, int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())\n}\n\n// ReadInt64 returns as integer as int64.\nfunc ReadInt64() int64 {\n\treturn readInt64()\n}\nfunc ReadInt64_2() (int64, int64) {\n\treturn readInt64(), readInt64()\n}\nfunc ReadInt64_3() (int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64()\n}\nfunc ReadInt64_4() (int64, int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64(), readInt64()\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadInt64Slice returns as int64 slice that has n integers.\nfunc ReadInt64Slice(n int) []int64 {\n\tb := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt64()\n\t}\n\treturn b\n}\n\n// ReadFloat64 returns an float64.\nfunc ReadFloat64() float64 {\n\treturn float64(readFloat64())\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(ReadString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// ReadFloatSlice returns an float64 slice that has n float64.\nfunc ReadFloat64Slice(n int) []float64 {\n\tb := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadFloat64()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n/*********** Debugging ***********/\n\n// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.\n// For debugging use.\nfunc ZeroPaddingRuneSlice(n, digitsNum int) []rune {\n\tsn := fmt.Sprintf(\"%b\", n)\n\n\tresidualLength := digitsNum - len(sn)\n\tif residualLength <= 0 {\n\t\treturn []rune(sn)\n\t}\n\n\tzeros := make([]rune, residualLength)\n\tfor i := 0; i < len(zeros); i++ {\n\t\tzeros[i] = '0'\n\t}\n\n\tres := []rune{}\n\tres = append(res, zeros...)\n\tres = append(res, []rune(sn)...)\n\n\treturn res\n}\n\n/*********** DP sub-functions ***********/\n\n// ChMin accepts a pointer of integer and a target value.\n// If target value is SMALLER than the first argument,\n//\tthen the first argument will be updated by the second argument.\nfunc ChMin(updatedValue *int, target int) bool {\n\tif *updatedValue > target {\n\t\t*updatedValue = target\n\t\treturn true\n\t}\n\treturn false\n}\n\n// ChMax accepts a pointer of integer and a target value.\n// If target value is LARGER than the first argument,\n//\tthen the first argument will be updated by the second argument.\nfunc ChMax(updatedValue *int, target int) bool {\n\tif *updatedValue < target {\n\t\t*updatedValue = target\n\t\treturn true\n\t}\n\treturn false\n}\n\n// NthBit returns nth bit value of an argument.\n// n starts from 0.\nfunc NthBit(num, nth int) int {\n\treturn num >> uint(nth) & 1\n}\n\n// OnBit returns the integer that has nth ON bit.\n// If an argument has nth ON bit, OnBit returns the argument.\nfunc OnBit(num, nth int) int {\n\treturn num | (1 << uint(nth))\n}\n\n// OffBit returns the integer that has nth OFF bit.\n// If an argument has nth OFF bit, OffBit returns the argument.\nfunc OffBit(num, nth int) int {\n\treturn num & ^(1 << uint(nth))\n}\n\n// PopCount returns the number of ON bit of an argument.\nfunc PopCount(num int) int {\n\tres := 0\n\n\tfor i := 0; i < 70; i++ {\n\t\tif ((num >> uint(i)) & 1) == 1 {\n\t\t\tres++\n\t\t}\n\t}\n\n\treturn res\n}\n\n/*********** Arithmetic ***********/\n\n// Max returns the max integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Max(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m < integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// Min returns the min integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Min(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m > integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// Sum returns multiple integers sum.\nfunc Sum(integers ...int) int {\n\ts := 0\n\n\tfor _, i := range integers {\n\t\ts += i\n\t}\n\n\treturn s\n}\n\n// PowInt is integer version of math.Pow\n// PowInt calculate a power by Binary Power (二分累乗法(O(log e))).\nfunc PowInt(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(errors.New(\"[argument error]: PowInt does not accept negative integers\"))\n\t}\n\n\tif e == 0 {\n\t\treturn 1\n\t}\n\n\tif e%2 == 0 {\n\t\thalfE := e / 2\n\t\thalf := PowInt(a, halfE)\n\t\treturn half * half\n\t}\n\n\treturn a * PowInt(a, e-1)\n}\n\n// AbsInt is integer version of math.Abs\nfunc AbsInt(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// Gcd returns the Greatest Common Divisor of two natural numbers.\n// Gcd only accepts two natural numbers (a, b >= 1).\n// 0 or negative number causes panic.\n// Gcd uses the Euclidean Algorithm.\nfunc Gcd(a, b int) int {\n\tif a <= 0 || b <= 0 {\n\t\tpanic(errors.New(\"[argument error]: Gcd only accepts two NATURAL numbers\"))\n\t}\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\n\t// Euclidean Algorithm\n\tfor b > 0 {\n\t\tdiv := a % b\n\t\ta, b = b, div\n\t}\n\n\treturn a\n}\n\n// Lcm returns the Least Common Multiple of two natural numbers.\n// Lcd only accepts two natural numbers (a, b >= 1).\n// 0 or negative number causes panic.\n// Lcd uses the Euclidean Algorithm indirectly.\nfunc Lcm(a, b int) int {\n\tif a <= 0 || b <= 0 {\n\t\tpanic(errors.New(\"[argument error]: Gcd only accepts two NATURAL numbers\"))\n\t}\n\n\t// a = a'*gcd, b = b'*gcd, a*b = a'*b'*gcd^2\n\t// a' and b' are relatively prime numbers\n\t// gcd consists of prime numbers, that are included in a and b\n\tgcd := Gcd(a, b)\n\n\t// not (a * b / gcd), because of reducing a probability of overflow\n\treturn (a / gcd) * b\n}\n\n// Strtoi is a wrapper of strconv.Atoi().\n// If strconv.Atoi() returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintIntsLine(A ...int) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.Itoa(A[i])\n\t\t// str := strconv.FormatInt(A[i], 10) // 64bit int version\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n/********** FAU standard libraries **********/\n\n//fmt.Sprintf(\"%b\\n\", 255) \t// binary expression\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := ZeroPaddingRuneSlice(num, 32)\n//str := PrintIntsLine(X...)\n\n/*******************************************************************/\n\nconst MOD = 1000000000 + 7\nconst ALPHABET_NUM = 26\nconst INF_INT64 = math.MaxInt64\nconst INF_BIT60 = 1 << 60\n\nvar n int\nvar memo map[string]bool\n\nfunc main() {\n\tn = ReadInt()\n\tmemo = make(map[string]bool)\n\tfor i := 0; i < n; i++ {\n\t\top, str := ReadString(), ReadString()\n\t\tif op == \"insert\" {\n\t\t\tmemo[str] = true\n\t\t} else {\n\t\t\tif _, ok := memo[str]; ok {\n\t\t\t\tfmt.Println(\"yes\")\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"no\")\n\t\t\t}\n\t\t}\n\t}\n}\n\n// MODはとったか?\n// 遷移だけじゃなくて最後の最後でちゃんと取れよ?\n\n/*******************************************************************/\n\n", "language": "Go", "metadata": {"date": 1571467953, "filename_ext": "go", "original_language": "Go", "problem_description_relpath": "problem_descriptions/p02269.html", "problem_id": "p02269", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02269/input.txt", "sample_output_relpath": "derived/input_output/data/p02269/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02269/Go/s248115320.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s248115320", "user_id": "u383717667"}, "prompt_components": {"gold_output": "no\nyes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\tReadString = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\t// r.Buffer(make([]byte, 1024), int(1e+11)) // for AtCoder\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\n\t// Split sets the split function for the Scanner. The default split function is ScanLines.\n\t// Split panics if it is called after scanning has started.\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\nfunc ReadInt2() (int, int) {\n\treturn int(readInt64()), int(readInt64())\n}\nfunc ReadInt3() (int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64())\n}\nfunc ReadInt4() (int, int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())\n}\n\n// ReadInt64 returns as integer as int64.\nfunc ReadInt64() int64 {\n\treturn readInt64()\n}\nfunc ReadInt64_2() (int64, int64) {\n\treturn readInt64(), readInt64()\n}\nfunc ReadInt64_3() (int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64()\n}\nfunc ReadInt64_4() (int64, int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64(), readInt64()\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadInt64Slice returns as int64 slice that has n integers.\nfunc ReadInt64Slice(n int) []int64 {\n\tb := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt64()\n\t}\n\treturn b\n}\n\n// ReadFloat64 returns an float64.\nfunc ReadFloat64() float64 {\n\treturn float64(readFloat64())\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(ReadString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// ReadFloatSlice returns an float64 slice that has n float64.\nfunc ReadFloat64Slice(n int) []float64 {\n\tb := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadFloat64()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n/*********** Debugging ***********/\n\n// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.\n// For debugging use.\nfunc ZeroPaddingRuneSlice(n, digitsNum int) []rune {\n\tsn := fmt.Sprintf(\"%b\", n)\n\n\tresidualLength := digitsNum - len(sn)\n\tif residualLength <= 0 {\n\t\treturn []rune(sn)\n\t}\n\n\tzeros := make([]rune, residualLength)\n\tfor i := 0; i < len(zeros); i++ {\n\t\tzeros[i] = '0'\n\t}\n\n\tres := []rune{}\n\tres = append(res, zeros...)\n\tres = append(res, []rune(sn)...)\n\n\treturn res\n}\n\n/*********** DP sub-functions ***********/\n\n// ChMin accepts a pointer of integer and a target value.\n// If target value is SMALLER than the first argument,\n//\tthen the first argument will be updated by the second argument.\nfunc ChMin(updatedValue *int, target int) bool {\n\tif *updatedValue > target {\n\t\t*updatedValue = target\n\t\treturn true\n\t}\n\treturn false\n}\n\n// ChMax accepts a pointer of integer and a target value.\n// If target value is LARGER than the first argument,\n//\tthen the first argument will be updated by the second argument.\nfunc ChMax(updatedValue *int, target int) bool {\n\tif *updatedValue < target {\n\t\t*updatedValue = target\n\t\treturn true\n\t}\n\treturn false\n}\n\n// NthBit returns nth bit value of an argument.\n// n starts from 0.\nfunc NthBit(num, nth int) int {\n\treturn num >> uint(nth) & 1\n}\n\n// OnBit returns the integer that has nth ON bit.\n// If an argument has nth ON bit, OnBit returns the argument.\nfunc OnBit(num, nth int) int {\n\treturn num | (1 << uint(nth))\n}\n\n// OffBit returns the integer that has nth OFF bit.\n// If an argument has nth OFF bit, OffBit returns the argument.\nfunc OffBit(num, nth int) int {\n\treturn num & ^(1 << uint(nth))\n}\n\n// PopCount returns the number of ON bit of an argument.\nfunc PopCount(num int) int {\n\tres := 0\n\n\tfor i := 0; i < 70; i++ {\n\t\tif ((num >> uint(i)) & 1) == 1 {\n\t\t\tres++\n\t\t}\n\t}\n\n\treturn res\n}\n\n/*********** Arithmetic ***********/\n\n// Max returns the max integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Max(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m < integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// Min returns the min integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Min(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m > integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// Sum returns multiple integers sum.\nfunc Sum(integers ...int) int {\n\ts := 0\n\n\tfor _, i := range integers {\n\t\ts += i\n\t}\n\n\treturn s\n}\n\n// PowInt is integer version of math.Pow\n// PowInt calculate a power by Binary Power (二分累乗法(O(log e))).\nfunc PowInt(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(errors.New(\"[argument error]: PowInt does not accept negative integers\"))\n\t}\n\n\tif e == 0 {\n\t\treturn 1\n\t}\n\n\tif e%2 == 0 {\n\t\thalfE := e / 2\n\t\thalf := PowInt(a, halfE)\n\t\treturn half * half\n\t}\n\n\treturn a * PowInt(a, e-1)\n}\n\n// AbsInt is integer version of math.Abs\nfunc AbsInt(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// Gcd returns the Greatest Common Divisor of two natural numbers.\n// Gcd only accepts two natural numbers (a, b >= 1).\n// 0 or negative number causes panic.\n// Gcd uses the Euclidean Algorithm.\nfunc Gcd(a, b int) int {\n\tif a <= 0 || b <= 0 {\n\t\tpanic(errors.New(\"[argument error]: Gcd only accepts two NATURAL numbers\"))\n\t}\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\n\t// Euclidean Algorithm\n\tfor b > 0 {\n\t\tdiv := a % b\n\t\ta, b = b, div\n\t}\n\n\treturn a\n}\n\n// Lcm returns the Least Common Multiple of two natural numbers.\n// Lcd only accepts two natural numbers (a, b >= 1).\n// 0 or negative number causes panic.\n// Lcd uses the Euclidean Algorithm indirectly.\nfunc Lcm(a, b int) int {\n\tif a <= 0 || b <= 0 {\n\t\tpanic(errors.New(\"[argument error]: Gcd only accepts two NATURAL numbers\"))\n\t}\n\n\t// a = a'*gcd, b = b'*gcd, a*b = a'*b'*gcd^2\n\t// a' and b' are relatively prime numbers\n\t// gcd consists of prime numbers, that are included in a and b\n\tgcd := Gcd(a, b)\n\n\t// not (a * b / gcd), because of reducing a probability of overflow\n\treturn (a / gcd) * b\n}\n\n// Strtoi is a wrapper of strconv.Atoi().\n// If strconv.Atoi() returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintIntsLine(A ...int) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.Itoa(A[i])\n\t\t// str := strconv.FormatInt(A[i], 10) // 64bit int version\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n/********** FAU standard libraries **********/\n\n//fmt.Sprintf(\"%b\\n\", 255) \t// binary expression\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := ZeroPaddingRuneSlice(num, 32)\n//str := PrintIntsLine(X...)\n\n/*******************************************************************/\n\nconst MOD = 1000000000 + 7\nconst ALPHABET_NUM = 26\nconst INF_INT64 = math.MaxInt64\nconst INF_BIT60 = 1 << 60\n\nvar n int\nvar memo map[string]bool\n\nfunc main() {\n\tn = ReadInt()\n\tmemo = make(map[string]bool)\n\tfor i := 0; i < n; i++ {\n\t\top, str := ReadString(), ReadString()\n\t\tif op == \"insert\" {\n\t\t\tmemo[str] = true\n\t\t} else {\n\t\t\tif _, ok := memo[str]; ok {\n\t\t\t\tfmt.Println(\"yes\")\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"no\")\n\t\t\t}\n\t\t}\n\t}\n}\n\n// MODはとったか?\n// 遷移だけじゃなくて最後の最後でちゃんと取れよ?\n\n/*******************************************************************/\n\n", "problem_context": "Search III\n\nYour task is to write a program of a simple dictionary which implements the following instructions:\n\ninsert str: insert a string str in to the dictionary\n\nfind str: if the distionary contains str, then print 'yes', otherwise print 'no'\n\nInput\n\nIn the first line n, the number of instructions is given. In the following n lines, n instructions are given in the above mentioned format.\n\nOutput\n\nPrint yes or no for each find instruction in a line.\n\nConstraints\n\nA string consists of 'A', 'C', 'G', or 'T'\n\n1 ≤ length of a string ≤ 12\n\nn ≤ 1000000\n\nSample Input 1\n\n5\ninsert A\ninsert T\ninsert C\nfind G\nfind A\n\nSample Output 1\n\nno\nyes\n\nSample Input 2\n\n13\ninsert AAA\ninsert AAC\ninsert AGA\ninsert AGG\ninsert TTT\nfind AAA\nfind CCC\nfind CCC\ninsert CCC\nfind CCC\ninsert T\nfind TTT\nfind T\n\nSample Output 2\n\nyes\nno\nno\nyes\nyes\nyes\n\nNotes\n\nTemplate in C", "sample_input": "5\ninsert A\ninsert T\ninsert C\nfind G\nfind A\n"}, "reference_outputs": ["no\nyes\n"], "source_document_id": "p02269", "source_text": "Search III\n\nYour task is to write a program of a simple dictionary which implements the following instructions:\n\ninsert str: insert a string str in to the dictionary\n\nfind str: if the distionary contains str, then print 'yes', otherwise print 'no'\n\nInput\n\nIn the first line n, the number of instructions is given. In the following n lines, n instructions are given in the above mentioned format.\n\nOutput\n\nPrint yes or no for each find instruction in a line.\n\nConstraints\n\nA string consists of 'A', 'C', 'G', or 'T'\n\n1 ≤ length of a string ≤ 12\n\nn ≤ 1000000\n\nSample Input 1\n\n5\ninsert A\ninsert T\ninsert C\nfind G\nfind A\n\nSample Output 1\n\nno\nyes\n\nSample Input 2\n\n13\ninsert AAA\ninsert AAC\ninsert AGA\ninsert AGG\ninsert TTT\nfind AAA\nfind CCC\nfind CCC\ninsert CCC\nfind CCC\ninsert T\nfind TTT\nfind T\n\nSample Output 2\n\nyes\nno\nno\nyes\nyes\nyes\n\nNotes\n\nTemplate in C", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 8309, "cpu_time_ms": 1350, "memory_kb": 26748}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s427651217", "group_id": "codeNet:p02572", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n\t\"sync\"\n)\n\n\nfunc main() {\n\tn := scanSplitedInt()\n\tarray := make([]uint64, 0, n)\n\n\t// 配列を作る\n\tfor i := 0; i < n; i++ {\n\t\tarray = append(array, scanSplitedUint64())\n\t}\n\n\t// 累積和を作る\n\tcusum := make([]uint64, n+1)\n\tfor i := 0; i < n; i++ {\n\t\tcusum[i+1] = cusum[i] + array[i]\n\t}\n\n\tvar sum uint64\n\tfor i, v := range array {\n\t\tsum += (v * (cusum[n] - cusum[i+1])) % 1000000007\n\t}\n\n\tfmt.Println(sum)\n}\n\n\nvar once sync.Once\nvar scanner *bufio.Scanner\n\nfunc scan() {\n\tonce.Do(func() {\n\t\tscanner = bufio.NewScanner(os.Stdin)\n\t\tscanner.Split(bufio.ScanWords)\n\t})\n\tscanner.Scan()\n}\n\nfunc check(err error) {\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n\nfunc scanSplitedUint64() uint64 {\n\tscan()\n\tval, err := strconv.ParseUint(scanner.Text(), 10, 64)\n\tcheck(err)\n\treturn val\n}\n\nfunc scanSplitedInt() int {\n\tscan()\n\tval, err := strconv.Atoi(scanner.Text())\n\tcheck(err)\n\treturn val\n}\n", "language": "Go", "metadata": {"date": 1599692622, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02572.html", "problem_id": "p02572", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02572/input.txt", "sample_output_relpath": "derived/input_output/data/p02572/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02572/Go/s427651217.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s427651217", "user_id": "u331811000"}, "prompt_components": {"gold_output": "11\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n\t\"sync\"\n)\n\n\nfunc main() {\n\tn := scanSplitedInt()\n\tarray := make([]uint64, 0, n)\n\n\t// 配列を作る\n\tfor i := 0; i < n; i++ {\n\t\tarray = append(array, scanSplitedUint64())\n\t}\n\n\t// 累積和を作る\n\tcusum := make([]uint64, n+1)\n\tfor i := 0; i < n; i++ {\n\t\tcusum[i+1] = cusum[i] + array[i]\n\t}\n\n\tvar sum uint64\n\tfor i, v := range array {\n\t\tsum += (v * (cusum[n] - cusum[i+1])) % 1000000007\n\t}\n\n\tfmt.Println(sum)\n}\n\n\nvar once sync.Once\nvar scanner *bufio.Scanner\n\nfunc scan() {\n\tonce.Do(func() {\n\t\tscanner = bufio.NewScanner(os.Stdin)\n\t\tscanner.Split(bufio.ScanWords)\n\t})\n\tscanner.Scan()\n}\n\nfunc check(err error) {\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n\nfunc scanSplitedUint64() uint64 {\n\tscan()\n\tval, err := strconv.ParseUint(scanner.Text(), 10, 64)\n\tcheck(err)\n\treturn val\n}\n\nfunc scanSplitedInt() int {\n\tscan()\n\tval, err := strconv.Atoi(scanner.Text())\n\tcheck(err)\n\treturn val\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nFind the sum of A_i \\times A_j over all pairs (i,j) such that 1\\leq i < j \\leq N, modulo (10^9+7).\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\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 \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} A_i A_j, modulo (10^9+7).\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n11\n\nWe have 1 \\times 2 + 1 \\times 3 + 2 \\times 3 = 11.\n\nSample Input 2\n\n4\n141421356 17320508 22360679 244949\n\nSample Output 2\n\n437235829", "sample_input": "3\n1 2 3\n"}, "reference_outputs": ["11\n"], "source_document_id": "p02572", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nFind the sum of A_i \\times A_j over all pairs (i,j) such that 1\\leq i < j \\leq N, modulo (10^9+7).\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\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 \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} A_i A_j, modulo (10^9+7).\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n11\n\nWe have 1 \\times 2 + 1 \\times 3 + 2 \\times 3 = 11.\n\nSample Input 2\n\n4\n141421356 17320508 22360679 244949\n\nSample Output 2\n\n437235829", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 944, "cpu_time_ms": 45, "memory_kb": 7516}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s923877952", "group_id": "codeNet:p02572", "input_text": "// refs: https://github.com/maitaken/atcoder-template\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst (\n\tBUFSIZE = 10000000\n\tMOD = 1000000007\n\tINT_INF = math.MaxInt32\n)\n\nvar rdr *bufio.Reader\n\nfunc main() {\n\trdr = bufio.NewReaderSize(os.Stdin, BUFSIZE)\n\tsolve()\n\n}\n\nfunc solve(){\n\tN := readint()\n\tA := readIntSlice()\n\tdst := cumsum(A)\n\tconst V = 1000000007\n\tans := 0\n\tfor i := 0; i < N; i++ {\n\t\tans = ans + A[i] * (dst[len(dst)-1] - dst[i])\n\t\tif ans >= V {\n\t\t\tans = mod(ans, V)\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc cumsum(base []int) []int {\n\tdst := make([]int, len(base))\n\ttmp := 0\n\tfor i := 0; i < len(base); i++ {\n\t\ttmp += base[i]\n\t\tdst[i] = tmp\n\t}\n\treturn dst\n}\n\nfunc readline() string {\n\tbuf := make([]byte, 0, 16)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tfmt.Println(e.Error())\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc readIntSlice() []int {\n\tslice := make([]int, 0)\n\tlines := strings.Split(readline(), \" \")\n\tfor _, v := range lines {\n\t\tslice = append(slice, s2i(v))\n\t}\n\treturn slice\n}\n\nfunc readint() int {\n\treturn s2i(readline())\n}\n\nfunc readint2() (int, int) {\n\tlines := strings.Split(readline(), \" \")\n\treturn s2i(lines[0]), s2i(lines[1])\n}\n\nfunc readint3() (int, int, int) {\n\tlines := strings.Split(readline(), \" \")\n\treturn s2i(lines[0]), s2i(lines[1]), s2i(lines[2])\n}\n\nfunc readint4() (int, int, int, int) {\n\tlines := strings.Split(readline(), \" \")\n\treturn s2i(lines[0]), s2i(lines[1]), s2i(lines[2]), s2i(lines[3])\n}\n\n// For int\nfunc b2i(b bool) int {\n\tif b {\n\t\treturn 1\n\t}\n\treturn 0\n}\n\nfunc abs(v int) int {\n\tif v < 0 {\n\t\treturn -v\n\t}\n\treturn v\n}\n\nfunc pow(x, y int) int {\n\treturn int(math.Pow(float64(x), float64(y)))\n}\n\nfunc mod(x, y int) int {\n\tm := x % y\n\tif m < 0 {\n\t\treturn m + y\n\t}\n\treturn m\n}\n\nfunc modpow(x, y int) int {\n\tret := 1\n\tfor ; y != 0; y >>= 1 {\n\t\tif y&1 == 1 {\n\t\t\tret = mod((ret * x), MOD)\n\t\t}\n\t\tx = mod(x*x, MOD)\n\t}\n\treturn ret\n}\n\nfunc min(values ...int) int {\n\tret := INT_INF\n\tfor _, v := range values {\n\t\tif ret > v {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc max(values ...int) int {\n\tret := -INT_INF\n\tfor _, v := range values {\n\t\tif ret < v {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc s2i(s string) int {\n\tv, ok := strconv.Atoi(s)\n\tif ok != nil {\n\t\tpanic(\"Faild : \" + s + \" can't convert to int\")\n\t}\n\treturn v\n}\n\nfunc i2s(i int) string {\n\treturn strconv.Itoa(i)\n}\n\nfunc gcd(v1, v2 int) int {\n\tif v1 > v2 {\n\t\tv1, v2 = v2, v1\n\t}\n\tfor v1 != 0 {\n\t\tv1, v2 = v2%v1, v1\n\t}\n\treturn v2\n}\n\nfunc lcm(v1, v2 int) int {\n\treturn v1 * v2 / gcd(v1, v2)\n}\n\nfunc extgcd(a, b, c int) (int, int, int) {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := extgcd(b, mod(a, b), c)\n\treturn d, y, x - int(a/b)*y\n}\n\nfunc bit(size int) [][]bool {\n\tbSize := int(math.Pow(2, float64(size)))\n\tb := make([][]bool, bSize)\n\tfor i := 0; i < bSize; i++ {\n\t\tb[i] = make([]bool, size)\n\t\tfor j := 0; j < size; j++ {\n\t\t\tif i>>j&1 == 1 {\n\t\t\t\tb[i][j] = true\n\t\t\t} else {\n\t\t\t\tb[i][j] = false\n\t\t\t}\n\t\t}\n\t}\n\treturn b\n}\n\n/* ------------------------------------------------ */\n/* Data stracture */\n/* ------------------------------------------------ */\ntype IntHeap []int\n\nfunc (h *IntHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IntHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc (h IntHeap) Len() int { return len(h) }\nfunc (h IntHeap) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h IntHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\n\n// BIT Tree\ntype FenwickTree []int\n\nfunc NewFenwickTree(size int) *FenwickTree {\n\tvar t FenwickTree\n\tt = make([]int, size+1)\n\treturn &t\n}\n\nfunc (t FenwickTree) add(index, v int) {\n\tfor i := index + 1; i < len(t); i += (i & -i) {\n\t\tt[i] += v\n\t}\n}\n\nfunc (t FenwickTree) sum(index int) int {\n\ttotal := 0\n\tfor i := index + 1; i != 0; i -= (i & -i) {\n\t\ttotal += t[i]\n\t}\n\treturn total\n}\n\ntype Comb struct {\n\tlength int\n\tfac []int\n\tinv []int\n\tfinv []int\n}\n\nfunc NewComb() *Comb {\n\treturn &Comb{\n\t\tlength: 2,\n\t\tfac: []int{1, 1},\n\t\tinv: []int{1, 1},\n\t\tfinv: []int{1, 1},\n\t}\n}\n\nfunc (c Comb) calc(n, k int) int {\n\tif n < k {\n\t\treturn 0\n\t}\n\tif n < 0 || k < 0 {\n\t\treturn 0\n\t}\n\n\tif c.length <= n {\n\t\tfor i := c.length; i <= n; i++ {\n\t\t\tc.fac = append(c.fac, mod(c.fac[i-1]*i, MOD))\n\t\t\tc.inv = append(c.inv, MOD-mod(c.inv[mod(MOD, i)]*(MOD/i), MOD))\n\t\t\tc.finv = append(c.finv, mod(c.finv[i-1]*c.inv[i], MOD))\n\t\t}\n\t}\n\treturn mod(c.fac[n]*mod(c.finv[k]*c.finv[n-k], MOD), MOD)\n}\n", "language": "Go", "metadata": {"date": 1599511317, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02572.html", "problem_id": "p02572", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02572/input.txt", "sample_output_relpath": "derived/input_output/data/p02572/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02572/Go/s923877952.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s923877952", "user_id": "u684056175"}, "prompt_components": {"gold_output": "11\n", "input_to_evaluate": "// refs: https://github.com/maitaken/atcoder-template\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst (\n\tBUFSIZE = 10000000\n\tMOD = 1000000007\n\tINT_INF = math.MaxInt32\n)\n\nvar rdr *bufio.Reader\n\nfunc main() {\n\trdr = bufio.NewReaderSize(os.Stdin, BUFSIZE)\n\tsolve()\n\n}\n\nfunc solve(){\n\tN := readint()\n\tA := readIntSlice()\n\tdst := cumsum(A)\n\tconst V = 1000000007\n\tans := 0\n\tfor i := 0; i < N; i++ {\n\t\tans = ans + A[i] * (dst[len(dst)-1] - dst[i])\n\t\tif ans >= V {\n\t\t\tans = mod(ans, V)\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc cumsum(base []int) []int {\n\tdst := make([]int, len(base))\n\ttmp := 0\n\tfor i := 0; i < len(base); i++ {\n\t\ttmp += base[i]\n\t\tdst[i] = tmp\n\t}\n\treturn dst\n}\n\nfunc readline() string {\n\tbuf := make([]byte, 0, 16)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tfmt.Println(e.Error())\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc readIntSlice() []int {\n\tslice := make([]int, 0)\n\tlines := strings.Split(readline(), \" \")\n\tfor _, v := range lines {\n\t\tslice = append(slice, s2i(v))\n\t}\n\treturn slice\n}\n\nfunc readint() int {\n\treturn s2i(readline())\n}\n\nfunc readint2() (int, int) {\n\tlines := strings.Split(readline(), \" \")\n\treturn s2i(lines[0]), s2i(lines[1])\n}\n\nfunc readint3() (int, int, int) {\n\tlines := strings.Split(readline(), \" \")\n\treturn s2i(lines[0]), s2i(lines[1]), s2i(lines[2])\n}\n\nfunc readint4() (int, int, int, int) {\n\tlines := strings.Split(readline(), \" \")\n\treturn s2i(lines[0]), s2i(lines[1]), s2i(lines[2]), s2i(lines[3])\n}\n\n// For int\nfunc b2i(b bool) int {\n\tif b {\n\t\treturn 1\n\t}\n\treturn 0\n}\n\nfunc abs(v int) int {\n\tif v < 0 {\n\t\treturn -v\n\t}\n\treturn v\n}\n\nfunc pow(x, y int) int {\n\treturn int(math.Pow(float64(x), float64(y)))\n}\n\nfunc mod(x, y int) int {\n\tm := x % y\n\tif m < 0 {\n\t\treturn m + y\n\t}\n\treturn m\n}\n\nfunc modpow(x, y int) int {\n\tret := 1\n\tfor ; y != 0; y >>= 1 {\n\t\tif y&1 == 1 {\n\t\t\tret = mod((ret * x), MOD)\n\t\t}\n\t\tx = mod(x*x, MOD)\n\t}\n\treturn ret\n}\n\nfunc min(values ...int) int {\n\tret := INT_INF\n\tfor _, v := range values {\n\t\tif ret > v {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc max(values ...int) int {\n\tret := -INT_INF\n\tfor _, v := range values {\n\t\tif ret < v {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc s2i(s string) int {\n\tv, ok := strconv.Atoi(s)\n\tif ok != nil {\n\t\tpanic(\"Faild : \" + s + \" can't convert to int\")\n\t}\n\treturn v\n}\n\nfunc i2s(i int) string {\n\treturn strconv.Itoa(i)\n}\n\nfunc gcd(v1, v2 int) int {\n\tif v1 > v2 {\n\t\tv1, v2 = v2, v1\n\t}\n\tfor v1 != 0 {\n\t\tv1, v2 = v2%v1, v1\n\t}\n\treturn v2\n}\n\nfunc lcm(v1, v2 int) int {\n\treturn v1 * v2 / gcd(v1, v2)\n}\n\nfunc extgcd(a, b, c int) (int, int, int) {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := extgcd(b, mod(a, b), c)\n\treturn d, y, x - int(a/b)*y\n}\n\nfunc bit(size int) [][]bool {\n\tbSize := int(math.Pow(2, float64(size)))\n\tb := make([][]bool, bSize)\n\tfor i := 0; i < bSize; i++ {\n\t\tb[i] = make([]bool, size)\n\t\tfor j := 0; j < size; j++ {\n\t\t\tif i>>j&1 == 1 {\n\t\t\t\tb[i][j] = true\n\t\t\t} else {\n\t\t\t\tb[i][j] = false\n\t\t\t}\n\t\t}\n\t}\n\treturn b\n}\n\n/* ------------------------------------------------ */\n/* Data stracture */\n/* ------------------------------------------------ */\ntype IntHeap []int\n\nfunc (h *IntHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IntHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc (h IntHeap) Len() int { return len(h) }\nfunc (h IntHeap) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h IntHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\n\n// BIT Tree\ntype FenwickTree []int\n\nfunc NewFenwickTree(size int) *FenwickTree {\n\tvar t FenwickTree\n\tt = make([]int, size+1)\n\treturn &t\n}\n\nfunc (t FenwickTree) add(index, v int) {\n\tfor i := index + 1; i < len(t); i += (i & -i) {\n\t\tt[i] += v\n\t}\n}\n\nfunc (t FenwickTree) sum(index int) int {\n\ttotal := 0\n\tfor i := index + 1; i != 0; i -= (i & -i) {\n\t\ttotal += t[i]\n\t}\n\treturn total\n}\n\ntype Comb struct {\n\tlength int\n\tfac []int\n\tinv []int\n\tfinv []int\n}\n\nfunc NewComb() *Comb {\n\treturn &Comb{\n\t\tlength: 2,\n\t\tfac: []int{1, 1},\n\t\tinv: []int{1, 1},\n\t\tfinv: []int{1, 1},\n\t}\n}\n\nfunc (c Comb) calc(n, k int) int {\n\tif n < k {\n\t\treturn 0\n\t}\n\tif n < 0 || k < 0 {\n\t\treturn 0\n\t}\n\n\tif c.length <= n {\n\t\tfor i := c.length; i <= n; i++ {\n\t\t\tc.fac = append(c.fac, mod(c.fac[i-1]*i, MOD))\n\t\t\tc.inv = append(c.inv, MOD-mod(c.inv[mod(MOD, i)]*(MOD/i), MOD))\n\t\t\tc.finv = append(c.finv, mod(c.finv[i-1]*c.inv[i], MOD))\n\t\t}\n\t}\n\treturn mod(c.fac[n]*mod(c.finv[k]*c.finv[n-k], MOD), MOD)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nFind the sum of A_i \\times A_j over all pairs (i,j) such that 1\\leq i < j \\leq N, modulo (10^9+7).\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\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 \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} A_i A_j, modulo (10^9+7).\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n11\n\nWe have 1 \\times 2 + 1 \\times 3 + 2 \\times 3 = 11.\n\nSample Input 2\n\n4\n141421356 17320508 22360679 244949\n\nSample Output 2\n\n437235829", "sample_input": "3\n1 2 3\n"}, "reference_outputs": ["11\n"], "source_document_id": "p02572", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nFind the sum of A_i \\times A_j over all pairs (i,j) such that 1\\leq i < j \\leq N, modulo (10^9+7).\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\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 \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} A_i A_j, modulo (10^9+7).\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n11\n\nWe have 1 \\times 2 + 1 \\times 3 + 2 \\times 3 = 11.\n\nSample Input 2\n\n4\n141421356 17320508 22360679 244949\n\nSample Output 2\n\n437235829", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4557, "cpu_time_ms": 41, "memory_kb": 21172}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s159614171", "group_id": "codeNet:p02572", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&A[i])\n\t}\n\tconst p = 1000_000_000 + 7\n\n\tsum := 0\n\ttmp := 0\n\n\tfor i := N - 2; i >= 0; i-- {\n\n\t\ttmp += A[i+1]\n\t\tsum += A[i] * tmp\n\t}\n\t//fmt.Println(sum)\n\n\tfmt.Println(sum % p)\n\n}\n", "language": "Go", "metadata": {"date": 1599449383, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02572.html", "problem_id": "p02572", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02572/input.txt", "sample_output_relpath": "derived/input_output/data/p02572/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02572/Go/s159614171.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s159614171", "user_id": "u343774545"}, "prompt_components": {"gold_output": "11\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&A[i])\n\t}\n\tconst p = 1000_000_000 + 7\n\n\tsum := 0\n\ttmp := 0\n\n\tfor i := N - 2; i >= 0; i-- {\n\n\t\ttmp += A[i+1]\n\t\tsum += A[i] * tmp\n\t}\n\t//fmt.Println(sum)\n\n\tfmt.Println(sum % p)\n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nFind the sum of A_i \\times A_j over all pairs (i,j) such that 1\\leq i < j \\leq N, modulo (10^9+7).\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\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 \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} A_i A_j, modulo (10^9+7).\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n11\n\nWe have 1 \\times 2 + 1 \\times 3 + 2 \\times 3 = 11.\n\nSample Input 2\n\n4\n141421356 17320508 22360679 244949\n\nSample Output 2\n\n437235829", "sample_input": "3\n1 2 3\n"}, "reference_outputs": ["11\n"], "source_document_id": "p02572", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nFind the sum of A_i \\times A_j over all pairs (i,j) such that 1\\leq i < j \\leq N, modulo (10^9+7).\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\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 \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} A_i A_j, modulo (10^9+7).\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n11\n\nWe have 1 \\times 2 + 1 \\times 3 + 2 \\times 3 = 11.\n\nSample Input 2\n\n4\n141421356 17320508 22360679 244949\n\nSample Output 2\n\n437235829", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 307, "cpu_time_ms": 1765, "memory_kb": 6488}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s687191301", "group_id": "codeNet:p02572", "input_text": "package main\n \nimport (\n \"fmt\"\n)\n\nfunc main() {\n var (\n i, s, N, ans int64\n mod int64 = 1000000007\n )\n fmt.Scanf(\"%d\", &N)\n arr := make([]int64, N)\n for i = 0; i < N; i++ {\n fmt.Scanf(\"%d\", &arr[i])\n s = s%mod + arr[i]\n }\n for i = 0; i < N; i++ {\n s = (s - arr[i]) % mod\n ans += (arr[i] * s) % mod\n }\n fmt.Println(ans % mod)\n}", "language": "Go", "metadata": {"date": 1598991736, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02572.html", "problem_id": "p02572", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02572/input.txt", "sample_output_relpath": "derived/input_output/data/p02572/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02572/Go/s687191301.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s687191301", "user_id": "u001464994"}, "prompt_components": {"gold_output": "11\n", "input_to_evaluate": "package main\n \nimport (\n \"fmt\"\n)\n\nfunc main() {\n var (\n i, s, N, ans int64\n mod int64 = 1000000007\n )\n fmt.Scanf(\"%d\", &N)\n arr := make([]int64, N)\n for i = 0; i < N; i++ {\n fmt.Scanf(\"%d\", &arr[i])\n s = s%mod + arr[i]\n }\n for i = 0; i < N; i++ {\n s = (s - arr[i]) % mod\n ans += (arr[i] * s) % mod\n }\n fmt.Println(ans % mod)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nFind the sum of A_i \\times A_j over all pairs (i,j) such that 1\\leq i < j \\leq N, modulo (10^9+7).\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\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 \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} A_i A_j, modulo (10^9+7).\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n11\n\nWe have 1 \\times 2 + 1 \\times 3 + 2 \\times 3 = 11.\n\nSample Input 2\n\n4\n141421356 17320508 22360679 244949\n\nSample Output 2\n\n437235829", "sample_input": "3\n1 2 3\n"}, "reference_outputs": ["11\n"], "source_document_id": "p02572", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nFind the sum of A_i \\times A_j over all pairs (i,j) such that 1\\leq i < j \\leq N, modulo (10^9+7).\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\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 \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} A_i A_j, modulo (10^9+7).\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n11\n\nWe have 1 \\times 2 + 1 \\times 3 + 2 \\times 3 = 11.\n\nSample Input 2\n\n4\n141421356 17320508 22360679 244949\n\nSample Output 2\n\n437235829", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 496, "cpu_time_ms": 1783, "memory_kb": 6492}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s109258418", "group_id": "codeNet:p02572", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// -----------------------------------------------------------------------------\n// IO helper functions\n\n// Returns next token from input. It must be initialized by SetInput()\n// before the first call.\nvar nextToken func() ([]byte, error)\n\n// OutputBuffer Holds a buffer for output. It must be initialized by SetOutput().\n// All IO fucntions (read*() and [e]print*()) should write to OutputWriter\n// instead of this.\nvar OutputBuffer *bufio.Writer\n\n// OutputWriter Holds an io.Writer. It must be initialized by SetOutput()\nvar OutputWriter io.Writer\n\n// SetInteractive SetInteractive Set IO functions for interactive input/output.\nfunc SetInteractive(w io.Writer, r io.Reader) {\n\tSetUnbefferedInput(r)\n\tOutputBuffer = nil\n\tOutputWriter = w\n}\n\n// SetOutput Setup OutputBuffer and OutputWriter.\nfunc SetOutput(w io.Writer) {\n\tOutputBuffer = bufio.NewWriter(w)\n\tOutputWriter = OutputBuffer\n}\n\n// Flush Flushes OutputBuffer\nfunc Flush() {\n\tif OutputBuffer != nil {\n\t\tOutputBuffer.Flush()\n\t}\n}\n\n// IsSpace Returns true if c is a white space\nfunc IsSpace(c byte) bool {\n\tswitch c {\n\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// SetInput Setup nextToken with input buffer.\nfunc SetInput(r io.Reader) {\n\tbuf := new(bytes.Buffer)\n\tvar b []byte\n\n\tvar i int\n\trest := func() ([]byte, error) {\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\tinitial := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextToken = rest\n\t\treturn rest()\n\t}\n\tnextToken = initial\n}\n\n// SetUnbefferedInput Setup nextToken without input buffer.\nfunc SetUnbefferedInput(r io.Reader) {\n\tbuf := bufio.NewReader(r)\n\tvar b []byte\n\n\tvar i int\n\tnextToken = func() ([]byte, error) {\n\t\tvar err error\n\t\tif i == len(b) {\n\t\t\tb, err = buf.ReadBytes('\\n')\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ti = 0\n\t\t\tj := len(b) - 1\n\t\t\tfor 0 <= j && IsSpace(b[j]) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tb = b[0 : j+1]\n\t\t}\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n}\n\n// -----------------------------------------------------------------------------\n\n// IO functions\n\n// Reads next token and return it as []byte\nfunc readb() []byte {\n\tb, err := nextToken()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b\n}\n\n// Reads next token and return it as string\nfunc reads() string {\n\treturn string(readb())\n}\n\n// Reads next token and return it as int64\nfunc readll() int64 {\n\ti, err := strconv.ParseInt(reads(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// Reads next token and return it as int\nfunc readi() int {\n\treturn int(readll())\n}\n\n// Reads next token and return it as float64\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(reads(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// Write args to OutputWriter with the format f\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(OutputWriter, f, args...)\n}\n\n// Write args to OutputWriter without format\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(OutputWriter, args...)\n}\n\n// Write args to stderr with the format f\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// Write args to stderr without format\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\n// -----------------------------------------------------------------------------\n// Simple math functions\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc min64(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc max64(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\nfunc abs64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// =============================================================================\nfunc init() {\n\t// for non-interactive\n\t// SetInput(os.Stdin)\n\t// SetOutput(os.Stdout)\n\n\t// Enable below when interactive. Its ok to leave above intact.\n\tSetInteractive(os.Stdout, os.Stdin)\n}\n\n// MOD 10 ^ 9 + 7\nconst MOD = 1000_000_000 + 7\n\nfunc main() {\n\tdefer Flush()\n\n\tN := readi()\n\tRW := make([]int64, N+1)\n\tA := make([]int64, N)\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = readll()\n\t\tRW[i+1] = RW[i] + A[i]\n\t}\n\tvar ans, wk int64 = 0, 0\n\tfor i := 0; i < N; i++ {\n\t\twk = (A[i] * ((RW[N] - RW[i+1] + MOD) % MOD)) % MOD\n\t\tans = (ans + wk) % MOD\n\t}\n\tprintln(ans)\n}\n\n// =============================================================================\n", "language": "Go", "metadata": {"date": 1598782911, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02572.html", "problem_id": "p02572", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02572/input.txt", "sample_output_relpath": "derived/input_output/data/p02572/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02572/Go/s109258418.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s109258418", "user_id": "u181039779"}, "prompt_components": {"gold_output": "11\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// -----------------------------------------------------------------------------\n// IO helper functions\n\n// Returns next token from input. It must be initialized by SetInput()\n// before the first call.\nvar nextToken func() ([]byte, error)\n\n// OutputBuffer Holds a buffer for output. It must be initialized by SetOutput().\n// All IO fucntions (read*() and [e]print*()) should write to OutputWriter\n// instead of this.\nvar OutputBuffer *bufio.Writer\n\n// OutputWriter Holds an io.Writer. It must be initialized by SetOutput()\nvar OutputWriter io.Writer\n\n// SetInteractive SetInteractive Set IO functions for interactive input/output.\nfunc SetInteractive(w io.Writer, r io.Reader) {\n\tSetUnbefferedInput(r)\n\tOutputBuffer = nil\n\tOutputWriter = w\n}\n\n// SetOutput Setup OutputBuffer and OutputWriter.\nfunc SetOutput(w io.Writer) {\n\tOutputBuffer = bufio.NewWriter(w)\n\tOutputWriter = OutputBuffer\n}\n\n// Flush Flushes OutputBuffer\nfunc Flush() {\n\tif OutputBuffer != nil {\n\t\tOutputBuffer.Flush()\n\t}\n}\n\n// IsSpace Returns true if c is a white space\nfunc IsSpace(c byte) bool {\n\tswitch c {\n\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// SetInput Setup nextToken with input buffer.\nfunc SetInput(r io.Reader) {\n\tbuf := new(bytes.Buffer)\n\tvar b []byte\n\n\tvar i int\n\trest := func() ([]byte, error) {\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\tinitial := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextToken = rest\n\t\treturn rest()\n\t}\n\tnextToken = initial\n}\n\n// SetUnbefferedInput Setup nextToken without input buffer.\nfunc SetUnbefferedInput(r io.Reader) {\n\tbuf := bufio.NewReader(r)\n\tvar b []byte\n\n\tvar i int\n\tnextToken = func() ([]byte, error) {\n\t\tvar err error\n\t\tif i == len(b) {\n\t\t\tb, err = buf.ReadBytes('\\n')\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ti = 0\n\t\t\tj := len(b) - 1\n\t\t\tfor 0 <= j && IsSpace(b[j]) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tb = b[0 : j+1]\n\t\t}\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n}\n\n// -----------------------------------------------------------------------------\n\n// IO functions\n\n// Reads next token and return it as []byte\nfunc readb() []byte {\n\tb, err := nextToken()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b\n}\n\n// Reads next token and return it as string\nfunc reads() string {\n\treturn string(readb())\n}\n\n// Reads next token and return it as int64\nfunc readll() int64 {\n\ti, err := strconv.ParseInt(reads(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// Reads next token and return it as int\nfunc readi() int {\n\treturn int(readll())\n}\n\n// Reads next token and return it as float64\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(reads(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// Write args to OutputWriter with the format f\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(OutputWriter, f, args...)\n}\n\n// Write args to OutputWriter without format\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(OutputWriter, args...)\n}\n\n// Write args to stderr with the format f\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// Write args to stderr without format\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\n// -----------------------------------------------------------------------------\n// Simple math functions\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc min64(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc max64(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\nfunc abs64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// =============================================================================\nfunc init() {\n\t// for non-interactive\n\t// SetInput(os.Stdin)\n\t// SetOutput(os.Stdout)\n\n\t// Enable below when interactive. Its ok to leave above intact.\n\tSetInteractive(os.Stdout, os.Stdin)\n}\n\n// MOD 10 ^ 9 + 7\nconst MOD = 1000_000_000 + 7\n\nfunc main() {\n\tdefer Flush()\n\n\tN := readi()\n\tRW := make([]int64, N+1)\n\tA := make([]int64, N)\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = readll()\n\t\tRW[i+1] = RW[i] + A[i]\n\t}\n\tvar ans, wk int64 = 0, 0\n\tfor i := 0; i < N; i++ {\n\t\twk = (A[i] * ((RW[N] - RW[i+1] + MOD) % MOD)) % MOD\n\t\tans = (ans + wk) % MOD\n\t}\n\tprintln(ans)\n}\n\n// =============================================================================\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nFind the sum of A_i \\times A_j over all pairs (i,j) such that 1\\leq i < j \\leq N, modulo (10^9+7).\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\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 \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} A_i A_j, modulo (10^9+7).\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n11\n\nWe have 1 \\times 2 + 1 \\times 3 + 2 \\times 3 = 11.\n\nSample Input 2\n\n4\n141421356 17320508 22360679 244949\n\nSample Output 2\n\n437235829", "sample_input": "3\n1 2 3\n"}, "reference_outputs": ["11\n"], "source_document_id": "p02572", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nFind the sum of A_i \\times A_j over all pairs (i,j) such that 1\\leq i < j \\leq N, modulo (10^9+7).\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\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 \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} A_i A_j, modulo (10^9+7).\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n11\n\nWe have 1 \\times 2 + 1 \\times 3 + 2 \\times 3 = 11.\n\nSample Input 2\n\n4\n141421356 17320508 22360679 244949\n\nSample Output 2\n\n437235829", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4823, "cpu_time_ms": 40, "memory_kb": 10560}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s184439518", "group_id": "codeNet:p02572", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar DEBUG = true\n\nfunc main() {\n\tdefer Flush()\n\tN, A := readInts(0)\n\n\t_ = N\n\tp := INF\n\n\tS := make([]int, N+1)\n\tfor i := range A {\n\t\tS[i+1] = (S[i] + A[i]) % p\n\t}\n\n\tvar ans int\n\tfor i := range A {\n\t\tans += A[i] * (S[N] - S[i+1]) % p\n\t\tans %= p\n\t}\n\tprintln(ans)\n}\n\n// -----------------------------------------------------------------------------\n\n// IO helper functions\n\n// Returns next token from input. It must be initialized by SetInput()\n// before the first call.\nvar nextToken func() ([]byte, error)\nvar nextLine func() ([]byte, error)\n\n// Holds a buffer for output. It must be initialized by SetOutput().\n// All IO fucntions (read*() and [e]print*()) should write to OutputWriter\n// instead of this.\nvar OutputBuffer *bufio.Writer\n\n// Holds an io.Writer. It must be initialized by SetOutput()\nvar OutputWriter io.Writer\n\n// Set IO functions for interactive input/output.\nfunc SetInteractive(w io.Writer, r io.Reader) {\n\tSetUnbefferedInput(r)\n\tOutputBuffer = nil\n\tOutputWriter = w\n}\n\n// Setup OutputBuffer and OutputWriter.\nfunc SetOutput(w io.Writer) {\n\tOutputBuffer = bufio.NewWriter(w)\n\tOutputWriter = OutputBuffer\n}\n\n// Flushes OutputBuffer\nfunc Flush() {\n\tif OutputBuffer != nil {\n\t\tOutputBuffer.Flush()\n\t}\n}\n\n// Returns true if c is a white space\nfunc IsSpace(c byte) bool {\n\tswitch c {\n\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc IsNewLine(c byte) bool {\n\tswitch c {\n\tcase '\\n', '\\r':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Setup nextToken with input buffer.\nfunc SetInput(r io.Reader) {\n\tbuf := new(bytes.Buffer)\n\tvar b []byte\n\n\tvar i int\n\trest := func() ([]byte, error) {\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\tinitial := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextToken = rest\n\t\treturn rest()\n\t}\n\tnextToken = initial\n\n\trestLn := func() ([]byte, error) {\n\t\tfor i < len(b) && IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\n\tinitialLn := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextLine = restLn\n\t\treturn restLn()\n\t}\n\tnextLine = initialLn\n}\n\n// Setup nextToken without input buffer.\nfunc SetUnbefferedInput(r io.Reader) {\n\tbuf := bufio.NewReader(r)\n\tvar b []byte\n\n\tvar i int\n\tnextToken = func() ([]byte, error) {\n\t\tvar err error\n\t\tif i == len(b) {\n\t\t\tb, err = buf.ReadBytes('\\n')\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ti = 0\n\t\t\tj := len(b) - 1\n\t\t\tfor 0 <= j && IsSpace(b[j]) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tb = b[0 : j+1]\n\t\t}\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n}\n\n// -----------------------------------------------------------------------------\n\n// IO functions\n\n// Reads next token and return it as []byte\nfunc readb() []byte {\n\tb, err := nextToken()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\nfunc readberr() ([]byte, error) {\n\tb, err := nextToken()\n\treturn b[:len(b):len(b)], err\n}\n\n// Reads next token and return it as string\nfunc reads() string {\n\treturn string(readb())\n}\n\nfunc readserr() (string, error) {\n\tb, err := readberr()\n\treturn string(b), err\n}\n\n// Read next line as []byte. Trailing '\\n' will not be included.\n// See also comments on readb()\nfunc readbln() []byte {\n\tb, err := nextLine()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\nfunc readblnerr() ([]byte, error) {\n\tb, err := nextLine()\n\treturn b[:len(b):len(b)], err\n}\n\n// Read next line as string\nfunc readsln() string {\n\treturn string(readbln())\n}\n\nfunc readslnerr() (string, error) {\n\tb, err := readblnerr()\n\treturn string(b), err\n}\n\n// Reads next token and return it as int64\nfunc readll() int64 {\n\ti, err := strconv.ParseInt(reads(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readllerr() (int64, error) {\n\ts, err := readserr()\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"reading string: %w\", err)\n\t}\n\n\ti, err := strconv.ParseInt(s, 10, 64)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"parsing int: %w\", err)\n\t}\n\n\treturn i, nil\n}\n\n// Reads next token and return it as int\nfunc readi() int {\n\treturn int(readll())\n}\n\nfunc readierr() (int, error) {\n\ti, err := readllerr()\n\treturn int(i), err\n}\n\n// Reads next token and return it as float64\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(reads(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc readferr() (float64, error) {\n\ts, err := readserr()\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"reading string: %w\", err)\n\t}\n\n\tf, err := strconv.ParseFloat(s, 64)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"parsing float: %w\", err)\n\t}\n\n\treturn f, nil\n}\n\n// Write args to OutputWriter with the format f\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(OutputWriter, f, args...)\n}\n\n// Write args to OutputWriter without format\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(OutputWriter, args...)\n}\n\n// Write args to stderr with the format f\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// Write args to stderr without format\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\nfunc dbgf(f string, args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintf(os.Stderr, f, args...)\n}\n\nfunc dbg(args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintln(os.Stderr, args...)\n}\n\n// -----------------------------------------------------------------------------\n\n// Utilities\n\nfunc sumSlice(a []int) int {\n\tvar res int\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc sumSlicell(a []int64) int64 {\n\tvar res int64\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc readInts(N int) (int, []int) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int, N)\n\tfor i := range a {\n\t\ta[i] = readi()\n\t}\n\treturn N, a\n}\n\nfunc readIntsll(N int) (int, []int64) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int64, N)\n\tfor i := range a {\n\t\ta[i] = readll()\n\t}\n\treturn N, a\n}\n\n// -----------------------------------------------------------------------------\n\n// Simple math functions\n\nconst (\n\t// big prime\n\tINF = 1000000007\n\tINF2 = 1000000009\n\tINF3 = 998244353\n)\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minll(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minf(a, b float64) float64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxll(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxf(a, b float64) float64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absll(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absf(a float64) float64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// egcd(a, b) returns d, x, y:\n// d is gcd(a,b)\n// x, y are integers that satisfy ax + by = d\nfunc egcd(a, b int) (int, int, int) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcd(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc egcdll(a, b int64) (int64, int64, int64) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcdll(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc gcd(a, b int) int {\n\td, _, _ := egcd(a, b)\n\treturn d\n}\n\nfunc gcdll(a, b int64) int64 {\n\td, _, _ := egcdll(a, b)\n\treturn d\n}\n\n// set up IO functions\nfunc init() {\n\t// for non-interactive\n\tSetInput(os.Stdin)\n\tSetOutput(os.Stdout)\n\n\t// Enable below when interactive. Its ok to leave above intact.\n\t// SetInteractive(os.Stdout, os.Stdin)\n}\n", "language": "Go", "metadata": {"date": 1598765478, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02572.html", "problem_id": "p02572", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02572/input.txt", "sample_output_relpath": "derived/input_output/data/p02572/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02572/Go/s184439518.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s184439518", "user_id": "u705974985"}, "prompt_components": {"gold_output": "11\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar DEBUG = true\n\nfunc main() {\n\tdefer Flush()\n\tN, A := readInts(0)\n\n\t_ = N\n\tp := INF\n\n\tS := make([]int, N+1)\n\tfor i := range A {\n\t\tS[i+1] = (S[i] + A[i]) % p\n\t}\n\n\tvar ans int\n\tfor i := range A {\n\t\tans += A[i] * (S[N] - S[i+1]) % p\n\t\tans %= p\n\t}\n\tprintln(ans)\n}\n\n// -----------------------------------------------------------------------------\n\n// IO helper functions\n\n// Returns next token from input. It must be initialized by SetInput()\n// before the first call.\nvar nextToken func() ([]byte, error)\nvar nextLine func() ([]byte, error)\n\n// Holds a buffer for output. It must be initialized by SetOutput().\n// All IO fucntions (read*() and [e]print*()) should write to OutputWriter\n// instead of this.\nvar OutputBuffer *bufio.Writer\n\n// Holds an io.Writer. It must be initialized by SetOutput()\nvar OutputWriter io.Writer\n\n// Set IO functions for interactive input/output.\nfunc SetInteractive(w io.Writer, r io.Reader) {\n\tSetUnbefferedInput(r)\n\tOutputBuffer = nil\n\tOutputWriter = w\n}\n\n// Setup OutputBuffer and OutputWriter.\nfunc SetOutput(w io.Writer) {\n\tOutputBuffer = bufio.NewWriter(w)\n\tOutputWriter = OutputBuffer\n}\n\n// Flushes OutputBuffer\nfunc Flush() {\n\tif OutputBuffer != nil {\n\t\tOutputBuffer.Flush()\n\t}\n}\n\n// Returns true if c is a white space\nfunc IsSpace(c byte) bool {\n\tswitch c {\n\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc IsNewLine(c byte) bool {\n\tswitch c {\n\tcase '\\n', '\\r':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Setup nextToken with input buffer.\nfunc SetInput(r io.Reader) {\n\tbuf := new(bytes.Buffer)\n\tvar b []byte\n\n\tvar i int\n\trest := func() ([]byte, error) {\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\tinitial := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextToken = rest\n\t\treturn rest()\n\t}\n\tnextToken = initial\n\n\trestLn := func() ([]byte, error) {\n\t\tfor i < len(b) && IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\n\tinitialLn := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextLine = restLn\n\t\treturn restLn()\n\t}\n\tnextLine = initialLn\n}\n\n// Setup nextToken without input buffer.\nfunc SetUnbefferedInput(r io.Reader) {\n\tbuf := bufio.NewReader(r)\n\tvar b []byte\n\n\tvar i int\n\tnextToken = func() ([]byte, error) {\n\t\tvar err error\n\t\tif i == len(b) {\n\t\t\tb, err = buf.ReadBytes('\\n')\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ti = 0\n\t\t\tj := len(b) - 1\n\t\t\tfor 0 <= j && IsSpace(b[j]) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tb = b[0 : j+1]\n\t\t}\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n}\n\n// -----------------------------------------------------------------------------\n\n// IO functions\n\n// Reads next token and return it as []byte\nfunc readb() []byte {\n\tb, err := nextToken()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\nfunc readberr() ([]byte, error) {\n\tb, err := nextToken()\n\treturn b[:len(b):len(b)], err\n}\n\n// Reads next token and return it as string\nfunc reads() string {\n\treturn string(readb())\n}\n\nfunc readserr() (string, error) {\n\tb, err := readberr()\n\treturn string(b), err\n}\n\n// Read next line as []byte. Trailing '\\n' will not be included.\n// See also comments on readb()\nfunc readbln() []byte {\n\tb, err := nextLine()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\nfunc readblnerr() ([]byte, error) {\n\tb, err := nextLine()\n\treturn b[:len(b):len(b)], err\n}\n\n// Read next line as string\nfunc readsln() string {\n\treturn string(readbln())\n}\n\nfunc readslnerr() (string, error) {\n\tb, err := readblnerr()\n\treturn string(b), err\n}\n\n// Reads next token and return it as int64\nfunc readll() int64 {\n\ti, err := strconv.ParseInt(reads(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readllerr() (int64, error) {\n\ts, err := readserr()\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"reading string: %w\", err)\n\t}\n\n\ti, err := strconv.ParseInt(s, 10, 64)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"parsing int: %w\", err)\n\t}\n\n\treturn i, nil\n}\n\n// Reads next token and return it as int\nfunc readi() int {\n\treturn int(readll())\n}\n\nfunc readierr() (int, error) {\n\ti, err := readllerr()\n\treturn int(i), err\n}\n\n// Reads next token and return it as float64\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(reads(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc readferr() (float64, error) {\n\ts, err := readserr()\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"reading string: %w\", err)\n\t}\n\n\tf, err := strconv.ParseFloat(s, 64)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"parsing float: %w\", err)\n\t}\n\n\treturn f, nil\n}\n\n// Write args to OutputWriter with the format f\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(OutputWriter, f, args...)\n}\n\n// Write args to OutputWriter without format\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(OutputWriter, args...)\n}\n\n// Write args to stderr with the format f\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// Write args to stderr without format\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\nfunc dbgf(f string, args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintf(os.Stderr, f, args...)\n}\n\nfunc dbg(args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintln(os.Stderr, args...)\n}\n\n// -----------------------------------------------------------------------------\n\n// Utilities\n\nfunc sumSlice(a []int) int {\n\tvar res int\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc sumSlicell(a []int64) int64 {\n\tvar res int64\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc readInts(N int) (int, []int) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int, N)\n\tfor i := range a {\n\t\ta[i] = readi()\n\t}\n\treturn N, a\n}\n\nfunc readIntsll(N int) (int, []int64) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int64, N)\n\tfor i := range a {\n\t\ta[i] = readll()\n\t}\n\treturn N, a\n}\n\n// -----------------------------------------------------------------------------\n\n// Simple math functions\n\nconst (\n\t// big prime\n\tINF = 1000000007\n\tINF2 = 1000000009\n\tINF3 = 998244353\n)\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minll(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minf(a, b float64) float64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxll(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxf(a, b float64) float64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absll(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absf(a float64) float64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// egcd(a, b) returns d, x, y:\n// d is gcd(a,b)\n// x, y are integers that satisfy ax + by = d\nfunc egcd(a, b int) (int, int, int) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcd(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc egcdll(a, b int64) (int64, int64, int64) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcdll(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc gcd(a, b int) int {\n\td, _, _ := egcd(a, b)\n\treturn d\n}\n\nfunc gcdll(a, b int64) int64 {\n\td, _, _ := egcdll(a, b)\n\treturn d\n}\n\n// set up IO functions\nfunc init() {\n\t// for non-interactive\n\tSetInput(os.Stdin)\n\tSetOutput(os.Stdout)\n\n\t// Enable below when interactive. Its ok to leave above intact.\n\t// SetInteractive(os.Stdout, os.Stdin)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nFind the sum of A_i \\times A_j over all pairs (i,j) such that 1\\leq i < j \\leq N, modulo (10^9+7).\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\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 \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} A_i A_j, modulo (10^9+7).\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n11\n\nWe have 1 \\times 2 + 1 \\times 3 + 2 \\times 3 = 11.\n\nSample Input 2\n\n4\n141421356 17320508 22360679 244949\n\nSample Output 2\n\n437235829", "sample_input": "3\n1 2 3\n"}, "reference_outputs": ["11\n"], "source_document_id": "p02572", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nFind the sum of A_i \\times A_j over all pairs (i,j) such that 1\\leq i < j \\leq N, modulo (10^9+7).\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\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 \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} A_i A_j, modulo (10^9+7).\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n11\n\nWe have 1 \\times 2 + 1 \\times 3 + 2 \\times 3 = 11.\n\nSample Input 2\n\n4\n141421356 17320508 22360679 244949\n\nSample Output 2\n\n437235829", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 7786, "cpu_time_ms": 45, "memory_kb": 12832}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s122103086", "group_id": "codeNet:p02572", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tvar a int\n\tfmt.Scan(&n)\n\tsliceA := make([]int, n)\n\tsliceSum := make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a)\n\t\tsliceA[i] = a\n\t}\n\n\t// 累積和\n\tsumsum := 0\n\tfor i := 0; i < n; i++ {\n\t\tsumsum += sliceA[i]\n\t\tsliceSum[i] = sumsum\n\t}\n\n\tsumAll := 0\n\tmod := 1000000007\n\tfor i := 0; i < n; i++ {\n\t\tsumAll += sliceA[i] * (sliceSum[n-1] - sliceSum[i])\n\t\tsumAll %= mod\n\t}\n\tfmt.Print(sumAll)\n\n\t// sumAll := 0\n\t// mod := 1000000007\n\t// for i := 0; i < n; i++ {\n\t// \tsum := (sliceSum[n-1] - sliceSum[i]) % mod\n\t// \tsumAll += sliceA[i] * sum\n\t// \tsumAll %= mod\n\t// }\n\t// fmt.Print(sumAll)\n\n\t// 計算量多い\n\t// for i := 0; i < n; i++ {\n\t// \tsum := 0\n\t// \tfor j := i; j < n; j++ {\n\t// \t\tif i == j {\n\t// \t\t\tcontinue\n\t// \t\t}\n\t// \t\tsum += sliceA[i] * sliceA[j]\n\t// \t}\n\t// \tsumAll += sum\n\t// }\n}\n\nfunc abc(value int) int {\n\tflag := 1000000007\n\tans := 0\n\tif value < flag {\n\t\tans = value\n\t} else {\n\t\tans = value % flag\n\t}\n\treturn ans\n}\n", "language": "Go", "metadata": {"date": 1598735726, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02572.html", "problem_id": "p02572", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02572/input.txt", "sample_output_relpath": "derived/input_output/data/p02572/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02572/Go/s122103086.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s122103086", "user_id": "u336561016"}, "prompt_components": {"gold_output": "11\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tvar a int\n\tfmt.Scan(&n)\n\tsliceA := make([]int, n)\n\tsliceSum := make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a)\n\t\tsliceA[i] = a\n\t}\n\n\t// 累積和\n\tsumsum := 0\n\tfor i := 0; i < n; i++ {\n\t\tsumsum += sliceA[i]\n\t\tsliceSum[i] = sumsum\n\t}\n\n\tsumAll := 0\n\tmod := 1000000007\n\tfor i := 0; i < n; i++ {\n\t\tsumAll += sliceA[i] * (sliceSum[n-1] - sliceSum[i])\n\t\tsumAll %= mod\n\t}\n\tfmt.Print(sumAll)\n\n\t// sumAll := 0\n\t// mod := 1000000007\n\t// for i := 0; i < n; i++ {\n\t// \tsum := (sliceSum[n-1] - sliceSum[i]) % mod\n\t// \tsumAll += sliceA[i] * sum\n\t// \tsumAll %= mod\n\t// }\n\t// fmt.Print(sumAll)\n\n\t// 計算量多い\n\t// for i := 0; i < n; i++ {\n\t// \tsum := 0\n\t// \tfor j := i; j < n; j++ {\n\t// \t\tif i == j {\n\t// \t\t\tcontinue\n\t// \t\t}\n\t// \t\tsum += sliceA[i] * sliceA[j]\n\t// \t}\n\t// \tsumAll += sum\n\t// }\n}\n\nfunc abc(value int) int {\n\tflag := 1000000007\n\tans := 0\n\tif value < flag {\n\t\tans = value\n\t} else {\n\t\tans = value % flag\n\t}\n\treturn ans\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nFind the sum of A_i \\times A_j over all pairs (i,j) such that 1\\leq i < j \\leq N, modulo (10^9+7).\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\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 \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} A_i A_j, modulo (10^9+7).\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n11\n\nWe have 1 \\times 2 + 1 \\times 3 + 2 \\times 3 = 11.\n\nSample Input 2\n\n4\n141421356 17320508 22360679 244949\n\nSample Output 2\n\n437235829", "sample_input": "3\n1 2 3\n"}, "reference_outputs": ["11\n"], "source_document_id": "p02572", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nFind the sum of A_i \\times A_j over all pairs (i,j) such that 1\\leq i < j \\leq N, modulo (10^9+7).\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\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 \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} A_i A_j, modulo (10^9+7).\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n11\n\nWe have 1 \\times 2 + 1 \\times 3 + 2 \\times 3 = 11.\n\nSample Input 2\n\n4\n141421356 17320508 22360679 244949\n\nSample Output 2\n\n437235829", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 988, "cpu_time_ms": 1616, "memory_kb": 8560}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s233313121", "group_id": "codeNet:p02572", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tnums := []int64{}\n\n\t_, err := fmt.Scanf(\"%d\", &n)\n\tif err != nil {\n\t\treturn\n\t}\n\tif n <= 1 {\n\t\tfmt.Printf(\"0\\n\")\n\t\treturn\n\t}\n\n\tfor i:=0;i=0;i--{\n\t\tsums[i] = sums[i+1] + nums[i]\n\t}\n\n\tvar sum int64\n\tfor i:=0;i+1=0;i--{\n\t\tsums[i] = sums[i+1] + nums[i]\n\t}\n\n\tvar sum int64\n\tfor i:=0;i+1= 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc min(values ...int) int {\n\tif len(values) == 0 {\n\t\tpanic(\"no values\")\n\t}\n\n\tmin := values[0]\n\tfor _, v := range values {\n\t\tif v < min {\n\t\t\tmin = v\n\t\t}\n\t}\n\treturn min\n}\n\nfunc max(values ...int) int {\n\tif len(values) == 0 {\n\t\tpanic(\"no values\")\n\t}\n\n\tmax := values[0]\n\tfor _, v := range values {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}\n\nfunc pow(base, exponent int) int {\n\tif exponent < 0 {\n\t\tpanic(fmt.Sprintf(\"exponent (%d) should not be a minus\", exponent))\n\t}\n\n\tanswer := 1\n\tfor i := 0; i < exponent; i++ {\n\t\tanswer *= base\n\t}\n\treturn answer\n}\n\nfunc ceil(divident, dividor int) int {\n\tif dividor == 0 {\n\t\tpanic(\"dividor should not be 0\")\n\t}\n\n\tquo := divident / dividor\n\trem := divident % dividor\n\n\tif rem != 0 {\n\t\tif (divident > 0 && dividor > 0) ||\n\t\t\t(divident < 0 && dividor < 0) {\n\t\t\treturn quo + 1\n\t\t}\n\t}\n\treturn quo\n}\n\n// - sortutil\n\nfunc reverseInts(a []int) {\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n}\n\nfunc reverseStrings(a []string) {\n\tsort.Sort(sort.Reverse(sort.StringSlice(a)))\n}\n\n// - io\n\ntype scanner struct {\n\tbufScanner *bufio.Scanner\n}\n\nfunc newScanner() *scanner {\n\tbufSc := bufio.NewScanner(os.Stdin)\n\tbufSc.Split(bufio.ScanWords)\n\tbufSc.Buffer(nil, 100000000)\n\treturn &scanner{bufSc}\n}\n\nfunc (sc *scanner) readString() string {\n\tbufSc := sc.bufScanner\n\tbufSc.Scan()\n\treturn bufSc.Text()\n}\n\nfunc (sc *scanner) readInt() int {\n\tbufSc := sc.bufScanner\n\tbufSc.Scan()\n\ttext := bufSc.Text()\n\n\tnum, err := strconv.Atoi(text)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn num\n}\n\nfunc (sc *scanner) readInt64() int64 {\n\tbufSc := sc.bufScanner\n\tbufSc.Scan()\n\ttext := bufSc.Text()\n\n\tnum, err := strconv.ParseInt(text, 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn num\n}\n", "language": "Go", "metadata": {"date": 1598732625, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02572.html", "problem_id": "p02572", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02572/input.txt", "sample_output_relpath": "derived/input_output/data/p02572/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02572/Go/s605665509.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s605665509", "user_id": "u745359993"}, "prompt_components": {"gold_output": "11\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := newScanner()\n\tvar n = sc.readInt()\n\tvar a = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = sc.readInt()\n\t}\n\tvar ho = 1000000007\n\tvar gyaku = 500000004\n\t// var sum = 0\n\tvar zen = 0\n\tvar goo = 0\n\tfor i := 0; i < n; i++ {\n\t\tzen = (zen + a[i]) % ho\n\t\tgoo = (goo + (a[i]*a[i])%ho) % ho\n\t}\n\tans := ((zen*zen)%ho - goo) % ho\n\tif ans < 0 {\n\t\tans += ho\n\t}\n\tfmt.Println(ans * gyaku % ho)\n\n}\n\n//////////////////\n//////////////////\n//////////////////\n\nfunc abs(x int) int {\n\tif x >= 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc min(values ...int) int {\n\tif len(values) == 0 {\n\t\tpanic(\"no values\")\n\t}\n\n\tmin := values[0]\n\tfor _, v := range values {\n\t\tif v < min {\n\t\t\tmin = v\n\t\t}\n\t}\n\treturn min\n}\n\nfunc max(values ...int) int {\n\tif len(values) == 0 {\n\t\tpanic(\"no values\")\n\t}\n\n\tmax := values[0]\n\tfor _, v := range values {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}\n\nfunc pow(base, exponent int) int {\n\tif exponent < 0 {\n\t\tpanic(fmt.Sprintf(\"exponent (%d) should not be a minus\", exponent))\n\t}\n\n\tanswer := 1\n\tfor i := 0; i < exponent; i++ {\n\t\tanswer *= base\n\t}\n\treturn answer\n}\n\nfunc ceil(divident, dividor int) int {\n\tif dividor == 0 {\n\t\tpanic(\"dividor should not be 0\")\n\t}\n\n\tquo := divident / dividor\n\trem := divident % dividor\n\n\tif rem != 0 {\n\t\tif (divident > 0 && dividor > 0) ||\n\t\t\t(divident < 0 && dividor < 0) {\n\t\t\treturn quo + 1\n\t\t}\n\t}\n\treturn quo\n}\n\n// - sortutil\n\nfunc reverseInts(a []int) {\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n}\n\nfunc reverseStrings(a []string) {\n\tsort.Sort(sort.Reverse(sort.StringSlice(a)))\n}\n\n// - io\n\ntype scanner struct {\n\tbufScanner *bufio.Scanner\n}\n\nfunc newScanner() *scanner {\n\tbufSc := bufio.NewScanner(os.Stdin)\n\tbufSc.Split(bufio.ScanWords)\n\tbufSc.Buffer(nil, 100000000)\n\treturn &scanner{bufSc}\n}\n\nfunc (sc *scanner) readString() string {\n\tbufSc := sc.bufScanner\n\tbufSc.Scan()\n\treturn bufSc.Text()\n}\n\nfunc (sc *scanner) readInt() int {\n\tbufSc := sc.bufScanner\n\tbufSc.Scan()\n\ttext := bufSc.Text()\n\n\tnum, err := strconv.Atoi(text)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn num\n}\n\nfunc (sc *scanner) readInt64() int64 {\n\tbufSc := sc.bufScanner\n\tbufSc.Scan()\n\ttext := bufSc.Text()\n\n\tnum, err := strconv.ParseInt(text, 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn num\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nFind the sum of A_i \\times A_j over all pairs (i,j) such that 1\\leq i < j \\leq N, modulo (10^9+7).\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\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 \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} A_i A_j, modulo (10^9+7).\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n11\n\nWe have 1 \\times 2 + 1 \\times 3 + 2 \\times 3 = 11.\n\nSample Input 2\n\n4\n141421356 17320508 22360679 244949\n\nSample Output 2\n\n437235829", "sample_input": "3\n1 2 3\n"}, "reference_outputs": ["11\n"], "source_document_id": "p02572", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nFind the sum of A_i \\times A_j over all pairs (i,j) such that 1\\leq i < j \\leq N, modulo (10^9+7).\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\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 \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} A_i A_j, modulo (10^9+7).\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n11\n\nWe have 1 \\times 2 + 1 \\times 3 + 2 \\times 3 = 11.\n\nSample Input 2\n\n4\n141421356 17320508 22360679 244949\n\nSample Output 2\n\n437235829", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2290, "cpu_time_ms": 48, "memory_kb": 5864}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s218587259", "group_id": "codeNet:p02572", "input_text": "// Sum of product of pairs\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc calcProduct(a []int64) int64 {\n\tconst M = 1000000007\n\tvar s int64\n\ts = 0\n\tfor i := 0; i < len(a)-1; i++ {\n\t\tvar ps int64\n\t\tps = 0\n\t\tfor j := i + 1; j < len(a); j++ {\n\t\t\tps += a[j]\n\t\t\tif M < ps {\n\t\t\t\tps -= M\n\t\t\t}\n\t\t}\n\t\ts += a[i] * ps\n\t\ts %= M\n\t}\n\treturn s\n}\n\nfunc nextInt(sc *bufio.Scanner) (int, error) {\n\tsc.Scan()\n\tt := sc.Text()\n\treturn strconv.Atoi(t)\n}\n\nfunc nextInt64(sc *bufio.Scanner) (int64, error) {\n\tsc.Scan()\n\tt := sc.Text()\n\treturn strconv.ParseInt(t, 10, 64)\n}\n\nfunc nextString(sc *bufio.Scanner) string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\n\tn, _ := nextInt(sc)\n\n\ta := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\taa, _ := nextInt64(sc)\n\t\ta[i] = aa\n\t}\n\n\tr := calcProduct(a)\n\tfmt.Println(r)\n}\n", "language": "Go", "metadata": {"date": 1598731605, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02572.html", "problem_id": "p02572", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02572/input.txt", "sample_output_relpath": "derived/input_output/data/p02572/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02572/Go/s218587259.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s218587259", "user_id": "u301059551"}, "prompt_components": {"gold_output": "11\n", "input_to_evaluate": "// Sum of product of pairs\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc calcProduct(a []int64) int64 {\n\tconst M = 1000000007\n\tvar s int64\n\ts = 0\n\tfor i := 0; i < len(a)-1; i++ {\n\t\tvar ps int64\n\t\tps = 0\n\t\tfor j := i + 1; j < len(a); j++ {\n\t\t\tps += a[j]\n\t\t\tif M < ps {\n\t\t\t\tps -= M\n\t\t\t}\n\t\t}\n\t\ts += a[i] * ps\n\t\ts %= M\n\t}\n\treturn s\n}\n\nfunc nextInt(sc *bufio.Scanner) (int, error) {\n\tsc.Scan()\n\tt := sc.Text()\n\treturn strconv.Atoi(t)\n}\n\nfunc nextInt64(sc *bufio.Scanner) (int64, error) {\n\tsc.Scan()\n\tt := sc.Text()\n\treturn strconv.ParseInt(t, 10, 64)\n}\n\nfunc nextString(sc *bufio.Scanner) string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\n\tn, _ := nextInt(sc)\n\n\ta := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\taa, _ := nextInt64(sc)\n\t\ta[i] = aa\n\t}\n\n\tr := calcProduct(a)\n\tfmt.Println(r)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nFind the sum of A_i \\times A_j over all pairs (i,j) such that 1\\leq i < j \\leq N, modulo (10^9+7).\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\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 \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} A_i A_j, modulo (10^9+7).\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n11\n\nWe have 1 \\times 2 + 1 \\times 3 + 2 \\times 3 = 11.\n\nSample Input 2\n\n4\n141421356 17320508 22360679 244949\n\nSample Output 2\n\n437235829", "sample_input": "3\n1 2 3\n"}, "reference_outputs": ["11\n"], "source_document_id": "p02572", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nFind the sum of A_i \\times A_j over all pairs (i,j) such that 1\\leq i < j \\leq N, modulo (10^9+7).\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\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 \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} A_i A_j, modulo (10^9+7).\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n11\n\nWe have 1 \\times 2 + 1 \\times 3 + 2 \\times 3 = 11.\n\nSample Input 2\n\n4\n141421356 17320508 22360679 244949\n\nSample Output 2\n\n437235829", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 871, "cpu_time_ms": 2206, "memory_kb": 5852}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s058951226", "group_id": "codeNet:p02572", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\tbuf := make([]byte, 1024*1024)\n\tsc.Buffer(buf, bufio.MaxScanTokenSize)\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush()\n\n\tn := nextInt()\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = nextInt()\n\t}\n\n\tsumA := 0\n\tfor i := 0; i < n; i++ {\n\t\tsumA += a[i]\n\t}\n\tsum := 0\n\tfor i := 0; i < n-1; i++ {\n\t\tsumA -= a[i]\n\t\tsum += a[i] * sumA\n\t}\n\n\tfmt.Fprintf(out, \"%d\\n\", sum%((10*10*10*10*10*10*10*10*10)+7))\n}\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextFloat64() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc quickSort(val []int) []int {\n\tif len(val) < 2 {\n\t\treturn val\n\t}\n\n\tpivot := val[0]\n\n\tleft := []int{}\n\tright := []int{}\n\n\tfor _, v := range val[1:] {\n\t\tif pivot > v {\n\t\t\tleft = append(left, v)\n\t\t} else {\n\t\t\tright = append(right, v)\n\t\t}\n\t}\n\n\tleft = quickSort(left)\n\tright = quickSort(right)\n\n\tret := append(left, pivot)\n\tret = append(ret, right...)\n\n\treturn ret\n}\n", "language": "Go", "metadata": {"date": 1598731359, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02572.html", "problem_id": "p02572", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02572/input.txt", "sample_output_relpath": "derived/input_output/data/p02572/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02572/Go/s058951226.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s058951226", "user_id": "u518086606"}, "prompt_components": {"gold_output": "11\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\tbuf := make([]byte, 1024*1024)\n\tsc.Buffer(buf, bufio.MaxScanTokenSize)\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush()\n\n\tn := nextInt()\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = nextInt()\n\t}\n\n\tsumA := 0\n\tfor i := 0; i < n; i++ {\n\t\tsumA += a[i]\n\t}\n\tsum := 0\n\tfor i := 0; i < n-1; i++ {\n\t\tsumA -= a[i]\n\t\tsum += a[i] * sumA\n\t}\n\n\tfmt.Fprintf(out, \"%d\\n\", sum%((10*10*10*10*10*10*10*10*10)+7))\n}\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextFloat64() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc quickSort(val []int) []int {\n\tif len(val) < 2 {\n\t\treturn val\n\t}\n\n\tpivot := val[0]\n\n\tleft := []int{}\n\tright := []int{}\n\n\tfor _, v := range val[1:] {\n\t\tif pivot > v {\n\t\t\tleft = append(left, v)\n\t\t} else {\n\t\t\tright = append(right, v)\n\t\t}\n\t}\n\n\tleft = quickSort(left)\n\tright = quickSort(right)\n\n\tret := append(left, pivot)\n\tret = append(ret, right...)\n\n\treturn ret\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nFind the sum of A_i \\times A_j over all pairs (i,j) such that 1\\leq i < j \\leq N, modulo (10^9+7).\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\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 \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} A_i A_j, modulo (10^9+7).\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n11\n\nWe have 1 \\times 2 + 1 \\times 3 + 2 \\times 3 = 11.\n\nSample Input 2\n\n4\n141421356 17320508 22360679 244949\n\nSample Output 2\n\n437235829", "sample_input": "3\n1 2 3\n"}, "reference_outputs": ["11\n"], "source_document_id": "p02572", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nFind the sum of A_i \\times A_j over all pairs (i,j) such that 1\\leq i < j \\leq N, modulo (10^9+7).\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\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 \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} A_i A_j, modulo (10^9+7).\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n11\n\nWe have 1 \\times 2 + 1 \\times 3 + 2 \\times 3 = 11.\n\nSample Input 2\n\n4\n141421356 17320508 22360679 244949\n\nSample Output 2\n\n437235829", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1294, "cpu_time_ms": 44, "memory_kb": 6400}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s333868888", "group_id": "codeNet:p02572", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tnums := []int{}\n\n\t_, err := fmt.Scanf(\"%d\", &n)\n\tif err != nil {\n\t\treturn\n\t}\n\tif n <= 1 {\n\t\tfmt.Printf(\"0\\n\")\n\t\treturn\n\t}\n\n\tfor i:=0;i>= 1 {\n\t\tif y&1 == 1 {\n\t\t\tret = mod((ret * x), MOD)\n\t\t}\n\t\tx = mod(x*x, MOD)\n\t}\n\treturn ret\n}\n\nfunc min(values ...int) int {\n\tret := INT_INF\n\tfor _, v := range values {\n\t\tif ret > v {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc max(values ...int) int {\n\tret := -INT_INF\n\tfor _, v := range values {\n\t\tif ret < v {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc s2i(s string) int {\n\tv, ok := strconv.Atoi(s)\n\tif ok != nil {\n\t\tpanic(\"Faild : \" + s + \" can't convert to int\")\n\t}\n\treturn v\n}\n\nfunc i2s(i int) string {\n\treturn strconv.Itoa(i)\n}\n\nfunc gcd(v1, v2 int) int {\n\tif v1 > v2 {\n\t\tv1, v2 = v2, v1\n\t}\n\tfor v1 != 0 {\n\t\tv1, v2 = v2%v1, v1\n\t}\n\treturn v2\n}\n\nfunc lcm(v1, v2 int) int {\n\treturn v1 * v2 / gcd(v1, v2)\n}\n\nfunc extgcd(a, b, c int) (int, int, int) {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := extgcd(b, mod(a, b), c)\n\treturn d, y, x - int(a/b)*y\n}\n\nfunc bit(size int) [][]bool {\n\tbSize := int(math.Pow(2, float64(size)))\n\tb := make([][]bool, bSize)\n\tfor i := 0; i < bSize; i++ {\n\t\tb[i] = make([]bool, size)\n\t\tfor j := 0; j < size; j++ {\n\t\t\tif i>>j&1 == 1 {\n\t\t\t\tb[i][j] = true\n\t\t\t} else {\n\t\t\t\tb[i][j] = false\n\t\t\t}\n\t\t}\n\t}\n\treturn b\n}\n\n/* ------------------------------------------------ */\n/* Data stracture */\n/* ------------------------------------------------ */\n// 簡易的なDeque (PushLeftが非常に遅い)\ntype Deque []interface{}\n\nfunc (q *Deque) PopRight() (r interface{}) {\n\tl := len(*q)\n\tr = (*q)[l-1]\n\t*q = (*q)[:l-1]\n\treturn\n}\n\nfunc (q *Deque) PopLeft() (r interface{}) {\n\tr = (*q)[0]\n\t*q = (*q)[1:]\n\treturn\n}\n\nfunc (q *Deque) PushRight(x interface{}) {\n\t*q = append(*q, x)\n}\n\nfunc (q *Deque) PushLeft(x interface{}) {\n\t*q = append([]interface{}{x}, *q...)\n}\n\ntype IntHeap []int\n\nfunc (h *IntHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IntHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc (h IntHeap) Len() int { return len(h) }\nfunc (h IntHeap) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h IntHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\n\n// BIT Tree\ntype FenwickTree []int\n\nfunc NewFenwickTree(size int) *FenwickTree {\n\tvar t FenwickTree\n\tt = make([]int, size+1)\n\treturn &t\n}\n\nfunc (t FenwickTree) add(index, v int) {\n\tfor i := index + 1; i < len(t); i += (i & -i) {\n\t\tt[i] += v\n\t}\n}\n\nfunc (t FenwickTree) sum(index int) int {\n\ttotal := 0\n\tfor i := index + 1; i != 0; i -= (i & -i) {\n\t\ttotal += t[i]\n\t}\n\treturn total\n}\n\ntype Comb struct {\n\tlength int\n\tfac []int\n\tinv []int\n\tfinv []int\n}\n\nfunc NewComb() *Comb {\n\treturn &Comb{\n\t\tlength: 2,\n\t\tfac: []int{1, 1},\n\t\tinv: []int{1, 1},\n\t\tfinv: []int{1, 1},\n\t}\n}\n\nfunc (c Comb) calc(n, k int) int {\n\tif n < k {\n\t\treturn 0\n\t}\n\tif n < 0 || k < 0 {\n\t\treturn 0\n\t}\n\n\tif c.length <= n {\n\t\tfor i := c.length; i <= n; i++ {\n\t\t\tc.fac = append(c.fac, mod(c.fac[i-1]*i, MOD))\n\t\t\tc.inv = append(c.inv, MOD-mod(c.inv[mod(MOD, i)]*(MOD/i), MOD))\n\t\t\tc.finv = append(c.finv, mod(c.finv[i-1]*c.inv[i], MOD))\n\t\t}\n\t}\n\treturn mod(c.fac[n]*mod(c.finv[k]*c.finv[n-k], MOD), MOD)\n}\n", "language": "Go", "metadata": {"date": 1598730025, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02572.html", "problem_id": "p02572", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02572/input.txt", "sample_output_relpath": "derived/input_output/data/p02572/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02572/Go/s514319256.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s514319256", "user_id": "u811202694"}, "prompt_components": {"gold_output": "11\n", "input_to_evaluate": "// Template: https://github.com/maitaken/atcoder-template\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst (\n\tBUFSIZE = 10000000\n\tMOD = 1000000007\n\tINT_INF = math.MaxInt32\n)\n\nvar rdr *bufio.Reader\n\nfunc main() {\n\trdr = bufio.NewReaderSize(os.Stdin, BUFSIZE)\n\tsolve()\n}\n\nfunc solve() {\n\tN := readint()\n\tA := readIntSlice()\n\tAr := make([]int, N+1)\n\tfor i := 0; i < N; i++ {\n\t\tAr[i+1] += (Ar[i] + A[i]) % MOD\n\t}\n\n\tans := 0\n\tfor i := 0; i < N-1; i++ {\n\t\tans = mod(ans+(Ar[N]-Ar[i+1])*A[i], MOD)\n\t}\n\tfmt.Println(ans)\n}\n\nfunc readline() string {\n\tbuf := make([]byte, 0, 16)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tfmt.Println(e.Error())\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc readIntSlice() []int {\n\tslice := make([]int, 0)\n\tlines := strings.Split(readline(), \" \")\n\tfor _, v := range lines {\n\t\tslice = append(slice, s2i(v))\n\t}\n\treturn slice\n}\n\nfunc readint() int {\n\treturn s2i(readline())\n}\n\nfunc readint2() (int, int) {\n\tlines := strings.Split(readline(), \" \")\n\treturn s2i(lines[0]), s2i(lines[1])\n}\n\nfunc readint3() (int, int, int) {\n\tlines := strings.Split(readline(), \" \")\n\treturn s2i(lines[0]), s2i(lines[1]), s2i(lines[2])\n}\n\nfunc readint4() (int, int, int, int) {\n\tlines := strings.Split(readline(), \" \")\n\treturn s2i(lines[0]), s2i(lines[1]), s2i(lines[2]), s2i(lines[3])\n}\n\n// For int\nfunc b2i(b bool) int {\n\tif b {\n\t\treturn 1\n\t}\n\treturn 0\n}\n\nfunc abs(v int) int {\n\tif v < 0 {\n\t\treturn -v\n\t}\n\treturn v\n}\n\nfunc pow(x, y int) int {\n\treturn int(math.Pow(float64(x), float64(y)))\n}\n\nfunc mod(x, y int) int {\n\tm := x % y\n\tif m < 0 {\n\t\treturn m + y\n\t}\n\treturn m\n}\n\nfunc modpow(x, y int) int {\n\tret := 1\n\tfor ; y != 0; y >>= 1 {\n\t\tif y&1 == 1 {\n\t\t\tret = mod((ret * x), MOD)\n\t\t}\n\t\tx = mod(x*x, MOD)\n\t}\n\treturn ret\n}\n\nfunc min(values ...int) int {\n\tret := INT_INF\n\tfor _, v := range values {\n\t\tif ret > v {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc max(values ...int) int {\n\tret := -INT_INF\n\tfor _, v := range values {\n\t\tif ret < v {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc s2i(s string) int {\n\tv, ok := strconv.Atoi(s)\n\tif ok != nil {\n\t\tpanic(\"Faild : \" + s + \" can't convert to int\")\n\t}\n\treturn v\n}\n\nfunc i2s(i int) string {\n\treturn strconv.Itoa(i)\n}\n\nfunc gcd(v1, v2 int) int {\n\tif v1 > v2 {\n\t\tv1, v2 = v2, v1\n\t}\n\tfor v1 != 0 {\n\t\tv1, v2 = v2%v1, v1\n\t}\n\treturn v2\n}\n\nfunc lcm(v1, v2 int) int {\n\treturn v1 * v2 / gcd(v1, v2)\n}\n\nfunc extgcd(a, b, c int) (int, int, int) {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := extgcd(b, mod(a, b), c)\n\treturn d, y, x - int(a/b)*y\n}\n\nfunc bit(size int) [][]bool {\n\tbSize := int(math.Pow(2, float64(size)))\n\tb := make([][]bool, bSize)\n\tfor i := 0; i < bSize; i++ {\n\t\tb[i] = make([]bool, size)\n\t\tfor j := 0; j < size; j++ {\n\t\t\tif i>>j&1 == 1 {\n\t\t\t\tb[i][j] = true\n\t\t\t} else {\n\t\t\t\tb[i][j] = false\n\t\t\t}\n\t\t}\n\t}\n\treturn b\n}\n\n/* ------------------------------------------------ */\n/* Data stracture */\n/* ------------------------------------------------ */\n// 簡易的なDeque (PushLeftが非常に遅い)\ntype Deque []interface{}\n\nfunc (q *Deque) PopRight() (r interface{}) {\n\tl := len(*q)\n\tr = (*q)[l-1]\n\t*q = (*q)[:l-1]\n\treturn\n}\n\nfunc (q *Deque) PopLeft() (r interface{}) {\n\tr = (*q)[0]\n\t*q = (*q)[1:]\n\treturn\n}\n\nfunc (q *Deque) PushRight(x interface{}) {\n\t*q = append(*q, x)\n}\n\nfunc (q *Deque) PushLeft(x interface{}) {\n\t*q = append([]interface{}{x}, *q...)\n}\n\ntype IntHeap []int\n\nfunc (h *IntHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IntHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc (h IntHeap) Len() int { return len(h) }\nfunc (h IntHeap) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h IntHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\n\n// BIT Tree\ntype FenwickTree []int\n\nfunc NewFenwickTree(size int) *FenwickTree {\n\tvar t FenwickTree\n\tt = make([]int, size+1)\n\treturn &t\n}\n\nfunc (t FenwickTree) add(index, v int) {\n\tfor i := index + 1; i < len(t); i += (i & -i) {\n\t\tt[i] += v\n\t}\n}\n\nfunc (t FenwickTree) sum(index int) int {\n\ttotal := 0\n\tfor i := index + 1; i != 0; i -= (i & -i) {\n\t\ttotal += t[i]\n\t}\n\treturn total\n}\n\ntype Comb struct {\n\tlength int\n\tfac []int\n\tinv []int\n\tfinv []int\n}\n\nfunc NewComb() *Comb {\n\treturn &Comb{\n\t\tlength: 2,\n\t\tfac: []int{1, 1},\n\t\tinv: []int{1, 1},\n\t\tfinv: []int{1, 1},\n\t}\n}\n\nfunc (c Comb) calc(n, k int) int {\n\tif n < k {\n\t\treturn 0\n\t}\n\tif n < 0 || k < 0 {\n\t\treturn 0\n\t}\n\n\tif c.length <= n {\n\t\tfor i := c.length; i <= n; i++ {\n\t\t\tc.fac = append(c.fac, mod(c.fac[i-1]*i, MOD))\n\t\t\tc.inv = append(c.inv, MOD-mod(c.inv[mod(MOD, i)]*(MOD/i), MOD))\n\t\t\tc.finv = append(c.finv, mod(c.finv[i-1]*c.inv[i], MOD))\n\t\t}\n\t}\n\treturn mod(c.fac[n]*mod(c.finv[k]*c.finv[n-k], MOD), MOD)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nFind the sum of A_i \\times A_j over all pairs (i,j) such that 1\\leq i < j \\leq N, modulo (10^9+7).\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\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 \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} A_i A_j, modulo (10^9+7).\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n11\n\nWe have 1 \\times 2 + 1 \\times 3 + 2 \\times 3 = 11.\n\nSample Input 2\n\n4\n141421356 17320508 22360679 244949\n\nSample Output 2\n\n437235829", "sample_input": "3\n1 2 3\n"}, "reference_outputs": ["11\n"], "source_document_id": "p02572", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nFind the sum of A_i \\times A_j over all pairs (i,j) such that 1\\leq i < j \\leq N, modulo (10^9+7).\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\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 \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} A_i A_j, modulo (10^9+7).\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n11\n\nWe have 1 \\times 2 + 1 \\times 3 + 2 \\times 3 = 11.\n\nSample Input 2\n\n4\n141421356 17320508 22360679 244949\n\nSample Output 2\n\n437235829", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4818, "cpu_time_ms": 45, "memory_kb": 21892}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s485874838", "group_id": "codeNet:p02572", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\ntype Node struct {\n\tValue int64\n\tNext *Node\n}\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tw := bufio.NewWriter(os.Stdout)\n\tdefer w.Flush()\n\n\tvar n int64\n\tfmt.Fscan(r, &n)\n\n\tfirst := &Node{\n\t\tValue: 0,\n\t\tNext: nil,\n\t}\n\n\ttmp := first\n\n\tvar a int64\n\tfor i := int64(0); i < n; i++ {\n\t\tfmt.Fscan(r, &a)\n\t\tnewNode := &Node{\n\t\t\tValue: a,\n\t\t\tNext: nil,\n\t\t}\n\t\ttmp.Next = newNode\n\t\ttmp = newNode\n\t}\n\n\tvar result int64\n\tvar base int64\n\tbase = 1000000000 + 7\n\n\tiNode := first.Next\n\tfor iNode.Next != nil {\n\t\tjNode := iNode.Next\n\t\tfor jNode != nil {\n\t\t\tfmt.Printf(\"%d, %d\\n\", iNode.Value, jNode.Value)\n\t\t\tr := (iNode.Value * jNode.Value) % base\n\t\t\tresult += r\n\t\t\tresult %= base\n\t\t\tjNode = jNode.Next\n\t\t}\n\t\tiNode = iNode.Next\n\t}\n\n\tfmt.Fprintln(w, result)\n\n}\n", "language": "Go", "metadata": {"date": 1598729719, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02572.html", "problem_id": "p02572", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02572/input.txt", "sample_output_relpath": "derived/input_output/data/p02572/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02572/Go/s485874838.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s485874838", "user_id": "u329377137"}, "prompt_components": {"gold_output": "11\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\ntype Node struct {\n\tValue int64\n\tNext *Node\n}\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tw := bufio.NewWriter(os.Stdout)\n\tdefer w.Flush()\n\n\tvar n int64\n\tfmt.Fscan(r, &n)\n\n\tfirst := &Node{\n\t\tValue: 0,\n\t\tNext: nil,\n\t}\n\n\ttmp := first\n\n\tvar a int64\n\tfor i := int64(0); i < n; i++ {\n\t\tfmt.Fscan(r, &a)\n\t\tnewNode := &Node{\n\t\t\tValue: a,\n\t\t\tNext: nil,\n\t\t}\n\t\ttmp.Next = newNode\n\t\ttmp = newNode\n\t}\n\n\tvar result int64\n\tvar base int64\n\tbase = 1000000000 + 7\n\n\tiNode := first.Next\n\tfor iNode.Next != nil {\n\t\tjNode := iNode.Next\n\t\tfor jNode != nil {\n\t\t\tfmt.Printf(\"%d, %d\\n\", iNode.Value, jNode.Value)\n\t\t\tr := (iNode.Value * jNode.Value) % base\n\t\t\tresult += r\n\t\t\tresult %= base\n\t\t\tjNode = jNode.Next\n\t\t}\n\t\tiNode = iNode.Next\n\t}\n\n\tfmt.Fprintln(w, result)\n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nFind the sum of A_i \\times A_j over all pairs (i,j) such that 1\\leq i < j \\leq N, modulo (10^9+7).\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\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 \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} A_i A_j, modulo (10^9+7).\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n11\n\nWe have 1 \\times 2 + 1 \\times 3 + 2 \\times 3 = 11.\n\nSample Input 2\n\n4\n141421356 17320508 22360679 244949\n\nSample Output 2\n\n437235829", "sample_input": "3\n1 2 3\n"}, "reference_outputs": ["11\n"], "source_document_id": "p02572", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nFind the sum of A_i \\times A_j over all pairs (i,j) such that 1\\leq i < j \\leq N, modulo (10^9+7).\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\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 \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} A_i A_j, modulo (10^9+7).\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n11\n\nWe have 1 \\times 2 + 1 \\times 3 + 2 \\times 3 = 11.\n\nSample Input 2\n\n4\n141421356 17320508 22360679 244949\n\nSample Output 2\n\n437235829", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 799, "cpu_time_ms": 2261, "memory_kb": 37148}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s430456474", "group_id": "codeNet:p02572", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nconst (\n\tBASE = 1000000007\n)\n\nfunc main() {\n\tbuf := make([]byte, 1024*1024)\n\tsc.Buffer(buf, bufio.MaxScanTokenSize)\n\tsc.Split(bufio.ScanWords)\n\n\tn := nextInt()\n\ta := make([]uint64, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = uint64(nextInt())\n\t}\n\n\tvar r uint64 = 0\n\tvar m uint64 = 0\n\n\tfor i := n - 2; i >= 0; i-- {\n\t\tm = (m + a[i+1]) % BASE\n\t\tr = (r + (a[i] * m)) % BASE\n\t}\n\n\tfmt.Println(r)\n}\n", "language": "Go", "metadata": {"date": 1598729441, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02572.html", "problem_id": "p02572", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02572/input.txt", "sample_output_relpath": "derived/input_output/data/p02572/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02572/Go/s430456474.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s430456474", "user_id": "u090225501"}, "prompt_components": {"gold_output": "11\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nconst (\n\tBASE = 1000000007\n)\n\nfunc main() {\n\tbuf := make([]byte, 1024*1024)\n\tsc.Buffer(buf, bufio.MaxScanTokenSize)\n\tsc.Split(bufio.ScanWords)\n\n\tn := nextInt()\n\ta := make([]uint64, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = uint64(nextInt())\n\t}\n\n\tvar r uint64 = 0\n\tvar m uint64 = 0\n\n\tfor i := n - 2; i >= 0; i-- {\n\t\tm = (m + a[i+1]) % BASE\n\t\tr = (r + (a[i] * m)) % BASE\n\t}\n\n\tfmt.Println(r)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nFind the sum of A_i \\times A_j over all pairs (i,j) such that 1\\leq i < j \\leq N, modulo (10^9+7).\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\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 \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} A_i A_j, modulo (10^9+7).\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n11\n\nWe have 1 \\times 2 + 1 \\times 3 + 2 \\times 3 = 11.\n\nSample Input 2\n\n4\n141421356 17320508 22360679 244949\n\nSample Output 2\n\n437235829", "sample_input": "3\n1 2 3\n"}, "reference_outputs": ["11\n"], "source_document_id": "p02572", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nFind the sum of A_i \\times A_j over all pairs (i,j) such that 1\\leq i < j \\leq N, modulo (10^9+7).\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\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 \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} A_i A_j, modulo (10^9+7).\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n11\n\nWe have 1 \\times 2 + 1 \\times 3 + 2 \\times 3 = 11.\n\nSample Input 2\n\n4\n141421356 17320508 22360679 244949\n\nSample Output 2\n\n437235829", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 45, "memory_kb": 6388}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s338213059", "group_id": "codeNet:p02572", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, tmp int\n var a []int\n\tfmt.Scanf(\"%d\", &n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &tmp)\n a = append(a, tmp)\n\t}\n \n\tsum := 0\n\tfor i := 0; i < n; i++ {\n for j := 0; j < n; j++ {\n if a[i] >= a[j] {\n continue\n }\n \tsum += a[i]*a[j]\n }\n\t if sum > 1000000007{\n \tsum = sum % 1000000007\n }\n }\n\n\tfmt.Printf(\"%d\\n\", sum)\n}\n", "language": "Go", "metadata": {"date": 1598729374, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02572.html", "problem_id": "p02572", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02572/input.txt", "sample_output_relpath": "derived/input_output/data/p02572/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02572/Go/s338213059.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s338213059", "user_id": "u903153704"}, "prompt_components": {"gold_output": "11\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, tmp int\n var a []int\n\tfmt.Scanf(\"%d\", &n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &tmp)\n a = append(a, tmp)\n\t}\n \n\tsum := 0\n\tfor i := 0; i < n; i++ {\n for j := 0; j < n; j++ {\n if a[i] >= a[j] {\n continue\n }\n \tsum += a[i]*a[j]\n }\n\t if sum > 1000000007{\n \tsum = sum % 1000000007\n }\n }\n\n\tfmt.Printf(\"%d\\n\", sum)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nFind the sum of A_i \\times A_j over all pairs (i,j) such that 1\\leq i < j \\leq N, modulo (10^9+7).\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\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 \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} A_i A_j, modulo (10^9+7).\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n11\n\nWe have 1 \\times 2 + 1 \\times 3 + 2 \\times 3 = 11.\n\nSample Input 2\n\n4\n141421356 17320508 22360679 244949\n\nSample Output 2\n\n437235829", "sample_input": "3\n1 2 3\n"}, "reference_outputs": ["11\n"], "source_document_id": "p02572", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nFind the sum of A_i \\times A_j over all pairs (i,j) such that 1\\leq i < j \\leq N, modulo (10^9+7).\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\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 \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} A_i A_j, modulo (10^9+7).\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n11\n\nWe have 1 \\times 2 + 1 \\times 3 + 2 \\times 3 = 11.\n\nSample Input 2\n\n4\n141421356 17320508 22360679 244949\n\nSample Output 2\n\n437235829", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 459, "cpu_time_ms": 2206, "memory_kb": 10228}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s611270785", "group_id": "codeNet:p02574", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e6 + 7\n)\n\nvar buf []byte = make([]byte, initialBufSize)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBufSize)\n}\n\nvar d = []Position{{1, 0}, {-1, 0}, {0, 1}, {0, -1}}\nvar d8 = []Position{{1, 0}, {-1, 0}, {0, 1}, {0, -1}, {1, 1}, {1, -1}, {-1, 1}, {-1, -1}}\n\n// 高速素数判定\n\nfunc main() {\n\tN := nextInt()\n\tA := make([]int, N)\n\tpfs := make([]map[int]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = nextInt()\n\t\tpfs[i] = primeFuctorize(A[i])\n\t}\n\tpw := true\n\tfor i := 0; i < N-1; i++ {\n\t\tfor k := range pfs[i] {\n\t\t\tif _, e := pfs[i+1][k]; e {\n\t\t\t\tpw = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !pw {\n\t\t\tbreak\n\t\t}\n\t}\n\tif pw {\n\t\tfmt.Println(\"pairwise coprime\")\n\t\treturn\n\t}\n\tgcd := gcdof2numbers(A[1], A[0])\n\tfor i := 2; i < N; i++ {\n\t\tgcd = gcdof2numbers(A[i], gcd)\n\t}\n\tif gcd == 1 {\n\t\tfmt.Println(\"setwise coprime\")\n\t\treturn\n\t}\n\tfmt.Println(\"not coprime\")\n}\n\n// 迷路問題での現在地を表す構造体\ntype Position struct {\n\tH int\n\tW int\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc abs(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc pow(p, q int) int {\n\tres := p\n\tif q == 0 {\n\t\treturn 1\n\t}\n\tfor i := 0; i < q-1; i++ {\n\t\tres *= p\n\t}\n\treturn res\n}\n\nfunc ceil(a, b int) int {\n\treturn (a + (b - 1)) / b\n}\n\nfunc MinOf(vars ...int) int {\n\tmin := vars[0]\n\tfor _, i := range vars {\n\t\tif min > i {\n\t\t\tmin = i\n\t\t}\n\t}\n\treturn min\n}\n\nfunc MaxOf(vars ...int) int {\n\tmax := vars[0]\n\tfor _, i := range vars {\n\t\tif max < i {\n\t\t\tmax = i\n\t\t}\n\t}\n\treturn max\n}\n\nfunc gcdof2numbers(a int, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcdof2numbers(b, a%b)\n}\n\nfunc lcmof2numbers(a int, b int) int {\n\treturn a / gcdof2numbers(a, b) * b\n}\n\n// マイナスの場合は考慮していない\nfunc fuctorial(a int) int {\n\tif a == 1 || a == 0 {\n\t\treturn 1\n\t} else {\n\t\treturn fuctorial(a-1) * a\n\t}\n}\n\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\n\n// 素因数分解したmapを返す\nfunc primeFuctorize(n int) map[int]int {\n\tpf := map[int]int{}\n\tfor i := 2; i*i <= n; i++ {\n\t\tfor n%i == 0 {\n\t\t\tpf[i]++\n\t\t\tn /= i\n\t\t}\n\t}\n\tif n != 1 {\n\t\tpf[n]++\n\t}\n\treturn pf\n}\n\n// golangの公式サンプルより\n// https://xn--go-hh0g6u.com/pkg/container/heap/#example__intHeap\n// IntHeap は,整数の最小ヒープです。\ntype IH []int\n\nfunc (h IH) Len() int { return len(h) }\nfunc (h IH) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h IH) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\n\nfunc (h *IH) Push(x interface{}) {\n\t// Push と Pop はポインタレシーバを使っています。\n\t// なぜなら,スライスの中身だけでなく,スライスの長さも変更するからです。\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IH) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\n// golangの公式サンプルより\n// https://xn--go-hh0g6u.com/pkg/container/heap/#example__priorityQueue\n\n// Item は,優先キューで管理する項目です。\ntype Item struct {\n\tvalue string // 値。任意です。\n\tpriority int // キューにおける優先度\n\t// index は heap.Interface メソッドで更新されます。\n\tindex int // ヒープにおけるインデックス\n}\n\n// PriorityQueue は heap.Interface を実装し,Item のリストを保持します。\ntype PriorityQueue []*Item\n\nfunc (pq PriorityQueue) Len() int { return len(pq) }\n\nfunc (pq PriorityQueue) Less(i, j int) bool {\n\t// Pop が最小ではなく最大の優先度を持つ項目を返して欲しいので,ここでは > を使っています。\n\treturn pq[i].priority > pq[j].priority\n}\n\nfunc (pq PriorityQueue) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n\tpq[i].index = i\n\tpq[j].index = j\n}\n\nfunc (pq *PriorityQueue) Push(x interface{}) {\n\tn := len(*pq)\n\titem := x.(*Item)\n\titem.index = n\n\t*pq = append(*pq, item)\n}\n\nfunc (pq *PriorityQueue) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\told[n-1] = nil // メモリリークを避ける\n\titem.index = -1 // 安全のため\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\n// update はキューの Item の優先度と値を更新します。\nfunc (pq *PriorityQueue) update(item *Item, value string, priority int) {\n\titem.value = value\n\titem.priority = priority\n\theap.Fix(pq, item.index)\n}\n", "language": "Go", "metadata": {"date": 1599184372, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02574.html", "problem_id": "p02574", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02574/input.txt", "sample_output_relpath": "derived/input_output/data/p02574/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02574/Go/s611270785.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s611270785", "user_id": "u605443479"}, "prompt_components": {"gold_output": "pairwise coprime\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e6 + 7\n)\n\nvar buf []byte = make([]byte, initialBufSize)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBufSize)\n}\n\nvar d = []Position{{1, 0}, {-1, 0}, {0, 1}, {0, -1}}\nvar d8 = []Position{{1, 0}, {-1, 0}, {0, 1}, {0, -1}, {1, 1}, {1, -1}, {-1, 1}, {-1, -1}}\n\n// 高速素数判定\n\nfunc main() {\n\tN := nextInt()\n\tA := make([]int, N)\n\tpfs := make([]map[int]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = nextInt()\n\t\tpfs[i] = primeFuctorize(A[i])\n\t}\n\tpw := true\n\tfor i := 0; i < N-1; i++ {\n\t\tfor k := range pfs[i] {\n\t\t\tif _, e := pfs[i+1][k]; e {\n\t\t\t\tpw = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !pw {\n\t\t\tbreak\n\t\t}\n\t}\n\tif pw {\n\t\tfmt.Println(\"pairwise coprime\")\n\t\treturn\n\t}\n\tgcd := gcdof2numbers(A[1], A[0])\n\tfor i := 2; i < N; i++ {\n\t\tgcd = gcdof2numbers(A[i], gcd)\n\t}\n\tif gcd == 1 {\n\t\tfmt.Println(\"setwise coprime\")\n\t\treturn\n\t}\n\tfmt.Println(\"not coprime\")\n}\n\n// 迷路問題での現在地を表す構造体\ntype Position struct {\n\tH int\n\tW int\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc abs(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc pow(p, q int) int {\n\tres := p\n\tif q == 0 {\n\t\treturn 1\n\t}\n\tfor i := 0; i < q-1; i++ {\n\t\tres *= p\n\t}\n\treturn res\n}\n\nfunc ceil(a, b int) int {\n\treturn (a + (b - 1)) / b\n}\n\nfunc MinOf(vars ...int) int {\n\tmin := vars[0]\n\tfor _, i := range vars {\n\t\tif min > i {\n\t\t\tmin = i\n\t\t}\n\t}\n\treturn min\n}\n\nfunc MaxOf(vars ...int) int {\n\tmax := vars[0]\n\tfor _, i := range vars {\n\t\tif max < i {\n\t\t\tmax = i\n\t\t}\n\t}\n\treturn max\n}\n\nfunc gcdof2numbers(a int, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcdof2numbers(b, a%b)\n}\n\nfunc lcmof2numbers(a int, b int) int {\n\treturn a / gcdof2numbers(a, b) * b\n}\n\n// マイナスの場合は考慮していない\nfunc fuctorial(a int) int {\n\tif a == 1 || a == 0 {\n\t\treturn 1\n\t} else {\n\t\treturn fuctorial(a-1) * a\n\t}\n}\n\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\n\n// 素因数分解したmapを返す\nfunc primeFuctorize(n int) map[int]int {\n\tpf := map[int]int{}\n\tfor i := 2; i*i <= n; i++ {\n\t\tfor n%i == 0 {\n\t\t\tpf[i]++\n\t\t\tn /= i\n\t\t}\n\t}\n\tif n != 1 {\n\t\tpf[n]++\n\t}\n\treturn pf\n}\n\n// golangの公式サンプルより\n// https://xn--go-hh0g6u.com/pkg/container/heap/#example__intHeap\n// IntHeap は,整数の最小ヒープです。\ntype IH []int\n\nfunc (h IH) Len() int { return len(h) }\nfunc (h IH) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h IH) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\n\nfunc (h *IH) Push(x interface{}) {\n\t// Push と Pop はポインタレシーバを使っています。\n\t// なぜなら,スライスの中身だけでなく,スライスの長さも変更するからです。\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IH) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\n// golangの公式サンプルより\n// https://xn--go-hh0g6u.com/pkg/container/heap/#example__priorityQueue\n\n// Item は,優先キューで管理する項目です。\ntype Item struct {\n\tvalue string // 値。任意です。\n\tpriority int // キューにおける優先度\n\t// index は heap.Interface メソッドで更新されます。\n\tindex int // ヒープにおけるインデックス\n}\n\n// PriorityQueue は heap.Interface を実装し,Item のリストを保持します。\ntype PriorityQueue []*Item\n\nfunc (pq PriorityQueue) Len() int { return len(pq) }\n\nfunc (pq PriorityQueue) Less(i, j int) bool {\n\t// Pop が最小ではなく最大の優先度を持つ項目を返して欲しいので,ここでは > を使っています。\n\treturn pq[i].priority > pq[j].priority\n}\n\nfunc (pq PriorityQueue) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n\tpq[i].index = i\n\tpq[j].index = j\n}\n\nfunc (pq *PriorityQueue) Push(x interface{}) {\n\tn := len(*pq)\n\titem := x.(*Item)\n\titem.index = n\n\t*pq = append(*pq, item)\n}\n\nfunc (pq *PriorityQueue) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\told[n-1] = nil // メモリリークを避ける\n\titem.index = -1 // 安全のため\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\n// update はキューの Item の優先度と値を更新します。\nfunc (pq *PriorityQueue) update(item *Item, value string, priority int) {\n\titem.value = value\n\titem.priority = priority\n\theap.Fix(pq, item.index)\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nWe have N integers. The i-th number is A_i.\n\n\\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\\leq i < j \\leq N.\n\n\\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\\ldots,A_N)=1.\n\nDetermine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.\n\nHere, GCD(\\ldots) denotes greatest common divisor.\n\nConstraints\n\n2 \\leq N \\leq 10^6\n\n1 \\leq A_i\\leq 10^6\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 \\ldots A_N\n\nOutput\n\nIf \\{A_i\\} is pairwise coprime, print pairwise coprime; if \\{A_i\\} is setwise coprime, print setwise coprime; if neither, print not coprime.\n\nSample Input 1\n\n3\n3 4 5\n\nSample Output 1\n\npairwise coprime\n\nGCD(3,4)=GCD(3,5)=GCD(4,5)=1, so they are pairwise coprime.\n\nSample Input 2\n\n3\n6 10 15\n\nSample Output 2\n\nsetwise coprime\n\nSince GCD(6,10)=2, they are not pairwise coprime. However, since GCD(6,10,15)=1, they are setwise coprime.\n\nSample Input 3\n\n3\n6 10 16\n\nSample Output 3\n\nnot coprime\n\nGCD(6,10,16)=2, so they are neither pairwise coprime nor setwise coprime.", "sample_input": "3\n3 4 5\n"}, "reference_outputs": ["pairwise coprime\n"], "source_document_id": "p02574", "source_text": "Score : 500 points\n\nProblem Statement\n\nWe have N integers. The i-th number is A_i.\n\n\\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\\leq i < j \\leq N.\n\n\\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\\ldots,A_N)=1.\n\nDetermine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.\n\nHere, GCD(\\ldots) denotes greatest common divisor.\n\nConstraints\n\n2 \\leq N \\leq 10^6\n\n1 \\leq A_i\\leq 10^6\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 \\ldots A_N\n\nOutput\n\nIf \\{A_i\\} is pairwise coprime, print pairwise coprime; if \\{A_i\\} is setwise coprime, print setwise coprime; if neither, print not coprime.\n\nSample Input 1\n\n3\n3 4 5\n\nSample Output 1\n\npairwise coprime\n\nGCD(3,4)=GCD(3,5)=GCD(4,5)=1, so they are pairwise coprime.\n\nSample Input 2\n\n3\n6 10 15\n\nSample Output 2\n\nsetwise coprime\n\nSince GCD(6,10)=2, they are not pairwise coprime. However, since GCD(6,10,15)=1, they are setwise coprime.\n\nSample Input 3\n\n3\n6 10 16\n\nSample Output 3\n\nnot coprime\n\nGCD(6,10,16)=2, so they are neither pairwise coprime nor setwise coprime.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4760, "cpu_time_ms": 2025, "memory_kb": 222656}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s501217994", "group_id": "codeNet:p02574", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar DEBUG = true\n\n// -----------------------------------------------------------------------------\n\n// IO helper functions\n\n// Returns next token from input. It must be initialized by SetInput()\n// before the first call.\nvar nextToken func() ([]byte, error)\nvar nextLine func() ([]byte, error)\n\n// Holds a buffer for output. It must be initialized by SetOutput().\n// All IO functions (read*() and [e]print*()) should write to OutputWriter\n// instead of this.\nvar OutputBuffer *bufio.Writer\n\n// Holds an io.Writer. It must be initialized by SetOutput()\nvar OutputWriter io.Writer\n\n// Set IO functions for interactive input/output.\nfunc SetInteractive(w io.Writer, r io.Reader) {\n\tSetUnbufferedInput(r)\n\tOutputBuffer = nil\n\tOutputWriter = w\n}\n\n// Setup OutputBuffer and OutputWriter.\nfunc SetOutput(w io.Writer) {\n\tOutputBuffer = bufio.NewWriter(w)\n\tOutputWriter = OutputBuffer\n}\n\n// Flushes OutputBuffer\nfunc Flush() {\n\tif OutputBuffer != nil {\n\t\tOutputBuffer.Flush()\n\t}\n}\n\n// Returns true if c is a white space\nfunc IsSpace(c byte) bool {\n\tswitch c {\n\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc IsNewLine(c byte) bool {\n\tswitch c {\n\tcase '\\n', '\\r':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Setup nextToken with input buffer.\nfunc SetInput(r io.Reader) {\n\tbuf := new(bytes.Buffer)\n\tvar b []byte\n\n\tvar i int\n\trest := func() ([]byte, error) {\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\tinitial := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextToken = rest\n\t\treturn rest()\n\t}\n\tnextToken = initial\n\n\trestLn := func() ([]byte, error) {\n\t\tfor i < len(b) && IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\n\tinitialLn := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextLine = restLn\n\t\treturn restLn()\n\t}\n\tnextLine = initialLn\n}\n\n// Setup nextToken without input buffer.\nfunc SetUnbufferedInput(r io.Reader) {\n\tbuf := bufio.NewReader(r)\n\tvar b []byte\n\n\tvar i int\n\tnextToken = func() ([]byte, error) {\n\t\tvar err error\n\t\tif i == len(b) {\n\t\t\tb, err = buf.ReadBytes('\\n')\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ti = 0\n\t\t\tj := len(b) - 1\n\t\t\tfor 0 <= j && IsSpace(b[j]) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tb = b[0 : j+1]\n\t\t}\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n}\n\n// -----------------------------------------------------------------------------\n\n// IO functions\n\n// Reads next token and return it as []byte\nfunc readb() []byte {\n\tb, err := nextToken()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\n// Reads next token and return it as string\nfunc reads() string {\n\treturn string(readb())\n}\n\n// Read next line as []byte. Trailing '\\n' will not be included.\n// See also comments on readb()\nfunc readbln() []byte {\n\tb, err := nextLine()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\n// Read next line as string\nfunc readsln() string {\n\treturn string(readbln())\n}\n\n// Reads next token and return it as int64\nfunc readll() int64 {\n\ti, err := strconv.ParseInt(reads(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// Reads next token and return it as int\nfunc readi() int {\n\treturn int(readll())\n}\n\n// Reads next token and return it as float64\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(reads(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// Write args to OutputWriter with the format f\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(OutputWriter, f, args...)\n}\n\n// Write args to OutputWriter without format\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(OutputWriter, args...)\n}\n\n// Write args to stderr with the format f\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// Write args to stderr without format\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\nfunc debugf(f string, args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintf(os.Stderr, f, args...)\n}\n\nfunc debug(args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintln(os.Stderr, args...)\n}\n\n// -----------------------------------------------------------------------------\n\n// Utilities\n\nfunc sumSlice(a []int) int {\n\tvar res int\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc sumSlicell(a []int64) int64 {\n\tvar res int64\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc readInts(N int) (int, []int) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int, N)\n\tfor i := range a {\n\t\ta[i] = readi()\n\t}\n\treturn N, a\n}\n\nfunc readIntsll(N int) (int, []int64) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int64, N)\n\tfor i := range a {\n\t\ta[i] = readll()\n\t}\n\treturn N, a\n}\n\n// -----------------------------------------------------------------------------\n\n// Simple math functions\n\nconst (\n\t// big prime\n\tINF = 1000000007\n\tINF2 = 1000000009\n\tINF3 = 998244353\n)\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minll(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minf(a, b float64) float64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxll(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxf(a, b float64) float64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absll(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absf(a float64) float64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// egcd(a, b) returns d, x, y:\n// d is gcd(a,b)\n// x, y are integers that satisfy ax + by = d\nfunc egcd(a, b int) (int, int, int) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcd(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc egcdll(a, b int64) (int64, int64, int64) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcdll(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc gcd(a, b int) int {\n\td, _, _ := egcd(a, b)\n\treturn d\n}\n\nfunc gcdll(a, b int64) int64 {\n\td, _, _ := egcdll(a, b)\n\treturn d\n}\n\n// set up IO functions\nfunc init() {\n\t// for non-interactive\n\tSetInput(os.Stdin)\n\tSetOutput(os.Stdout)\n\n\t// Enable below when interactive. Its ok to leave above intact.\n\tSetInteractive(os.Stdout, os.Stdin)\n}\n\nfunc main() {\n\tdefer Flush()\n\tn := readi()\n\t_, a := readInts(n)\n\tanswer := solve(n, a)\n\tprintln(answer)\n}\n\nfunc solve(n int, a []int) string {\n\t// numbers := make([]int, 1000001)\n\t// for i := 0; i < n; i++ {\n\t// \tnumbers[a[i]]++\n\t// }\n\t// for i := 2; i < 1000001; i++ {\n\t// \tcnt := 0\n\t// \tfor j := i; j < 1000001; j += i {\n\t// \t\tcnt += numbers[j]\n\t// \t}\n\n\t// \tif cnt > 1 {\n\t// \t\tgoto loopOut\n\t// \t}\n\t// }\n\tmod := 1000000007\n\tlcm := LCM(a[0], a[1], a[2:]...) % mod\n\tprod := a[0]\n\tfor i := 1; i < n; i++ {\n\t\tprod *= a[i]\n\t\tprod %= mod\n\t}\n\tif prod == lcm {\n\t\treturn \"pairwise coprime\"\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\tif gcd(a[i], a[j]) != 1 {\n\t\t\t\tgoto loopOut\n\t\t\t}\n\t\t}\n\t}\n\treturn \"pairwise coprime\"\nloopOut:\n\tres := a[0]\n\tfor i := 1; i < n; i++ {\n\t\tres = GCD(res, a[i])\n\t}\n\tif res == 1 {\n\t\treturn \"setwise coprime\"\n\t}\n\treturn \"not coprime\"\n}\n\nfunc LCM(a, b int, integers ...int) int {\n\tmod := 1000000007\n\tresult := a * b % mod / gcd(a, b)\n\n\tfor i := 0; i < len(integers); i++ {\n\t\tresult = LCM(result, integers[i])\n\t}\n\n\treturn result\n}\nfunc GCD(a, b int) int {\n\tfor b != 0 {\n\t\tt := b\n\t\tb = a % b\n\t\ta = t\n\t}\n\treturn a\n}\n\n// func gcd(x, y int) int {\n// \tif x < y {\n// \t\ty, x = x, y\n// \t}\n\n// \tfor y > 0 {\n// \t\tx, y = y, x%y\n// \t}\n// \treturn x\n// }\n", "language": "Go", "metadata": {"date": 1598983205, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02574.html", "problem_id": "p02574", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02574/input.txt", "sample_output_relpath": "derived/input_output/data/p02574/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02574/Go/s501217994.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s501217994", "user_id": "u238461782"}, "prompt_components": {"gold_output": "pairwise coprime\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar DEBUG = true\n\n// -----------------------------------------------------------------------------\n\n// IO helper functions\n\n// Returns next token from input. It must be initialized by SetInput()\n// before the first call.\nvar nextToken func() ([]byte, error)\nvar nextLine func() ([]byte, error)\n\n// Holds a buffer for output. It must be initialized by SetOutput().\n// All IO functions (read*() and [e]print*()) should write to OutputWriter\n// instead of this.\nvar OutputBuffer *bufio.Writer\n\n// Holds an io.Writer. It must be initialized by SetOutput()\nvar OutputWriter io.Writer\n\n// Set IO functions for interactive input/output.\nfunc SetInteractive(w io.Writer, r io.Reader) {\n\tSetUnbufferedInput(r)\n\tOutputBuffer = nil\n\tOutputWriter = w\n}\n\n// Setup OutputBuffer and OutputWriter.\nfunc SetOutput(w io.Writer) {\n\tOutputBuffer = bufio.NewWriter(w)\n\tOutputWriter = OutputBuffer\n}\n\n// Flushes OutputBuffer\nfunc Flush() {\n\tif OutputBuffer != nil {\n\t\tOutputBuffer.Flush()\n\t}\n}\n\n// Returns true if c is a white space\nfunc IsSpace(c byte) bool {\n\tswitch c {\n\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc IsNewLine(c byte) bool {\n\tswitch c {\n\tcase '\\n', '\\r':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Setup nextToken with input buffer.\nfunc SetInput(r io.Reader) {\n\tbuf := new(bytes.Buffer)\n\tvar b []byte\n\n\tvar i int\n\trest := func() ([]byte, error) {\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\tinitial := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextToken = rest\n\t\treturn rest()\n\t}\n\tnextToken = initial\n\n\trestLn := func() ([]byte, error) {\n\t\tfor i < len(b) && IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\n\tinitialLn := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextLine = restLn\n\t\treturn restLn()\n\t}\n\tnextLine = initialLn\n}\n\n// Setup nextToken without input buffer.\nfunc SetUnbufferedInput(r io.Reader) {\n\tbuf := bufio.NewReader(r)\n\tvar b []byte\n\n\tvar i int\n\tnextToken = func() ([]byte, error) {\n\t\tvar err error\n\t\tif i == len(b) {\n\t\t\tb, err = buf.ReadBytes('\\n')\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ti = 0\n\t\t\tj := len(b) - 1\n\t\t\tfor 0 <= j && IsSpace(b[j]) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tb = b[0 : j+1]\n\t\t}\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n}\n\n// -----------------------------------------------------------------------------\n\n// IO functions\n\n// Reads next token and return it as []byte\nfunc readb() []byte {\n\tb, err := nextToken()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\n// Reads next token and return it as string\nfunc reads() string {\n\treturn string(readb())\n}\n\n// Read next line as []byte. Trailing '\\n' will not be included.\n// See also comments on readb()\nfunc readbln() []byte {\n\tb, err := nextLine()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\n// Read next line as string\nfunc readsln() string {\n\treturn string(readbln())\n}\n\n// Reads next token and return it as int64\nfunc readll() int64 {\n\ti, err := strconv.ParseInt(reads(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// Reads next token and return it as int\nfunc readi() int {\n\treturn int(readll())\n}\n\n// Reads next token and return it as float64\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(reads(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// Write args to OutputWriter with the format f\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(OutputWriter, f, args...)\n}\n\n// Write args to OutputWriter without format\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(OutputWriter, args...)\n}\n\n// Write args to stderr with the format f\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// Write args to stderr without format\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\nfunc debugf(f string, args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintf(os.Stderr, f, args...)\n}\n\nfunc debug(args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintln(os.Stderr, args...)\n}\n\n// -----------------------------------------------------------------------------\n\n// Utilities\n\nfunc sumSlice(a []int) int {\n\tvar res int\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc sumSlicell(a []int64) int64 {\n\tvar res int64\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc readInts(N int) (int, []int) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int, N)\n\tfor i := range a {\n\t\ta[i] = readi()\n\t}\n\treturn N, a\n}\n\nfunc readIntsll(N int) (int, []int64) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int64, N)\n\tfor i := range a {\n\t\ta[i] = readll()\n\t}\n\treturn N, a\n}\n\n// -----------------------------------------------------------------------------\n\n// Simple math functions\n\nconst (\n\t// big prime\n\tINF = 1000000007\n\tINF2 = 1000000009\n\tINF3 = 998244353\n)\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minll(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minf(a, b float64) float64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxll(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxf(a, b float64) float64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absll(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absf(a float64) float64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// egcd(a, b) returns d, x, y:\n// d is gcd(a,b)\n// x, y are integers that satisfy ax + by = d\nfunc egcd(a, b int) (int, int, int) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcd(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc egcdll(a, b int64) (int64, int64, int64) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcdll(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc gcd(a, b int) int {\n\td, _, _ := egcd(a, b)\n\treturn d\n}\n\nfunc gcdll(a, b int64) int64 {\n\td, _, _ := egcdll(a, b)\n\treturn d\n}\n\n// set up IO functions\nfunc init() {\n\t// for non-interactive\n\tSetInput(os.Stdin)\n\tSetOutput(os.Stdout)\n\n\t// Enable below when interactive. Its ok to leave above intact.\n\tSetInteractive(os.Stdout, os.Stdin)\n}\n\nfunc main() {\n\tdefer Flush()\n\tn := readi()\n\t_, a := readInts(n)\n\tanswer := solve(n, a)\n\tprintln(answer)\n}\n\nfunc solve(n int, a []int) string {\n\t// numbers := make([]int, 1000001)\n\t// for i := 0; i < n; i++ {\n\t// \tnumbers[a[i]]++\n\t// }\n\t// for i := 2; i < 1000001; i++ {\n\t// \tcnt := 0\n\t// \tfor j := i; j < 1000001; j += i {\n\t// \t\tcnt += numbers[j]\n\t// \t}\n\n\t// \tif cnt > 1 {\n\t// \t\tgoto loopOut\n\t// \t}\n\t// }\n\tmod := 1000000007\n\tlcm := LCM(a[0], a[1], a[2:]...) % mod\n\tprod := a[0]\n\tfor i := 1; i < n; i++ {\n\t\tprod *= a[i]\n\t\tprod %= mod\n\t}\n\tif prod == lcm {\n\t\treturn \"pairwise coprime\"\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\tif gcd(a[i], a[j]) != 1 {\n\t\t\t\tgoto loopOut\n\t\t\t}\n\t\t}\n\t}\n\treturn \"pairwise coprime\"\nloopOut:\n\tres := a[0]\n\tfor i := 1; i < n; i++ {\n\t\tres = GCD(res, a[i])\n\t}\n\tif res == 1 {\n\t\treturn \"setwise coprime\"\n\t}\n\treturn \"not coprime\"\n}\n\nfunc LCM(a, b int, integers ...int) int {\n\tmod := 1000000007\n\tresult := a * b % mod / gcd(a, b)\n\n\tfor i := 0; i < len(integers); i++ {\n\t\tresult = LCM(result, integers[i])\n\t}\n\n\treturn result\n}\nfunc GCD(a, b int) int {\n\tfor b != 0 {\n\t\tt := b\n\t\tb = a % b\n\t\ta = t\n\t}\n\treturn a\n}\n\n// func gcd(x, y int) int {\n// \tif x < y {\n// \t\ty, x = x, y\n// \t}\n\n// \tfor y > 0 {\n// \t\tx, y = y, x%y\n// \t}\n// \treturn x\n// }\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nWe have N integers. The i-th number is A_i.\n\n\\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\\leq i < j \\leq N.\n\n\\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\\ldots,A_N)=1.\n\nDetermine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.\n\nHere, GCD(\\ldots) denotes greatest common divisor.\n\nConstraints\n\n2 \\leq N \\leq 10^6\n\n1 \\leq A_i\\leq 10^6\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 \\ldots A_N\n\nOutput\n\nIf \\{A_i\\} is pairwise coprime, print pairwise coprime; if \\{A_i\\} is setwise coprime, print setwise coprime; if neither, print not coprime.\n\nSample Input 1\n\n3\n3 4 5\n\nSample Output 1\n\npairwise coprime\n\nGCD(3,4)=GCD(3,5)=GCD(4,5)=1, so they are pairwise coprime.\n\nSample Input 2\n\n3\n6 10 15\n\nSample Output 2\n\nsetwise coprime\n\nSince GCD(6,10)=2, they are not pairwise coprime. However, since GCD(6,10,15)=1, they are setwise coprime.\n\nSample Input 3\n\n3\n6 10 16\n\nSample Output 3\n\nnot coprime\n\nGCD(6,10,16)=2, so they are neither pairwise coprime nor setwise coprime.", "sample_input": "3\n3 4 5\n"}, "reference_outputs": ["pairwise coprime\n"], "source_document_id": "p02574", "source_text": "Score : 500 points\n\nProblem Statement\n\nWe have N integers. The i-th number is A_i.\n\n\\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\\leq i < j \\leq N.\n\n\\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\\ldots,A_N)=1.\n\nDetermine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.\n\nHere, GCD(\\ldots) denotes greatest common divisor.\n\nConstraints\n\n2 \\leq N \\leq 10^6\n\n1 \\leq A_i\\leq 10^6\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 \\ldots A_N\n\nOutput\n\nIf \\{A_i\\} is pairwise coprime, print pairwise coprime; if \\{A_i\\} is setwise coprime, print setwise coprime; if neither, print not coprime.\n\nSample Input 1\n\n3\n3 4 5\n\nSample Output 1\n\npairwise coprime\n\nGCD(3,4)=GCD(3,5)=GCD(4,5)=1, so they are pairwise coprime.\n\nSample Input 2\n\n3\n6 10 15\n\nSample Output 2\n\nsetwise coprime\n\nSince GCD(6,10)=2, they are not pairwise coprime. However, since GCD(6,10,15)=1, they are setwise coprime.\n\nSample Input 3\n\n3\n6 10 16\n\nSample Output 3\n\nnot coprime\n\nGCD(6,10,16)=2, so they are neither pairwise coprime nor setwise coprime.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 7883, "cpu_time_ms": 2206, "memory_kb": 26584}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s121546576", "group_id": "codeNet:p02574", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar DEBUG = true\n\n// -----------------------------------------------------------------------------\n\n// IO helper functions\n\n// Returns next token from input. It must be initialized by SetInput()\n// before the first call.\nvar nextToken func() ([]byte, error)\nvar nextLine func() ([]byte, error)\n\n// Holds a buffer for output. It must be initialized by SetOutput().\n// All IO functions (read*() and [e]print*()) should write to OutputWriter\n// instead of this.\nvar OutputBuffer *bufio.Writer\n\n// Holds an io.Writer. It must be initialized by SetOutput()\nvar OutputWriter io.Writer\n\n// Set IO functions for interactive input/output.\nfunc SetInteractive(w io.Writer, r io.Reader) {\n\tSetUnbufferedInput(r)\n\tOutputBuffer = nil\n\tOutputWriter = w\n}\n\n// Setup OutputBuffer and OutputWriter.\nfunc SetOutput(w io.Writer) {\n\tOutputBuffer = bufio.NewWriter(w)\n\tOutputWriter = OutputBuffer\n}\n\n// Flushes OutputBuffer\nfunc Flush() {\n\tif OutputBuffer != nil {\n\t\tOutputBuffer.Flush()\n\t}\n}\n\n// Returns true if c is a white space\nfunc IsSpace(c byte) bool {\n\tswitch c {\n\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc IsNewLine(c byte) bool {\n\tswitch c {\n\tcase '\\n', '\\r':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Setup nextToken with input buffer.\nfunc SetInput(r io.Reader) {\n\tbuf := new(bytes.Buffer)\n\tvar b []byte\n\n\tvar i int\n\trest := func() ([]byte, error) {\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\tinitial := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextToken = rest\n\t\treturn rest()\n\t}\n\tnextToken = initial\n\n\trestLn := func() ([]byte, error) {\n\t\tfor i < len(b) && IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\n\tinitialLn := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextLine = restLn\n\t\treturn restLn()\n\t}\n\tnextLine = initialLn\n}\n\n// Setup nextToken without input buffer.\nfunc SetUnbufferedInput(r io.Reader) {\n\tbuf := bufio.NewReader(r)\n\tvar b []byte\n\n\tvar i int\n\tnextToken = func() ([]byte, error) {\n\t\tvar err error\n\t\tif i == len(b) {\n\t\t\tb, err = buf.ReadBytes('\\n')\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ti = 0\n\t\t\tj := len(b) - 1\n\t\t\tfor 0 <= j && IsSpace(b[j]) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tb = b[0 : j+1]\n\t\t}\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n}\n\n// -----------------------------------------------------------------------------\n\n// IO functions\n\n// Reads next token and return it as []byte\nfunc readb() []byte {\n\tb, err := nextToken()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\n// Reads next token and return it as string\nfunc reads() string {\n\treturn string(readb())\n}\n\n// Read next line as []byte. Trailing '\\n' will not be included.\n// See also comments on readb()\nfunc readbln() []byte {\n\tb, err := nextLine()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\n// Read next line as string\nfunc readsln() string {\n\treturn string(readbln())\n}\n\n// Reads next token and return it as int64\nfunc readll() int64 {\n\ti, err := strconv.ParseInt(reads(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// Reads next token and return it as int\nfunc readi() int {\n\treturn int(readll())\n}\n\n// Reads next token and return it as float64\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(reads(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// Write args to OutputWriter with the format f\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(OutputWriter, f, args...)\n}\n\n// Write args to OutputWriter without format\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(OutputWriter, args...)\n}\n\n// Write args to stderr with the format f\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// Write args to stderr without format\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\nfunc debugf(f string, args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintf(os.Stderr, f, args...)\n}\n\nfunc debug(args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintln(os.Stderr, args...)\n}\n\n// -----------------------------------------------------------------------------\n\n// Utilities\n\nfunc sumSlice(a []int) int {\n\tvar res int\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc sumSlicell(a []int64) int64 {\n\tvar res int64\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc readInts(N int) (int, []int) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int, N)\n\tfor i := range a {\n\t\ta[i] = readi()\n\t}\n\treturn N, a\n}\n\nfunc readIntsll(N int) (int, []int64) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int64, N)\n\tfor i := range a {\n\t\ta[i] = readll()\n\t}\n\treturn N, a\n}\n\n// -----------------------------------------------------------------------------\n\n// Simple math functions\n\nconst (\n\t// big prime\n\tINF = 1000000007\n\tINF2 = 1000000009\n\tINF3 = 998244353\n)\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minll(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minf(a, b float64) float64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxll(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxf(a, b float64) float64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absll(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absf(a float64) float64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// egcd(a, b) returns d, x, y:\n// d is gcd(a,b)\n// x, y are integers that satisfy ax + by = d\nfunc egcd(a, b int) (int, int, int) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcd(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc egcdll(a, b int64) (int64, int64, int64) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcdll(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc gcd(a, b int) int {\n\td, _, _ := egcd(a, b)\n\treturn d\n}\n\nfunc gcdll(a, b int64) int64 {\n\td, _, _ := egcdll(a, b)\n\treturn d\n}\n\n// set up IO functions\nfunc init() {\n\t// for non-interactive\n\tSetInput(os.Stdin)\n\tSetOutput(os.Stdout)\n\n\t// Enable below when interactive. Its ok to leave above intact.\n\tSetInteractive(os.Stdout, os.Stdin)\n}\n\nfunc main() {\n\tdefer Flush()\n\tn := readi()\n\t_, a := readInts(n)\n\tanswer := solve(n, a)\n\tprintln(answer)\n}\n\nvar modCounterLCM int\n\nfunc solve(n int, a []int) string {\n\tmod := 1000000009\n\tlcm := LCM(a[0], a[1], a[2:]...) % mod\n\tprod := a[0]\n\tmodCounter := 0\n\tfor i := 1; i < n; i++ {\n\t\tprod *= a[i]\n\t\tif prod != prod%mod {\n\t\t\tmodCounter++\n\t\t}\n\t\tprod %= mod\n\t}\n\t// println(modCounter, modCounterLCM)\n\tif prod == lcm && modCounter == modCounterLCM {\n\t\treturn \"pairwise coprime\"\n\t}\n\t// for i := 0; i < n; i++ {\n\t// \tfor j := i + 1; j < n; j++ {\n\t// \t\tif gcd(a[i], a[j]) != 1 {\n\t// \t\t\tgoto loopOut\n\t// \t\t}\n\t// \t}\n\t// }\n\t// return \"pairwise coprime\"\n\t// loopOut:\n\n\tres := a[0]\n\tfor i := 1; i < n; i++ {\n\t\tres = GCD(res, a[i])\n\t}\n\tif res == 1 {\n\t\treturn \"setwise coprime\"\n\t}\n\treturn \"not coprime\"\n}\n\nfunc LCM(a, b int, integers ...int) int {\n\tmod := 1000000009\n\tresult := a * b % mod / gcd(a, b)\n\tif a*b%mod != a*b {\n\t\tmodCounterLCM++\n\t}\n\n\tfor i := 0; i < len(integers); i++ {\n\t\tresult = LCM(result, integers[i])\n\t}\n\n\treturn result\n}\nfunc GCD(a, b int) int {\n\tfor b != 0 {\n\t\tt := b\n\t\tb = a % b\n\t\ta = t\n\t}\n\treturn a\n}\n\n// func gcd(x, y int) int {\n// \tif x < y {\n// \t\ty, x = x, y\n// \t}\n\n// \tfor y > 0 {\n// \t\tx, y = y, x%y\n// \t}\n// \treturn x\n// }\n", "language": "Go", "metadata": {"date": 1598859711, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02574.html", "problem_id": "p02574", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02574/input.txt", "sample_output_relpath": "derived/input_output/data/p02574/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02574/Go/s121546576.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s121546576", "user_id": "u238461782"}, "prompt_components": {"gold_output": "pairwise coprime\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar DEBUG = true\n\n// -----------------------------------------------------------------------------\n\n// IO helper functions\n\n// Returns next token from input. It must be initialized by SetInput()\n// before the first call.\nvar nextToken func() ([]byte, error)\nvar nextLine func() ([]byte, error)\n\n// Holds a buffer for output. It must be initialized by SetOutput().\n// All IO functions (read*() and [e]print*()) should write to OutputWriter\n// instead of this.\nvar OutputBuffer *bufio.Writer\n\n// Holds an io.Writer. It must be initialized by SetOutput()\nvar OutputWriter io.Writer\n\n// Set IO functions for interactive input/output.\nfunc SetInteractive(w io.Writer, r io.Reader) {\n\tSetUnbufferedInput(r)\n\tOutputBuffer = nil\n\tOutputWriter = w\n}\n\n// Setup OutputBuffer and OutputWriter.\nfunc SetOutput(w io.Writer) {\n\tOutputBuffer = bufio.NewWriter(w)\n\tOutputWriter = OutputBuffer\n}\n\n// Flushes OutputBuffer\nfunc Flush() {\n\tif OutputBuffer != nil {\n\t\tOutputBuffer.Flush()\n\t}\n}\n\n// Returns true if c is a white space\nfunc IsSpace(c byte) bool {\n\tswitch c {\n\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc IsNewLine(c byte) bool {\n\tswitch c {\n\tcase '\\n', '\\r':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Setup nextToken with input buffer.\nfunc SetInput(r io.Reader) {\n\tbuf := new(bytes.Buffer)\n\tvar b []byte\n\n\tvar i int\n\trest := func() ([]byte, error) {\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\tinitial := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextToken = rest\n\t\treturn rest()\n\t}\n\tnextToken = initial\n\n\trestLn := func() ([]byte, error) {\n\t\tfor i < len(b) && IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\n\tinitialLn := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextLine = restLn\n\t\treturn restLn()\n\t}\n\tnextLine = initialLn\n}\n\n// Setup nextToken without input buffer.\nfunc SetUnbufferedInput(r io.Reader) {\n\tbuf := bufio.NewReader(r)\n\tvar b []byte\n\n\tvar i int\n\tnextToken = func() ([]byte, error) {\n\t\tvar err error\n\t\tif i == len(b) {\n\t\t\tb, err = buf.ReadBytes('\\n')\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ti = 0\n\t\t\tj := len(b) - 1\n\t\t\tfor 0 <= j && IsSpace(b[j]) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tb = b[0 : j+1]\n\t\t}\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n}\n\n// -----------------------------------------------------------------------------\n\n// IO functions\n\n// Reads next token and return it as []byte\nfunc readb() []byte {\n\tb, err := nextToken()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\n// Reads next token and return it as string\nfunc reads() string {\n\treturn string(readb())\n}\n\n// Read next line as []byte. Trailing '\\n' will not be included.\n// See also comments on readb()\nfunc readbln() []byte {\n\tb, err := nextLine()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\n// Read next line as string\nfunc readsln() string {\n\treturn string(readbln())\n}\n\n// Reads next token and return it as int64\nfunc readll() int64 {\n\ti, err := strconv.ParseInt(reads(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// Reads next token and return it as int\nfunc readi() int {\n\treturn int(readll())\n}\n\n// Reads next token and return it as float64\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(reads(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// Write args to OutputWriter with the format f\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(OutputWriter, f, args...)\n}\n\n// Write args to OutputWriter without format\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(OutputWriter, args...)\n}\n\n// Write args to stderr with the format f\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// Write args to stderr without format\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\nfunc debugf(f string, args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintf(os.Stderr, f, args...)\n}\n\nfunc debug(args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintln(os.Stderr, args...)\n}\n\n// -----------------------------------------------------------------------------\n\n// Utilities\n\nfunc sumSlice(a []int) int {\n\tvar res int\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc sumSlicell(a []int64) int64 {\n\tvar res int64\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc readInts(N int) (int, []int) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int, N)\n\tfor i := range a {\n\t\ta[i] = readi()\n\t}\n\treturn N, a\n}\n\nfunc readIntsll(N int) (int, []int64) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int64, N)\n\tfor i := range a {\n\t\ta[i] = readll()\n\t}\n\treturn N, a\n}\n\n// -----------------------------------------------------------------------------\n\n// Simple math functions\n\nconst (\n\t// big prime\n\tINF = 1000000007\n\tINF2 = 1000000009\n\tINF3 = 998244353\n)\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minll(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minf(a, b float64) float64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxll(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxf(a, b float64) float64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absll(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absf(a float64) float64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// egcd(a, b) returns d, x, y:\n// d is gcd(a,b)\n// x, y are integers that satisfy ax + by = d\nfunc egcd(a, b int) (int, int, int) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcd(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc egcdll(a, b int64) (int64, int64, int64) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcdll(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc gcd(a, b int) int {\n\td, _, _ := egcd(a, b)\n\treturn d\n}\n\nfunc gcdll(a, b int64) int64 {\n\td, _, _ := egcdll(a, b)\n\treturn d\n}\n\n// set up IO functions\nfunc init() {\n\t// for non-interactive\n\tSetInput(os.Stdin)\n\tSetOutput(os.Stdout)\n\n\t// Enable below when interactive. Its ok to leave above intact.\n\tSetInteractive(os.Stdout, os.Stdin)\n}\n\nfunc main() {\n\tdefer Flush()\n\tn := readi()\n\t_, a := readInts(n)\n\tanswer := solve(n, a)\n\tprintln(answer)\n}\n\nvar modCounterLCM int\n\nfunc solve(n int, a []int) string {\n\tmod := 1000000009\n\tlcm := LCM(a[0], a[1], a[2:]...) % mod\n\tprod := a[0]\n\tmodCounter := 0\n\tfor i := 1; i < n; i++ {\n\t\tprod *= a[i]\n\t\tif prod != prod%mod {\n\t\t\tmodCounter++\n\t\t}\n\t\tprod %= mod\n\t}\n\t// println(modCounter, modCounterLCM)\n\tif prod == lcm && modCounter == modCounterLCM {\n\t\treturn \"pairwise coprime\"\n\t}\n\t// for i := 0; i < n; i++ {\n\t// \tfor j := i + 1; j < n; j++ {\n\t// \t\tif gcd(a[i], a[j]) != 1 {\n\t// \t\t\tgoto loopOut\n\t// \t\t}\n\t// \t}\n\t// }\n\t// return \"pairwise coprime\"\n\t// loopOut:\n\n\tres := a[0]\n\tfor i := 1; i < n; i++ {\n\t\tres = GCD(res, a[i])\n\t}\n\tif res == 1 {\n\t\treturn \"setwise coprime\"\n\t}\n\treturn \"not coprime\"\n}\n\nfunc LCM(a, b int, integers ...int) int {\n\tmod := 1000000009\n\tresult := a * b % mod / gcd(a, b)\n\tif a*b%mod != a*b {\n\t\tmodCounterLCM++\n\t}\n\n\tfor i := 0; i < len(integers); i++ {\n\t\tresult = LCM(result, integers[i])\n\t}\n\n\treturn result\n}\nfunc GCD(a, b int) int {\n\tfor b != 0 {\n\t\tt := b\n\t\tb = a % b\n\t\ta = t\n\t}\n\treturn a\n}\n\n// func gcd(x, y int) int {\n// \tif x < y {\n// \t\ty, x = x, y\n// \t}\n\n// \tfor y > 0 {\n// \t\tx, y = y, x%y\n// \t}\n// \treturn x\n// }\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nWe have N integers. The i-th number is A_i.\n\n\\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\\leq i < j \\leq N.\n\n\\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\\ldots,A_N)=1.\n\nDetermine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.\n\nHere, GCD(\\ldots) denotes greatest common divisor.\n\nConstraints\n\n2 \\leq N \\leq 10^6\n\n1 \\leq A_i\\leq 10^6\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 \\ldots A_N\n\nOutput\n\nIf \\{A_i\\} is pairwise coprime, print pairwise coprime; if \\{A_i\\} is setwise coprime, print setwise coprime; if neither, print not coprime.\n\nSample Input 1\n\n3\n3 4 5\n\nSample Output 1\n\npairwise coprime\n\nGCD(3,4)=GCD(3,5)=GCD(4,5)=1, so they are pairwise coprime.\n\nSample Input 2\n\n3\n6 10 15\n\nSample Output 2\n\nsetwise coprime\n\nSince GCD(6,10)=2, they are not pairwise coprime. However, since GCD(6,10,15)=1, they are setwise coprime.\n\nSample Input 3\n\n3\n6 10 16\n\nSample Output 3\n\nnot coprime\n\nGCD(6,10,16)=2, so they are neither pairwise coprime nor setwise coprime.", "sample_input": "3\n3 4 5\n"}, "reference_outputs": ["pairwise coprime\n"], "source_document_id": "p02574", "source_text": "Score : 500 points\n\nProblem Statement\n\nWe have N integers. The i-th number is A_i.\n\n\\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\\leq i < j \\leq N.\n\n\\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\\ldots,A_N)=1.\n\nDetermine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.\n\nHere, GCD(\\ldots) denotes greatest common divisor.\n\nConstraints\n\n2 \\leq N \\leq 10^6\n\n1 \\leq A_i\\leq 10^6\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 \\ldots A_N\n\nOutput\n\nIf \\{A_i\\} is pairwise coprime, print pairwise coprime; if \\{A_i\\} is setwise coprime, print setwise coprime; if neither, print not coprime.\n\nSample Input 1\n\n3\n3 4 5\n\nSample Output 1\n\npairwise coprime\n\nGCD(3,4)=GCD(3,5)=GCD(4,5)=1, so they are pairwise coprime.\n\nSample Input 2\n\n3\n6 10 15\n\nSample Output 2\n\nsetwise coprime\n\nSince GCD(6,10)=2, they are not pairwise coprime. However, since GCD(6,10,15)=1, they are setwise coprime.\n\nSample Input 3\n\n3\n6 10 16\n\nSample Output 3\n\nnot coprime\n\nGCD(6,10,16)=2, so they are neither pairwise coprime nor setwise coprime.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 7846, "cpu_time_ms": 302, "memory_kb": 26588}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s951987955", "group_id": "codeNet:p02574", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn := nextInt()\n\tps := primes(1e6 + 10)\n\tas := make([]int, n)\n\tgs := make([]int, n+1)\n\tpm := make(map[int]int)\n\tfor i := 0; i < n; i++ {\n\t\tas[i] = nextInt()\n\t\tgs[i+1] = gcd(gs[i], as[i])\n\t\tpf := primeFactoriation(as[i], ps)\n\t\tfor p := range pf {\n\t\t\tpm[p]++\n\t\t}\n\t}\n\n\tif gs[n] != 1 {\n\t\tfmt.Println(\"not coprime\")\n\t\treturn\n\t}\n\n\tfor p, c := range pm {\n\t\tif p > 1 && c > 1 {\n\t\t\tfmt.Println(\"setwise coprime\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(\"pairwise coprime\")\n}\n\nfunc primes(n int) []int {\n\tps := make([]int, n+1)\n\tfor i := 0; i <= n; i++ {\n\t\tps[i] = i\n\t}\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tfor j := i + i; j < n; j += i {\n\t\t\t\tif ps[j] == j {\n\t\t\t\t\tps[j] = i\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn ps\n}\n\nfunc primeFactoriation(n int, ps []int) map[int]int {\n\tpm := make(map[int]int)\n\tfor n != 1 {\n\t\tpm[ps[n]]++\n\t\tn /= ps[n]\n\t}\n\treturn pm\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n", "language": "Go", "metadata": {"date": 1598740696, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02574.html", "problem_id": "p02574", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02574/input.txt", "sample_output_relpath": "derived/input_output/data/p02574/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02574/Go/s951987955.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s951987955", "user_id": "u902409225"}, "prompt_components": {"gold_output": "pairwise coprime\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn := nextInt()\n\tps := primes(1e6 + 10)\n\tas := make([]int, n)\n\tgs := make([]int, n+1)\n\tpm := make(map[int]int)\n\tfor i := 0; i < n; i++ {\n\t\tas[i] = nextInt()\n\t\tgs[i+1] = gcd(gs[i], as[i])\n\t\tpf := primeFactoriation(as[i], ps)\n\t\tfor p := range pf {\n\t\t\tpm[p]++\n\t\t}\n\t}\n\n\tif gs[n] != 1 {\n\t\tfmt.Println(\"not coprime\")\n\t\treturn\n\t}\n\n\tfor p, c := range pm {\n\t\tif p > 1 && c > 1 {\n\t\t\tfmt.Println(\"setwise coprime\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(\"pairwise coprime\")\n}\n\nfunc primes(n int) []int {\n\tps := make([]int, n+1)\n\tfor i := 0; i <= n; i++ {\n\t\tps[i] = i\n\t}\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tfor j := i + i; j < n; j += i {\n\t\t\t\tif ps[j] == j {\n\t\t\t\t\tps[j] = i\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn ps\n}\n\nfunc primeFactoriation(n int, ps []int) map[int]int {\n\tpm := make(map[int]int)\n\tfor n != 1 {\n\t\tpm[ps[n]]++\n\t\tn /= ps[n]\n\t}\n\treturn pm\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nWe have N integers. The i-th number is A_i.\n\n\\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\\leq i < j \\leq N.\n\n\\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\\ldots,A_N)=1.\n\nDetermine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.\n\nHere, GCD(\\ldots) denotes greatest common divisor.\n\nConstraints\n\n2 \\leq N \\leq 10^6\n\n1 \\leq A_i\\leq 10^6\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 \\ldots A_N\n\nOutput\n\nIf \\{A_i\\} is pairwise coprime, print pairwise coprime; if \\{A_i\\} is setwise coprime, print setwise coprime; if neither, print not coprime.\n\nSample Input 1\n\n3\n3 4 5\n\nSample Output 1\n\npairwise coprime\n\nGCD(3,4)=GCD(3,5)=GCD(4,5)=1, so they are pairwise coprime.\n\nSample Input 2\n\n3\n6 10 15\n\nSample Output 2\n\nsetwise coprime\n\nSince GCD(6,10)=2, they are not pairwise coprime. However, since GCD(6,10,15)=1, they are setwise coprime.\n\nSample Input 3\n\n3\n6 10 16\n\nSample Output 3\n\nnot coprime\n\nGCD(6,10,16)=2, so they are neither pairwise coprime nor setwise coprime.", "sample_input": "3\n3 4 5\n"}, "reference_outputs": ["pairwise coprime\n"], "source_document_id": "p02574", "source_text": "Score : 500 points\n\nProblem Statement\n\nWe have N integers. The i-th number is A_i.\n\n\\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\\leq i < j \\leq N.\n\n\\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\\ldots,A_N)=1.\n\nDetermine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.\n\nHere, GCD(\\ldots) denotes greatest common divisor.\n\nConstraints\n\n2 \\leq N \\leq 10^6\n\n1 \\leq A_i\\leq 10^6\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 \\ldots A_N\n\nOutput\n\nIf \\{A_i\\} is pairwise coprime, print pairwise coprime; if \\{A_i\\} is setwise coprime, print setwise coprime; if neither, print not coprime.\n\nSample Input 1\n\n3\n3 4 5\n\nSample Output 1\n\npairwise coprime\n\nGCD(3,4)=GCD(3,5)=GCD(4,5)=1, so they are pairwise coprime.\n\nSample Input 2\n\n3\n6 10 15\n\nSample Output 2\n\nsetwise coprime\n\nSince GCD(6,10)=2, they are not pairwise coprime. However, since GCD(6,10,15)=1, they are setwise coprime.\n\nSample Input 3\n\n3\n6 10 16\n\nSample Output 3\n\nnot coprime\n\nGCD(6,10,16)=2, so they are neither pairwise coprime nor setwise coprime.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1154, "cpu_time_ms": 725, "memory_kb": 70676}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s477303317", "group_id": "codeNet:p02574", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tnum, _ := strconv.Atoi(scanString())\n\treturn num\n}\n\nfunc scanString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc scanInts(n int) []int {\n\tsl := make([]int, n)\n\tfor i := range sl {\n\t\tsl[i] = scanInt()\n\t}\n\treturn sl\n}\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nconst mod = 1000000007\n\nfunc main() {\n\tn := scanInt()\n\tas := scanInts(n)\n\n\ta, m := as[0], as[0]\n\tfor i := 1; i < n; i++ {\n\t\ta = lcm(a, as[i])\n\t\ta %= mod\n\t\tm *= as[i]\n\t\tm %= mod\n\t}\n\tif a == m {\n\t\tfmt.Println(\"pairwise coprime\")\n\t\treturn\n\t}\n\n\tb := as[0]\n\tfor i := 1; i < n; i++ {\n\t\tb = gcd(b, as[i])\n\t}\n\tif b == 1 {\n\t\tfmt.Println(\"setwise coprime\")\n\t} else {\n\t\tfmt.Println(\"not coprime\")\n\t}\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\treturn a / gcd(a, b) * b\n}\n", "language": "Go", "metadata": {"date": 1598732601, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02574.html", "problem_id": "p02574", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02574/input.txt", "sample_output_relpath": "derived/input_output/data/p02574/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02574/Go/s477303317.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s477303317", "user_id": "u367908963"}, "prompt_components": {"gold_output": "pairwise coprime\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tnum, _ := strconv.Atoi(scanString())\n\treturn num\n}\n\nfunc scanString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc scanInts(n int) []int {\n\tsl := make([]int, n)\n\tfor i := range sl {\n\t\tsl[i] = scanInt()\n\t}\n\treturn sl\n}\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nconst mod = 1000000007\n\nfunc main() {\n\tn := scanInt()\n\tas := scanInts(n)\n\n\ta, m := as[0], as[0]\n\tfor i := 1; i < n; i++ {\n\t\ta = lcm(a, as[i])\n\t\ta %= mod\n\t\tm *= as[i]\n\t\tm %= mod\n\t}\n\tif a == m {\n\t\tfmt.Println(\"pairwise coprime\")\n\t\treturn\n\t}\n\n\tb := as[0]\n\tfor i := 1; i < n; i++ {\n\t\tb = gcd(b, as[i])\n\t}\n\tif b == 1 {\n\t\tfmt.Println(\"setwise coprime\")\n\t} else {\n\t\tfmt.Println(\"not coprime\")\n\t}\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\treturn a / gcd(a, b) * b\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nWe have N integers. The i-th number is A_i.\n\n\\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\\leq i < j \\leq N.\n\n\\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\\ldots,A_N)=1.\n\nDetermine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.\n\nHere, GCD(\\ldots) denotes greatest common divisor.\n\nConstraints\n\n2 \\leq N \\leq 10^6\n\n1 \\leq A_i\\leq 10^6\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 \\ldots A_N\n\nOutput\n\nIf \\{A_i\\} is pairwise coprime, print pairwise coprime; if \\{A_i\\} is setwise coprime, print setwise coprime; if neither, print not coprime.\n\nSample Input 1\n\n3\n3 4 5\n\nSample Output 1\n\npairwise coprime\n\nGCD(3,4)=GCD(3,5)=GCD(4,5)=1, so they are pairwise coprime.\n\nSample Input 2\n\n3\n6 10 15\n\nSample Output 2\n\nsetwise coprime\n\nSince GCD(6,10)=2, they are not pairwise coprime. However, since GCD(6,10,15)=1, they are setwise coprime.\n\nSample Input 3\n\n3\n6 10 16\n\nSample Output 3\n\nnot coprime\n\nGCD(6,10,16)=2, so they are neither pairwise coprime nor setwise coprime.", "sample_input": "3\n3 4 5\n"}, "reference_outputs": ["pairwise coprime\n"], "source_document_id": "p02574", "source_text": "Score : 500 points\n\nProblem Statement\n\nWe have N integers. The i-th number is A_i.\n\n\\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\\leq i < j \\leq N.\n\n\\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\\ldots,A_N)=1.\n\nDetermine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.\n\nHere, GCD(\\ldots) denotes greatest common divisor.\n\nConstraints\n\n2 \\leq N \\leq 10^6\n\n1 \\leq A_i\\leq 10^6\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 \\ldots A_N\n\nOutput\n\nIf \\{A_i\\} is pairwise coprime, print pairwise coprime; if \\{A_i\\} is setwise coprime, print setwise coprime; if neither, print not coprime.\n\nSample Input 1\n\n3\n3 4 5\n\nSample Output 1\n\npairwise coprime\n\nGCD(3,4)=GCD(3,5)=GCD(4,5)=1, so they are pairwise coprime.\n\nSample Input 2\n\n3\n6 10 15\n\nSample Output 2\n\nsetwise coprime\n\nSince GCD(6,10)=2, they are not pairwise coprime. However, since GCD(6,10,15)=1, they are setwise coprime.\n\nSample Input 3\n\n3\n6 10 16\n\nSample Output 3\n\nnot coprime\n\nGCD(6,10,16)=2, so they are neither pairwise coprime nor setwise coprime.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 902, "cpu_time_ms": 322, "memory_kb": 15200}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s718401039", "group_id": "codeNet:p02574", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tas := make([]int, n)\n\tgg := make([]int, n+1)\n\tfor i := 0; i < n; i++ {\n\t\tas[i] = nextInt()\n\t}\n\n\tsort.Sort(sort.Reverse(sort.IntSlice(as)))\n\n\tfor i := 0; i < n; i++ {\n\t\tgg[i+1] = gcd(gg[i], as[i])\n\t}\n\n\tif gg[n] != 1 {\n\t\tfmt.Println(\"not coprime\")\n\t\treturn\n\t}\n\n\tdm := make(map[int]int)\n\tfor i := 0; i < len(gg); i++ {\n\t\tdivs := divisors(gg[i])\n\t\tfor _, v := range divs {\n\t\t\tdm[v]++\n\t\t}\n\t}\n\n\tfor k, v := range dm {\n\t\tif k == 1 {\n\t\t\tcontinue\n\t\t}\n\t\tif v > 1 {\n\t\t\tfmt.Println(\"setwise coprime\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(\"pairwise coprime\")\n}\n\nfunc divisors(n int) []int {\n\tds := make([]int, 0)\n\tfor i := 1; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tds = append(ds, i)\n\t\t\tif i*i != n {\n\t\t\t\tds = append(ds, n/i)\n\t\t\t}\n\t\t}\n\t}\n\treturn ds\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n", "language": "Go", "metadata": {"date": 1598731857, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02574.html", "problem_id": "p02574", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02574/input.txt", "sample_output_relpath": "derived/input_output/data/p02574/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02574/Go/s718401039.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s718401039", "user_id": "u902409225"}, "prompt_components": {"gold_output": "pairwise coprime\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tas := make([]int, n)\n\tgg := make([]int, n+1)\n\tfor i := 0; i < n; i++ {\n\t\tas[i] = nextInt()\n\t}\n\n\tsort.Sort(sort.Reverse(sort.IntSlice(as)))\n\n\tfor i := 0; i < n; i++ {\n\t\tgg[i+1] = gcd(gg[i], as[i])\n\t}\n\n\tif gg[n] != 1 {\n\t\tfmt.Println(\"not coprime\")\n\t\treturn\n\t}\n\n\tdm := make(map[int]int)\n\tfor i := 0; i < len(gg); i++ {\n\t\tdivs := divisors(gg[i])\n\t\tfor _, v := range divs {\n\t\t\tdm[v]++\n\t\t}\n\t}\n\n\tfor k, v := range dm {\n\t\tif k == 1 {\n\t\t\tcontinue\n\t\t}\n\t\tif v > 1 {\n\t\t\tfmt.Println(\"setwise coprime\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(\"pairwise coprime\")\n}\n\nfunc divisors(n int) []int {\n\tds := make([]int, 0)\n\tfor i := 1; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tds = append(ds, i)\n\t\t\tif i*i != n {\n\t\t\t\tds = append(ds, n/i)\n\t\t\t}\n\t\t}\n\t}\n\treturn ds\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nWe have N integers. The i-th number is A_i.\n\n\\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\\leq i < j \\leq N.\n\n\\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\\ldots,A_N)=1.\n\nDetermine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.\n\nHere, GCD(\\ldots) denotes greatest common divisor.\n\nConstraints\n\n2 \\leq N \\leq 10^6\n\n1 \\leq A_i\\leq 10^6\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 \\ldots A_N\n\nOutput\n\nIf \\{A_i\\} is pairwise coprime, print pairwise coprime; if \\{A_i\\} is setwise coprime, print setwise coprime; if neither, print not coprime.\n\nSample Input 1\n\n3\n3 4 5\n\nSample Output 1\n\npairwise coprime\n\nGCD(3,4)=GCD(3,5)=GCD(4,5)=1, so they are pairwise coprime.\n\nSample Input 2\n\n3\n6 10 15\n\nSample Output 2\n\nsetwise coprime\n\nSince GCD(6,10)=2, they are not pairwise coprime. However, since GCD(6,10,15)=1, they are setwise coprime.\n\nSample Input 3\n\n3\n6 10 16\n\nSample Output 3\n\nnot coprime\n\nGCD(6,10,16)=2, so they are neither pairwise coprime nor setwise coprime.", "sample_input": "3\n3 4 5\n"}, "reference_outputs": ["pairwise coprime\n"], "source_document_id": "p02574", "source_text": "Score : 500 points\n\nProblem Statement\n\nWe have N integers. The i-th number is A_i.\n\n\\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\\leq i < j \\leq N.\n\n\\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\\ldots,A_N)=1.\n\nDetermine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.\n\nHere, GCD(\\ldots) denotes greatest common divisor.\n\nConstraints\n\n2 \\leq N \\leq 10^6\n\n1 \\leq A_i\\leq 10^6\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 \\ldots A_N\n\nOutput\n\nIf \\{A_i\\} is pairwise coprime, print pairwise coprime; if \\{A_i\\} is setwise coprime, print setwise coprime; if neither, print not coprime.\n\nSample Input 1\n\n3\n3 4 5\n\nSample Output 1\n\npairwise coprime\n\nGCD(3,4)=GCD(3,5)=GCD(4,5)=1, so they are pairwise coprime.\n\nSample Input 2\n\n3\n6 10 15\n\nSample Output 2\n\nsetwise coprime\n\nSince GCD(6,10)=2, they are not pairwise coprime. However, since GCD(6,10,15)=1, they are setwise coprime.\n\nSample Input 3\n\n3\n6 10 16\n\nSample Output 3\n\nnot coprime\n\nGCD(6,10,16)=2, so they are neither pairwise coprime nor setwise coprime.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1072, "cpu_time_ms": 460, "memory_kb": 28112}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s340142422", "group_id": "codeNet:p02574", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e6 + 7\n)\n\nvar buf []byte = make([]byte, maxBufSize)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBufSize)\n}\n\nvar d = []Position{{1, 0}, {-1, 0}, {0, 1}, {0, -1}}\nvar d8 = []Position{{1, 0}, {-1, 0}, {0, 1}, {0, -1}, {1, 1}, {1, -1}, {-1, 1}, {-1, -1}}\n\nfunc main() {\n\tN := nextInt()\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = nextInt()\n\t}\n\tmemo := make([]int, N)\n\tpw, sw := true, true\n\tfor i := 0; i < N-1; i++ {\n\t\tif !pw && !sw {\n\t\t\tbreak\n\t\t}\n\t\tfor j := i + 1; j < N; j++ {\n\t\t\tgcd := gcdof2numbers(A[i], A[j])\n\t\t\tif j == i+1 && sw {\n\t\t\t\tmemo[i] = gcd\n\t\t\t\tif i >= 1 {\n\t\t\t\t\tgcdmemo := gcdof2numbers(memo[i], memo[i-1])\n\t\t\t\t\tif gcdmemo != 1 {\n\t\t\t\t\t\tsw = false\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif gcd != 1 {\n\t\t\t\tpw = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tif pw {\n\t\tfmt.Println(\"pairwise coprime\")\n\t\treturn\n\t}\n\tif sw {\n\t\tfmt.Println(\"setwise coprime\")\n\t\treturn\n\t}\n\tfmt.Println(\"not coprime\")\n}\n\n// 迷路問題での現在地を表す構造体\ntype Position struct {\n\tH int\n\tW int\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc abs(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc pow(p, q int) int {\n\tres := p\n\tif q == 0 {\n\t\treturn 1\n\t}\n\tfor i := 0; i < q-1; i++ {\n\t\tres *= p\n\t}\n\treturn res\n}\n\nfunc ceil(a, b int) int {\n\treturn (a + (b - 1)) / b\n}\n\nfunc MinOf(vars ...int) int {\n\tmin := vars[0]\n\tfor _, i := range vars {\n\t\tif min > i {\n\t\t\tmin = i\n\t\t}\n\t}\n\treturn min\n}\n\nfunc MaxOf(vars ...int) int {\n\tmax := vars[0]\n\tfor _, i := range vars {\n\t\tif max < i {\n\t\t\tmax = i\n\t\t}\n\t}\n\treturn max\n}\n\nfunc gcdof2numbers(a int, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcdof2numbers(b, a%b)\n}\n\nfunc lcmof2numbers(a int, b int) int {\n\treturn a / gcdof2numbers(a, b) * b\n}\n\n// マイナスの場合は考慮していない\nfunc fuctorial(a int) int {\n\tif a == 1 || a == 0 {\n\t\treturn 1\n\t} else {\n\t\treturn fuctorial(a-1) * a\n\t}\n}\n\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\n\n// 素因数分解したmapを返す\nfunc primeFuctorize(n int) map[int]int {\n\tpf := map[int]int{}\n\tfor i := 2; i*i <= n; i++ {\n\t\tfor n%i == 0 {\n\t\t\tpf[i]++\n\t\t\tn /= i\n\t\t}\n\t}\n\tif n != 1 {\n\t\tpf[n]++\n\t}\n\treturn pf\n}\n\n// golangの公式サンプルより\n// https://xn--go-hh0g6u.com/pkg/container/heap/#example__intHeap\n// IntHeap は,整数の最小ヒープです。\ntype IH []int\n\nfunc (h IH) Len() int { return len(h) }\nfunc (h IH) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h IH) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\n\nfunc (h *IH) Push(x interface{}) {\n\t// Push と Pop はポインタレシーバを使っています。\n\t// なぜなら,スライスの中身だけでなく,スライスの長さも変更するからです。\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IH) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\n// golangの公式サンプルより\n// https://xn--go-hh0g6u.com/pkg/container/heap/#example__priorityQueue\n\n// Item は,優先キューで管理する項目です。\ntype Item struct {\n\tvalue string // 値。任意です。\n\tpriority int // キューにおける優先度\n\t// index は heap.Interface メソッドで更新されます。\n\tindex int // ヒープにおけるインデックス\n}\n\n// PriorityQueue は heap.Interface を実装し,Item のリストを保持します。\ntype PriorityQueue []*Item\n\nfunc (pq PriorityQueue) Len() int { return len(pq) }\n\nfunc (pq PriorityQueue) Less(i, j int) bool {\n\t// Pop が最小ではなく最大の優先度を持つ項目を返して欲しいので,ここでは > を使っています。\n\treturn pq[i].priority > pq[j].priority\n}\n\nfunc (pq PriorityQueue) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n\tpq[i].index = i\n\tpq[j].index = j\n}\n\nfunc (pq *PriorityQueue) Push(x interface{}) {\n\tn := len(*pq)\n\titem := x.(*Item)\n\titem.index = n\n\t*pq = append(*pq, item)\n}\n\nfunc (pq *PriorityQueue) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\told[n-1] = nil // メモリリークを避ける\n\titem.index = -1 // 安全のため\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\n// update はキューの Item の優先度と値を更新します。\nfunc (pq *PriorityQueue) update(item *Item, value string, priority int) {\n\titem.value = value\n\titem.priority = priority\n\theap.Fix(pq, item.index)\n}\n", "language": "Go", "metadata": {"date": 1598730659, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02574.html", "problem_id": "p02574", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02574/input.txt", "sample_output_relpath": "derived/input_output/data/p02574/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02574/Go/s340142422.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s340142422", "user_id": "u605443479"}, "prompt_components": {"gold_output": "pairwise coprime\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e6 + 7\n)\n\nvar buf []byte = make([]byte, maxBufSize)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBufSize)\n}\n\nvar d = []Position{{1, 0}, {-1, 0}, {0, 1}, {0, -1}}\nvar d8 = []Position{{1, 0}, {-1, 0}, {0, 1}, {0, -1}, {1, 1}, {1, -1}, {-1, 1}, {-1, -1}}\n\nfunc main() {\n\tN := nextInt()\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = nextInt()\n\t}\n\tmemo := make([]int, N)\n\tpw, sw := true, true\n\tfor i := 0; i < N-1; i++ {\n\t\tif !pw && !sw {\n\t\t\tbreak\n\t\t}\n\t\tfor j := i + 1; j < N; j++ {\n\t\t\tgcd := gcdof2numbers(A[i], A[j])\n\t\t\tif j == i+1 && sw {\n\t\t\t\tmemo[i] = gcd\n\t\t\t\tif i >= 1 {\n\t\t\t\t\tgcdmemo := gcdof2numbers(memo[i], memo[i-1])\n\t\t\t\t\tif gcdmemo != 1 {\n\t\t\t\t\t\tsw = false\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif gcd != 1 {\n\t\t\t\tpw = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tif pw {\n\t\tfmt.Println(\"pairwise coprime\")\n\t\treturn\n\t}\n\tif sw {\n\t\tfmt.Println(\"setwise coprime\")\n\t\treturn\n\t}\n\tfmt.Println(\"not coprime\")\n}\n\n// 迷路問題での現在地を表す構造体\ntype Position struct {\n\tH int\n\tW int\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc abs(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc pow(p, q int) int {\n\tres := p\n\tif q == 0 {\n\t\treturn 1\n\t}\n\tfor i := 0; i < q-1; i++ {\n\t\tres *= p\n\t}\n\treturn res\n}\n\nfunc ceil(a, b int) int {\n\treturn (a + (b - 1)) / b\n}\n\nfunc MinOf(vars ...int) int {\n\tmin := vars[0]\n\tfor _, i := range vars {\n\t\tif min > i {\n\t\t\tmin = i\n\t\t}\n\t}\n\treturn min\n}\n\nfunc MaxOf(vars ...int) int {\n\tmax := vars[0]\n\tfor _, i := range vars {\n\t\tif max < i {\n\t\t\tmax = i\n\t\t}\n\t}\n\treturn max\n}\n\nfunc gcdof2numbers(a int, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcdof2numbers(b, a%b)\n}\n\nfunc lcmof2numbers(a int, b int) int {\n\treturn a / gcdof2numbers(a, b) * b\n}\n\n// マイナスの場合は考慮していない\nfunc fuctorial(a int) int {\n\tif a == 1 || a == 0 {\n\t\treturn 1\n\t} else {\n\t\treturn fuctorial(a-1) * a\n\t}\n}\n\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\n\n// 素因数分解したmapを返す\nfunc primeFuctorize(n int) map[int]int {\n\tpf := map[int]int{}\n\tfor i := 2; i*i <= n; i++ {\n\t\tfor n%i == 0 {\n\t\t\tpf[i]++\n\t\t\tn /= i\n\t\t}\n\t}\n\tif n != 1 {\n\t\tpf[n]++\n\t}\n\treturn pf\n}\n\n// golangの公式サンプルより\n// https://xn--go-hh0g6u.com/pkg/container/heap/#example__intHeap\n// IntHeap は,整数の最小ヒープです。\ntype IH []int\n\nfunc (h IH) Len() int { return len(h) }\nfunc (h IH) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h IH) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\n\nfunc (h *IH) Push(x interface{}) {\n\t// Push と Pop はポインタレシーバを使っています。\n\t// なぜなら,スライスの中身だけでなく,スライスの長さも変更するからです。\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IH) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\n// golangの公式サンプルより\n// https://xn--go-hh0g6u.com/pkg/container/heap/#example__priorityQueue\n\n// Item は,優先キューで管理する項目です。\ntype Item struct {\n\tvalue string // 値。任意です。\n\tpriority int // キューにおける優先度\n\t// index は heap.Interface メソッドで更新されます。\n\tindex int // ヒープにおけるインデックス\n}\n\n// PriorityQueue は heap.Interface を実装し,Item のリストを保持します。\ntype PriorityQueue []*Item\n\nfunc (pq PriorityQueue) Len() int { return len(pq) }\n\nfunc (pq PriorityQueue) Less(i, j int) bool {\n\t// Pop が最小ではなく最大の優先度を持つ項目を返して欲しいので,ここでは > を使っています。\n\treturn pq[i].priority > pq[j].priority\n}\n\nfunc (pq PriorityQueue) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n\tpq[i].index = i\n\tpq[j].index = j\n}\n\nfunc (pq *PriorityQueue) Push(x interface{}) {\n\tn := len(*pq)\n\titem := x.(*Item)\n\titem.index = n\n\t*pq = append(*pq, item)\n}\n\nfunc (pq *PriorityQueue) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\told[n-1] = nil // メモリリークを避ける\n\titem.index = -1 // 安全のため\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\n// update はキューの Item の優先度と値を更新します。\nfunc (pq *PriorityQueue) update(item *Item, value string, priority int) {\n\titem.value = value\n\titem.priority = priority\n\theap.Fix(pq, item.index)\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nWe have N integers. The i-th number is A_i.\n\n\\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\\leq i < j \\leq N.\n\n\\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\\ldots,A_N)=1.\n\nDetermine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.\n\nHere, GCD(\\ldots) denotes greatest common divisor.\n\nConstraints\n\n2 \\leq N \\leq 10^6\n\n1 \\leq A_i\\leq 10^6\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 \\ldots A_N\n\nOutput\n\nIf \\{A_i\\} is pairwise coprime, print pairwise coprime; if \\{A_i\\} is setwise coprime, print setwise coprime; if neither, print not coprime.\n\nSample Input 1\n\n3\n3 4 5\n\nSample Output 1\n\npairwise coprime\n\nGCD(3,4)=GCD(3,5)=GCD(4,5)=1, so they are pairwise coprime.\n\nSample Input 2\n\n3\n6 10 15\n\nSample Output 2\n\nsetwise coprime\n\nSince GCD(6,10)=2, they are not pairwise coprime. However, since GCD(6,10,15)=1, they are setwise coprime.\n\nSample Input 3\n\n3\n6 10 16\n\nSample Output 3\n\nnot coprime\n\nGCD(6,10,16)=2, so they are neither pairwise coprime nor setwise coprime.", "sample_input": "3\n3 4 5\n"}, "reference_outputs": ["pairwise coprime\n"], "source_document_id": "p02574", "source_text": "Score : 500 points\n\nProblem Statement\n\nWe have N integers. The i-th number is A_i.\n\n\\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\\leq i < j \\leq N.\n\n\\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\\ldots,A_N)=1.\n\nDetermine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.\n\nHere, GCD(\\ldots) denotes greatest common divisor.\n\nConstraints\n\n2 \\leq N \\leq 10^6\n\n1 \\leq A_i\\leq 10^6\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 \\ldots A_N\n\nOutput\n\nIf \\{A_i\\} is pairwise coprime, print pairwise coprime; if \\{A_i\\} is setwise coprime, print setwise coprime; if neither, print not coprime.\n\nSample Input 1\n\n3\n3 4 5\n\nSample Output 1\n\npairwise coprime\n\nGCD(3,4)=GCD(3,5)=GCD(4,5)=1, so they are pairwise coprime.\n\nSample Input 2\n\n3\n6 10 15\n\nSample Output 2\n\nsetwise coprime\n\nSince GCD(6,10)=2, they are not pairwise coprime. However, since GCD(6,10,15)=1, they are setwise coprime.\n\nSample Input 3\n\n3\n6 10 16\n\nSample Output 3\n\nnot coprime\n\nGCD(6,10,16)=2, so they are neither pairwise coprime nor setwise coprime.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4801, "cpu_time_ms": 2206, "memory_kb": 17168}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s780414307", "group_id": "codeNet:p02574", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tN := ReadInt()\n\tA := ReadInts(N)\n\n\t// not coprime\n\tgcd := A[0]\n\tfor i := 1; i < N; i++ {\n\t\tgcd = GCD(gcd, A[i])\n\t}\n\tif gcd != 1 {\n\t\tfmt.Println(\"not coprime\")\n\t\treturn\n\t}\n\n\tm := make(map[int]int)\n\tfor i := 0; i < N; i++ {\n\t\tfactors := Factorization(A[i])\n\t\tfor _, factor := range factors {\n\t\t\tv := factor[0]\n\t\t\tif m[v] > 0 {\n\t\t\t\tfmt.Println(\"setwise coprime\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tm[v] = 1\n\t\t}\n\t}\n\tfmt.Println(\"pairwise coprime\")\n}\n\nfunc Factorization(n int) [][]int {\n\tres := [][]int{}\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i != 0 {\n\t\t\tcontinue\n\t\t}\n\t\tcnt := 0\n\t\tfor n%i == 0 {\n\t\t\tn /= i\n\t\t\tcnt++\n\t\t}\n\t\tres = append(res, []int{i, cnt})\n\t}\n\tif n != 1 {\n\t\tres = append(res, []int{n, 1})\n\t}\n\treturn res\n}\n\nfunc GCD(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn GCD(b, a%b)\n}\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadString() (s string) { Scan(&s); return }\nfunc ReadInts(n int) []int {\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tScan(&v[i])\n\t}\n\treturn v\n}\n", "language": "Go", "metadata": {"date": 1598730658, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02574.html", "problem_id": "p02574", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02574/input.txt", "sample_output_relpath": "derived/input_output/data/p02574/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02574/Go/s780414307.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s780414307", "user_id": "u328656362"}, "prompt_components": {"gold_output": "pairwise coprime\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tN := ReadInt()\n\tA := ReadInts(N)\n\n\t// not coprime\n\tgcd := A[0]\n\tfor i := 1; i < N; i++ {\n\t\tgcd = GCD(gcd, A[i])\n\t}\n\tif gcd != 1 {\n\t\tfmt.Println(\"not coprime\")\n\t\treturn\n\t}\n\n\tm := make(map[int]int)\n\tfor i := 0; i < N; i++ {\n\t\tfactors := Factorization(A[i])\n\t\tfor _, factor := range factors {\n\t\t\tv := factor[0]\n\t\t\tif m[v] > 0 {\n\t\t\t\tfmt.Println(\"setwise coprime\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tm[v] = 1\n\t\t}\n\t}\n\tfmt.Println(\"pairwise coprime\")\n}\n\nfunc Factorization(n int) [][]int {\n\tres := [][]int{}\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i != 0 {\n\t\t\tcontinue\n\t\t}\n\t\tcnt := 0\n\t\tfor n%i == 0 {\n\t\t\tn /= i\n\t\t\tcnt++\n\t\t}\n\t\tres = append(res, []int{i, cnt})\n\t}\n\tif n != 1 {\n\t\tres = append(res, []int{n, 1})\n\t}\n\treturn res\n}\n\nfunc GCD(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn GCD(b, a%b)\n}\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadString() (s string) { Scan(&s); return }\nfunc ReadInts(n int) []int {\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tScan(&v[i])\n\t}\n\treturn v\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nWe have N integers. The i-th number is A_i.\n\n\\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\\leq i < j \\leq N.\n\n\\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\\ldots,A_N)=1.\n\nDetermine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.\n\nHere, GCD(\\ldots) denotes greatest common divisor.\n\nConstraints\n\n2 \\leq N \\leq 10^6\n\n1 \\leq A_i\\leq 10^6\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 \\ldots A_N\n\nOutput\n\nIf \\{A_i\\} is pairwise coprime, print pairwise coprime; if \\{A_i\\} is setwise coprime, print setwise coprime; if neither, print not coprime.\n\nSample Input 1\n\n3\n3 4 5\n\nSample Output 1\n\npairwise coprime\n\nGCD(3,4)=GCD(3,5)=GCD(4,5)=1, so they are pairwise coprime.\n\nSample Input 2\n\n3\n6 10 15\n\nSample Output 2\n\nsetwise coprime\n\nSince GCD(6,10)=2, they are not pairwise coprime. However, since GCD(6,10,15)=1, they are setwise coprime.\n\nSample Input 3\n\n3\n6 10 16\n\nSample Output 3\n\nnot coprime\n\nGCD(6,10,16)=2, so they are neither pairwise coprime nor setwise coprime.", "sample_input": "3\n3 4 5\n"}, "reference_outputs": ["pairwise coprime\n"], "source_document_id": "p02574", "source_text": "Score : 500 points\n\nProblem Statement\n\nWe have N integers. The i-th number is A_i.\n\n\\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\\leq i < j \\leq N.\n\n\\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\\ldots,A_N)=1.\n\nDetermine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.\n\nHere, GCD(\\ldots) denotes greatest common divisor.\n\nConstraints\n\n2 \\leq N \\leq 10^6\n\n1 \\leq A_i\\leq 10^6\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 \\ldots A_N\n\nOutput\n\nIf \\{A_i\\} is pairwise coprime, print pairwise coprime; if \\{A_i\\} is setwise coprime, print setwise coprime; if neither, print not coprime.\n\nSample Input 1\n\n3\n3 4 5\n\nSample Output 1\n\npairwise coprime\n\nGCD(3,4)=GCD(3,5)=GCD(4,5)=1, so they are pairwise coprime.\n\nSample Input 2\n\n3\n6 10 15\n\nSample Output 2\n\nsetwise coprime\n\nSince GCD(6,10)=2, they are not pairwise coprime. However, since GCD(6,10,15)=1, they are setwise coprime.\n\nSample Input 3\n\n3\n6 10 16\n\nSample Output 3\n\nnot coprime\n\nGCD(6,10,16)=2, so they are neither pairwise coprime nor setwise coprime.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1182, "cpu_time_ms": 537, "memory_kb": 15332}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s130618400", "group_id": "codeNet:p02574", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getInts(N int) []int {\n\tret := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tret[i] = getInt()\n\t}\n\treturn ret\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc lowerBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] >= x\n\t})\n\treturn idx\n}\n\nfunc upperBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] > x\n\t})\n\treturn idx\n}\n\nvar pfs map[int]int\n\n// PfsMap : 素因数分解し、マップを作成\nfunc PfsMap(n int) bool {\n\tfor n%2 == 0 {\n\t\tpfs[2] = pfs[2] + 1\n\t\t// if pfs[2] == 2 {\n\t\t// \treturn false\n\t\t// }\n\t\tn = n / 2\n\t\tfor n%2 == 0 {\n\t\t\tn = n / 2\n\t\t}\n\t}\n\n\tfor i := 3; i*i <= n; i = i + 2 {\n\t\tfor n%i == 0 {\n\t\t\tpfs[i] = pfs[i] + 1\n\t\t\t// if pfs[i] == 2 {\n\t\t\t// \treturn false\n\t\t\t// }\n\t\t\tn = n / i\n\t\t\tfor n%i == 0 {\n\t\t\t\tn = n / i\n\t\t\t}\n\t\t}\n\t}\n\n\tif n > 2 {\n\t\tpfs[n] = pfs[n] + 1\n\t}\n\treturn true\n}\n\n// GCD : greatest common divisor (GCD) via Euclidean algorithm\nfunc GCD(a, b int) int {\n\tfor b != 0 {\n\t\tt := b\n\t\tb = a % b\n\t\ta = t\n\t}\n\treturn a\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, 1000000)\n\tN := getInt()\n\ta := getInts(N)\n\tsc := a[0]\n\tpfs = make(map[int]int)\n\tPfsMap(a[0])\n\tfor i := 1; i < N; i++ {\n\t\tPfsMap(a[i])\n\t\tsc = GCD(sc, a[i])\n\t}\n\t// out(sc, pfs, a)\n\tflg := true\n\tfor _, e := range pfs {\n\t\tif e != 1 {\n\t\t\tflg = false\n\t\t\tbreak\n\t\t}\n\t}\n\tif flg == true {\n\t\tout(\"pairwise coprime\")\n\t\treturn\n\t}\n\tif sc == 1 {\n\t\tout(\"setwise coprime\")\n\t\treturn\n\t}\n\tout(\"not coprime\")\n\n}\n", "language": "Go", "metadata": {"date": 1598729931, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02574.html", "problem_id": "p02574", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02574/input.txt", "sample_output_relpath": "derived/input_output/data/p02574/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02574/Go/s130618400.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s130618400", "user_id": "u814575783"}, "prompt_components": {"gold_output": "pairwise coprime\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getInts(N int) []int {\n\tret := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tret[i] = getInt()\n\t}\n\treturn ret\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc lowerBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] >= x\n\t})\n\treturn idx\n}\n\nfunc upperBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] > x\n\t})\n\treturn idx\n}\n\nvar pfs map[int]int\n\n// PfsMap : 素因数分解し、マップを作成\nfunc PfsMap(n int) bool {\n\tfor n%2 == 0 {\n\t\tpfs[2] = pfs[2] + 1\n\t\t// if pfs[2] == 2 {\n\t\t// \treturn false\n\t\t// }\n\t\tn = n / 2\n\t\tfor n%2 == 0 {\n\t\t\tn = n / 2\n\t\t}\n\t}\n\n\tfor i := 3; i*i <= n; i = i + 2 {\n\t\tfor n%i == 0 {\n\t\t\tpfs[i] = pfs[i] + 1\n\t\t\t// if pfs[i] == 2 {\n\t\t\t// \treturn false\n\t\t\t// }\n\t\t\tn = n / i\n\t\t\tfor n%i == 0 {\n\t\t\t\tn = n / i\n\t\t\t}\n\t\t}\n\t}\n\n\tif n > 2 {\n\t\tpfs[n] = pfs[n] + 1\n\t}\n\treturn true\n}\n\n// GCD : greatest common divisor (GCD) via Euclidean algorithm\nfunc GCD(a, b int) int {\n\tfor b != 0 {\n\t\tt := b\n\t\tb = a % b\n\t\ta = t\n\t}\n\treturn a\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, 1000000)\n\tN := getInt()\n\ta := getInts(N)\n\tsc := a[0]\n\tpfs = make(map[int]int)\n\tPfsMap(a[0])\n\tfor i := 1; i < N; i++ {\n\t\tPfsMap(a[i])\n\t\tsc = GCD(sc, a[i])\n\t}\n\t// out(sc, pfs, a)\n\tflg := true\n\tfor _, e := range pfs {\n\t\tif e != 1 {\n\t\t\tflg = false\n\t\t\tbreak\n\t\t}\n\t}\n\tif flg == true {\n\t\tout(\"pairwise coprime\")\n\t\treturn\n\t}\n\tif sc == 1 {\n\t\tout(\"setwise coprime\")\n\t\treturn\n\t}\n\tout(\"not coprime\")\n\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nWe have N integers. The i-th number is A_i.\n\n\\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\\leq i < j \\leq N.\n\n\\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\\ldots,A_N)=1.\n\nDetermine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.\n\nHere, GCD(\\ldots) denotes greatest common divisor.\n\nConstraints\n\n2 \\leq N \\leq 10^6\n\n1 \\leq A_i\\leq 10^6\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 \\ldots A_N\n\nOutput\n\nIf \\{A_i\\} is pairwise coprime, print pairwise coprime; if \\{A_i\\} is setwise coprime, print setwise coprime; if neither, print not coprime.\n\nSample Input 1\n\n3\n3 4 5\n\nSample Output 1\n\npairwise coprime\n\nGCD(3,4)=GCD(3,5)=GCD(4,5)=1, so they are pairwise coprime.\n\nSample Input 2\n\n3\n6 10 15\n\nSample Output 2\n\nsetwise coprime\n\nSince GCD(6,10)=2, they are not pairwise coprime. However, since GCD(6,10,15)=1, they are setwise coprime.\n\nSample Input 3\n\n3\n6 10 16\n\nSample Output 3\n\nnot coprime\n\nGCD(6,10,16)=2, so they are neither pairwise coprime nor setwise coprime.", "sample_input": "3\n3 4 5\n"}, "reference_outputs": ["pairwise coprime\n"], "source_document_id": "p02574", "source_text": "Score : 500 points\n\nProblem Statement\n\nWe have N integers. The i-th number is A_i.\n\n\\{A_i\\} is said to be pairwise coprime when GCD(A_i,A_j)=1 holds for every pair (i, j) such that 1\\leq i < j \\leq N.\n\n\\{A_i\\} is said to be setwise coprime when \\{A_i\\} is not pairwise coprime but GCD(A_1,\\ldots,A_N)=1.\n\nDetermine if \\{A_i\\} is pairwise coprime, setwise coprime, or neither.\n\nHere, GCD(\\ldots) denotes greatest common divisor.\n\nConstraints\n\n2 \\leq N \\leq 10^6\n\n1 \\leq A_i\\leq 10^6\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 \\ldots A_N\n\nOutput\n\nIf \\{A_i\\} is pairwise coprime, print pairwise coprime; if \\{A_i\\} is setwise coprime, print setwise coprime; if neither, print not coprime.\n\nSample Input 1\n\n3\n3 4 5\n\nSample Output 1\n\npairwise coprime\n\nGCD(3,4)=GCD(3,5)=GCD(4,5)=1, so they are pairwise coprime.\n\nSample Input 2\n\n3\n6 10 15\n\nSample Output 2\n\nsetwise coprime\n\nSince GCD(6,10)=2, they are not pairwise coprime. However, since GCD(6,10,15)=1, they are setwise coprime.\n\nSample Input 3\n\n3\n6 10 16\n\nSample Output 3\n\nnot coprime\n\nGCD(6,10,16)=2, so they are neither pairwise coprime nor setwise coprime.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2055, "cpu_time_ms": 1094, "memory_kb": 19080}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s709165295", "group_id": "codeNet:p02580", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc nextFloat64() float64 {\n\tsc.Scan()\n\ti, e := strconv.ParseFloat(sc.Text(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -1 * x\n\t} else {\n\t\treturn x\n\t}\n}\n\nfunc max(x map[int]int) int {\n\tans := 0\n\tfor _, v := range x {\n\t\tif ans < v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(nil, 10000000000)\n\n\t_, _, m := nextInt(), nextInt(), nextInt()\n\n\ths := make([]int, m)\n\tws := make([]int, m)\n\n\thsum := make(map[int]int)\n\twsum := make(map[int]int)\n\n\tbomb := make(map[int]map[int]bool)\n\n\tfor i := 0; i < m; i++ {\n\t\ths[i], ws[i] = nextInt()-1, nextInt()-1\n\n\t\tif _, ok := bomb[hs[i]]; ok {\n\t\t\tbomb[hs[i]][ws[i]] = true\n\t\t} else {\n\t\t\tbomb[hs[i]] = make(map[int]bool)\n\t\t\tbomb[hs[i]][ws[i]] = true\n\t\t}\n\n\t\thsum[hs[i]] += 1\n\t\twsum[ws[i]] += 1\n\t}\n\n\thmax := max(hsum)\n\twmax := max(wsum)\n\n\tcheckh := []int{}\n\tcheckw := []int{}\n\n\tfor i := 0; i < m; i++ {\n\t\tif _, ok := hsum[i]; ok {\n\t\t\tif hsum[i] == hmax {\n\t\t\t\tcheckh = append(checkh, i)\n\t\t\t}\n\t\t}\n\t\tif _, ok := wsum[i]; ok {\n\t\t\tif wsum[i] == wmax {\n\t\t\t\tcheckw = append(checkw, i)\n\t\t\t}\n\t\t}\n\t}\n\n\tans := hmax + wmax - 1\n\tfor _, ch := range checkh {\n\t\tif _, ok := bomb[ch]; !ok {\n\t\t\tcontinue\n\t\t}\n\t\tfor _, cw := range checkw {\n\t\t\tif _, ok := bomb[ch][cw]; !ok {\n\t\t\t\tans = hmax + wmax\n\t\t\t\tfmt.Println(ans)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1598506729, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02580.html", "problem_id": "p02580", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02580/input.txt", "sample_output_relpath": "derived/input_output/data/p02580/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02580/Go/s709165295.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s709165295", "user_id": "u998286277"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc nextFloat64() float64 {\n\tsc.Scan()\n\ti, e := strconv.ParseFloat(sc.Text(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -1 * x\n\t} else {\n\t\treturn x\n\t}\n}\n\nfunc max(x map[int]int) int {\n\tans := 0\n\tfor _, v := range x {\n\t\tif ans < v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(nil, 10000000000)\n\n\t_, _, m := nextInt(), nextInt(), nextInt()\n\n\ths := make([]int, m)\n\tws := make([]int, m)\n\n\thsum := make(map[int]int)\n\twsum := make(map[int]int)\n\n\tbomb := make(map[int]map[int]bool)\n\n\tfor i := 0; i < m; i++ {\n\t\ths[i], ws[i] = nextInt()-1, nextInt()-1\n\n\t\tif _, ok := bomb[hs[i]]; ok {\n\t\t\tbomb[hs[i]][ws[i]] = true\n\t\t} else {\n\t\t\tbomb[hs[i]] = make(map[int]bool)\n\t\t\tbomb[hs[i]][ws[i]] = true\n\t\t}\n\n\t\thsum[hs[i]] += 1\n\t\twsum[ws[i]] += 1\n\t}\n\n\thmax := max(hsum)\n\twmax := max(wsum)\n\n\tcheckh := []int{}\n\tcheckw := []int{}\n\n\tfor i := 0; i < m; i++ {\n\t\tif _, ok := hsum[i]; ok {\n\t\t\tif hsum[i] == hmax {\n\t\t\t\tcheckh = append(checkh, i)\n\t\t\t}\n\t\t}\n\t\tif _, ok := wsum[i]; ok {\n\t\t\tif wsum[i] == wmax {\n\t\t\t\tcheckw = append(checkw, i)\n\t\t\t}\n\t\t}\n\t}\n\n\tans := hmax + wmax - 1\n\tfor _, ch := range checkh {\n\t\tif _, ok := bomb[ch]; !ok {\n\t\t\tcontinue\n\t\t}\n\t\tfor _, cw := range checkw {\n\t\t\tif _, ok := bomb[ch][cw]; !ok {\n\t\t\t\tans = hmax + wmax\n\t\t\t\tfmt.Println(ans)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nWe have a two-dimensional grid with H \\times W squares. There are M targets to destroy in this grid - the position of the i-th target is \\left(h_i, w_i \\right).\n\nTakahashi will choose one square in this grid, place a bomb there, and ignite it. The bomb will destroy all targets that are in the row or the column where the bomb is placed. It is possible to place the bomb at a square with a target.\n\nTakahashi is trying to maximize the number of targets to destroy. Find the maximum number of targets that can be destroyed.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq H, W \\leq 3 \\times 10^5\n\n1 \\leq M \\leq \\min\\left(H\\times W, 3 \\times 10^5\\right)\n\n1 \\leq h_i \\leq H\n\n1 \\leq w_i \\leq W\n\n\\left(h_i, w_i\\right) \\neq \\left(h_j, w_j\\right) \\left(i \\neq j\\right)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W M\nh_1 w_1\n\\vdots\nh_M w_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 3 3\n2 2\n1 1\n1 3\n\nSample Output 1\n\n3\n\nWe can destroy all the targets by placing the bomb at \\left(1, 2\\right).\n\nSample Input 2\n\n3 3 4\n3 3\n3 1\n1 1\n1 2\n\nSample Output 2\n\n3\n\nSample Input 3\n\n5 5 10\n2 5\n4 3\n2 3\n5 5\n2 2\n5 4\n5 3\n5 1\n3 5\n1 4\n\nSample Output 3\n\n6", "sample_input": "2 3 3\n2 2\n1 1\n1 3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02580", "source_text": "Score : 500 points\n\nProblem Statement\n\nWe have a two-dimensional grid with H \\times W squares. There are M targets to destroy in this grid - the position of the i-th target is \\left(h_i, w_i \\right).\n\nTakahashi will choose one square in this grid, place a bomb there, and ignite it. The bomb will destroy all targets that are in the row or the column where the bomb is placed. It is possible to place the bomb at a square with a target.\n\nTakahashi is trying to maximize the number of targets to destroy. Find the maximum number of targets that can be destroyed.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq H, W \\leq 3 \\times 10^5\n\n1 \\leq M \\leq \\min\\left(H\\times W, 3 \\times 10^5\\right)\n\n1 \\leq h_i \\leq H\n\n1 \\leq w_i \\leq W\n\n\\left(h_i, w_i\\right) \\neq \\left(h_j, w_j\\right) \\left(i \\neq j\\right)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W M\nh_1 w_1\n\\vdots\nh_M w_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 3 3\n2 2\n1 1\n1 3\n\nSample Output 1\n\n3\n\nWe can destroy all the targets by placing the bomb at \\left(1, 2\\right).\n\nSample Input 2\n\n3 3 4\n3 3\n3 1\n1 1\n1 2\n\nSample Output 2\n\n3\n\nSample Input 3\n\n5 5 10\n2 5\n4 3\n2 3\n5 5\n2 2\n5 4\n5 3\n5 1\n3 5\n1 4\n\nSample Output 3\n\n6", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1624, "cpu_time_ms": 466, "memory_kb": 130104}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s250493043", "group_id": "codeNet:p02580", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\th, w, m := readI(), readI(), readI()\n\tcounth, countw := make([]int, h), make([]int, w)\n\ttarget := make([][]bool, h)\n\tfor i := 0; i < h; i++ {\n\t\ttarget[i] = make([]bool, w)\n\t}\n\tfor i := 0; i < m; i++ {\n\t\ttmph, tmpw := readI()-1, readI()-1\n\t\ttarget[tmph][tmpw] = true\n\t\tcounth[tmph]++\n\t\tcountw[tmpw]++\n\t}\n\n\tmax := 0\n\tmaxh, maxw := make([]int, 0), make([]int, 0)\n\tfor i := 0; i < h; i++ {\n\t\tif max < counth[i] {\n\t\t\tmax = counth[i]\n\t\t\tmaxh = []int{i}\n\t\t} else if max == counth[i] {\n\t\t\tmaxh = append(maxh, i)\n\t\t}\n\t}\n\tmax = 0\n\tfor i := 0; i < w; i++ {\n\t\tif max < countw[i] {\n\t\t\tmax = countw[i]\n\t\t\tmaxw = []int{i}\n\t\t} else if max == countw[i] {\n\t\t\tmaxw = append(maxw, i)\n\t\t}\n\t}\n\n\tfor i := 0; i < len(maxh); i++ {\n\t\tfor j := 0; j < len(maxw); j++ {\n\t\t\tif target[maxh[i]][maxw[j]] == false {\n\t\t\t\tfmt.Println(counth[maxh[0]] + countw[maxw[0]])\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(counth[maxh[0]] + countw[maxw[0]] - 1)\n}\n\n/*-----------Utils-----------*/\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tif len(os.Args) >= 2 {\n\t\tif os.Args[1] == \"debug\" {\n\t\t\tdebug()\n\t\t}\n\t}\n\tconst maxBuf = 200100\n\tvar buf []byte = make([]byte, maxBuf)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBuf)\n}\n\nfunc debug() {\n\ttestFile, err := os.Open(\"./test/sample-3.in\")\n\tif err != nil {\n\t\tfmt.Fprintln(os.Stderr, \"Error : There is no testfile.\")\n\t\tos.Exit(1)\n\t}\n\tsc = bufio.NewScanner(testFile)\n}\n\nfunc readS() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readSs(a int) []string {\n\tb := make([]string, a)\n\tfor i := 0; i < a; i++ {\n\t\tb[i] = readS()\n\t}\n\treturn b\n}\n\nfunc readI() int {\n\tsc.Scan()\n\tr, _ := strconv.Atoi(sc.Text())\n\treturn r\n}\n\nfunc readIs(a int) []int {\n\tb := make([]int, a)\n\tfor i := 0; i < a; i++ {\n\t\tb[i] = readI()\n\t}\n\treturn b\n}\n\nfunc readF() float64 {\n\tsc.Scan()\n\tr, _ := strconv.ParseFloat(sc.Text(), 64)\n\treturn r\n}\n\nfunc readFs(a int) []float64 {\n\tb := make([]float64, a)\n\tfor i := 0; i < a; i++ {\n\t\tb[i] = readF()\n\t}\n\treturn b\n}\n", "language": "Go", "metadata": {"date": 1598199493, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02580.html", "problem_id": "p02580", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02580/input.txt", "sample_output_relpath": "derived/input_output/data/p02580/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02580/Go/s250493043.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s250493043", "user_id": "u533258444"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\th, w, m := readI(), readI(), readI()\n\tcounth, countw := make([]int, h), make([]int, w)\n\ttarget := make([][]bool, h)\n\tfor i := 0; i < h; i++ {\n\t\ttarget[i] = make([]bool, w)\n\t}\n\tfor i := 0; i < m; i++ {\n\t\ttmph, tmpw := readI()-1, readI()-1\n\t\ttarget[tmph][tmpw] = true\n\t\tcounth[tmph]++\n\t\tcountw[tmpw]++\n\t}\n\n\tmax := 0\n\tmaxh, maxw := make([]int, 0), make([]int, 0)\n\tfor i := 0; i < h; i++ {\n\t\tif max < counth[i] {\n\t\t\tmax = counth[i]\n\t\t\tmaxh = []int{i}\n\t\t} else if max == counth[i] {\n\t\t\tmaxh = append(maxh, i)\n\t\t}\n\t}\n\tmax = 0\n\tfor i := 0; i < w; i++ {\n\t\tif max < countw[i] {\n\t\t\tmax = countw[i]\n\t\t\tmaxw = []int{i}\n\t\t} else if max == countw[i] {\n\t\t\tmaxw = append(maxw, i)\n\t\t}\n\t}\n\n\tfor i := 0; i < len(maxh); i++ {\n\t\tfor j := 0; j < len(maxw); j++ {\n\t\t\tif target[maxh[i]][maxw[j]] == false {\n\t\t\t\tfmt.Println(counth[maxh[0]] + countw[maxw[0]])\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(counth[maxh[0]] + countw[maxw[0]] - 1)\n}\n\n/*-----------Utils-----------*/\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tif len(os.Args) >= 2 {\n\t\tif os.Args[1] == \"debug\" {\n\t\t\tdebug()\n\t\t}\n\t}\n\tconst maxBuf = 200100\n\tvar buf []byte = make([]byte, maxBuf)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBuf)\n}\n\nfunc debug() {\n\ttestFile, err := os.Open(\"./test/sample-3.in\")\n\tif err != nil {\n\t\tfmt.Fprintln(os.Stderr, \"Error : There is no testfile.\")\n\t\tos.Exit(1)\n\t}\n\tsc = bufio.NewScanner(testFile)\n}\n\nfunc readS() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readSs(a int) []string {\n\tb := make([]string, a)\n\tfor i := 0; i < a; i++ {\n\t\tb[i] = readS()\n\t}\n\treturn b\n}\n\nfunc readI() int {\n\tsc.Scan()\n\tr, _ := strconv.Atoi(sc.Text())\n\treturn r\n}\n\nfunc readIs(a int) []int {\n\tb := make([]int, a)\n\tfor i := 0; i < a; i++ {\n\t\tb[i] = readI()\n\t}\n\treturn b\n}\n\nfunc readF() float64 {\n\tsc.Scan()\n\tr, _ := strconv.ParseFloat(sc.Text(), 64)\n\treturn r\n}\n\nfunc readFs(a int) []float64 {\n\tb := make([]float64, a)\n\tfor i := 0; i < a; i++ {\n\t\tb[i] = readF()\n\t}\n\treturn b\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nWe have a two-dimensional grid with H \\times W squares. There are M targets to destroy in this grid - the position of the i-th target is \\left(h_i, w_i \\right).\n\nTakahashi will choose one square in this grid, place a bomb there, and ignite it. The bomb will destroy all targets that are in the row or the column where the bomb is placed. It is possible to place the bomb at a square with a target.\n\nTakahashi is trying to maximize the number of targets to destroy. Find the maximum number of targets that can be destroyed.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq H, W \\leq 3 \\times 10^5\n\n1 \\leq M \\leq \\min\\left(H\\times W, 3 \\times 10^5\\right)\n\n1 \\leq h_i \\leq H\n\n1 \\leq w_i \\leq W\n\n\\left(h_i, w_i\\right) \\neq \\left(h_j, w_j\\right) \\left(i \\neq j\\right)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W M\nh_1 w_1\n\\vdots\nh_M w_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 3 3\n2 2\n1 1\n1 3\n\nSample Output 1\n\n3\n\nWe can destroy all the targets by placing the bomb at \\left(1, 2\\right).\n\nSample Input 2\n\n3 3 4\n3 3\n3 1\n1 1\n1 2\n\nSample Output 2\n\n3\n\nSample Input 3\n\n5 5 10\n2 5\n4 3\n2 3\n5 5\n2 2\n5 4\n5 3\n5 1\n3 5\n1 4\n\nSample Output 3\n\n6", "sample_input": "2 3 3\n2 2\n1 1\n1 3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02580", "source_text": "Score : 500 points\n\nProblem Statement\n\nWe have a two-dimensional grid with H \\times W squares. There are M targets to destroy in this grid - the position of the i-th target is \\left(h_i, w_i \\right).\n\nTakahashi will choose one square in this grid, place a bomb there, and ignite it. The bomb will destroy all targets that are in the row or the column where the bomb is placed. It is possible to place the bomb at a square with a target.\n\nTakahashi is trying to maximize the number of targets to destroy. Find the maximum number of targets that can be destroyed.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq H, W \\leq 3 \\times 10^5\n\n1 \\leq M \\leq \\min\\left(H\\times W, 3 \\times 10^5\\right)\n\n1 \\leq h_i \\leq H\n\n1 \\leq w_i \\leq W\n\n\\left(h_i, w_i\\right) \\neq \\left(h_j, w_j\\right) \\left(i \\neq j\\right)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W M\nh_1 w_1\n\\vdots\nh_M w_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 3 3\n2 2\n1 1\n1 3\n\nSample Output 1\n\n3\n\nWe can destroy all the targets by placing the bomb at \\left(1, 2\\right).\n\nSample Input 2\n\n3 3 4\n3 3\n3 1\n1 1\n1 2\n\nSample Output 2\n\n3\n\nSample Input 3\n\n5 5 10\n2 5\n4 3\n2 3\n5 5\n2 2\n5 4\n5 3\n5 1\n3 5\n1 4\n\nSample Output 3\n\n6", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2002, "cpu_time_ms": 3483, "memory_kb": 3492124}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s256740451", "group_id": "codeNet:p02580", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tio := NewIo(os.Stdin, os.Stdout)\n\tdefer io.Flush()\n\t_, _, m := io.NextInt(), io.NextInt(), io.NextInt()\n\tpoints := map[point]struct{}{}\n\tcntX, cntY := map[int]int{}, map[int]int{}\n\tfor i := 0; i < m; i++ {\n\t\txi, yi := io.NextInt(), io.NextInt()\n\t\tpoints[point{xi, yi}] = struct{}{}\n\t\tcntX[xi]++\n\t\tcntY[yi]++\n\t}\n\tsortedX := sortedKeys(cntX)\n\tsortedY := sortedKeys(cntY)\n\tfor i := 0; i < len(sortedX); i++ {\n\t\tif i > 0 && cntX[sortedX[i]] < cntX[sortedX[i-1]] {\n\t\t\tbreak\n\t\t}\n\t\tfor j := 0; j < len(sortedY); j++ {\n\t\t\tif j > 0 && cntY[sortedY[j]] < cntY[sortedY[j-1]] {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tx, y := sortedX[i], sortedY[j]\n\t\t\tif _, ok := points[point{x, y}]; !ok {\n\t\t\t\tLog(\"not exists\")\n\t\t\t\tio.Println(cntX[x] + cntY[y])\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tx, y := sortedX[0], sortedY[0]\n\tio.Println(cntX[x] + cntY[y] - 1)\n}\n\nfunc sortedKeys(mp map[int]int) []int {\n\tkeys := make([]int, len(mp))\n\tidx := 0\n\tfor k := range mp {\n\t\tkeys[idx] = k\n\t\tidx++\n\t}\n\tsort.Slice(keys, func(i, j int) bool { return mp[keys[i]] > mp[keys[j]] })\n\treturn keys\n}\n\ntype point struct{ x, y int }\n\n// Io is I/O object\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\n// NewIo returns a new Io instance\nfunc NewIo(r io.Reader, w io.Writer) *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(r),\n\t\twriter: bufio.NewWriter(w),\n\t}\n}\n\n// Flush flushes writer\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\n// NextLine scans a line from stdin\nfunc (io *Io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\n// Next return a word from stdin\nfunc (io *Io) Next() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\n// NextInt returns an integer from stdin\nfunc (io *Io) NextInt() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\n// Println is a wrapper of fmt.Fprintln\nfunc (io *Io) Println(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\n// Log outputs a to stderr\nfunc Log(a ...interface{}) {\n\tfmt.Fprintln(os.Stderr, a...)\n}\n", "language": "Go", "metadata": {"date": 1598133734, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02580.html", "problem_id": "p02580", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02580/input.txt", "sample_output_relpath": "derived/input_output/data/p02580/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02580/Go/s256740451.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s256740451", "user_id": "u914096063"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tio := NewIo(os.Stdin, os.Stdout)\n\tdefer io.Flush()\n\t_, _, m := io.NextInt(), io.NextInt(), io.NextInt()\n\tpoints := map[point]struct{}{}\n\tcntX, cntY := map[int]int{}, map[int]int{}\n\tfor i := 0; i < m; i++ {\n\t\txi, yi := io.NextInt(), io.NextInt()\n\t\tpoints[point{xi, yi}] = struct{}{}\n\t\tcntX[xi]++\n\t\tcntY[yi]++\n\t}\n\tsortedX := sortedKeys(cntX)\n\tsortedY := sortedKeys(cntY)\n\tfor i := 0; i < len(sortedX); i++ {\n\t\tif i > 0 && cntX[sortedX[i]] < cntX[sortedX[i-1]] {\n\t\t\tbreak\n\t\t}\n\t\tfor j := 0; j < len(sortedY); j++ {\n\t\t\tif j > 0 && cntY[sortedY[j]] < cntY[sortedY[j-1]] {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tx, y := sortedX[i], sortedY[j]\n\t\t\tif _, ok := points[point{x, y}]; !ok {\n\t\t\t\tLog(\"not exists\")\n\t\t\t\tio.Println(cntX[x] + cntY[y])\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tx, y := sortedX[0], sortedY[0]\n\tio.Println(cntX[x] + cntY[y] - 1)\n}\n\nfunc sortedKeys(mp map[int]int) []int {\n\tkeys := make([]int, len(mp))\n\tidx := 0\n\tfor k := range mp {\n\t\tkeys[idx] = k\n\t\tidx++\n\t}\n\tsort.Slice(keys, func(i, j int) bool { return mp[keys[i]] > mp[keys[j]] })\n\treturn keys\n}\n\ntype point struct{ x, y int }\n\n// Io is I/O object\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\n// NewIo returns a new Io instance\nfunc NewIo(r io.Reader, w io.Writer) *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(r),\n\t\twriter: bufio.NewWriter(w),\n\t}\n}\n\n// Flush flushes writer\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\n// NextLine scans a line from stdin\nfunc (io *Io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\n// Next return a word from stdin\nfunc (io *Io) Next() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\n// NextInt returns an integer from stdin\nfunc (io *Io) NextInt() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\n// Println is a wrapper of fmt.Fprintln\nfunc (io *Io) Println(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\n// Log outputs a to stderr\nfunc Log(a ...interface{}) {\n\tfmt.Fprintln(os.Stderr, a...)\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nWe have a two-dimensional grid with H \\times W squares. There are M targets to destroy in this grid - the position of the i-th target is \\left(h_i, w_i \\right).\n\nTakahashi will choose one square in this grid, place a bomb there, and ignite it. The bomb will destroy all targets that are in the row or the column where the bomb is placed. It is possible to place the bomb at a square with a target.\n\nTakahashi is trying to maximize the number of targets to destroy. Find the maximum number of targets that can be destroyed.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq H, W \\leq 3 \\times 10^5\n\n1 \\leq M \\leq \\min\\left(H\\times W, 3 \\times 10^5\\right)\n\n1 \\leq h_i \\leq H\n\n1 \\leq w_i \\leq W\n\n\\left(h_i, w_i\\right) \\neq \\left(h_j, w_j\\right) \\left(i \\neq j\\right)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W M\nh_1 w_1\n\\vdots\nh_M w_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 3 3\n2 2\n1 1\n1 3\n\nSample Output 1\n\n3\n\nWe can destroy all the targets by placing the bomb at \\left(1, 2\\right).\n\nSample Input 2\n\n3 3 4\n3 3\n3 1\n1 1\n1 2\n\nSample Output 2\n\n3\n\nSample Input 3\n\n5 5 10\n2 5\n4 3\n2 3\n5 5\n2 2\n5 4\n5 3\n5 1\n3 5\n1 4\n\nSample Output 3\n\n6", "sample_input": "2 3 3\n2 2\n1 1\n1 3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02580", "source_text": "Score : 500 points\n\nProblem Statement\n\nWe have a two-dimensional grid with H \\times W squares. There are M targets to destroy in this grid - the position of the i-th target is \\left(h_i, w_i \\right).\n\nTakahashi will choose one square in this grid, place a bomb there, and ignite it. The bomb will destroy all targets that are in the row or the column where the bomb is placed. It is possible to place the bomb at a square with a target.\n\nTakahashi is trying to maximize the number of targets to destroy. Find the maximum number of targets that can be destroyed.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq H, W \\leq 3 \\times 10^5\n\n1 \\leq M \\leq \\min\\left(H\\times W, 3 \\times 10^5\\right)\n\n1 \\leq h_i \\leq H\n\n1 \\leq w_i \\leq W\n\n\\left(h_i, w_i\\right) \\neq \\left(h_j, w_j\\right) \\left(i \\neq j\\right)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W M\nh_1 w_1\n\\vdots\nh_M w_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 3 3\n2 2\n1 1\n1 3\n\nSample Output 1\n\n3\n\nWe can destroy all the targets by placing the bomb at \\left(1, 2\\right).\n\nSample Input 2\n\n3 3 4\n3 3\n3 1\n1 1\n1 2\n\nSample Output 2\n\n3\n\nSample Input 3\n\n5 5 10\n2 5\n4 3\n2 3\n5 5\n2 2\n5 4\n5 3\n5 1\n3 5\n1 4\n\nSample Output 3\n\n6", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2418, "cpu_time_ms": 378, "memory_kb": 66068}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s242137342", "group_id": "codeNet:p02580", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc Scan() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc iScan() int {\n\tn, _ := strconv.Atoi(Scan())\n\treturn n\n}\nfunc fScan() float64 {\n\tn, _ := strconv.ParseFloat(Scan(), 64)\n\treturn n\n}\nfunc stringToInt(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\nfunc SScan(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = Scan()\n\t}\n\treturn a\n}\nfunc iSScan(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = iScan()\n\t}\n\treturn a\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\nfunc larger(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc smaller(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc max(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x < a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc min(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x > a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc sum(a []int) int {\n\tx := 0\n\tfor _, v := range a {\n\t\tx += v\n\t}\n\treturn x\n}\n\nvar mod int = 1000000007\n\ntype con struct {\n\ta int\n\tb int\n}\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, mod)\n\tsc.Split(bufio.ScanWords)\n\t//予備\n\th := iScan()\n\tw := iScan()\n\tm := iScan()\n\ta := make([]int, m)\n\tb := make([]int, m)\n\n\td1 := map[int]int{}\n\td2 := map[int]int{}\n\tconfirm := map[con]int{}\n\tfor i := 0; i < m; i++ {\n\t\ta[i] = iScan()\n\t\tb[i] = iScan()\n\t\tvar tmp con\n\t\ttmp.a = a[i]\n\t\ttmp.b = b[i]\n\t\t_, ok := confirm[tmp]\n\t\tv1, ok1 := d1[a[i]]\n\t\tv2, ok2 := d2[b[i]]\n\t\tif ok {\n\t\t\tcontinue\n\t\t} else {\n\t\t\tconfirm[tmp] = 1\n\t\t}\n\t\tif ok1 {\n\t\t\td1[a[i]] = v1 + 1\n\t\t} else {\n\t\t\td1[a[i]] = 1\n\t\t}\n\t\tif ok2 {\n\t\t\td2[b[i]] = v2 + 1\n\t\t} else {\n\t\t\td2[b[i]] = 1\n\t\t}\n\t}\n\tmaxA := 0\n\tmaxB := 0\n\n\tvar aitr int\n\tvar bitr int\n\taitr = 0\n\tbitr = 0\n\n\tai := make([]int, 1)\n\tbi := make([]int, 1)\n\tfor i := 1; i <= h; i++ {\n\t\tv, ok := d1[i]\n\t\tif ok {\n\t\t\tif maxA < v {\n\t\t\t\tmaxA = v\n\t\t\t\taitr = i\n\t\t\t\tai = ai[0:1]\n\t\t\t\tai = append(ai, aitr)\n\t\t\t} else if maxA == v {\n\t\t\t\taitr = i\n\t\t\t\tai = append(ai, aitr)\n\t\t\t}\n\t\t} else {\n\t\t\tcontinue\n\t\t}\n\t}\n\tfor i := 1; i <= w; i++ {\n\t\tv, ok := d2[i]\n\t\tif ok {\n\t\t\tif maxB < v {\n\t\t\t\tmaxB = v\n\t\t\t\tbitr = i\n\t\t\t\tbi = bi[0:1]\n\t\t\t\tbi = append(bi, bitr)\n\t\t\t} else if maxB == v {\n\t\t\t\tbitr = i\n\t\t\t\tbi = append(bi, bitr)\n\t\t\t}\n\t\t} else {\n\t\t\tcontinue\n\t\t}\n\t}\n\tans := 0\n\tfor i := 1; i < len(ai); i++ {\n\t\tfor j := 1; j < len(bi); j++ {\n\t\t\tvar tmp con\n\t\t\ttmp.a = ai[i]\n\t\t\ttmp.b = bi[j]\n\t\t\t_, ok := confirm[tmp]\n\t\t\tif ok {\n\t\t\t\tif ans < maxA+maxB-1 {\n\t\t\t\t\tans = maxA + maxB - 1\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tans = maxA + maxB\n\t\t\t\tfmt.Println(ans)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\t//fmt.Println(d1)\n\t//fmt.Println(d2)\n\t//fmt.Println(h, w)\n\t//fmt.Println(aitr, bitr)\n\t//fmt.Println(ai, bi)\n\t//fmt.Println(confirm)\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1598127539, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02580.html", "problem_id": "p02580", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02580/input.txt", "sample_output_relpath": "derived/input_output/data/p02580/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02580/Go/s242137342.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s242137342", "user_id": "u554990639"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc Scan() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc iScan() int {\n\tn, _ := strconv.Atoi(Scan())\n\treturn n\n}\nfunc fScan() float64 {\n\tn, _ := strconv.ParseFloat(Scan(), 64)\n\treturn n\n}\nfunc stringToInt(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\nfunc SScan(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = Scan()\n\t}\n\treturn a\n}\nfunc iSScan(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = iScan()\n\t}\n\treturn a\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\nfunc larger(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc smaller(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc max(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x < a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc min(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x > a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc sum(a []int) int {\n\tx := 0\n\tfor _, v := range a {\n\t\tx += v\n\t}\n\treturn x\n}\n\nvar mod int = 1000000007\n\ntype con struct {\n\ta int\n\tb int\n}\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, mod)\n\tsc.Split(bufio.ScanWords)\n\t//予備\n\th := iScan()\n\tw := iScan()\n\tm := iScan()\n\ta := make([]int, m)\n\tb := make([]int, m)\n\n\td1 := map[int]int{}\n\td2 := map[int]int{}\n\tconfirm := map[con]int{}\n\tfor i := 0; i < m; i++ {\n\t\ta[i] = iScan()\n\t\tb[i] = iScan()\n\t\tvar tmp con\n\t\ttmp.a = a[i]\n\t\ttmp.b = b[i]\n\t\t_, ok := confirm[tmp]\n\t\tv1, ok1 := d1[a[i]]\n\t\tv2, ok2 := d2[b[i]]\n\t\tif ok {\n\t\t\tcontinue\n\t\t} else {\n\t\t\tconfirm[tmp] = 1\n\t\t}\n\t\tif ok1 {\n\t\t\td1[a[i]] = v1 + 1\n\t\t} else {\n\t\t\td1[a[i]] = 1\n\t\t}\n\t\tif ok2 {\n\t\t\td2[b[i]] = v2 + 1\n\t\t} else {\n\t\t\td2[b[i]] = 1\n\t\t}\n\t}\n\tmaxA := 0\n\tmaxB := 0\n\n\tvar aitr int\n\tvar bitr int\n\taitr = 0\n\tbitr = 0\n\n\tai := make([]int, 1)\n\tbi := make([]int, 1)\n\tfor i := 1; i <= h; i++ {\n\t\tv, ok := d1[i]\n\t\tif ok {\n\t\t\tif maxA < v {\n\t\t\t\tmaxA = v\n\t\t\t\taitr = i\n\t\t\t\tai = ai[0:1]\n\t\t\t\tai = append(ai, aitr)\n\t\t\t} else if maxA == v {\n\t\t\t\taitr = i\n\t\t\t\tai = append(ai, aitr)\n\t\t\t}\n\t\t} else {\n\t\t\tcontinue\n\t\t}\n\t}\n\tfor i := 1; i <= w; i++ {\n\t\tv, ok := d2[i]\n\t\tif ok {\n\t\t\tif maxB < v {\n\t\t\t\tmaxB = v\n\t\t\t\tbitr = i\n\t\t\t\tbi = bi[0:1]\n\t\t\t\tbi = append(bi, bitr)\n\t\t\t} else if maxB == v {\n\t\t\t\tbitr = i\n\t\t\t\tbi = append(bi, bitr)\n\t\t\t}\n\t\t} else {\n\t\t\tcontinue\n\t\t}\n\t}\n\tans := 0\n\tfor i := 1; i < len(ai); i++ {\n\t\tfor j := 1; j < len(bi); j++ {\n\t\t\tvar tmp con\n\t\t\ttmp.a = ai[i]\n\t\t\ttmp.b = bi[j]\n\t\t\t_, ok := confirm[tmp]\n\t\t\tif ok {\n\t\t\t\tif ans < maxA+maxB-1 {\n\t\t\t\t\tans = maxA + maxB - 1\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tans = maxA + maxB\n\t\t\t\tfmt.Println(ans)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\t//fmt.Println(d1)\n\t//fmt.Println(d2)\n\t//fmt.Println(h, w)\n\t//fmt.Println(aitr, bitr)\n\t//fmt.Println(ai, bi)\n\t//fmt.Println(confirm)\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nWe have a two-dimensional grid with H \\times W squares. There are M targets to destroy in this grid - the position of the i-th target is \\left(h_i, w_i \\right).\n\nTakahashi will choose one square in this grid, place a bomb there, and ignite it. The bomb will destroy all targets that are in the row or the column where the bomb is placed. It is possible to place the bomb at a square with a target.\n\nTakahashi is trying to maximize the number of targets to destroy. Find the maximum number of targets that can be destroyed.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq H, W \\leq 3 \\times 10^5\n\n1 \\leq M \\leq \\min\\left(H\\times W, 3 \\times 10^5\\right)\n\n1 \\leq h_i \\leq H\n\n1 \\leq w_i \\leq W\n\n\\left(h_i, w_i\\right) \\neq \\left(h_j, w_j\\right) \\left(i \\neq j\\right)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W M\nh_1 w_1\n\\vdots\nh_M w_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 3 3\n2 2\n1 1\n1 3\n\nSample Output 1\n\n3\n\nWe can destroy all the targets by placing the bomb at \\left(1, 2\\right).\n\nSample Input 2\n\n3 3 4\n3 3\n3 1\n1 1\n1 2\n\nSample Output 2\n\n3\n\nSample Input 3\n\n5 5 10\n2 5\n4 3\n2 3\n5 5\n2 2\n5 4\n5 3\n5 1\n3 5\n1 4\n\nSample Output 3\n\n6", "sample_input": "2 3 3\n2 2\n1 1\n1 3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02580", "source_text": "Score : 500 points\n\nProblem Statement\n\nWe have a two-dimensional grid with H \\times W squares. There are M targets to destroy in this grid - the position of the i-th target is \\left(h_i, w_i \\right).\n\nTakahashi will choose one square in this grid, place a bomb there, and ignite it. The bomb will destroy all targets that are in the row or the column where the bomb is placed. It is possible to place the bomb at a square with a target.\n\nTakahashi is trying to maximize the number of targets to destroy. Find the maximum number of targets that can be destroyed.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq H, W \\leq 3 \\times 10^5\n\n1 \\leq M \\leq \\min\\left(H\\times W, 3 \\times 10^5\\right)\n\n1 \\leq h_i \\leq H\n\n1 \\leq w_i \\leq W\n\n\\left(h_i, w_i\\right) \\neq \\left(h_j, w_j\\right) \\left(i \\neq j\\right)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W M\nh_1 w_1\n\\vdots\nh_M w_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 3 3\n2 2\n1 1\n1 3\n\nSample Output 1\n\n3\n\nWe can destroy all the targets by placing the bomb at \\left(1, 2\\right).\n\nSample Input 2\n\n3 3 4\n3 3\n3 1\n1 1\n1 2\n\nSample Output 2\n\n3\n\nSample Input 3\n\n5 5 10\n2 5\n4 3\n2 3\n5 5\n2 2\n5 4\n5 3\n5 1\n3 5\n1 4\n\nSample Output 3\n\n6", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2802, "cpu_time_ms": 417, "memory_kb": 91340}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s409516554", "group_id": "codeNet:p02580", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\th := nextInt()\n\tw := nextInt()\n\tm := nextInt()\n\t\n\thArr := make([]int, h)\n\twArr := make([]int, w)\n\tsave := map[[2]int]int{}\n\thMax := 0\n\tmaxIndex := 0\n\twMax := 0\n\tmaxWIndex := 0\n\tfor i := 0; i < m; i++ {\n\t\tww := nextInt()\n\t\thh := nextInt()\n\t\tsave[[2]int{ww, hh}] = 1\n\t\thArr[ww-1]++\n\t\tif hArr[ww-1] > hMax {\n\t\t\thMax = hArr[ww-1]\n\t\t\tmaxIndex = ww - 1\n\t\t}\n\t\twArr[hh-1]++\n\t\tif wArr[hh-1] > wMax {\n\t\t\twMax = wArr[hh-1]\n\t\t\tmaxWIndex = hh - 1\n\t\t}\n\t}\n\n\txx := 0\n\tif save[[2]int{maxIndex, maxWIndex}] != 0 {\n\t\txx++\n\t}\n\n\tfmt.Println(wMax + hMax - xx)\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n", "language": "Go", "metadata": {"date": 1598127433, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02580.html", "problem_id": "p02580", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02580/input.txt", "sample_output_relpath": "derived/input_output/data/p02580/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02580/Go/s409516554.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s409516554", "user_id": "u507027929"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\th := nextInt()\n\tw := nextInt()\n\tm := nextInt()\n\t\n\thArr := make([]int, h)\n\twArr := make([]int, w)\n\tsave := map[[2]int]int{}\n\thMax := 0\n\tmaxIndex := 0\n\twMax := 0\n\tmaxWIndex := 0\n\tfor i := 0; i < m; i++ {\n\t\tww := nextInt()\n\t\thh := nextInt()\n\t\tsave[[2]int{ww, hh}] = 1\n\t\thArr[ww-1]++\n\t\tif hArr[ww-1] > hMax {\n\t\t\thMax = hArr[ww-1]\n\t\t\tmaxIndex = ww - 1\n\t\t}\n\t\twArr[hh-1]++\n\t\tif wArr[hh-1] > wMax {\n\t\t\twMax = wArr[hh-1]\n\t\t\tmaxWIndex = hh - 1\n\t\t}\n\t}\n\n\txx := 0\n\tif save[[2]int{maxIndex, maxWIndex}] != 0 {\n\t\txx++\n\t}\n\n\tfmt.Println(wMax + hMax - xx)\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nWe have a two-dimensional grid with H \\times W squares. There are M targets to destroy in this grid - the position of the i-th target is \\left(h_i, w_i \\right).\n\nTakahashi will choose one square in this grid, place a bomb there, and ignite it. The bomb will destroy all targets that are in the row or the column where the bomb is placed. It is possible to place the bomb at a square with a target.\n\nTakahashi is trying to maximize the number of targets to destroy. Find the maximum number of targets that can be destroyed.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq H, W \\leq 3 \\times 10^5\n\n1 \\leq M \\leq \\min\\left(H\\times W, 3 \\times 10^5\\right)\n\n1 \\leq h_i \\leq H\n\n1 \\leq w_i \\leq W\n\n\\left(h_i, w_i\\right) \\neq \\left(h_j, w_j\\right) \\left(i \\neq j\\right)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W M\nh_1 w_1\n\\vdots\nh_M w_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 3 3\n2 2\n1 1\n1 3\n\nSample Output 1\n\n3\n\nWe can destroy all the targets by placing the bomb at \\left(1, 2\\right).\n\nSample Input 2\n\n3 3 4\n3 3\n3 1\n1 1\n1 2\n\nSample Output 2\n\n3\n\nSample Input 3\n\n5 5 10\n2 5\n4 3\n2 3\n5 5\n2 2\n5 4\n5 3\n5 1\n3 5\n1 4\n\nSample Output 3\n\n6", "sample_input": "2 3 3\n2 2\n1 1\n1 3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02580", "source_text": "Score : 500 points\n\nProblem Statement\n\nWe have a two-dimensional grid with H \\times W squares. There are M targets to destroy in this grid - the position of the i-th target is \\left(h_i, w_i \\right).\n\nTakahashi will choose one square in this grid, place a bomb there, and ignite it. The bomb will destroy all targets that are in the row or the column where the bomb is placed. It is possible to place the bomb at a square with a target.\n\nTakahashi is trying to maximize the number of targets to destroy. Find the maximum number of targets that can be destroyed.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq H, W \\leq 3 \\times 10^5\n\n1 \\leq M \\leq \\min\\left(H\\times W, 3 \\times 10^5\\right)\n\n1 \\leq h_i \\leq H\n\n1 \\leq w_i \\leq W\n\n\\left(h_i, w_i\\right) \\neq \\left(h_j, w_j\\right) \\left(i \\neq j\\right)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W M\nh_1 w_1\n\\vdots\nh_M w_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 3 3\n2 2\n1 1\n1 3\n\nSample Output 1\n\n3\n\nWe can destroy all the targets by placing the bomb at \\left(1, 2\\right).\n\nSample Input 2\n\n3 3 4\n3 3\n3 1\n1 1\n1 2\n\nSample Output 2\n\n3\n\nSample Input 3\n\n5 5 10\n2 5\n4 3\n2 3\n5 5\n2 2\n5 4\n5 3\n5 1\n3 5\n1 4\n\nSample Output 3\n\n6", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 785, "cpu_time_ms": 176, "memory_kb": 37208}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s007707413", "group_id": "codeNet:p02580", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\nfunc main() {\n\tH, W, M := ReadInt(), ReadInt(), ReadInt()\n\tgrid := make([][]bool, H)\n\tfor i := 0; i < H; i++ {\n\t\tgrid[i] = make([]bool, W)\n\t}\n\tcx := make([]int, W)\n\tcy := make([]int, H)\n\tfor i := 0; i < M; i++ {\n\t\ty, x := ReadInt()-1, ReadInt()-1\n\t\tcx[x]++\n\t\tcy[y]++\n\t\tgrid[y][x] = true\n\t}\n\n\txidx := make([]int, W)\n\tfor i := 0; i < W; i++ {\n\t\txidx[i] = i\n\t}\n\tyidx := make([]int, H)\n\tfor i := 0; i < H; i++ {\n\t\tyidx[i] = i\n\t}\n\n\tsort.Slice(xidx, func(i, j int) bool {\n\t\treturn cx[xidx[i]] > cx[xidx[j]]\n\t})\n\tsort.Slice(yidx, func(i, j int) bool {\n\t\treturn cy[yidx[i]] > cy[yidx[j]]\n\t})\n\n\tmaxCx := cx[xidx[0]]\n\tmaxCy := cy[yidx[0]]\n\tmaxSum := maxCx + maxCy - 1\n\tfor xi := 0; xi < W; xi++ {\n\t\tx := xidx[xi]\n\t\tif cx[x] != maxCx {\n\t\t\tbreak\n\t\t}\n\t\tfor yi := 0; yi < H; yi++ {\n\t\t\ty := yidx[yi]\n\t\t\tif cy[y] != maxCy {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif !grid[y][x] {\n\t\t\t\tfmt.Println(cx[x] + cy[y])\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(maxSum)\n}\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadString() (s string) { Scan(&s); return }\nfunc ReadInts(n int) []int {\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tScan(&v[i])\n\t}\n\treturn v\n}\n", "language": "Go", "metadata": {"date": 1598127356, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02580.html", "problem_id": "p02580", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02580/input.txt", "sample_output_relpath": "derived/input_output/data/p02580/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02580/Go/s007707413.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s007707413", "user_id": "u328656362"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\nfunc main() {\n\tH, W, M := ReadInt(), ReadInt(), ReadInt()\n\tgrid := make([][]bool, H)\n\tfor i := 0; i < H; i++ {\n\t\tgrid[i] = make([]bool, W)\n\t}\n\tcx := make([]int, W)\n\tcy := make([]int, H)\n\tfor i := 0; i < M; i++ {\n\t\ty, x := ReadInt()-1, ReadInt()-1\n\t\tcx[x]++\n\t\tcy[y]++\n\t\tgrid[y][x] = true\n\t}\n\n\txidx := make([]int, W)\n\tfor i := 0; i < W; i++ {\n\t\txidx[i] = i\n\t}\n\tyidx := make([]int, H)\n\tfor i := 0; i < H; i++ {\n\t\tyidx[i] = i\n\t}\n\n\tsort.Slice(xidx, func(i, j int) bool {\n\t\treturn cx[xidx[i]] > cx[xidx[j]]\n\t})\n\tsort.Slice(yidx, func(i, j int) bool {\n\t\treturn cy[yidx[i]] > cy[yidx[j]]\n\t})\n\n\tmaxCx := cx[xidx[0]]\n\tmaxCy := cy[yidx[0]]\n\tmaxSum := maxCx + maxCy - 1\n\tfor xi := 0; xi < W; xi++ {\n\t\tx := xidx[xi]\n\t\tif cx[x] != maxCx {\n\t\t\tbreak\n\t\t}\n\t\tfor yi := 0; yi < H; yi++ {\n\t\t\ty := yidx[yi]\n\t\t\tif cy[y] != maxCy {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif !grid[y][x] {\n\t\t\t\tfmt.Println(cx[x] + cy[y])\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(maxSum)\n}\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadString() (s string) { Scan(&s); return }\nfunc ReadInts(n int) []int {\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tScan(&v[i])\n\t}\n\treturn v\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nWe have a two-dimensional grid with H \\times W squares. There are M targets to destroy in this grid - the position of the i-th target is \\left(h_i, w_i \\right).\n\nTakahashi will choose one square in this grid, place a bomb there, and ignite it. The bomb will destroy all targets that are in the row or the column where the bomb is placed. It is possible to place the bomb at a square with a target.\n\nTakahashi is trying to maximize the number of targets to destroy. Find the maximum number of targets that can be destroyed.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq H, W \\leq 3 \\times 10^5\n\n1 \\leq M \\leq \\min\\left(H\\times W, 3 \\times 10^5\\right)\n\n1 \\leq h_i \\leq H\n\n1 \\leq w_i \\leq W\n\n\\left(h_i, w_i\\right) \\neq \\left(h_j, w_j\\right) \\left(i \\neq j\\right)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W M\nh_1 w_1\n\\vdots\nh_M w_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 3 3\n2 2\n1 1\n1 3\n\nSample Output 1\n\n3\n\nWe can destroy all the targets by placing the bomb at \\left(1, 2\\right).\n\nSample Input 2\n\n3 3 4\n3 3\n3 1\n1 1\n1 2\n\nSample Output 2\n\n3\n\nSample Input 3\n\n5 5 10\n2 5\n4 3\n2 3\n5 5\n2 2\n5 4\n5 3\n5 1\n3 5\n1 4\n\nSample Output 3\n\n6", "sample_input": "2 3 3\n2 2\n1 1\n1 3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02580", "source_text": "Score : 500 points\n\nProblem Statement\n\nWe have a two-dimensional grid with H \\times W squares. There are M targets to destroy in this grid - the position of the i-th target is \\left(h_i, w_i \\right).\n\nTakahashi will choose one square in this grid, place a bomb there, and ignite it. The bomb will destroy all targets that are in the row or the column where the bomb is placed. It is possible to place the bomb at a square with a target.\n\nTakahashi is trying to maximize the number of targets to destroy. Find the maximum number of targets that can be destroyed.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq H, W \\leq 3 \\times 10^5\n\n1 \\leq M \\leq \\min\\left(H\\times W, 3 \\times 10^5\\right)\n\n1 \\leq h_i \\leq H\n\n1 \\leq w_i \\leq W\n\n\\left(h_i, w_i\\right) \\neq \\left(h_j, w_j\\right) \\left(i \\neq j\\right)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W M\nh_1 w_1\n\\vdots\nh_M w_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 3 3\n2 2\n1 1\n1 3\n\nSample Output 1\n\n3\n\nWe can destroy all the targets by placing the bomb at \\left(1, 2\\right).\n\nSample Input 2\n\n3 3 4\n3 3\n3 1\n1 1\n1 2\n\nSample Output 2\n\n3\n\nSample Input 3\n\n5 5 10\n2 5\n4 3\n2 3\n5 5\n2 2\n5 4\n5 3\n5 1\n3 5\n1 4\n\nSample Output 3\n\n6", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1322, "cpu_time_ms": 3508, "memory_kb": 3511876}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s484840028", "group_id": "codeNet:p02580", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\tsc.Buffer(make([]byte, 0), 1e6) // maxTokenSize\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush()\n\t/* --- code --- */\n\tH, W, M := nextInt(), nextInt(), nextInt()\n\thn := make([]int, H)\n\twn := make([]int, W)\n\tgrid := make([][]int, H)\n\tfor i := 0; i < H; i++ {\n\t\tgrid[i] = make([]int, W)\n\t}\n\n\tfor i := 0; i < M; i++ {\n\t\th, w := nextInt(), nextInt()\n\t\tgrid[h-1][w-1] = 1\n\t\thn[h-1]++\n\t\twn[w-1]++\n\t}\n\thi, hx := arrMax(hn)\n\n\tfor i := 0; i < W; i++ {\n\t\tif grid[hi][i] == 1 {\n\t\t\twn[i]--\n\t\t}\n\t}\n\n\t_, wx := arrMax(wn)\n\tans := hx + wx\n\n\t// fmt.Println(\"hi\", hi)\n\t// fmt.Println(\"hx\", hx)\n\t// fmt.Println(\"wi\", wi)\n\t// fmt.Println(\"wx\", wx)\n\t// fmt.Println(hn, wn)\n\n\tfmt.Println(ans)\n\n}\n\nfunc arrMax(arr []int) (int, int) {\n\tvar max int = arr[0]\n\tvar maxI int = 0\n\tfor ind, val := range arr {\n\t\tif max < val {\n\t\t\tmax = val\n\t\t\tmaxI = ind\n\t\t}\n\t}\n\treturn maxI, max\n}\n\n// -*-*-*-*-*-*-*-*-\n// * I/O utilities *\n// -*-*-*-*-*-*-*-*-\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextInt64() int64 {\n\ta, _ := strconv.ParseInt(next(), 10, 64)\n\treturn a\n}\n\nfunc nextFloat64() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\nfunc nextFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextFloat64()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\nfunc split(s string) []string {\n\tret := make([]string, len([]rune(s)))\n\tfor i, v := range []rune(s) {\n\t\tret[i] = string(v)\n\t}\n\treturn ret\n}\n\n// -*-*-*-*-*-*-*-*-\n// * tool snippets *\n// -*-*-*-*-*-*-*-*-\nfunc duplicate2Int(base [][]int) (ret [][]int) {\n\tret = make([][]int, len(base))\n\tfor i, v := range base {\n\t\tret[i] = append([]int{}, v...)\n\t}\n\treturn\n}\n\nfunc max(a, b int) int {\n\treturn int(max64(int64(a), int64(b)))\n}\n\nfunc max64(a int64, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc min(a, b int) int {\n\treturn int(min64(int64(a), int64(b)))\n}\n\nfunc min64(a int64, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-\n// * math flavor typical theories *\n// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-\nfunc gcd(a, b int) int {\n\tif a > b {\n\t\treturn gcd(b, a)\n\t}\n\tfor a != 0 {\n\t\ta, b = b%a, a\n\t}\n\treturn b\n}\n\nfunc pow(a, b int) (ret int) {\n\tret = a\n\tfor i := 0; i < b-1; i++ {\n\t\tret *= a\n\t}\n\treturn\n}\n\nfunc powMod(n, m, mod int) (ret int) {\n\tret = 1\n\tfor m > 0 {\n\t\tif m&1 == 1 {\n\t\t\tret *= n\n\t\t\tret %= mod\n\t\t}\n\t\tn *= n\n\t\tn %= mod\n\t\tm >>= 1\n\t}\n\treturn ret\n}\n", "language": "Go", "metadata": {"date": 1598125353, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02580.html", "problem_id": "p02580", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02580/input.txt", "sample_output_relpath": "derived/input_output/data/p02580/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02580/Go/s484840028.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s484840028", "user_id": "u532762536"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\tsc.Buffer(make([]byte, 0), 1e6) // maxTokenSize\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush()\n\t/* --- code --- */\n\tH, W, M := nextInt(), nextInt(), nextInt()\n\thn := make([]int, H)\n\twn := make([]int, W)\n\tgrid := make([][]int, H)\n\tfor i := 0; i < H; i++ {\n\t\tgrid[i] = make([]int, W)\n\t}\n\n\tfor i := 0; i < M; i++ {\n\t\th, w := nextInt(), nextInt()\n\t\tgrid[h-1][w-1] = 1\n\t\thn[h-1]++\n\t\twn[w-1]++\n\t}\n\thi, hx := arrMax(hn)\n\n\tfor i := 0; i < W; i++ {\n\t\tif grid[hi][i] == 1 {\n\t\t\twn[i]--\n\t\t}\n\t}\n\n\t_, wx := arrMax(wn)\n\tans := hx + wx\n\n\t// fmt.Println(\"hi\", hi)\n\t// fmt.Println(\"hx\", hx)\n\t// fmt.Println(\"wi\", wi)\n\t// fmt.Println(\"wx\", wx)\n\t// fmt.Println(hn, wn)\n\n\tfmt.Println(ans)\n\n}\n\nfunc arrMax(arr []int) (int, int) {\n\tvar max int = arr[0]\n\tvar maxI int = 0\n\tfor ind, val := range arr {\n\t\tif max < val {\n\t\t\tmax = val\n\t\t\tmaxI = ind\n\t\t}\n\t}\n\treturn maxI, max\n}\n\n// -*-*-*-*-*-*-*-*-\n// * I/O utilities *\n// -*-*-*-*-*-*-*-*-\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextInt64() int64 {\n\ta, _ := strconv.ParseInt(next(), 10, 64)\n\treturn a\n}\n\nfunc nextFloat64() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\nfunc nextFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextFloat64()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\nfunc split(s string) []string {\n\tret := make([]string, len([]rune(s)))\n\tfor i, v := range []rune(s) {\n\t\tret[i] = string(v)\n\t}\n\treturn ret\n}\n\n// -*-*-*-*-*-*-*-*-\n// * tool snippets *\n// -*-*-*-*-*-*-*-*-\nfunc duplicate2Int(base [][]int) (ret [][]int) {\n\tret = make([][]int, len(base))\n\tfor i, v := range base {\n\t\tret[i] = append([]int{}, v...)\n\t}\n\treturn\n}\n\nfunc max(a, b int) int {\n\treturn int(max64(int64(a), int64(b)))\n}\n\nfunc max64(a int64, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc min(a, b int) int {\n\treturn int(min64(int64(a), int64(b)))\n}\n\nfunc min64(a int64, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-\n// * math flavor typical theories *\n// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-\nfunc gcd(a, b int) int {\n\tif a > b {\n\t\treturn gcd(b, a)\n\t}\n\tfor a != 0 {\n\t\ta, b = b%a, a\n\t}\n\treturn b\n}\n\nfunc pow(a, b int) (ret int) {\n\tret = a\n\tfor i := 0; i < b-1; i++ {\n\t\tret *= a\n\t}\n\treturn\n}\n\nfunc powMod(n, m, mod int) (ret int) {\n\tret = 1\n\tfor m > 0 {\n\t\tif m&1 == 1 {\n\t\t\tret *= n\n\t\t\tret %= mod\n\t\t}\n\t\tn *= n\n\t\tn %= mod\n\t\tm >>= 1\n\t}\n\treturn ret\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nWe have a two-dimensional grid with H \\times W squares. There are M targets to destroy in this grid - the position of the i-th target is \\left(h_i, w_i \\right).\n\nTakahashi will choose one square in this grid, place a bomb there, and ignite it. The bomb will destroy all targets that are in the row or the column where the bomb is placed. It is possible to place the bomb at a square with a target.\n\nTakahashi is trying to maximize the number of targets to destroy. Find the maximum number of targets that can be destroyed.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq H, W \\leq 3 \\times 10^5\n\n1 \\leq M \\leq \\min\\left(H\\times W, 3 \\times 10^5\\right)\n\n1 \\leq h_i \\leq H\n\n1 \\leq w_i \\leq W\n\n\\left(h_i, w_i\\right) \\neq \\left(h_j, w_j\\right) \\left(i \\neq j\\right)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W M\nh_1 w_1\n\\vdots\nh_M w_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 3 3\n2 2\n1 1\n1 3\n\nSample Output 1\n\n3\n\nWe can destroy all the targets by placing the bomb at \\left(1, 2\\right).\n\nSample Input 2\n\n3 3 4\n3 3\n3 1\n1 1\n1 2\n\nSample Output 2\n\n3\n\nSample Input 3\n\n5 5 10\n2 5\n4 3\n2 3\n5 5\n2 2\n5 4\n5 3\n5 1\n3 5\n1 4\n\nSample Output 3\n\n6", "sample_input": "2 3 3\n2 2\n1 1\n1 3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02580", "source_text": "Score : 500 points\n\nProblem Statement\n\nWe have a two-dimensional grid with H \\times W squares. There are M targets to destroy in this grid - the position of the i-th target is \\left(h_i, w_i \\right).\n\nTakahashi will choose one square in this grid, place a bomb there, and ignite it. The bomb will destroy all targets that are in the row or the column where the bomb is placed. It is possible to place the bomb at a square with a target.\n\nTakahashi is trying to maximize the number of targets to destroy. Find the maximum number of targets that can be destroyed.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq H, W \\leq 3 \\times 10^5\n\n1 \\leq M \\leq \\min\\left(H\\times W, 3 \\times 10^5\\right)\n\n1 \\leq h_i \\leq H\n\n1 \\leq w_i \\leq W\n\n\\left(h_i, w_i\\right) \\neq \\left(h_j, w_j\\right) \\left(i \\neq j\\right)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W M\nh_1 w_1\n\\vdots\nh_M w_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 3 3\n2 2\n1 1\n1 3\n\nSample Output 1\n\n3\n\nWe can destroy all the targets by placing the bomb at \\left(1, 2\\right).\n\nSample Input 2\n\n3 3 4\n3 3\n3 1\n1 1\n1 2\n\nSample Output 2\n\n3\n\nSample Input 3\n\n5 5 10\n2 5\n4 3\n2 3\n5 5\n2 2\n5 4\n5 3\n5 1\n3 5\n1 4\n\nSample Output 3\n\n6", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2812, "cpu_time_ms": 3646, "memory_kb": 3530568}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s110515062", "group_id": "codeNet:p02612", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tif n%1000 == 0 {\n\t\tfmt.Println(0)\n\t} else {\n\t\tfmt.Println(1000 - n%1000)\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1597369331, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02612.html", "problem_id": "p02612", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02612/input.txt", "sample_output_relpath": "derived/input_output/data/p02612/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02612/Go/s110515062.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s110515062", "user_id": "u061804469"}, "prompt_components": {"gold_output": "100\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tif n%1000 == 0 {\n\t\tfmt.Println(0)\n\t} else {\n\t\tfmt.Println(1000 - n%1000)\n\t}\n\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe will buy a product for N yen (the currency of Japan) at a shop.\n\nIf we use only 1000-yen bills to pay the price, how much change will we receive?\n\nAssume we use the minimum number of bills required.\n\nConstraints\n\n1 \\leq N \\leq 10000\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 amount of change as an integer.\n\nSample Input 1\n\n1900\n\nSample Output 1\n\n100\n\nWe will use two 1000-yen bills to pay the price and receive 100 yen in change.\n\nSample Input 2\n\n3000\n\nSample Output 2\n\n0\n\nWe can pay the exact price.", "sample_input": "1900\n"}, "reference_outputs": ["100\n"], "source_document_id": "p02612", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe will buy a product for N yen (the currency of Japan) at a shop.\n\nIf we use only 1000-yen bills to pay the price, how much change will we receive?\n\nAssume we use the minimum number of bills required.\n\nConstraints\n\n1 \\leq N \\leq 10000\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 amount of change as an integer.\n\nSample Input 1\n\n1900\n\nSample Output 1\n\n100\n\nWe will use two 1000-yen bills to pay the price and receive 100 yen in change.\n\nSample Input 2\n\n3000\n\nSample Output 2\n\n0\n\nWe can pay the exact price.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1772}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s507772601", "group_id": "codeNet:p02612", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar i int\n\tfmt.Scan(&i)\n\n\tresult := i % 1000\n\n\tfmt.Println(result)\n}", "language": "Go", "metadata": {"date": 1596338774, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02612.html", "problem_id": "p02612", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02612/input.txt", "sample_output_relpath": "derived/input_output/data/p02612/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02612/Go/s507772601.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s507772601", "user_id": "u116616101"}, "prompt_components": {"gold_output": "100\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar i int\n\tfmt.Scan(&i)\n\n\tresult := i % 1000\n\n\tfmt.Println(result)\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe will buy a product for N yen (the currency of Japan) at a shop.\n\nIf we use only 1000-yen bills to pay the price, how much change will we receive?\n\nAssume we use the minimum number of bills required.\n\nConstraints\n\n1 \\leq N \\leq 10000\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 amount of change as an integer.\n\nSample Input 1\n\n1900\n\nSample Output 1\n\n100\n\nWe will use two 1000-yen bills to pay the price and receive 100 yen in change.\n\nSample Input 2\n\n3000\n\nSample Output 2\n\n0\n\nWe can pay the exact price.", "sample_input": "1900\n"}, "reference_outputs": ["100\n"], "source_document_id": "p02612", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe will buy a product for N yen (the currency of Japan) at a shop.\n\nIf we use only 1000-yen bills to pay the price, how much change will we receive?\n\nAssume we use the minimum number of bills required.\n\nConstraints\n\n1 \\leq N \\leq 10000\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 amount of change as an integer.\n\nSample Input 1\n\n1900\n\nSample Output 1\n\n100\n\nWe will use two 1000-yen bills to pay the price and receive 100 yen in change.\n\nSample Input 2\n\n3000\n\nSample Output 2\n\n0\n\nWe can pay the exact price.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 7, "memory_kb": 1768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s448224054", "group_id": "codeNet:p02612", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tN int\n)\n\nfunc main() {\n\treadVariables()\n\tvar answer int\n\trem := N % 1000\n\tif rem != 0 {\n\t\tanswer = 1000 - rem\n\t}\n\tfmt.Println(answer)\n}\n\nfunc readVariables() {\n\tN = nextInt()\n\n}\n\n/* Template */\n\nvar scanner *bufio.Scanner\n\nfunc init() {\n\tMax := 1001001\n\tscanner = bufio.NewScanner(os.Stdin)\n\tscanner.Buffer(make([]byte, 0, Max), Max)\n\tscanner.Split(bufio.ScanWords)\n}\n\n//nextInt converts next token from stdin and returns integer value.\n//nextInt panics when conversion into an integer fails.\nfunc nextInt() int {\n\tif !scanner.Scan() {\n\t\tpanic(\"No more token.\")\n\t}\n\tnum, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tpanic(\"nextInt(): cannot convert to int: \" + scanner.Text())\n\t}\n\treturn num\n}\n\nfunc nextStr() string {\n\tif !scanner.Scan() {\n\t\tpanic(\"No more token.\")\n\t}\n\treturn scanner.Text()\n}\n\n// MinInt returns minimum argument\nfunc MinInt(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t} else {\n\t\treturn y\n\t}\n}\n\n//MaxInt returns maximum argument\nfunc MaxInt(x, y int) int {\n\tif x < y {\n\t\treturn y\n\t} else {\n\t\treturn x\n\t}\n}\n\n//AbsInt returns |x| for x\nfunc AbsInt(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\n//ModPow calculates integer power with modulo operation\n//if modulo <= 1, it powers w/o module operation\n//if base < 0, return value might be negative too.\nfunc ModPow(base, exponent, modulo int) (result int) {\n\tresult = 1\n\tfor exponent > 0 {\n\t\tif exponent%2 == 1 {\n\t\t\tresult *= base\n\t\t\tif modulo > 1 {\n\t\t\t\tresult %= modulo\n\t\t\t}\n\t\t}\n\t\tbase *= base\n\t\tif modulo > 1 {\n\t\t\tbase %= modulo\n\t\t}\n\t\texponent /= 2\n\t}\n\treturn\n}\n\n//Gcd\nfunc Gcd(vals ...int) (result int) {\n\tif len(vals) == 0 {\n\t\treturn\n\t}\n\tresult = vals[0]\n\tfor i := 1; i < len(vals); i++ {\n\t\tresult = gcd(result, vals[i])\n\t}\n\treturn\n}\n\nfunc gcd(x, y int) int {\n\tx, y = AbsInt(x), AbsInt(y)\n\tfor y > 0 {\n\t\tx, y = y, x%y\n\t}\n\treturn x\n}\n\n//Lcm\nfunc Lcm(vals ...int) (result int) {\n\tif len(vals) == 0 {\n\t\treturn\n\t}\n\tresult = vals[0]\n\tfor i := 1; i < len(vals); i++ {\n\t\tresult = lcm(result, vals[i])\n\t}\n\treturn\n}\n\nfunc lcm(x, y int) int {\n\treturn x * y / gcd(x, y)\n}\n", "language": "Go", "metadata": {"date": 1594689915, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02612.html", "problem_id": "p02612", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02612/input.txt", "sample_output_relpath": "derived/input_output/data/p02612/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02612/Go/s448224054.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s448224054", "user_id": "u390694622"}, "prompt_components": {"gold_output": "100\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tN int\n)\n\nfunc main() {\n\treadVariables()\n\tvar answer int\n\trem := N % 1000\n\tif rem != 0 {\n\t\tanswer = 1000 - rem\n\t}\n\tfmt.Println(answer)\n}\n\nfunc readVariables() {\n\tN = nextInt()\n\n}\n\n/* Template */\n\nvar scanner *bufio.Scanner\n\nfunc init() {\n\tMax := 1001001\n\tscanner = bufio.NewScanner(os.Stdin)\n\tscanner.Buffer(make([]byte, 0, Max), Max)\n\tscanner.Split(bufio.ScanWords)\n}\n\n//nextInt converts next token from stdin and returns integer value.\n//nextInt panics when conversion into an integer fails.\nfunc nextInt() int {\n\tif !scanner.Scan() {\n\t\tpanic(\"No more token.\")\n\t}\n\tnum, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tpanic(\"nextInt(): cannot convert to int: \" + scanner.Text())\n\t}\n\treturn num\n}\n\nfunc nextStr() string {\n\tif !scanner.Scan() {\n\t\tpanic(\"No more token.\")\n\t}\n\treturn scanner.Text()\n}\n\n// MinInt returns minimum argument\nfunc MinInt(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t} else {\n\t\treturn y\n\t}\n}\n\n//MaxInt returns maximum argument\nfunc MaxInt(x, y int) int {\n\tif x < y {\n\t\treturn y\n\t} else {\n\t\treturn x\n\t}\n}\n\n//AbsInt returns |x| for x\nfunc AbsInt(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\n//ModPow calculates integer power with modulo operation\n//if modulo <= 1, it powers w/o module operation\n//if base < 0, return value might be negative too.\nfunc ModPow(base, exponent, modulo int) (result int) {\n\tresult = 1\n\tfor exponent > 0 {\n\t\tif exponent%2 == 1 {\n\t\t\tresult *= base\n\t\t\tif modulo > 1 {\n\t\t\t\tresult %= modulo\n\t\t\t}\n\t\t}\n\t\tbase *= base\n\t\tif modulo > 1 {\n\t\t\tbase %= modulo\n\t\t}\n\t\texponent /= 2\n\t}\n\treturn\n}\n\n//Gcd\nfunc Gcd(vals ...int) (result int) {\n\tif len(vals) == 0 {\n\t\treturn\n\t}\n\tresult = vals[0]\n\tfor i := 1; i < len(vals); i++ {\n\t\tresult = gcd(result, vals[i])\n\t}\n\treturn\n}\n\nfunc gcd(x, y int) int {\n\tx, y = AbsInt(x), AbsInt(y)\n\tfor y > 0 {\n\t\tx, y = y, x%y\n\t}\n\treturn x\n}\n\n//Lcm\nfunc Lcm(vals ...int) (result int) {\n\tif len(vals) == 0 {\n\t\treturn\n\t}\n\tresult = vals[0]\n\tfor i := 1; i < len(vals); i++ {\n\t\tresult = lcm(result, vals[i])\n\t}\n\treturn\n}\n\nfunc lcm(x, y int) int {\n\treturn x * y / gcd(x, y)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe will buy a product for N yen (the currency of Japan) at a shop.\n\nIf we use only 1000-yen bills to pay the price, how much change will we receive?\n\nAssume we use the minimum number of bills required.\n\nConstraints\n\n1 \\leq N \\leq 10000\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 amount of change as an integer.\n\nSample Input 1\n\n1900\n\nSample Output 1\n\n100\n\nWe will use two 1000-yen bills to pay the price and receive 100 yen in change.\n\nSample Input 2\n\n3000\n\nSample Output 2\n\n0\n\nWe can pay the exact price.", "sample_input": "1900\n"}, "reference_outputs": ["100\n"], "source_document_id": "p02612", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe will buy a product for N yen (the currency of Japan) at a shop.\n\nIf we use only 1000-yen bills to pay the price, how much change will we receive?\n\nAssume we use the minimum number of bills required.\n\nConstraints\n\n1 \\leq N \\leq 10000\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 amount of change as an integer.\n\nSample Input 1\n\n1900\n\nSample Output 1\n\n100\n\nWe will use two 1000-yen bills to pay the price and receive 100 yen in change.\n\nSample Input 2\n\n3000\n\nSample Output 2\n\n0\n\nWe can pay the exact price.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2107, "cpu_time_ms": 4, "memory_kb": 1804}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s256759097", "group_id": "codeNet:p02612", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\n/* 一つ読み */\nfunc scanText() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc scanInt() int {\n\tsc.Scan()\n\ta, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\treturn a\n}\nfunc scanFloat() float64 {\n\tsc.Scan()\n\ta, err := strconv.ParseFloat(sc.Text(), 64)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\treturn a\n}\n\n/* 複数読み */\nfunc scanTextSlice(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = scanText()\n\t}\n\treturn a\n}\nfunc scanSlice(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = scanInt()\n\t}\n\treturn a\n}\nfunc scanFloatSlice(n int) []float64 {\n\ta := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = scanFloat()\n\t}\n\treturn a\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := scanInt()\n\tbill := (n / 1000) + 1\n\n\tfmt.Println(bill * 1000 - n) \n\t\n\n}", "language": "Go", "metadata": {"date": 1594669233, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02612.html", "problem_id": "p02612", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02612/input.txt", "sample_output_relpath": "derived/input_output/data/p02612/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02612/Go/s256759097.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s256759097", "user_id": "u742001194"}, "prompt_components": {"gold_output": "100\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\n/* 一つ読み */\nfunc scanText() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc scanInt() int {\n\tsc.Scan()\n\ta, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\treturn a\n}\nfunc scanFloat() float64 {\n\tsc.Scan()\n\ta, err := strconv.ParseFloat(sc.Text(), 64)\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\treturn a\n}\n\n/* 複数読み */\nfunc scanTextSlice(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = scanText()\n\t}\n\treturn a\n}\nfunc scanSlice(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = scanInt()\n\t}\n\treturn a\n}\nfunc scanFloatSlice(n int) []float64 {\n\ta := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = scanFloat()\n\t}\n\treturn a\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := scanInt()\n\tbill := (n / 1000) + 1\n\n\tfmt.Println(bill * 1000 - n) \n\t\n\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe will buy a product for N yen (the currency of Japan) at a shop.\n\nIf we use only 1000-yen bills to pay the price, how much change will we receive?\n\nAssume we use the minimum number of bills required.\n\nConstraints\n\n1 \\leq N \\leq 10000\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 amount of change as an integer.\n\nSample Input 1\n\n1900\n\nSample Output 1\n\n100\n\nWe will use two 1000-yen bills to pay the price and receive 100 yen in change.\n\nSample Input 2\n\n3000\n\nSample Output 2\n\n0\n\nWe can pay the exact price.", "sample_input": "1900\n"}, "reference_outputs": ["100\n"], "source_document_id": "p02612", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe will buy a product for N yen (the currency of Japan) at a shop.\n\nIf we use only 1000-yen bills to pay the price, how much change will we receive?\n\nAssume we use the minimum number of bills required.\n\nConstraints\n\n1 \\leq N \\leq 10000\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 amount of change as an integer.\n\nSample Input 1\n\n1900\n\nSample Output 1\n\n100\n\nWe will use two 1000-yen bills to pay the price and receive 100 yen in change.\n\nSample Input 2\n\n3000\n\nSample Output 2\n\n0\n\nWe can pay the exact price.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 922, "cpu_time_ms": 7, "memory_kb": 1772}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s287608324", "group_id": "codeNet:p02612", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 100000\n\tmaxBufSize = 10000000\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twt = bufio.NewWriter(os.Stdout)\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(next())\n\treturn i\n}\n\nfunc puts(a ...interface{}) {\n\tfmt.Fprintln(wt, a...)\n}\n\nfunc divFloor(a, b int) int {\n\treturn (a + (b - 1)) / b\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer wt.Flush()\n\n\tn := nextInt()\n\n\tputs(divFloor(n, 1000)*1000 - n)\n}\n", "language": "Go", "metadata": {"date": 1594086706, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02612.html", "problem_id": "p02612", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02612/input.txt", "sample_output_relpath": "derived/input_output/data/p02612/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02612/Go/s287608324.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s287608324", "user_id": "u502813058"}, "prompt_components": {"gold_output": "100\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 100000\n\tmaxBufSize = 10000000\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twt = bufio.NewWriter(os.Stdout)\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(next())\n\treturn i\n}\n\nfunc puts(a ...interface{}) {\n\tfmt.Fprintln(wt, a...)\n}\n\nfunc divFloor(a, b int) int {\n\treturn (a + (b - 1)) / b\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer wt.Flush()\n\n\tn := nextInt()\n\n\tputs(divFloor(n, 1000)*1000 - n)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe will buy a product for N yen (the currency of Japan) at a shop.\n\nIf we use only 1000-yen bills to pay the price, how much change will we receive?\n\nAssume we use the minimum number of bills required.\n\nConstraints\n\n1 \\leq N \\leq 10000\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 amount of change as an integer.\n\nSample Input 1\n\n1900\n\nSample Output 1\n\n100\n\nWe will use two 1000-yen bills to pay the price and receive 100 yen in change.\n\nSample Input 2\n\n3000\n\nSample Output 2\n\n0\n\nWe can pay the exact price.", "sample_input": "1900\n"}, "reference_outputs": ["100\n"], "source_document_id": "p02612", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe will buy a product for N yen (the currency of Japan) at a shop.\n\nIf we use only 1000-yen bills to pay the price, how much change will we receive?\n\nAssume we use the minimum number of bills required.\n\nConstraints\n\n1 \\leq N \\leq 10000\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 amount of change as an integer.\n\nSample Input 1\n\n1900\n\nSample Output 1\n\n100\n\nWe will use two 1000-yen bills to pay the price and receive 100 yen in change.\n\nSample Input 2\n\n3000\n\nSample Output 2\n\n0\n\nWe can pay the exact price.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 596, "cpu_time_ms": 8, "memory_kb": 1780}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s997315543", "group_id": "codeNet:p02612", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner = bufio.NewScanner(os.Stdin)\n\nfunc scanStringToken() (word string) {\n\tscanner.Scan()\n\tword = scanner.Text()\n\treturn\n}\n\nfunc scanNumberToken() (num int) {\n\tscanner.Scan()\n\tnum, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc main() {\n\tn := scanNumberToken()\n\t// c := int(n / 1000)\n\tmod := n % 1000\n\n\tif mod == 0 {\n\t\tfmt.Println(0)\n\t} else {\n\t\tfmt.Println(1000 - mod)\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1594002141, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02612.html", "problem_id": "p02612", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02612/input.txt", "sample_output_relpath": "derived/input_output/data/p02612/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02612/Go/s997315543.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s997315543", "user_id": "u756076027"}, "prompt_components": {"gold_output": "100\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner = bufio.NewScanner(os.Stdin)\n\nfunc scanStringToken() (word string) {\n\tscanner.Scan()\n\tword = scanner.Text()\n\treturn\n}\n\nfunc scanNumberToken() (num int) {\n\tscanner.Scan()\n\tnum, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc main() {\n\tn := scanNumberToken()\n\t// c := int(n / 1000)\n\tmod := n % 1000\n\n\tif mod == 0 {\n\t\tfmt.Println(0)\n\t} else {\n\t\tfmt.Println(1000 - mod)\n\t}\n\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe will buy a product for N yen (the currency of Japan) at a shop.\n\nIf we use only 1000-yen bills to pay the price, how much change will we receive?\n\nAssume we use the minimum number of bills required.\n\nConstraints\n\n1 \\leq N \\leq 10000\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 amount of change as an integer.\n\nSample Input 1\n\n1900\n\nSample Output 1\n\n100\n\nWe will use two 1000-yen bills to pay the price and receive 100 yen in change.\n\nSample Input 2\n\n3000\n\nSample Output 2\n\n0\n\nWe can pay the exact price.", "sample_input": "1900\n"}, "reference_outputs": ["100\n"], "source_document_id": "p02612", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe will buy a product for N yen (the currency of Japan) at a shop.\n\nIf we use only 1000-yen bills to pay the price, how much change will we receive?\n\nAssume we use the minimum number of bills required.\n\nConstraints\n\n1 \\leq N \\leq 10000\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 amount of change as an integer.\n\nSample Input 1\n\n1900\n\nSample Output 1\n\n100\n\nWe will use two 1000-yen bills to pay the price and receive 100 yen in change.\n\nSample Input 2\n\n3000\n\nSample Output 2\n\n0\n\nWe can pay the exact price.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 7, "memory_kb": 1776}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s444687587", "group_id": "codeNet:p02612", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tmoney := 0\n\tif n % 1000 != 0{\n\t\tmoney = 1000 * ((n / 1000)+1) - n\n\t}\n\n\tfmt.Println(money)\n\n}", "language": "Go", "metadata": {"date": 1593997767, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02612.html", "problem_id": "p02612", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02612/input.txt", "sample_output_relpath": "derived/input_output/data/p02612/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02612/Go/s444687587.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s444687587", "user_id": "u223172005"}, "prompt_components": {"gold_output": "100\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tmoney := 0\n\tif n % 1000 != 0{\n\t\tmoney = 1000 * ((n / 1000)+1) - n\n\t}\n\n\tfmt.Println(money)\n\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe will buy a product for N yen (the currency of Japan) at a shop.\n\nIf we use only 1000-yen bills to pay the price, how much change will we receive?\n\nAssume we use the minimum number of bills required.\n\nConstraints\n\n1 \\leq N \\leq 10000\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 amount of change as an integer.\n\nSample Input 1\n\n1900\n\nSample Output 1\n\n100\n\nWe will use two 1000-yen bills to pay the price and receive 100 yen in change.\n\nSample Input 2\n\n3000\n\nSample Output 2\n\n0\n\nWe can pay the exact price.", "sample_input": "1900\n"}, "reference_outputs": ["100\n"], "source_document_id": "p02612", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe will buy a product for N yen (the currency of Japan) at a shop.\n\nIf we use only 1000-yen bills to pay the price, how much change will we receive?\n\nAssume we use the minimum number of bills required.\n\nConstraints\n\n1 \\leq N \\leq 10000\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 amount of change as an integer.\n\nSample Input 1\n\n1900\n\nSample Output 1\n\n100\n\nWe will use two 1000-yen bills to pay the price and receive 100 yen in change.\n\nSample Input 2\n\n3000\n\nSample Output 2\n\n0\n\nWe can pay the exact price.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 6, "memory_kb": 1768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s986670586", "group_id": "codeNet:p02612", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tfmt.Printf(\"%d\\n\", (10000-n)%1000)\n}\n", "language": "Go", "metadata": {"date": 1593997400, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02612.html", "problem_id": "p02612", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02612/input.txt", "sample_output_relpath": "derived/input_output/data/p02612/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02612/Go/s986670586.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s986670586", "user_id": "u226445453"}, "prompt_components": {"gold_output": "100\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tfmt.Printf(\"%d\\n\", (10000-n)%1000)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe will buy a product for N yen (the currency of Japan) at a shop.\n\nIf we use only 1000-yen bills to pay the price, how much change will we receive?\n\nAssume we use the minimum number of bills required.\n\nConstraints\n\n1 \\leq N \\leq 10000\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 amount of change as an integer.\n\nSample Input 1\n\n1900\n\nSample Output 1\n\n100\n\nWe will use two 1000-yen bills to pay the price and receive 100 yen in change.\n\nSample Input 2\n\n3000\n\nSample Output 2\n\n0\n\nWe can pay the exact price.", "sample_input": "1900\n"}, "reference_outputs": ["100\n"], "source_document_id": "p02612", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe will buy a product for N yen (the currency of Japan) at a shop.\n\nIf we use only 1000-yen bills to pay the price, how much change will we receive?\n\nAssume we use the minimum number of bills required.\n\nConstraints\n\n1 \\leq N \\leq 10000\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 amount of change as an integer.\n\nSample Input 1\n\n1900\n\nSample Output 1\n\n100\n\nWe will use two 1000-yen bills to pay the price and receive 100 yen in change.\n\nSample Input 2\n\n3000\n\nSample Output 2\n\n0\n\nWe can pay the exact price.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 6, "memory_kb": 1832}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s265073494", "group_id": "codeNet:p02612", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve(sc *scanner, wr *bufio.Writer) {\n\tn := sc.getInt()\n\tans := 1000 - (n % 1000)\n\tif n%1000 == 0 {\n\t\tans = 0\n\t}\n\tfmt.Fprintln(wr, ans)\n}\n\nfunc main() {\n\tsc := newScanner()\n\twr := bufio.NewWriter(os.Stdout)\n\tmaxBufSize := int(1e8)\n\tsc.Buffer(make([]byte, 4096), maxBufSize)\n\tsc.Split(bufio.ScanWords)\n\n\tsolve(sc, wr)\n\twr.Flush()\n}\n\n// input ------------------------\ntype scanner struct {\n\t*bufio.Scanner\n}\n\nfunc newScanner() *scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\treturn &scanner{sc}\n}\nfunc (sc *scanner) getInt() int {\n\tsc.Scan()\n\tret, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ret\n}\nfunc (sc *scanner) getInt2() (int, int) {\n\treturn sc.getInt(), sc.getInt()\n}\nfunc (sc *scanner) getInt3() (int, int, int) {\n\treturn sc.getInt(), sc.getInt(), sc.getInt()\n}\nfunc (sc *scanner) getInt4() (int, int, int, int) {\n\treturn sc.getInt(), sc.getInt(), sc.getInt(), sc.getInt()\n}\nfunc (sc *scanner) getInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := range ret {\n\t\tret[i] = sc.getInt()\n\t}\n\treturn ret\n}\nfunc (sc *scanner) getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc (sc *scanner) getRunes() []rune {\n\treturn []rune(sc.getString())\n}\nfunc (sc *scanner) getFloat() float64 {\n\tsc.Scan()\n\tret, err := strconv.ParseFloat(sc.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ret\n}\nfunc (sc *scanner) getFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := range ret {\n\t\tret[i] = sc.getFloat()\n\t}\n\treturn ret\n}\n\n// math ----------------------------\nfunc sum(ns ...int) int {\n\tvar sum int\n\tfor _, n := range ns {\n\t\tsum += n\n\t}\n\treturn sum\n}\n\nfunc max(ns ...int) int {\n\tmax := ns[0]\n\tfor i := 1; i < len(ns); i++ {\n\t\tif max < ns[i] {\n\t\t\tmax = ns[i]\n\t\t}\n\t}\n\treturn max\n}\n\nfunc min(ns ...int) int {\n\tmin := ns[0]\n\tfor i := 1; i < len(ns); i++ {\n\t\tif min > ns[i] {\n\t\t\tmin = ns[i]\n\t\t}\n\t}\n\treturn min\n}\n\nfunc pow(a, b int) int {\n\tret := 1\n\tfor b > 0 {\n\t\tif b&1 > 0 {\n\t\t\tret = ret * a\n\t\t}\n\t\ta = a * a\n\t\tb >>= 1\n\t}\n\treturn ret\n}\n", "language": "Go", "metadata": {"date": 1593997385, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02612.html", "problem_id": "p02612", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02612/input.txt", "sample_output_relpath": "derived/input_output/data/p02612/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02612/Go/s265073494.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s265073494", "user_id": "u543933043"}, "prompt_components": {"gold_output": "100\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve(sc *scanner, wr *bufio.Writer) {\n\tn := sc.getInt()\n\tans := 1000 - (n % 1000)\n\tif n%1000 == 0 {\n\t\tans = 0\n\t}\n\tfmt.Fprintln(wr, ans)\n}\n\nfunc main() {\n\tsc := newScanner()\n\twr := bufio.NewWriter(os.Stdout)\n\tmaxBufSize := int(1e8)\n\tsc.Buffer(make([]byte, 4096), maxBufSize)\n\tsc.Split(bufio.ScanWords)\n\n\tsolve(sc, wr)\n\twr.Flush()\n}\n\n// input ------------------------\ntype scanner struct {\n\t*bufio.Scanner\n}\n\nfunc newScanner() *scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\treturn &scanner{sc}\n}\nfunc (sc *scanner) getInt() int {\n\tsc.Scan()\n\tret, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ret\n}\nfunc (sc *scanner) getInt2() (int, int) {\n\treturn sc.getInt(), sc.getInt()\n}\nfunc (sc *scanner) getInt3() (int, int, int) {\n\treturn sc.getInt(), sc.getInt(), sc.getInt()\n}\nfunc (sc *scanner) getInt4() (int, int, int, int) {\n\treturn sc.getInt(), sc.getInt(), sc.getInt(), sc.getInt()\n}\nfunc (sc *scanner) getInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := range ret {\n\t\tret[i] = sc.getInt()\n\t}\n\treturn ret\n}\nfunc (sc *scanner) getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc (sc *scanner) getRunes() []rune {\n\treturn []rune(sc.getString())\n}\nfunc (sc *scanner) getFloat() float64 {\n\tsc.Scan()\n\tret, err := strconv.ParseFloat(sc.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ret\n}\nfunc (sc *scanner) getFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := range ret {\n\t\tret[i] = sc.getFloat()\n\t}\n\treturn ret\n}\n\n// math ----------------------------\nfunc sum(ns ...int) int {\n\tvar sum int\n\tfor _, n := range ns {\n\t\tsum += n\n\t}\n\treturn sum\n}\n\nfunc max(ns ...int) int {\n\tmax := ns[0]\n\tfor i := 1; i < len(ns); i++ {\n\t\tif max < ns[i] {\n\t\t\tmax = ns[i]\n\t\t}\n\t}\n\treturn max\n}\n\nfunc min(ns ...int) int {\n\tmin := ns[0]\n\tfor i := 1; i < len(ns); i++ {\n\t\tif min > ns[i] {\n\t\t\tmin = ns[i]\n\t\t}\n\t}\n\treturn min\n}\n\nfunc pow(a, b int) int {\n\tret := 1\n\tfor b > 0 {\n\t\tif b&1 > 0 {\n\t\t\tret = ret * a\n\t\t}\n\t\ta = a * a\n\t\tb >>= 1\n\t}\n\treturn ret\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe will buy a product for N yen (the currency of Japan) at a shop.\n\nIf we use only 1000-yen bills to pay the price, how much change will we receive?\n\nAssume we use the minimum number of bills required.\n\nConstraints\n\n1 \\leq N \\leq 10000\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 amount of change as an integer.\n\nSample Input 1\n\n1900\n\nSample Output 1\n\n100\n\nWe will use two 1000-yen bills to pay the price and receive 100 yen in change.\n\nSample Input 2\n\n3000\n\nSample Output 2\n\n0\n\nWe can pay the exact price.", "sample_input": "1900\n"}, "reference_outputs": ["100\n"], "source_document_id": "p02612", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe will buy a product for N yen (the currency of Japan) at a shop.\n\nIf we use only 1000-yen bills to pay the price, how much change will we receive?\n\nAssume we use the minimum number of bills required.\n\nConstraints\n\n1 \\leq N \\leq 10000\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 amount of change as an integer.\n\nSample Input 1\n\n1900\n\nSample Output 1\n\n100\n\nWe will use two 1000-yen bills to pay the price and receive 100 yen in change.\n\nSample Input 2\n\n3000\n\nSample Output 2\n\n0\n\nWe can pay the exact price.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2035, "cpu_time_ms": 6, "memory_kb": 1776}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s618010498", "group_id": "codeNet:p02612", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar mod = 1000000007\nvar inf = 1000000007\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tvar n int\n\tfmt.Fscan(r, &n)\n\n\tans := n % 1000\n\tif ans == 0 {\n\t\tfmt.Println(0)\n\t} else {\n\t\tfmt.Println(1000 - ans)\n\t}\n}\n\n// permutations\nfunc permutations(arr []int) [][]int {\n\tvar helper func([]int, int)\n\tres := [][]int{}\n\n\thelper = func(arr []int, n int) {\n\t\tif n == 1 {\n\t\t\ttmp := make([]int, len(arr))\n\t\t\tcopy(tmp, arr)\n\t\t\tres = append(res, tmp)\n\t\t} else {\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\thelper(arr, n-1)\n\t\t\t\tif n%2 == 1 {\n\t\t\t\t\ttmp := arr[i]\n\t\t\t\t\tarr[i] = arr[n-1]\n\t\t\t\t\tarr[n-1] = tmp\n\t\t\t\t} else {\n\t\t\t\t\ttmp := arr[0]\n\t\t\t\t\tarr[0] = arr[n-1]\n\t\t\t\t\tarr[n-1] = tmp\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\thelper(arr, len(arr))\n\treturn res\n}\n\n// Union-Find\ntype unionFind struct {\n\td []int\n}\n\nfunc newUnionFind(n int) *unionFind {\n\tuf := new(unionFind)\n\tuf.d = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tuf.d[i] = -1\n\t}\n\treturn uf\n}\n\nfunc (uf *unionFind) find(x int) int {\n\tif uf.d[x] < 0 {\n\t\treturn x\n\t}\n\tuf.d[x] = uf.find(uf.d[x])\n\treturn uf.d[x]\n}\n\nfunc (uf *unionFind) unite(x, y int) bool {\n\trootX := uf.find(x)\n\trootY := uf.find(y)\n\tif rootX == rootY {\n\t\treturn false\n\t}\n\n\tif uf.d[rootX] < uf.d[rootY] {\n\t\tuf.d[rootX] += uf.d[rootY]\n\t\tuf.d[rootY] = rootX\n\t} else {\n\t\tuf.d[rootY] += uf.d[rootX]\n\t\tuf.d[rootX] = rootY\n\t}\n\n\treturn true\n}\n\nfunc (uf *unionFind) same(x, y int) bool {\n\treturn uf.find(x) == uf.find(y)\n}\n\nfunc (uf *unionFind) size(x int) int {\n\treturn -uf.d[uf.find(x)]\n}\n\n// mod\nfunc modpow(a, n, mod int) int {\n\tres := 1\n\tfor n > 0 {\n\t\tif n%2 != 0 {\n\t\t\tres = res * a % mod\n\t\t}\n\t\ta = a * a % mod\n\t\tn = n / 2\n\t}\n\treturn res\n}\n\nfunc modinv(n, mod int) int {\n\treturn modpow(n, mod-2, mod)\n}\n\nfunc modcomb(n, a, mod int) int {\n\tx := 1\n\ty := 1\n\tfor i := 0; i < a; i++ {\n\t\tx = x * (n - i)\n\t\tx %= mod\n\t\ty = y * (i + 1)\n\t\ty %= mod\n\t}\n\treturn x * modpow(y, mod-2, mod) % mod\n}\n\nfunc modfactorial(n, mod int) int {\n\tresult := 1\n\tfor i := 1; i <= n; i++ {\n\t\tresult = (result * i) % mod\n\t}\n\treturn result\n}\n\n// Combination ...\ntype Combination struct {\n\tfacts, invs []int\n\tmod int\n}\n\n// NewCombination ...\nfunc NewCombination(n, mod int) Combination {\n\treturn Combination{\n\t\tfacts: make([]int, n+1),\n\t\tinvs: make([]int, n+1),\n\t\tmod: mod,\n\t}\n}\n\nfunc (cmb *Combination) calc(n, k int) int {\n\tret := cmb.facts[n] * cmb.invs[k]\n\tret %= cmb.mod\n\tret = ret * cmb.invs[n-k]\n\tret %= cmb.mod\n\treturn ret\n}\n\nfunc (cmb *Combination) init(n int) {\n\tcmb.facts[0] = 1\n\t// 階乗を算出\n\tfor i := 1; i <= n; i++ {\n\t\tcmb.facts[i] = cmb.facts[i-1] * i % cmb.mod\n\t}\n\t// 逆元を算出\n\tcmb.invs[n] = modinv(cmb.facts[n], cmb.mod)\n\tfor i := n - 1; i >= 0; i-- {\n\t\tcmb.invs[i] = cmb.invs[i+1] * (i + 1) % cmb.mod\n\t}\n}\n\n// Utility\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc primeFactor(x int) map[int]int {\n\tres := make(map[int]int)\n\tfor i := 2; i*i <= x; i++ {\n\t\tfor x%i == 0 {\n\t\t\tres[i]++\n\t\t\tx = x / i\n\t\t}\n\t}\n\tif x != 1 {\n\t\tres[x] = 1\n\t}\n\treturn res\n}\n\nfunc divisor(x int) []int {\n\tres := make([]int, 0)\n\tfor i := 1; i*i <= x; i++ {\n\t\tif x%i == 0 {\n\t\t\tres = append(res, i)\n\t\t\tif i != x/i {\n\t\t\t\tres = append(res, x/i)\n\t\t\t}\n\t\t}\n\t}\n\treturn res\n}\n\nfunc gcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t}\n\treturn gcd(y, x%y)\n}\n\nfunc lcm(x, y int) int {\n\treturn x / gcd(x, y) * y\n}\n\nfunc reverseString(s string) string {\n\tr := []rune(s)\n\tfor i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {\n\t\tr[i], r[j] = r[j], r[i]\n\t}\n\treturn string(r)\n}\n\nfunc pow(a, n int) int {\n\tret := 1\n\tfor i := 1; i <= n; i++ {\n\t\tret *= a\n\t}\n\treturn ret\n}\n\n// Queue ...\ntype Queue []int\n\n// pop ...\nfunc (q *Queue) empty() bool {\n\treturn len(*q) == 0\n}\n\n// push ...\nfunc (q *Queue) push(i int) {\n\t*q = append(*q, i)\n}\n\n// pop ...\nfunc (q *Queue) pop() (int, bool) {\n\tif q.empty() {\n\t\treturn 0, false\n\t} else {\n\t\tres := (*q)[0]\n\t\t*q = (*q)[1:]\n\t\treturn res, true\n\t}\n}\n\n// Stack ...\ntype Stack []int\n\n// pop ...\nfunc (s *Stack) empty() bool {\n\treturn len(*s) == 0\n}\n\n// push ...\nfunc (s *Stack) push(i int) {\n\t*s = append(*s, i)\n}\n\n// pop ...\nfunc (s *Stack) pop() (int, bool) {\n\tif s.empty() {\n\t\treturn 0, false\n\t} else {\n\t\tindex := len(*s) - 1\n\t\tres := (*s)[index]\n\t\t*s = (*s)[:index]\n\t\treturn res, true\n\t}\n}\n\n// priority_queue\ntype intHeap []int\n\nfunc (h intHeap) Len() int { return len(h) }\nfunc (h intHeap) Less(i, j int) bool { return h[i] > h[j] }\nfunc (h intHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\n// sortable points\ntype point struct {\n\tx int\n\ty int\n}\n\ntype points []point\n\nfunc (p points) Len() int {\n\treturn len(p)\n}\n\nfunc (p points) Less(i, j int) bool {\n\treturn p[i].x < p[j].x\n}\n\nfunc (p points) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n", "language": "Go", "metadata": {"date": 1593997335, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02612.html", "problem_id": "p02612", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02612/input.txt", "sample_output_relpath": "derived/input_output/data/p02612/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02612/Go/s618010498.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s618010498", "user_id": "u433254839"}, "prompt_components": {"gold_output": "100\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar mod = 1000000007\nvar inf = 1000000007\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tvar n int\n\tfmt.Fscan(r, &n)\n\n\tans := n % 1000\n\tif ans == 0 {\n\t\tfmt.Println(0)\n\t} else {\n\t\tfmt.Println(1000 - ans)\n\t}\n}\n\n// permutations\nfunc permutations(arr []int) [][]int {\n\tvar helper func([]int, int)\n\tres := [][]int{}\n\n\thelper = func(arr []int, n int) {\n\t\tif n == 1 {\n\t\t\ttmp := make([]int, len(arr))\n\t\t\tcopy(tmp, arr)\n\t\t\tres = append(res, tmp)\n\t\t} else {\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\thelper(arr, n-1)\n\t\t\t\tif n%2 == 1 {\n\t\t\t\t\ttmp := arr[i]\n\t\t\t\t\tarr[i] = arr[n-1]\n\t\t\t\t\tarr[n-1] = tmp\n\t\t\t\t} else {\n\t\t\t\t\ttmp := arr[0]\n\t\t\t\t\tarr[0] = arr[n-1]\n\t\t\t\t\tarr[n-1] = tmp\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\thelper(arr, len(arr))\n\treturn res\n}\n\n// Union-Find\ntype unionFind struct {\n\td []int\n}\n\nfunc newUnionFind(n int) *unionFind {\n\tuf := new(unionFind)\n\tuf.d = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tuf.d[i] = -1\n\t}\n\treturn uf\n}\n\nfunc (uf *unionFind) find(x int) int {\n\tif uf.d[x] < 0 {\n\t\treturn x\n\t}\n\tuf.d[x] = uf.find(uf.d[x])\n\treturn uf.d[x]\n}\n\nfunc (uf *unionFind) unite(x, y int) bool {\n\trootX := uf.find(x)\n\trootY := uf.find(y)\n\tif rootX == rootY {\n\t\treturn false\n\t}\n\n\tif uf.d[rootX] < uf.d[rootY] {\n\t\tuf.d[rootX] += uf.d[rootY]\n\t\tuf.d[rootY] = rootX\n\t} else {\n\t\tuf.d[rootY] += uf.d[rootX]\n\t\tuf.d[rootX] = rootY\n\t}\n\n\treturn true\n}\n\nfunc (uf *unionFind) same(x, y int) bool {\n\treturn uf.find(x) == uf.find(y)\n}\n\nfunc (uf *unionFind) size(x int) int {\n\treturn -uf.d[uf.find(x)]\n}\n\n// mod\nfunc modpow(a, n, mod int) int {\n\tres := 1\n\tfor n > 0 {\n\t\tif n%2 != 0 {\n\t\t\tres = res * a % mod\n\t\t}\n\t\ta = a * a % mod\n\t\tn = n / 2\n\t}\n\treturn res\n}\n\nfunc modinv(n, mod int) int {\n\treturn modpow(n, mod-2, mod)\n}\n\nfunc modcomb(n, a, mod int) int {\n\tx := 1\n\ty := 1\n\tfor i := 0; i < a; i++ {\n\t\tx = x * (n - i)\n\t\tx %= mod\n\t\ty = y * (i + 1)\n\t\ty %= mod\n\t}\n\treturn x * modpow(y, mod-2, mod) % mod\n}\n\nfunc modfactorial(n, mod int) int {\n\tresult := 1\n\tfor i := 1; i <= n; i++ {\n\t\tresult = (result * i) % mod\n\t}\n\treturn result\n}\n\n// Combination ...\ntype Combination struct {\n\tfacts, invs []int\n\tmod int\n}\n\n// NewCombination ...\nfunc NewCombination(n, mod int) Combination {\n\treturn Combination{\n\t\tfacts: make([]int, n+1),\n\t\tinvs: make([]int, n+1),\n\t\tmod: mod,\n\t}\n}\n\nfunc (cmb *Combination) calc(n, k int) int {\n\tret := cmb.facts[n] * cmb.invs[k]\n\tret %= cmb.mod\n\tret = ret * cmb.invs[n-k]\n\tret %= cmb.mod\n\treturn ret\n}\n\nfunc (cmb *Combination) init(n int) {\n\tcmb.facts[0] = 1\n\t// 階乗を算出\n\tfor i := 1; i <= n; i++ {\n\t\tcmb.facts[i] = cmb.facts[i-1] * i % cmb.mod\n\t}\n\t// 逆元を算出\n\tcmb.invs[n] = modinv(cmb.facts[n], cmb.mod)\n\tfor i := n - 1; i >= 0; i-- {\n\t\tcmb.invs[i] = cmb.invs[i+1] * (i + 1) % cmb.mod\n\t}\n}\n\n// Utility\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc primeFactor(x int) map[int]int {\n\tres := make(map[int]int)\n\tfor i := 2; i*i <= x; i++ {\n\t\tfor x%i == 0 {\n\t\t\tres[i]++\n\t\t\tx = x / i\n\t\t}\n\t}\n\tif x != 1 {\n\t\tres[x] = 1\n\t}\n\treturn res\n}\n\nfunc divisor(x int) []int {\n\tres := make([]int, 0)\n\tfor i := 1; i*i <= x; i++ {\n\t\tif x%i == 0 {\n\t\t\tres = append(res, i)\n\t\t\tif i != x/i {\n\t\t\t\tres = append(res, x/i)\n\t\t\t}\n\t\t}\n\t}\n\treturn res\n}\n\nfunc gcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t}\n\treturn gcd(y, x%y)\n}\n\nfunc lcm(x, y int) int {\n\treturn x / gcd(x, y) * y\n}\n\nfunc reverseString(s string) string {\n\tr := []rune(s)\n\tfor i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {\n\t\tr[i], r[j] = r[j], r[i]\n\t}\n\treturn string(r)\n}\n\nfunc pow(a, n int) int {\n\tret := 1\n\tfor i := 1; i <= n; i++ {\n\t\tret *= a\n\t}\n\treturn ret\n}\n\n// Queue ...\ntype Queue []int\n\n// pop ...\nfunc (q *Queue) empty() bool {\n\treturn len(*q) == 0\n}\n\n// push ...\nfunc (q *Queue) push(i int) {\n\t*q = append(*q, i)\n}\n\n// pop ...\nfunc (q *Queue) pop() (int, bool) {\n\tif q.empty() {\n\t\treturn 0, false\n\t} else {\n\t\tres := (*q)[0]\n\t\t*q = (*q)[1:]\n\t\treturn res, true\n\t}\n}\n\n// Stack ...\ntype Stack []int\n\n// pop ...\nfunc (s *Stack) empty() bool {\n\treturn len(*s) == 0\n}\n\n// push ...\nfunc (s *Stack) push(i int) {\n\t*s = append(*s, i)\n}\n\n// pop ...\nfunc (s *Stack) pop() (int, bool) {\n\tif s.empty() {\n\t\treturn 0, false\n\t} else {\n\t\tindex := len(*s) - 1\n\t\tres := (*s)[index]\n\t\t*s = (*s)[:index]\n\t\treturn res, true\n\t}\n}\n\n// priority_queue\ntype intHeap []int\n\nfunc (h intHeap) Len() int { return len(h) }\nfunc (h intHeap) Less(i, j int) bool { return h[i] > h[j] }\nfunc (h intHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\n// sortable points\ntype point struct {\n\tx int\n\ty int\n}\n\ntype points []point\n\nfunc (p points) Len() int {\n\treturn len(p)\n}\n\nfunc (p points) Less(i, j int) bool {\n\treturn p[i].x < p[j].x\n}\n\nfunc (p points) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe will buy a product for N yen (the currency of Japan) at a shop.\n\nIf we use only 1000-yen bills to pay the price, how much change will we receive?\n\nAssume we use the minimum number of bills required.\n\nConstraints\n\n1 \\leq N \\leq 10000\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 amount of change as an integer.\n\nSample Input 1\n\n1900\n\nSample Output 1\n\n100\n\nWe will use two 1000-yen bills to pay the price and receive 100 yen in change.\n\nSample Input 2\n\n3000\n\nSample Output 2\n\n0\n\nWe can pay the exact price.", "sample_input": "1900\n"}, "reference_outputs": ["100\n"], "source_document_id": "p02612", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe will buy a product for N yen (the currency of Japan) at a shop.\n\nIf we use only 1000-yen bills to pay the price, how much change will we receive?\n\nAssume we use the minimum number of bills required.\n\nConstraints\n\n1 \\leq N \\leq 10000\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 amount of change as an integer.\n\nSample Input 1\n\n1900\n\nSample Output 1\n\n100\n\nWe will use two 1000-yen bills to pay the price and receive 100 yen in change.\n\nSample Input 2\n\n3000\n\nSample Output 2\n\n0\n\nWe can pay the exact price.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4990, "cpu_time_ms": 7, "memory_kb": 1844}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s425514200", "group_id": "codeNet:p02612", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tN := ReadInt()\n\tfmt.Println((1000 - N%1000) % 1000)\n}\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadString() (s string) { Scan(&s); return }\nfunc ReadInts(n int) []int {\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tScan(&v[i])\n\t}\n\treturn v\n}\n", "language": "Go", "metadata": {"date": 1593997274, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02612.html", "problem_id": "p02612", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02612/input.txt", "sample_output_relpath": "derived/input_output/data/p02612/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02612/Go/s425514200.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s425514200", "user_id": "u328656362"}, "prompt_components": {"gold_output": "100\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tN := ReadInt()\n\tfmt.Println((1000 - N%1000) % 1000)\n}\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadString() (s string) { Scan(&s); return }\nfunc ReadInts(n int) []int {\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tScan(&v[i])\n\t}\n\treturn v\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe will buy a product for N yen (the currency of Japan) at a shop.\n\nIf we use only 1000-yen bills to pay the price, how much change will we receive?\n\nAssume we use the minimum number of bills required.\n\nConstraints\n\n1 \\leq N \\leq 10000\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 amount of change as an integer.\n\nSample Input 1\n\n1900\n\nSample Output 1\n\n100\n\nWe will use two 1000-yen bills to pay the price and receive 100 yen in change.\n\nSample Input 2\n\n3000\n\nSample Output 2\n\n0\n\nWe can pay the exact price.", "sample_input": "1900\n"}, "reference_outputs": ["100\n"], "source_document_id": "p02612", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe will buy a product for N yen (the currency of Japan) at a shop.\n\nIf we use only 1000-yen bills to pay the price, how much change will we receive?\n\nAssume we use the minimum number of bills required.\n\nConstraints\n\n1 \\leq N \\leq 10000\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 amount of change as an integer.\n\nSample Input 1\n\n1900\n\nSample Output 1\n\n100\n\nWe will use two 1000-yen bills to pay the price and receive 100 yen in change.\n\nSample Input 2\n\n3000\n\nSample Output 2\n\n0\n\nWe can pay the exact price.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 463, "cpu_time_ms": 6, "memory_kb": 1844}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s264552844", "group_id": "codeNet:p02612", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst (\n\tBUFSIZE = 10000000\n\tMOD = 1000000007\n\tINF_INT = math.MaxInt32\n\tINF_INT64 = math.MaxInt64\n)\n\nvar rdr *bufio.Reader\n\nfunc main() {\n\trdr = bufio.NewReaderSize(os.Stdin, BUFSIZE)\n\tsolve()\n}\n\nfunc solve() {\n\tN := readint()\n\tfmt.Println(N % 1000)\n}\n\nfunc readline() string {\n\tbuf := make([]byte, 0, BUFSIZE)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tfmt.Println(e.Error())\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc readIntSlice(size int) []int {\n\tslice := make([]int, size)\n\tlines := strings.Split(readline(), \" \")\n\tfor i, v := range lines {\n\t\tslice[i] = s2i(v)\n\t}\n\treturn slice\n}\n\nfunc readInt64Slice(size int) []int64 {\n\tslice := make([]int64, size)\n\tlines := strings.Split(readline(), \" \")\n\tfor i, v := range lines {\n\t\tslice[i] = s2i64(v)\n\t}\n\treturn slice\n}\n\nfunc readint() int {\n\treturn s2i(readline())\n}\n\nfunc readint64() int64 {\n\treturn s2i64(readline())\n}\n\n// For int64\nfunc b2i64(b bool) int64 {\n\tif b {\n\t\treturn 1\n\t}\n\treturn 0\n}\n\nfunc abs64(v int64) int64 {\n\tif v < 0 {\n\t\treturn -v\n\t}\n\treturn v\n}\n\nfunc min64(values ...int64) int64 {\n\tret := int64(INF_INT64)\n\tfor _, v := range values {\n\t\tif ret > v {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc max64(values ...int64) int64 {\n\tret := -int64(INF_INT64)\n\tfor _, v := range values {\n\t\tif ret < v {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc s2i64(s string) int64 {\n\tv, ok := strconv.ParseInt(s, 10, 64)\n\tif ok != nil {\n\t\tpanic(\"Faild : \" + s + \" can't convert to int64\")\n\t}\n\treturn v\n}\n\n// For int\nfunc b2i(b bool) int {\n\tif b {\n\t\treturn 1\n\t}\n\treturn 0\n}\n\nfunc abs(v int) int {\n\tif v < 0 {\n\t\treturn -v\n\t}\n\treturn v\n}\n\nfunc min(values ...int) int {\n\tret := INF_INT\n\tfor _, v := range values {\n\t\tif ret > v {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc max(values ...int) int {\n\tret := -INF_INT\n\tfor _, v := range values {\n\t\tif ret < v {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc s2i(s string) int {\n\tv, ok := strconv.Atoi(s)\n\tif ok != nil {\n\t\tpanic(\"Faild : \" + s + \" can't convert to int\")\n\t}\n\treturn v\n}\n\nfunc lcm(v1, v2 int) int {\n\tif v1 > v2 {\n\t\tv1, v2 = v2, v1\n\t}\n\tfor v1 != 0 {\n\t\tv1, v2 = v2%v1, v1\n\t}\n\treturn v2\n}\n\nfunc gcd(v1, v2 int) int {\n\treturn v1 * v2 / lcm(v1, v2)\n}\n\n/* ------------------------------------------------ */\n/* Data stracture */\n/* ------------------------------------------------ */\ntype IntHeap []int\n\nfunc (h *IntHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IntHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc (h IntHeap) Len() int { return len(h) }\nfunc (h IntHeap) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h IntHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\n", "language": "Go", "metadata": {"date": 1593997253, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02612.html", "problem_id": "p02612", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02612/input.txt", "sample_output_relpath": "derived/input_output/data/p02612/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02612/Go/s264552844.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s264552844", "user_id": "u811202694"}, "prompt_components": {"gold_output": "100\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst (\n\tBUFSIZE = 10000000\n\tMOD = 1000000007\n\tINF_INT = math.MaxInt32\n\tINF_INT64 = math.MaxInt64\n)\n\nvar rdr *bufio.Reader\n\nfunc main() {\n\trdr = bufio.NewReaderSize(os.Stdin, BUFSIZE)\n\tsolve()\n}\n\nfunc solve() {\n\tN := readint()\n\tfmt.Println(N % 1000)\n}\n\nfunc readline() string {\n\tbuf := make([]byte, 0, BUFSIZE)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tfmt.Println(e.Error())\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc readIntSlice(size int) []int {\n\tslice := make([]int, size)\n\tlines := strings.Split(readline(), \" \")\n\tfor i, v := range lines {\n\t\tslice[i] = s2i(v)\n\t}\n\treturn slice\n}\n\nfunc readInt64Slice(size int) []int64 {\n\tslice := make([]int64, size)\n\tlines := strings.Split(readline(), \" \")\n\tfor i, v := range lines {\n\t\tslice[i] = s2i64(v)\n\t}\n\treturn slice\n}\n\nfunc readint() int {\n\treturn s2i(readline())\n}\n\nfunc readint64() int64 {\n\treturn s2i64(readline())\n}\n\n// For int64\nfunc b2i64(b bool) int64 {\n\tif b {\n\t\treturn 1\n\t}\n\treturn 0\n}\n\nfunc abs64(v int64) int64 {\n\tif v < 0 {\n\t\treturn -v\n\t}\n\treturn v\n}\n\nfunc min64(values ...int64) int64 {\n\tret := int64(INF_INT64)\n\tfor _, v := range values {\n\t\tif ret > v {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc max64(values ...int64) int64 {\n\tret := -int64(INF_INT64)\n\tfor _, v := range values {\n\t\tif ret < v {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc s2i64(s string) int64 {\n\tv, ok := strconv.ParseInt(s, 10, 64)\n\tif ok != nil {\n\t\tpanic(\"Faild : \" + s + \" can't convert to int64\")\n\t}\n\treturn v\n}\n\n// For int\nfunc b2i(b bool) int {\n\tif b {\n\t\treturn 1\n\t}\n\treturn 0\n}\n\nfunc abs(v int) int {\n\tif v < 0 {\n\t\treturn -v\n\t}\n\treturn v\n}\n\nfunc min(values ...int) int {\n\tret := INF_INT\n\tfor _, v := range values {\n\t\tif ret > v {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc max(values ...int) int {\n\tret := -INF_INT\n\tfor _, v := range values {\n\t\tif ret < v {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc s2i(s string) int {\n\tv, ok := strconv.Atoi(s)\n\tif ok != nil {\n\t\tpanic(\"Faild : \" + s + \" can't convert to int\")\n\t}\n\treturn v\n}\n\nfunc lcm(v1, v2 int) int {\n\tif v1 > v2 {\n\t\tv1, v2 = v2, v1\n\t}\n\tfor v1 != 0 {\n\t\tv1, v2 = v2%v1, v1\n\t}\n\treturn v2\n}\n\nfunc gcd(v1, v2 int) int {\n\treturn v1 * v2 / lcm(v1, v2)\n}\n\n/* ------------------------------------------------ */\n/* Data stracture */\n/* ------------------------------------------------ */\ntype IntHeap []int\n\nfunc (h *IntHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IntHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc (h IntHeap) Len() int { return len(h) }\nfunc (h IntHeap) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h IntHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe will buy a product for N yen (the currency of Japan) at a shop.\n\nIf we use only 1000-yen bills to pay the price, how much change will we receive?\n\nAssume we use the minimum number of bills required.\n\nConstraints\n\n1 \\leq N \\leq 10000\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 amount of change as an integer.\n\nSample Input 1\n\n1900\n\nSample Output 1\n\n100\n\nWe will use two 1000-yen bills to pay the price and receive 100 yen in change.\n\nSample Input 2\n\n3000\n\nSample Output 2\n\n0\n\nWe can pay the exact price.", "sample_input": "1900\n"}, "reference_outputs": ["100\n"], "source_document_id": "p02612", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe will buy a product for N yen (the currency of Japan) at a shop.\n\nIf we use only 1000-yen bills to pay the price, how much change will we receive?\n\nAssume we use the minimum number of bills required.\n\nConstraints\n\n1 \\leq N \\leq 10000\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 amount of change as an integer.\n\nSample Input 1\n\n1900\n\nSample Output 1\n\n100\n\nWe will use two 1000-yen bills to pay the price and receive 100 yen in change.\n\nSample Input 2\n\n3000\n\nSample Output 2\n\n0\n\nWe can pay the exact price.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2819, "cpu_time_ms": 8, "memory_kb": 2488}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s046660422", "group_id": "codeNet:p02618", "input_text": "package main\n\nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n \"strconv\"\n \"math\"\n \"math/rand\"\n \"time\"\n)\n\ntype XorShift struct {\n X uint64\n Nl [65536]float64\n}\n\nfunc (xs *XorShift) xinit(){\n var n2 = 0.5 / 65536\n for i:=0; i<65536; i++ {\n xs.Nl[i] = math.Log(float64(i) / 65536.0 + n2)\n }\n}\n\nfunc (xs *XorShift) next() uint64 {\n xs.X ^= xs.X << 13; xs.X ^= xs.X >> 7; xs.X ^= xs.X << 17;\n return xs.X\n}\n\nfunc (xs *XorShift) nextInt(n int) int {\n return int(xs.next() % uint64(n))\n}\n\nfunc (xs *XorShift) nextLog() float64 {\n return xs.Nl[xs.nextInt(65536)]\n}\n\nvar xs XorShift\nvar starttime time.Time\n\nconst (\n M = 26\n D = 365\n TO = 1.98\n)\n\nvar C = make([]int, M)\nvar S [D][M]int\nvar T = make([]int, D)\nvar (\n ttt = 0\n ctt = 0\n dtt = 0\n ett = 0\n ftt = 0\n)\n\ntype Link struct {\n Day int\n C int\n Prev *Link\n Next *Link\n}\n\nvar LA = make([]Link, D+M*2)\nvar DS = make([]int, D+2)\n\nfunc sinit(){\n sc := bufio.NewScanner(os.Stdin)\n sc.Split(bufio.ScanWords)\n sc.Scan()\n sc.Text()\n\n for i:=0; i= ca {\n cc++\n }\n lc := LA[D + cc].Next\n for lc.Day < da {\n lc = lc.Next\n }\n pda := la.Prev.Day\n nda := la.Next.Day\n pdc := lc.Prev.Day\n ndc := lc.Day\n\n t := S[da][ca] -\n C[ca] * (DS[nda - da] + DS[da - pda]) -\n C[cc] * (DS[ndc - pdc])\n u := S[da][cc] -\n C[ca] * (DS[nda - pda]) -\n C[cc] * (DS[ndc - da] + DS[da - pdc])\n\n ts := u - t\n if ts >= 0 || float64(ts) > gg * xs.nextLog() * gt {\n ett++\n la.C = cc\n la.Prev.Next = la.Next\n la.Next.Prev = la.Prev\n la.Prev = lc.Prev\n la.Next = lc\n la.Prev.Next = la\n la.Next.Prev = la\n }\n }\n\n for tt:=0; tt= ba {\n continue\n }\n dtt++\n b := xs.nextInt(ba - bi) + bi\n if b >= a {\n b++\n if LA[b].Prev.Day > a {\n continue\n }\n } else {\n if LA[b].Next.Day < a {\n continue\n }\n }\n lb := &LA[b]\n ttt++\n\n ts := sswap(la, lb)\n if ts >= 0 || float64(ts) > gg * xs.nextLog() * gt {\n ctt++\n la.C, lb.C = lb.C, la.C\n la.Prev, lb.Prev = lb.Prev, la.Prev\n la.Next, lb.Next = lb.Next, la.Next\n la.Prev.Next = la\n la.Next.Prev = la\n lb.Prev.Next = lb\n lb.Next.Prev = lb\n sc += ts\n }\n }\n }\n\n for i:=0; i> 7; xs.X ^= xs.X << 17;\n return xs.X\n}\n\nfunc (xs *XorShift) nextInt(n int) int {\n return int(xs.next() % uint64(n))\n}\n\nfunc (xs *XorShift) nextLog() float64 {\n return xs.Nl[xs.nextInt(65536)]\n}\n\nvar xs XorShift\nvar starttime time.Time\n\nconst (\n M = 26\n D = 365\n TO = 1.98\n)\n\nvar C = make([]int, M)\nvar S [D][M]int\nvar T = make([]int, D)\nvar (\n ttt = 0\n ctt = 0\n dtt = 0\n ett = 0\n ftt = 0\n)\n\ntype Link struct {\n Day int\n C int\n Prev *Link\n Next *Link\n}\n\nvar LA = make([]Link, D+M*2)\nvar DS = make([]int, D+2)\n\nfunc sinit(){\n sc := bufio.NewScanner(os.Stdin)\n sc.Split(bufio.ScanWords)\n sc.Scan()\n sc.Text()\n\n for i:=0; i= ca {\n cc++\n }\n lc := LA[D + cc].Next\n for lc.Day < da {\n lc = lc.Next\n }\n pda := la.Prev.Day\n nda := la.Next.Day\n pdc := lc.Prev.Day\n ndc := lc.Day\n\n t := S[da][ca] -\n C[ca] * (DS[nda - da] + DS[da - pda]) -\n C[cc] * (DS[ndc - pdc])\n u := S[da][cc] -\n C[ca] * (DS[nda - pda]) -\n C[cc] * (DS[ndc - da] + DS[da - pdc])\n\n ts := u - t\n if ts >= 0 || float64(ts) > gg * xs.nextLog() * gt {\n ett++\n la.C = cc\n la.Prev.Next = la.Next\n la.Next.Prev = la.Prev\n la.Prev = lc.Prev\n la.Next = lc\n la.Prev.Next = la\n la.Next.Prev = la\n }\n }\n\n for tt:=0; tt= ba {\n continue\n }\n dtt++\n b := xs.nextInt(ba - bi) + bi\n if b >= a {\n b++\n if LA[b].Prev.Day > a {\n continue\n }\n } else {\n if LA[b].Next.Day < a {\n continue\n }\n }\n lb := &LA[b]\n ttt++\n\n ts := sswap(la, lb)\n if ts >= 0 || float64(ts) > gg * xs.nextLog() * gt {\n ctt++\n la.C, lb.C = lb.C, la.C\n la.Prev, lb.Prev = lb.Prev, la.Prev\n la.Next, lb.Next = lb.Next, la.Next\n la.Prev.Next = la\n la.Next.Prev = la\n lb.Prev.Next = lb\n lb.Next.Prev = lb\n sc += ts\n }\n }\n }\n\n for i:=0; i y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc calcScore(t []int) int {\n\tvar last [26]int\n\tscore := 0\n\tS := 0\n\tfor i := 0; i < 26; i++ {\n\t\tlast[i] = -1\n\t}\n\tfor d := 0; d < len(t); d++ {\n\t\tS += s[d][t[d]]\n\t\tlast[t[d]] = d\n\t\tfor i := 0; i < 26; i++ {\n\t\t\tS -= c[i] * (d - last[i])\n\t\t}\n\t\tscore += max(1000000+S, 0)\n\t}\n\treturn score\n}\n\nfunc solution3aSub(t []int, S int, score int, last []int) ([]int, int, int, []int) {\n\td := len(t)\n\tt = append(t, 0)\n\tbestNewS := -1\n\tbestNewScore := -1\n\tbestNewContestType := -1\n\tfor i := 0; i < 26; i++ {\n\t\tt[len(t)-1] = i\n\t\tnewS := S + s[d][t[d]]\n\t\told := last[i]\n\t\tlast[i] = d\n\t\tfor j := 0; j < 26; j++ {\n\t\t\tnewS -= c[j] * (d - last[j])\n\t\t}\n\t\tnewScore := score + max(1000000+newS, 0)\n\t\tif newScore > bestNewScore {\n\t\t\tbestNewS = newS\n\t\t\tbestNewScore = newScore\n\t\t\tbestNewContestType = i\n\t\t}\n\t\tlast[i] = old\n\t}\n\tt[len(t)-1] = bestNewContestType\n\tlast[bestNewContestType] = d\n\treturn t, bestNewS, bestNewScore, last\n}\n\nfunc solution3a() []int {\n\tt := make([]int, 0, D)\n\tscore := 0\n\tS := 0\n\tlast := make([]int, 26)\n\tfor i := 0; i < 26; i++ {\n\t\tlast[i] = -1\n\t}\n\tfor d := 0; d < D; d++ {\n\t\tt, S, score, last = solution3aSub(t, S, score, last)\n\t}\n\treturn t\n}\n\nfunc solution3() []int {\n\tvar t []int\n\tfor d := 0; d < D; d++ {\n\t\tscore := -1\n\t\tbest := -1\n\t\tt = append(t, 0)\n\t\tfor i := 0; i < 26; i++ {\n\t\t\tt[len(t)-1] = i\n\t\t\tnewScore := calcScore(t)\n\t\t\tif newScore > score {\n\t\t\t\tbest = i\n\t\t\t\tscore = newScore\n\t\t\t}\n\t\t}\n\t\tt[len(t)-1] = best\n\t}\n\treturn t\n}\n\nfunc solution4Sub(t []int) int {\n\tl := max(len(t)+13, D)\n\tfor len(t) != l {\n\t\tscore := -1\n\t\tbest := -1\n\t\tt = append(t, 0)\n\t\tfor i := 0; i < 26; i++ {\n\t\t\tt[len(t)-1] = i\n\t\t\tnewScore := calcScore(t)\n\t\t\tif newScore > score {\n\t\t\t\tbest = i\n\t\t\t\tscore = newScore\n\t\t\t}\n\t\t}\n\t\tt[len(t)-1] = best\n\t}\n\treturn calcScore(t)\n}\n\nfunc solution4() []int {\n\tvar t []int\n\tfor d := 0; d < D; d++ {\n\t\tscore := -1\n\t\tbest := -1\n\t\tt = append(t, 0)\n\t\tfor i := 0; i < 26; i++ {\n\t\t\tt[len(t)-1] = i\n\t\t\tnewScore := solution4Sub(t)\n\t\t\tif newScore > score {\n\t\t\t\tbest = i\n\t\t\t\tscore = newScore\n\t\t\t}\n\t\t}\n\t\tt[len(t)-1] = best\n\t}\n\treturn t\n}\n\nfunc solution4aSubSub(t []int, S int, score int, last []int) ([]int, int, int, []int) {\n\td := len(t)\n\tt = append(t, 0)\n\tbestNewS := -1\n\tbestNewScore := -1\n\tbestNewContestType := -1\n\tfor i := 0; i < 26; i++ {\n\t\told := last[i]\n\t\tt[d] = i\n\t\tnewS := S + s[d][t[d]]\n\t\tlast[i] = d\n\t\tfor j := 0; j < 26; j++ {\n\t\t\tnewS -= c[j] * (d - last[j])\n\t\t}\n\t\tnewScore := score + max(1000000+newS, 0)\n\t\tif newScore > bestNewScore {\n\t\t\tbestNewS = newS\n\t\t\tbestNewScore = newScore\n\t\t\tbestNewContestType = i\n\t\t}\n\t\tlast[i] = old\n\t}\n\tt[d] = bestNewContestType\n\tlast[bestNewContestType] = d\n\treturn t, bestNewS, bestNewScore, last\n}\n\nfunc solution4aSub(t []int, S int, score int, last []int) int {\n\txt := make([]int, len(t))\n\tcopy(xt, t)\n\txLast := make([]int, len(last))\n\tcopy(xLast, last)\n\td := len(t)\n\tfor i := d; i < min(d+13, D); i++ {\n\t\txt, S, score, xLast = solution4aSubSub(xt, S, score, xLast)\n\t}\n\treturn score\n}\n\nfunc solution4a() []int {\n\tvar t []int\n\tS := 0\n\tscore := 0\n\tlast := make([]int, 26)\n\tfor i := 0; i < 26; i++ {\n\t\tlast[i] = -1\n\t}\n\tfor d := 0; d < D; d++ {\n\t\tt = append(t, 0)\n\t\tnewBestScore := -1\n\t\tnewBestContestType := -1\n\t\tfor i := 0; i < 26; i++ {\n\t\t\told := last[i]\n\t\t\tt[d] = i\n\t\t\tnewS := S + s[d][t[d]]\n\t\t\tlast[i] = d\n\t\t\tfor i := 0; i < 26; i++ {\n\t\t\t\tnewS -= c[i] * (d - last[i])\n\t\t\t}\n\t\t\tnewScore := score + max(1000000+newS, 0)\n\t\t\tnewScore = solution4aSub(t, newS, newScore, last)\n\t\t\tif newScore > newBestScore {\n\t\t\t\tnewBestContestType = i\n\t\t\t\tnewBestScore = newScore\n\t\t\t}\n\t\t\tlast[i] = old\n\t\t}\n\t\tt[d] = newBestContestType\n\t\tlast[newBestContestType] = d\n\t\tS += s[d][t[d]]\n\t\tfor i := 0; i < 26; i++ {\n\t\t\tS -= c[i] * (d - last[i])\n\t\t}\n\t\tscore += max(1000000+S, 0)\n\t}\n\treturn t\n}\n\nfunc optimize3(t []int) []int {\n\tvar (\n\t\td [3]int\n\t\told [3]int\n\t)\n\trand.Seed(time.Now().UnixNano())\n\tscore := calcScore(t)\n\tfor time.Now().Sub(startTime).Seconds()+0.011 < limitSecs {\n\t\tn := rand.Intn(3) + 1\n\t\tfor i := 0; i < n; i++ {\n\t\t\td[i] = rand.Intn(D)\n\t\t\told[i] = t[d[i]]\n\t\t\tt[d[i]] = rand.Intn(26)\n\t\t}\n\t\tnewScore := calcScore(t)\n\t\tif newScore < score {\n\t\t\tfor i := n - 1; i > -1; i-- {\n\t\t\t\tt[d[i]] = old[i]\n\t\t\t}\n\t\t} else {\n\t\t\tscore = newScore\n\t\t}\n\t}\n\treturn t\n}\n\nfunc optimize1(t []int) []int {\n\trand.Seed(time.Now().UnixNano())\n\tscore := calcScore(t)\n\tfor time.Now().Sub(startTime).Seconds()+0.015 < limitSecs {\n\t\td := rand.Intn(D)\n\t\tq := rand.Intn(26)\n\t\told := t[d]\n\t\tt[d] = q\n\t\tnewScore := calcScore(t)\n\t\tif newScore < score {\n\t\t\tt[d] = old\n\t\t} else {\n\t\t\tscore = newScore\n\t\t}\n\t}\n\treturn t\n}\n\nfunc main() {\n\tdefer flush()\n\n\tstartTime = time.Now()\n\n\tD = readInt()\n\tfor i := 0; i < 26; i++ {\n\t\tc[i] = readInt()\n\t}\n\ts = make([][26]int, D)\n\tfor i := 0; i < D; i++ {\n\t\tfor j := 0; j < 26; j++ {\n\t\t\ts[i][j] = readInt()\n\t\t}\n\t}\n\n\tt := solution4a()\n\tt = optimize1(t)\n\tfor d := 0; d < D; d++ {\n\t\tprintln(t[d] + 1)\n\t}\n}\n\nconst (\n\tioBufferSize = 1 * 1024 * 1024 // 1 MB\n)\n\nvar stdinScanner = func() *bufio.Scanner {\n\tresult := bufio.NewScanner(os.Stdin)\n\tresult.Buffer(make([]byte, ioBufferSize), ioBufferSize)\n\tresult.Split(bufio.ScanWords)\n\treturn result\n}()\n\nfunc readString() string {\n\tstdinScanner.Scan()\n\treturn stdinScanner.Text()\n}\n\nfunc readInt() int {\n\tresult, err := strconv.Atoi(readString())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn result\n}\n\nvar stdoutWriter = bufio.NewWriter(os.Stdout)\n\nfunc flush() {\n\tstdoutWriter.Flush()\n}\n\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(stdoutWriter, args...)\n}\n", "language": "Go", "metadata": {"date": 1593588892, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02618.html", "problem_id": "p02618", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02618/input.txt", "sample_output_relpath": "derived/input_output/data/p02618/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02618/Go/s651809759.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s651809759", "user_id": "u347640436"}, "prompt_components": {"gold_output": "1\n17\n13\n14\n13\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math/rand\"\n\t\"os\"\n\t\"strconv\"\n\t\"time\"\n)\n\nconst (\n\tlimitSecs = 2.0\n)\n\n// D\nvar (\n\tD int\n\tc [26]int\n\ts [][26]int\n\tstartTime time.Time\n)\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc calcScore(t []int) int {\n\tvar last [26]int\n\tscore := 0\n\tS := 0\n\tfor i := 0; i < 26; i++ {\n\t\tlast[i] = -1\n\t}\n\tfor d := 0; d < len(t); d++ {\n\t\tS += s[d][t[d]]\n\t\tlast[t[d]] = d\n\t\tfor i := 0; i < 26; i++ {\n\t\t\tS -= c[i] * (d - last[i])\n\t\t}\n\t\tscore += max(1000000+S, 0)\n\t}\n\treturn score\n}\n\nfunc solution3aSub(t []int, S int, score int, last []int) ([]int, int, int, []int) {\n\td := len(t)\n\tt = append(t, 0)\n\tbestNewS := -1\n\tbestNewScore := -1\n\tbestNewContestType := -1\n\tfor i := 0; i < 26; i++ {\n\t\tt[len(t)-1] = i\n\t\tnewS := S + s[d][t[d]]\n\t\told := last[i]\n\t\tlast[i] = d\n\t\tfor j := 0; j < 26; j++ {\n\t\t\tnewS -= c[j] * (d - last[j])\n\t\t}\n\t\tnewScore := score + max(1000000+newS, 0)\n\t\tif newScore > bestNewScore {\n\t\t\tbestNewS = newS\n\t\t\tbestNewScore = newScore\n\t\t\tbestNewContestType = i\n\t\t}\n\t\tlast[i] = old\n\t}\n\tt[len(t)-1] = bestNewContestType\n\tlast[bestNewContestType] = d\n\treturn t, bestNewS, bestNewScore, last\n}\n\nfunc solution3a() []int {\n\tt := make([]int, 0, D)\n\tscore := 0\n\tS := 0\n\tlast := make([]int, 26)\n\tfor i := 0; i < 26; i++ {\n\t\tlast[i] = -1\n\t}\n\tfor d := 0; d < D; d++ {\n\t\tt, S, score, last = solution3aSub(t, S, score, last)\n\t}\n\treturn t\n}\n\nfunc solution3() []int {\n\tvar t []int\n\tfor d := 0; d < D; d++ {\n\t\tscore := -1\n\t\tbest := -1\n\t\tt = append(t, 0)\n\t\tfor i := 0; i < 26; i++ {\n\t\t\tt[len(t)-1] = i\n\t\t\tnewScore := calcScore(t)\n\t\t\tif newScore > score {\n\t\t\t\tbest = i\n\t\t\t\tscore = newScore\n\t\t\t}\n\t\t}\n\t\tt[len(t)-1] = best\n\t}\n\treturn t\n}\n\nfunc solution4Sub(t []int) int {\n\tl := max(len(t)+13, D)\n\tfor len(t) != l {\n\t\tscore := -1\n\t\tbest := -1\n\t\tt = append(t, 0)\n\t\tfor i := 0; i < 26; i++ {\n\t\t\tt[len(t)-1] = i\n\t\t\tnewScore := calcScore(t)\n\t\t\tif newScore > score {\n\t\t\t\tbest = i\n\t\t\t\tscore = newScore\n\t\t\t}\n\t\t}\n\t\tt[len(t)-1] = best\n\t}\n\treturn calcScore(t)\n}\n\nfunc solution4() []int {\n\tvar t []int\n\tfor d := 0; d < D; d++ {\n\t\tscore := -1\n\t\tbest := -1\n\t\tt = append(t, 0)\n\t\tfor i := 0; i < 26; i++ {\n\t\t\tt[len(t)-1] = i\n\t\t\tnewScore := solution4Sub(t)\n\t\t\tif newScore > score {\n\t\t\t\tbest = i\n\t\t\t\tscore = newScore\n\t\t\t}\n\t\t}\n\t\tt[len(t)-1] = best\n\t}\n\treturn t\n}\n\nfunc solution4aSubSub(t []int, S int, score int, last []int) ([]int, int, int, []int) {\n\td := len(t)\n\tt = append(t, 0)\n\tbestNewS := -1\n\tbestNewScore := -1\n\tbestNewContestType := -1\n\tfor i := 0; i < 26; i++ {\n\t\told := last[i]\n\t\tt[d] = i\n\t\tnewS := S + s[d][t[d]]\n\t\tlast[i] = d\n\t\tfor j := 0; j < 26; j++ {\n\t\t\tnewS -= c[j] * (d - last[j])\n\t\t}\n\t\tnewScore := score + max(1000000+newS, 0)\n\t\tif newScore > bestNewScore {\n\t\t\tbestNewS = newS\n\t\t\tbestNewScore = newScore\n\t\t\tbestNewContestType = i\n\t\t}\n\t\tlast[i] = old\n\t}\n\tt[d] = bestNewContestType\n\tlast[bestNewContestType] = d\n\treturn t, bestNewS, bestNewScore, last\n}\n\nfunc solution4aSub(t []int, S int, score int, last []int) int {\n\txt := make([]int, len(t))\n\tcopy(xt, t)\n\txLast := make([]int, len(last))\n\tcopy(xLast, last)\n\td := len(t)\n\tfor i := d; i < min(d+13, D); i++ {\n\t\txt, S, score, xLast = solution4aSubSub(xt, S, score, xLast)\n\t}\n\treturn score\n}\n\nfunc solution4a() []int {\n\tvar t []int\n\tS := 0\n\tscore := 0\n\tlast := make([]int, 26)\n\tfor i := 0; i < 26; i++ {\n\t\tlast[i] = -1\n\t}\n\tfor d := 0; d < D; d++ {\n\t\tt = append(t, 0)\n\t\tnewBestScore := -1\n\t\tnewBestContestType := -1\n\t\tfor i := 0; i < 26; i++ {\n\t\t\told := last[i]\n\t\t\tt[d] = i\n\t\t\tnewS := S + s[d][t[d]]\n\t\t\tlast[i] = d\n\t\t\tfor i := 0; i < 26; i++ {\n\t\t\t\tnewS -= c[i] * (d - last[i])\n\t\t\t}\n\t\t\tnewScore := score + max(1000000+newS, 0)\n\t\t\tnewScore = solution4aSub(t, newS, newScore, last)\n\t\t\tif newScore > newBestScore {\n\t\t\t\tnewBestContestType = i\n\t\t\t\tnewBestScore = newScore\n\t\t\t}\n\t\t\tlast[i] = old\n\t\t}\n\t\tt[d] = newBestContestType\n\t\tlast[newBestContestType] = d\n\t\tS += s[d][t[d]]\n\t\tfor i := 0; i < 26; i++ {\n\t\t\tS -= c[i] * (d - last[i])\n\t\t}\n\t\tscore += max(1000000+S, 0)\n\t}\n\treturn t\n}\n\nfunc optimize3(t []int) []int {\n\tvar (\n\t\td [3]int\n\t\told [3]int\n\t)\n\trand.Seed(time.Now().UnixNano())\n\tscore := calcScore(t)\n\tfor time.Now().Sub(startTime).Seconds()+0.011 < limitSecs {\n\t\tn := rand.Intn(3) + 1\n\t\tfor i := 0; i < n; i++ {\n\t\t\td[i] = rand.Intn(D)\n\t\t\told[i] = t[d[i]]\n\t\t\tt[d[i]] = rand.Intn(26)\n\t\t}\n\t\tnewScore := calcScore(t)\n\t\tif newScore < score {\n\t\t\tfor i := n - 1; i > -1; i-- {\n\t\t\t\tt[d[i]] = old[i]\n\t\t\t}\n\t\t} else {\n\t\t\tscore = newScore\n\t\t}\n\t}\n\treturn t\n}\n\nfunc optimize1(t []int) []int {\n\trand.Seed(time.Now().UnixNano())\n\tscore := calcScore(t)\n\tfor time.Now().Sub(startTime).Seconds()+0.015 < limitSecs {\n\t\td := rand.Intn(D)\n\t\tq := rand.Intn(26)\n\t\told := t[d]\n\t\tt[d] = q\n\t\tnewScore := calcScore(t)\n\t\tif newScore < score {\n\t\t\tt[d] = old\n\t\t} else {\n\t\t\tscore = newScore\n\t\t}\n\t}\n\treturn t\n}\n\nfunc main() {\n\tdefer flush()\n\n\tstartTime = time.Now()\n\n\tD = readInt()\n\tfor i := 0; i < 26; i++ {\n\t\tc[i] = readInt()\n\t}\n\ts = make([][26]int, D)\n\tfor i := 0; i < D; i++ {\n\t\tfor j := 0; j < 26; j++ {\n\t\t\ts[i][j] = readInt()\n\t\t}\n\t}\n\n\tt := solution4a()\n\tt = optimize1(t)\n\tfor d := 0; d < D; d++ {\n\t\tprintln(t[d] + 1)\n\t}\n}\n\nconst (\n\tioBufferSize = 1 * 1024 * 1024 // 1 MB\n)\n\nvar stdinScanner = func() *bufio.Scanner {\n\tresult := bufio.NewScanner(os.Stdin)\n\tresult.Buffer(make([]byte, ioBufferSize), ioBufferSize)\n\tresult.Split(bufio.ScanWords)\n\treturn result\n}()\n\nfunc readString() string {\n\tstdinScanner.Scan()\n\treturn stdinScanner.Text()\n}\n\nfunc readInt() int {\n\tresult, err := strconv.Atoi(readString())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn result\n}\n\nvar stdoutWriter = bufio.NewWriter(os.Stdout)\n\nfunc flush() {\n\tstdoutWriter.Flush()\n}\n\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(stdoutWriter, args...)\n}\n", "problem_context": "Problem Statement\n\nAtCoder currently hosts three types of contests: ABC, ARC, and AGC. As the number of users has grown, in order to meet the needs of more users, AtCoder has decided to increase the number of contests to 26 types, from AAC to AZC. For convenience, we number these 26 types as type 1 through type 26. AtCoder wants to schedule contests for D days so that user satisfaction is as high as possible. For every day, AtCoder will hold exactly one contest, and each contest will end on that day. The satisfaction is calculated as follows.\n\nThe satisfaction at the beginning of day 1 is 0. Satisfaction can be negative.\n\nHolding contests increases satisfaction. The amount of increase will vary depending on a variety of factors. Specifically, we know in advance that holding a contest of type i on day d will increase the satisfaction by s_{d,i}.\n\nIf a particular type of contest is not held for a while, the satisfaction decreases. Each contest type i has an integer c_i, and at the end of each day d=1,2,...,D, the satisfaction decreases as follows. Let \\mathrm{last}(d,i) be the last day before day d (including d) on which a contest of type i was held. If contests of type i have never been held yet, we define \\mathrm{last}(d,i)=0. At the end of day d, the satisfaction decreases by \\sum _{i=1}^{26}c_i \\times (d-\\mathrm{last}(d,i)).\n\nPlease schedule contests on behalf of AtCoder.\nIf the satisfaction at the end of day D is S, you will get a score of \\max(10^6 + S, 0).\nThere are 50 test cases, and the score of a submission is the total scores for each test case.\nYou can make submissions multiple times, and the highest score among your submissions will be your score.\n\nConstraints\n\nD = 365\n\nEach c_i is an integer satisfying 0\\leq c_i \\leq 100.\n\nEach s_{d,i} is an integer satisfying 0\\leq s_{d,i} \\leq 20000.\n\nInput\n\nInput is given from Standard Input in the following format:\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}\n\nOutput\n\nLet t_d (1\\leq t_d \\leq 26) be the type of the contest that will be held at day d.\nPrint D integers t_d to Standard Output in the following format:\n\nt_1\nt_2\n\\vdots\nt_D\n\nAny output that does not follow the above format may result in 0 pointsWA for that test case.\n\nInput Generation\n\nEach integer c_i and s_{d,i} is generated independently and uniformly at random from the integers in the range described in the problem statement.\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\n\nSample Output 1\n\n1\n17\n13\n14\n13\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. The final satisfaction with this output is 79325, so the score is 1079325.\n\nInput generator, score calculator, and visualizer\n\nBeginner's Guide\n\nIf you don't know what to do, proceed to problem B or C.", "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\n"}, "reference_outputs": ["1\n17\n13\n14\n13\n"], "source_document_id": "p02618", "source_text": "Problem Statement\n\nAtCoder currently hosts three types of contests: ABC, ARC, and AGC. As the number of users has grown, in order to meet the needs of more users, AtCoder has decided to increase the number of contests to 26 types, from AAC to AZC. For convenience, we number these 26 types as type 1 through type 26. AtCoder wants to schedule contests for D days so that user satisfaction is as high as possible. For every day, AtCoder will hold exactly one contest, and each contest will end on that day. The satisfaction is calculated as follows.\n\nThe satisfaction at the beginning of day 1 is 0. Satisfaction can be negative.\n\nHolding contests increases satisfaction. The amount of increase will vary depending on a variety of factors. Specifically, we know in advance that holding a contest of type i on day d will increase the satisfaction by s_{d,i}.\n\nIf a particular type of contest is not held for a while, the satisfaction decreases. Each contest type i has an integer c_i, and at the end of each day d=1,2,...,D, the satisfaction decreases as follows. Let \\mathrm{last}(d,i) be the last day before day d (including d) on which a contest of type i was held. If contests of type i have never been held yet, we define \\mathrm{last}(d,i)=0. At the end of day d, the satisfaction decreases by \\sum _{i=1}^{26}c_i \\times (d-\\mathrm{last}(d,i)).\n\nPlease schedule contests on behalf of AtCoder.\nIf the satisfaction at the end of day D is S, you will get a score of \\max(10^6 + S, 0).\nThere are 50 test cases, and the score of a submission is the total scores for each test case.\nYou can make submissions multiple times, and the highest score among your submissions will be your score.\n\nConstraints\n\nD = 365\n\nEach c_i is an integer satisfying 0\\leq c_i \\leq 100.\n\nEach s_{d,i} is an integer satisfying 0\\leq s_{d,i} \\leq 20000.\n\nInput\n\nInput is given from Standard Input in the following format:\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}\n\nOutput\n\nLet t_d (1\\leq t_d \\leq 26) be the type of the contest that will be held at day d.\nPrint D integers t_d to Standard Output in the following format:\n\nt_1\nt_2\n\\vdots\nt_D\n\nAny output that does not follow the above format may result in 0 pointsWA for that test case.\n\nInput Generation\n\nEach integer c_i and s_{d,i} is generated independently and uniformly at random from the integers in the range described in the problem statement.\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\n\nSample Output 1\n\n1\n17\n13\n14\n13\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. The final satisfaction with this output is 79325, so the score is 1079325.\n\nInput generator, score calculator, and visualizer\n\nBeginner's Guide\n\nIf you don't know what to do, proceed to problem B or C.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5781, "cpu_time_ms": 1994, "memory_kb": 5924}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s425034880", "group_id": "codeNet:p02618", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"math/rand\"\n\t\"os\"\n\t\"time\"\n)\n\nvar D int\nvar cs []int\nvar ss [][]int\n\nfunc main() {\n\tD = ReadInt()\n\tcs = ReadInts(26)\n\tss = make([][]int, D)\n\tfor i := 0; i < D; i++ {\n\t\tss[i] = ReadInts(26)\n\t}\n\n\t// naives\n\tanswers := []int{}\n\tlast := make([]int, 26)\n\tfor d := 1; d <= D; d++ {\n\t\tmaxT, maxScore := -1, math.MinInt32\n\t\tfor i := 0; i < 26; i++ {\n\t\t\ts := ss[d-1][i] - cs[i]*(d-last[i])\n\t\t\tif s > maxScore {\n\t\t\t\tmaxT, maxScore = i, s\n\t\t\t}\n\t\t}\n\t\tlast[maxT] = d\n\t\tanswers = append(answers, maxT+1)\n\t}\n\n\trand.Seed(123456777)\n\n\tscore := scores(answers)\n\tbestAnswers, bestScore := Dup(answers), score\n\n\tstart := time.Now()\n\ttimeout := 1950 * time.Millisecond\n\n\tfor {\n\t\telapsed := time.Now().Sub(start)\n\t\tif elapsed >= timeout {\n\t\t\tbreak\n\t\t}\n\n\t\td, q := rand.Intn(D)+1, rand.Intn(26)+1\n\t\torig := answers[d-1]\n\t\tanswers[d-1] = q\n\t\tscore := scores(answers)\n\n\t\tbest := false\n\t\tif score > bestScore {\n\t\t\tbest = true\n\t\t\tbestAnswers, bestScore = Dup(answers), score\n\t\t}\n\n\t\tif elapsed < time.Second {\n\t\t\t// 最初はベストのときだけ更新する\n\t\t\tif best {\n\t\t\t\t// none\n\t\t\t} else {\n\t\t\t\tanswers[d-1] = orig // revert\n\t\t\t}\n\t\t} else {\n\t\t\tanswers[d-1] = orig // revert\n\t\t}\n\t}\n\n\tfor _, v := range bestAnswers {\n\t\tfmt.Println(v)\n\t}\n}\n\nfunc Dup(xs []int) []int {\n\treturn append([]int{}, xs...)\n}\n\nfunc scores(answers []int) int {\n\tlast := make([]int, 26)\n\tscore := 0\n\tfor d := 1; d <= D; d++ {\n\t\tt := answers[d-1] - 1\n\t\tscore += ss[d-1][t]\n\t\tlast[t] = d\n\t\tfor i := 0; i < 26; i++ {\n\t\t\tscore -= cs[i] * (d - last[i])\n\t\t}\n\t}\n\treturn score\n}\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadInts(n int) []int {\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tScan(&v[i])\n\t}\n\treturn v\n}\n", "language": "Go", "metadata": {"date": 1593399016, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02618.html", "problem_id": "p02618", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02618/input.txt", "sample_output_relpath": "derived/input_output/data/p02618/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02618/Go/s425034880.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s425034880", "user_id": "u328656362"}, "prompt_components": {"gold_output": "1\n17\n13\n14\n13\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"math/rand\"\n\t\"os\"\n\t\"time\"\n)\n\nvar D int\nvar cs []int\nvar ss [][]int\n\nfunc main() {\n\tD = ReadInt()\n\tcs = ReadInts(26)\n\tss = make([][]int, D)\n\tfor i := 0; i < D; i++ {\n\t\tss[i] = ReadInts(26)\n\t}\n\n\t// naives\n\tanswers := []int{}\n\tlast := make([]int, 26)\n\tfor d := 1; d <= D; d++ {\n\t\tmaxT, maxScore := -1, math.MinInt32\n\t\tfor i := 0; i < 26; i++ {\n\t\t\ts := ss[d-1][i] - cs[i]*(d-last[i])\n\t\t\tif s > maxScore {\n\t\t\t\tmaxT, maxScore = i, s\n\t\t\t}\n\t\t}\n\t\tlast[maxT] = d\n\t\tanswers = append(answers, maxT+1)\n\t}\n\n\trand.Seed(123456777)\n\n\tscore := scores(answers)\n\tbestAnswers, bestScore := Dup(answers), score\n\n\tstart := time.Now()\n\ttimeout := 1950 * time.Millisecond\n\n\tfor {\n\t\telapsed := time.Now().Sub(start)\n\t\tif elapsed >= timeout {\n\t\t\tbreak\n\t\t}\n\n\t\td, q := rand.Intn(D)+1, rand.Intn(26)+1\n\t\torig := answers[d-1]\n\t\tanswers[d-1] = q\n\t\tscore := scores(answers)\n\n\t\tbest := false\n\t\tif score > bestScore {\n\t\t\tbest = true\n\t\t\tbestAnswers, bestScore = Dup(answers), score\n\t\t}\n\n\t\tif elapsed < time.Second {\n\t\t\t// 最初はベストのときだけ更新する\n\t\t\tif best {\n\t\t\t\t// none\n\t\t\t} else {\n\t\t\t\tanswers[d-1] = orig // revert\n\t\t\t}\n\t\t} else {\n\t\t\tanswers[d-1] = orig // revert\n\t\t}\n\t}\n\n\tfor _, v := range bestAnswers {\n\t\tfmt.Println(v)\n\t}\n}\n\nfunc Dup(xs []int) []int {\n\treturn append([]int{}, xs...)\n}\n\nfunc scores(answers []int) int {\n\tlast := make([]int, 26)\n\tscore := 0\n\tfor d := 1; d <= D; d++ {\n\t\tt := answers[d-1] - 1\n\t\tscore += ss[d-1][t]\n\t\tlast[t] = d\n\t\tfor i := 0; i < 26; i++ {\n\t\t\tscore -= cs[i] * (d - last[i])\n\t\t}\n\t}\n\treturn score\n}\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadInts(n int) []int {\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tScan(&v[i])\n\t}\n\treturn v\n}\n", "problem_context": "Problem Statement\n\nAtCoder currently hosts three types of contests: ABC, ARC, and AGC. As the number of users has grown, in order to meet the needs of more users, AtCoder has decided to increase the number of contests to 26 types, from AAC to AZC. For convenience, we number these 26 types as type 1 through type 26. AtCoder wants to schedule contests for D days so that user satisfaction is as high as possible. For every day, AtCoder will hold exactly one contest, and each contest will end on that day. The satisfaction is calculated as follows.\n\nThe satisfaction at the beginning of day 1 is 0. Satisfaction can be negative.\n\nHolding contests increases satisfaction. The amount of increase will vary depending on a variety of factors. Specifically, we know in advance that holding a contest of type i on day d will increase the satisfaction by s_{d,i}.\n\nIf a particular type of contest is not held for a while, the satisfaction decreases. Each contest type i has an integer c_i, and at the end of each day d=1,2,...,D, the satisfaction decreases as follows. Let \\mathrm{last}(d,i) be the last day before day d (including d) on which a contest of type i was held. If contests of type i have never been held yet, we define \\mathrm{last}(d,i)=0. At the end of day d, the satisfaction decreases by \\sum _{i=1}^{26}c_i \\times (d-\\mathrm{last}(d,i)).\n\nPlease schedule contests on behalf of AtCoder.\nIf the satisfaction at the end of day D is S, you will get a score of \\max(10^6 + S, 0).\nThere are 50 test cases, and the score of a submission is the total scores for each test case.\nYou can make submissions multiple times, and the highest score among your submissions will be your score.\n\nConstraints\n\nD = 365\n\nEach c_i is an integer satisfying 0\\leq c_i \\leq 100.\n\nEach s_{d,i} is an integer satisfying 0\\leq s_{d,i} \\leq 20000.\n\nInput\n\nInput is given from Standard Input in the following format:\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}\n\nOutput\n\nLet t_d (1\\leq t_d \\leq 26) be the type of the contest that will be held at day d.\nPrint D integers t_d to Standard Output in the following format:\n\nt_1\nt_2\n\\vdots\nt_D\n\nAny output that does not follow the above format may result in 0 pointsWA for that test case.\n\nInput Generation\n\nEach integer c_i and s_{d,i} is generated independently and uniformly at random from the integers in the range described in the problem statement.\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\n\nSample Output 1\n\n1\n17\n13\n14\n13\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. The final satisfaction with this output is 79325, so the score is 1079325.\n\nInput generator, score calculator, and visualizer\n\nBeginner's Guide\n\nIf you don't know what to do, proceed to problem B or C.", "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\n"}, "reference_outputs": ["1\n17\n13\n14\n13\n"], "source_document_id": "p02618", "source_text": "Problem Statement\n\nAtCoder currently hosts three types of contests: ABC, ARC, and AGC. As the number of users has grown, in order to meet the needs of more users, AtCoder has decided to increase the number of contests to 26 types, from AAC to AZC. For convenience, we number these 26 types as type 1 through type 26. AtCoder wants to schedule contests for D days so that user satisfaction is as high as possible. For every day, AtCoder will hold exactly one contest, and each contest will end on that day. The satisfaction is calculated as follows.\n\nThe satisfaction at the beginning of day 1 is 0. Satisfaction can be negative.\n\nHolding contests increases satisfaction. The amount of increase will vary depending on a variety of factors. Specifically, we know in advance that holding a contest of type i on day d will increase the satisfaction by s_{d,i}.\n\nIf a particular type of contest is not held for a while, the satisfaction decreases. Each contest type i has an integer c_i, and at the end of each day d=1,2,...,D, the satisfaction decreases as follows. Let \\mathrm{last}(d,i) be the last day before day d (including d) on which a contest of type i was held. If contests of type i have never been held yet, we define \\mathrm{last}(d,i)=0. At the end of day d, the satisfaction decreases by \\sum _{i=1}^{26}c_i \\times (d-\\mathrm{last}(d,i)).\n\nPlease schedule contests on behalf of AtCoder.\nIf the satisfaction at the end of day D is S, you will get a score of \\max(10^6 + S, 0).\nThere are 50 test cases, and the score of a submission is the total scores for each test case.\nYou can make submissions multiple times, and the highest score among your submissions will be your score.\n\nConstraints\n\nD = 365\n\nEach c_i is an integer satisfying 0\\leq c_i \\leq 100.\n\nEach s_{d,i} is an integer satisfying 0\\leq s_{d,i} \\leq 20000.\n\nInput\n\nInput is given from Standard Input in the following format:\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}\n\nOutput\n\nLet t_d (1\\leq t_d \\leq 26) be the type of the contest that will be held at day d.\nPrint D integers t_d to Standard Output in the following format:\n\nt_1\nt_2\n\\vdots\nt_D\n\nAny output that does not follow the above format may result in 0 pointsWA for that test case.\n\nInput Generation\n\nEach integer c_i and s_{d,i} is generated independently and uniformly at random from the integers in the range described in the problem statement.\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\n\nSample Output 1\n\n1\n17\n13\n14\n13\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. The final satisfaction with this output is 79325, so the score is 1079325.\n\nInput generator, score calculator, and visualizer\n\nBeginner's Guide\n\nIf you don't know what to do, proceed to problem B or C.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1857, "cpu_time_ms": 1971, "memory_kb": 4744}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s140051363", "group_id": "codeNet:p02618", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"math/rand\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc Scanner() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc intScanner() int {\n\tn, _ := strconv.Atoi(Scanner())\n\treturn n\n}\n\nfunc floatScanner() float64 {\n\tn, _ := strconv.ParseFloat(Scanner(), 64)\n\treturn n\n}\nfunc stringToInt(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\nfunc stringSliceScanner(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = Scanner()\n\t}\n\treturn a\n}\nfunc intSliceScanner(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = intScanner()\n\t}\n\treturn a\n}\nfunc larger(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc smaller(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc max(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x < a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc min(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x > a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\n\nvar mod int\nvar t float64\n\nfunc main() {\n\tmod = 1000000007\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, mod)\n\tsc.Split(bufio.ScanWords)\n\td := intScanner()\n\tc := intSliceScanner(26)\n\ts := make([][]int, d)\n\tfor i := 0; i < d; i++ {\n\t\ts[i] = intSliceScanner(26)\n\t}\n\tbest := -mod\n\tbestSchedule := make([]int, d)\n\tchangeNum := 10\n\tfor x := 0; x < 1; x++ {\n\t\tschedule := make([]int, d)\n\t\tfor i := 0; i < d; i++ {\n\t\t\tschedule[i] = rand.Intn(26)\n\t\t}\n\t\tscore := calcScore(schedule, c, s, d)\n\t\tfor y := 0; y < 80000; y++ {\n\t\t\tchanges := make([]int, changeNum)\n\t\t\tpres := make([]int, changeNum)\n\t\t\tfor i := 0; i < changeNum; i++ {\n\t\t\t\tchanges[i] = rand.Intn(d)\n\t\t\t\tpres[i] = schedule[changes[i]]\n\t\t\t\tschedule[changes[i]] = rand.Intn(26)\n\t\t\t}\n\t\t\tnextScore := calcScore(schedule, c, s, d)\n\t\t\tt = float64(score) * 0.5\n\t\t\tif prob(score, nextScore) >= math.Abs(rand.Float64()) {\n\t\t\t\tscore = nextScore\n\t\t\t} else {\n\t\t\t\tfor i := 0; i < changeNum; i++ {\n\t\t\t\t\tschedule[changes[i]] = pres[i]\n\t\t\t\t}\n\t\t\t}\n\t\t\tif nextScore >= best {\n\t\t\t\tbest = nextScore\n\t\t\t\tcopy(bestSchedule, schedule)\n\t\t\t}\n\t\t\tt *= 0.999\n\t\t}\n\t}\n\tfor i := 0; i < d; i++ {\n\t\tfmt.Println(bestSchedule[i] + 1)\n\t}\n}\nfunc calcScore(schedule []int, c []int, s [][]int, d int) int {\n\tscore := 0\n\tlast := make([]int, 26)\n\tfor i, v := range schedule {\n\t\tscore += s[i][v]\n\t\tfor j, _ := range last {\n\t\t\tlast[j]++\n\t\t}\n\t\tlast[v] = 0\n\t\tfor j, v := range last {\n\t\t\tscore -= c[j] * v\n\t\t}\n\t}\n\treturn score\n}\nfunc prob(before int, after int) float64 {\n\tif before <= after {\n\t\treturn 1.0\n\t}\n\treturn math.Exp((float64(after) - float64(before)) / float64(t))\n}\n", "language": "Go", "metadata": {"date": 1593396809, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02618.html", "problem_id": "p02618", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02618/input.txt", "sample_output_relpath": "derived/input_output/data/p02618/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02618/Go/s140051363.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s140051363", "user_id": "u843722521"}, "prompt_components": {"gold_output": "1\n17\n13\n14\n13\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"math/rand\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc Scanner() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc intScanner() int {\n\tn, _ := strconv.Atoi(Scanner())\n\treturn n\n}\n\nfunc floatScanner() float64 {\n\tn, _ := strconv.ParseFloat(Scanner(), 64)\n\treturn n\n}\nfunc stringToInt(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\nfunc stringSliceScanner(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = Scanner()\n\t}\n\treturn a\n}\nfunc intSliceScanner(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = intScanner()\n\t}\n\treturn a\n}\nfunc larger(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc smaller(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc max(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x < a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc min(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x > a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\n\nvar mod int\nvar t float64\n\nfunc main() {\n\tmod = 1000000007\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, mod)\n\tsc.Split(bufio.ScanWords)\n\td := intScanner()\n\tc := intSliceScanner(26)\n\ts := make([][]int, d)\n\tfor i := 0; i < d; i++ {\n\t\ts[i] = intSliceScanner(26)\n\t}\n\tbest := -mod\n\tbestSchedule := make([]int, d)\n\tchangeNum := 10\n\tfor x := 0; x < 1; x++ {\n\t\tschedule := make([]int, d)\n\t\tfor i := 0; i < d; i++ {\n\t\t\tschedule[i] = rand.Intn(26)\n\t\t}\n\t\tscore := calcScore(schedule, c, s, d)\n\t\tfor y := 0; y < 80000; y++ {\n\t\t\tchanges := make([]int, changeNum)\n\t\t\tpres := make([]int, changeNum)\n\t\t\tfor i := 0; i < changeNum; i++ {\n\t\t\t\tchanges[i] = rand.Intn(d)\n\t\t\t\tpres[i] = schedule[changes[i]]\n\t\t\t\tschedule[changes[i]] = rand.Intn(26)\n\t\t\t}\n\t\t\tnextScore := calcScore(schedule, c, s, d)\n\t\t\tt = float64(score) * 0.5\n\t\t\tif prob(score, nextScore) >= math.Abs(rand.Float64()) {\n\t\t\t\tscore = nextScore\n\t\t\t} else {\n\t\t\t\tfor i := 0; i < changeNum; i++ {\n\t\t\t\t\tschedule[changes[i]] = pres[i]\n\t\t\t\t}\n\t\t\t}\n\t\t\tif nextScore >= best {\n\t\t\t\tbest = nextScore\n\t\t\t\tcopy(bestSchedule, schedule)\n\t\t\t}\n\t\t\tt *= 0.999\n\t\t}\n\t}\n\tfor i := 0; i < d; i++ {\n\t\tfmt.Println(bestSchedule[i] + 1)\n\t}\n}\nfunc calcScore(schedule []int, c []int, s [][]int, d int) int {\n\tscore := 0\n\tlast := make([]int, 26)\n\tfor i, v := range schedule {\n\t\tscore += s[i][v]\n\t\tfor j, _ := range last {\n\t\t\tlast[j]++\n\t\t}\n\t\tlast[v] = 0\n\t\tfor j, v := range last {\n\t\t\tscore -= c[j] * v\n\t\t}\n\t}\n\treturn score\n}\nfunc prob(before int, after int) float64 {\n\tif before <= after {\n\t\treturn 1.0\n\t}\n\treturn math.Exp((float64(after) - float64(before)) / float64(t))\n}\n", "problem_context": "Problem Statement\n\nAtCoder currently hosts three types of contests: ABC, ARC, and AGC. As the number of users has grown, in order to meet the needs of more users, AtCoder has decided to increase the number of contests to 26 types, from AAC to AZC. For convenience, we number these 26 types as type 1 through type 26. AtCoder wants to schedule contests for D days so that user satisfaction is as high as possible. For every day, AtCoder will hold exactly one contest, and each contest will end on that day. The satisfaction is calculated as follows.\n\nThe satisfaction at the beginning of day 1 is 0. Satisfaction can be negative.\n\nHolding contests increases satisfaction. The amount of increase will vary depending on a variety of factors. Specifically, we know in advance that holding a contest of type i on day d will increase the satisfaction by s_{d,i}.\n\nIf a particular type of contest is not held for a while, the satisfaction decreases. Each contest type i has an integer c_i, and at the end of each day d=1,2,...,D, the satisfaction decreases as follows. Let \\mathrm{last}(d,i) be the last day before day d (including d) on which a contest of type i was held. If contests of type i have never been held yet, we define \\mathrm{last}(d,i)=0. At the end of day d, the satisfaction decreases by \\sum _{i=1}^{26}c_i \\times (d-\\mathrm{last}(d,i)).\n\nPlease schedule contests on behalf of AtCoder.\nIf the satisfaction at the end of day D is S, you will get a score of \\max(10^6 + S, 0).\nThere are 50 test cases, and the score of a submission is the total scores for each test case.\nYou can make submissions multiple times, and the highest score among your submissions will be your score.\n\nConstraints\n\nD = 365\n\nEach c_i is an integer satisfying 0\\leq c_i \\leq 100.\n\nEach s_{d,i} is an integer satisfying 0\\leq s_{d,i} \\leq 20000.\n\nInput\n\nInput is given from Standard Input in the following format:\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}\n\nOutput\n\nLet t_d (1\\leq t_d \\leq 26) be the type of the contest that will be held at day d.\nPrint D integers t_d to Standard Output in the following format:\n\nt_1\nt_2\n\\vdots\nt_D\n\nAny output that does not follow the above format may result in 0 pointsWA for that test case.\n\nInput Generation\n\nEach integer c_i and s_{d,i} is generated independently and uniformly at random from the integers in the range described in the problem statement.\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\n\nSample Output 1\n\n1\n17\n13\n14\n13\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. The final satisfaction with this output is 79325, so the score is 1079325.\n\nInput generator, score calculator, and visualizer\n\nBeginner's Guide\n\nIf you don't know what to do, proceed to problem B or C.", "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\n"}, "reference_outputs": ["1\n17\n13\n14\n13\n"], "source_document_id": "p02618", "source_text": "Problem Statement\n\nAtCoder currently hosts three types of contests: ABC, ARC, and AGC. As the number of users has grown, in order to meet the needs of more users, AtCoder has decided to increase the number of contests to 26 types, from AAC to AZC. For convenience, we number these 26 types as type 1 through type 26. AtCoder wants to schedule contests for D days so that user satisfaction is as high as possible. For every day, AtCoder will hold exactly one contest, and each contest will end on that day. The satisfaction is calculated as follows.\n\nThe satisfaction at the beginning of day 1 is 0. Satisfaction can be negative.\n\nHolding contests increases satisfaction. The amount of increase will vary depending on a variety of factors. Specifically, we know in advance that holding a contest of type i on day d will increase the satisfaction by s_{d,i}.\n\nIf a particular type of contest is not held for a while, the satisfaction decreases. Each contest type i has an integer c_i, and at the end of each day d=1,2,...,D, the satisfaction decreases as follows. Let \\mathrm{last}(d,i) be the last day before day d (including d) on which a contest of type i was held. If contests of type i have never been held yet, we define \\mathrm{last}(d,i)=0. At the end of day d, the satisfaction decreases by \\sum _{i=1}^{26}c_i \\times (d-\\mathrm{last}(d,i)).\n\nPlease schedule contests on behalf of AtCoder.\nIf the satisfaction at the end of day D is S, you will get a score of \\max(10^6 + S, 0).\nThere are 50 test cases, and the score of a submission is the total scores for each test case.\nYou can make submissions multiple times, and the highest score among your submissions will be your score.\n\nConstraints\n\nD = 365\n\nEach c_i is an integer satisfying 0\\leq c_i \\leq 100.\n\nEach s_{d,i} is an integer satisfying 0\\leq s_{d,i} \\leq 20000.\n\nInput\n\nInput is given from Standard Input in the following format:\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}\n\nOutput\n\nLet t_d (1\\leq t_d \\leq 26) be the type of the contest that will be held at day d.\nPrint D integers t_d to Standard Output in the following format:\n\nt_1\nt_2\n\\vdots\nt_D\n\nAny output that does not follow the above format may result in 0 pointsWA for that test case.\n\nInput Generation\n\nEach integer c_i and s_{d,i} is generated independently and uniformly at random from the integers in the range described in the problem statement.\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\n\nSample Output 1\n\n1\n17\n13\n14\n13\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. The final satisfaction with this output is 79325, so the score is 1079325.\n\nInput generator, score calculator, and visualizer\n\nBeginner's Guide\n\nIf you don't know what to do, proceed to problem B or C.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2660, "cpu_time_ms": 1051, "memory_kb": 6256}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s518311931", "group_id": "codeNet:p02618", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"math/rand\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc Scanner() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc intScanner() int {\n\tn, _ := strconv.Atoi(Scanner())\n\treturn n\n}\n\nfunc floatScanner() float64 {\n\tn, _ := strconv.ParseFloat(Scanner(), 64)\n\treturn n\n}\nfunc stringToInt(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\nfunc stringSliceScanner(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = Scanner()\n\t}\n\treturn a\n}\nfunc intSliceScanner(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = intScanner()\n\t}\n\treturn a\n}\nfunc larger(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc smaller(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc max(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x < a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc min(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x > a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\n\nvar mod int\nvar t float64\n\nfunc main() {\n\tmod = 1000000007\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, mod)\n\tsc.Split(bufio.ScanWords)\n\td := intScanner()\n\tc := intSliceScanner(26)\n\ts := make([][]int, d)\n\tfor i := 0; i < d; i++ {\n\t\ts[i] = intSliceScanner(26)\n\t}\n\tbest := -mod\n\tbestSchedule := make([]int, d)\n\tfor x := 0; x < 5; x++ {\n\t\tschedule := make([]int, d)\n\t\tfor i := 0; i < d; i++ {\n\t\t\tschedule[i] = rand.Intn(26)\n\t\t}\n\t\tscore := calcScore(schedule, c, s, d)\n\t\tfor y := 0; y < 10000; y++ {\n\t\t\tz := make([]int, d)\n\t\t\tcopy(z, schedule)\n\t\t\tchange := rand.Intn(d)\n\t\t\tval := rand.Intn(26)\n\t\t\tz[change] = val\n\t\t\tnextScore := calcScore(z, c, s, d)\n\t\t\tt = float64(score) * 0.1\n\t\t\tif prob(score, nextScore) >= math.Abs(rand.Float64()) {\n\t\t\t\tcopy(schedule, z)\n\t\t\t\tscore = nextScore\n\t\t\t}\n\t\t\tif nextScore >= best {\n\t\t\t\tbest = nextScore\n\t\t\t\tcopy(bestSchedule, schedule)\n\t\t\t}\n\t\t\tt *= 0.999\n\t\t}\n\t}\n\tfor i := 0; i < d; i++ {\n\t\tfmt.Println(bestSchedule[i] + 1)\n\t}\n}\nfunc calcScore(schedule []int, c []int, s [][]int, d int) int {\n\tscore := 0\n\tlast := make([]int, 26)\n\tfor i, v := range schedule {\n\t\tscore += s[i][v]\n\t\tfor j, _ := range last {\n\t\t\tlast[j]++\n\t\t}\n\t\tlast[v] = 0\n\t\tfor j, v := range last {\n\t\t\tscore -= c[j] * v\n\t\t}\n\t}\n\treturn score\n}\nfunc prob(before int, after int) float64 {\n\tif before <= after {\n\t\treturn 1.0\n\t}\n\treturn math.Exp((float64(after) - float64(before)) / float64(t))\n}\n", "language": "Go", "metadata": {"date": 1593395258, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02618.html", "problem_id": "p02618", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02618/input.txt", "sample_output_relpath": "derived/input_output/data/p02618/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02618/Go/s518311931.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s518311931", "user_id": "u843722521"}, "prompt_components": {"gold_output": "1\n17\n13\n14\n13\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"math/rand\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc Scanner() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc intScanner() int {\n\tn, _ := strconv.Atoi(Scanner())\n\treturn n\n}\n\nfunc floatScanner() float64 {\n\tn, _ := strconv.ParseFloat(Scanner(), 64)\n\treturn n\n}\nfunc stringToInt(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\nfunc stringSliceScanner(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = Scanner()\n\t}\n\treturn a\n}\nfunc intSliceScanner(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = intScanner()\n\t}\n\treturn a\n}\nfunc larger(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc smaller(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc max(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x < a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc min(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x > a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\n\nvar mod int\nvar t float64\n\nfunc main() {\n\tmod = 1000000007\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, mod)\n\tsc.Split(bufio.ScanWords)\n\td := intScanner()\n\tc := intSliceScanner(26)\n\ts := make([][]int, d)\n\tfor i := 0; i < d; i++ {\n\t\ts[i] = intSliceScanner(26)\n\t}\n\tbest := -mod\n\tbestSchedule := make([]int, d)\n\tfor x := 0; x < 5; x++ {\n\t\tschedule := make([]int, d)\n\t\tfor i := 0; i < d; i++ {\n\t\t\tschedule[i] = rand.Intn(26)\n\t\t}\n\t\tscore := calcScore(schedule, c, s, d)\n\t\tfor y := 0; y < 10000; y++ {\n\t\t\tz := make([]int, d)\n\t\t\tcopy(z, schedule)\n\t\t\tchange := rand.Intn(d)\n\t\t\tval := rand.Intn(26)\n\t\t\tz[change] = val\n\t\t\tnextScore := calcScore(z, c, s, d)\n\t\t\tt = float64(score) * 0.1\n\t\t\tif prob(score, nextScore) >= math.Abs(rand.Float64()) {\n\t\t\t\tcopy(schedule, z)\n\t\t\t\tscore = nextScore\n\t\t\t}\n\t\t\tif nextScore >= best {\n\t\t\t\tbest = nextScore\n\t\t\t\tcopy(bestSchedule, schedule)\n\t\t\t}\n\t\t\tt *= 0.999\n\t\t}\n\t}\n\tfor i := 0; i < d; i++ {\n\t\tfmt.Println(bestSchedule[i] + 1)\n\t}\n}\nfunc calcScore(schedule []int, c []int, s [][]int, d int) int {\n\tscore := 0\n\tlast := make([]int, 26)\n\tfor i, v := range schedule {\n\t\tscore += s[i][v]\n\t\tfor j, _ := range last {\n\t\t\tlast[j]++\n\t\t}\n\t\tlast[v] = 0\n\t\tfor j, v := range last {\n\t\t\tscore -= c[j] * v\n\t\t}\n\t}\n\treturn score\n}\nfunc prob(before int, after int) float64 {\n\tif before <= after {\n\t\treturn 1.0\n\t}\n\treturn math.Exp((float64(after) - float64(before)) / float64(t))\n}\n", "problem_context": "Problem Statement\n\nAtCoder currently hosts three types of contests: ABC, ARC, and AGC. As the number of users has grown, in order to meet the needs of more users, AtCoder has decided to increase the number of contests to 26 types, from AAC to AZC. For convenience, we number these 26 types as type 1 through type 26. AtCoder wants to schedule contests for D days so that user satisfaction is as high as possible. For every day, AtCoder will hold exactly one contest, and each contest will end on that day. The satisfaction is calculated as follows.\n\nThe satisfaction at the beginning of day 1 is 0. Satisfaction can be negative.\n\nHolding contests increases satisfaction. The amount of increase will vary depending on a variety of factors. Specifically, we know in advance that holding a contest of type i on day d will increase the satisfaction by s_{d,i}.\n\nIf a particular type of contest is not held for a while, the satisfaction decreases. Each contest type i has an integer c_i, and at the end of each day d=1,2,...,D, the satisfaction decreases as follows. Let \\mathrm{last}(d,i) be the last day before day d (including d) on which a contest of type i was held. If contests of type i have never been held yet, we define \\mathrm{last}(d,i)=0. At the end of day d, the satisfaction decreases by \\sum _{i=1}^{26}c_i \\times (d-\\mathrm{last}(d,i)).\n\nPlease schedule contests on behalf of AtCoder.\nIf the satisfaction at the end of day D is S, you will get a score of \\max(10^6 + S, 0).\nThere are 50 test cases, and the score of a submission is the total scores for each test case.\nYou can make submissions multiple times, and the highest score among your submissions will be your score.\n\nConstraints\n\nD = 365\n\nEach c_i is an integer satisfying 0\\leq c_i \\leq 100.\n\nEach s_{d,i} is an integer satisfying 0\\leq s_{d,i} \\leq 20000.\n\nInput\n\nInput is given from Standard Input in the following format:\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}\n\nOutput\n\nLet t_d (1\\leq t_d \\leq 26) be the type of the contest that will be held at day d.\nPrint D integers t_d to Standard Output in the following format:\n\nt_1\nt_2\n\\vdots\nt_D\n\nAny output that does not follow the above format may result in 0 pointsWA for that test case.\n\nInput Generation\n\nEach integer c_i and s_{d,i} is generated independently and uniformly at random from the integers in the range described in the problem statement.\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\n\nSample Output 1\n\n1\n17\n13\n14\n13\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. The final satisfaction with this output is 79325, so the score is 1079325.\n\nInput generator, score calculator, and visualizer\n\nBeginner's Guide\n\nIf you don't know what to do, proceed to problem B or C.", "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\n"}, "reference_outputs": ["1\n17\n13\n14\n13\n"], "source_document_id": "p02618", "source_text": "Problem Statement\n\nAtCoder currently hosts three types of contests: ABC, ARC, and AGC. As the number of users has grown, in order to meet the needs of more users, AtCoder has decided to increase the number of contests to 26 types, from AAC to AZC. For convenience, we number these 26 types as type 1 through type 26. AtCoder wants to schedule contests for D days so that user satisfaction is as high as possible. For every day, AtCoder will hold exactly one contest, and each contest will end on that day. The satisfaction is calculated as follows.\n\nThe satisfaction at the beginning of day 1 is 0. Satisfaction can be negative.\n\nHolding contests increases satisfaction. The amount of increase will vary depending on a variety of factors. Specifically, we know in advance that holding a contest of type i on day d will increase the satisfaction by s_{d,i}.\n\nIf a particular type of contest is not held for a while, the satisfaction decreases. Each contest type i has an integer c_i, and at the end of each day d=1,2,...,D, the satisfaction decreases as follows. Let \\mathrm{last}(d,i) be the last day before day d (including d) on which a contest of type i was held. If contests of type i have never been held yet, we define \\mathrm{last}(d,i)=0. At the end of day d, the satisfaction decreases by \\sum _{i=1}^{26}c_i \\times (d-\\mathrm{last}(d,i)).\n\nPlease schedule contests on behalf of AtCoder.\nIf the satisfaction at the end of day D is S, you will get a score of \\max(10^6 + S, 0).\nThere are 50 test cases, and the score of a submission is the total scores for each test case.\nYou can make submissions multiple times, and the highest score among your submissions will be your score.\n\nConstraints\n\nD = 365\n\nEach c_i is an integer satisfying 0\\leq c_i \\leq 100.\n\nEach s_{d,i} is an integer satisfying 0\\leq s_{d,i} \\leq 20000.\n\nInput\n\nInput is given from Standard Input in the following format:\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}\n\nOutput\n\nLet t_d (1\\leq t_d \\leq 26) be the type of the contest that will be held at day d.\nPrint D integers t_d to Standard Output in the following format:\n\nt_1\nt_2\n\\vdots\nt_D\n\nAny output that does not follow the above format may result in 0 pointsWA for that test case.\n\nInput Generation\n\nEach integer c_i and s_{d,i} is generated independently and uniformly at random from the integers in the range described in the problem statement.\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\n\nSample Output 1\n\n1\n17\n13\n14\n13\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. The final satisfaction with this output is 79325, so the score is 1079325.\n\nInput generator, score calculator, and visualizer\n\nBeginner's Guide\n\nIf you don't know what to do, proceed to problem B or C.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2462, "cpu_time_ms": 647, "memory_kb": 6336}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s187381369", "group_id": "codeNet:p02623", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\t// Code for C - Tsundoku\n\tvar N, M, K int\n\tfmt.Scan(&N, &M, &K)\n\n\tsc.Split(bufio.ScanWords)\n\tvar temp int\n\n\tA := make([]int, N+1)\n\tsumA := make([]int, N+1)\n\ttemp = 0\n\tfor i := 1; i <= N; i++ {\n\t\tA[i] = nextInt()\n\t\ttemp += A[i]\n\t\tsumA[i] = temp\n\t}\n\n\tB := make([]int, M+1)\n\tsumB := make([]int, M+1)\n\ttemp = 0\n\tfor i := 1; i <= M; i++ {\n\t\tB[i] = nextInt()\n\t\ttemp += B[i]\n\t\tsumB[i] = temp\n\t}\n\n\tvar J int = M\n\tvar max int = 0\n\tfor i := 0; i <= N; i++ {\n\t\tif sumA[i] > K {\n\t\t\tbreak\n\t\t}\n\t\tfor j := J; 0 <= j; j-- {\n\t\t\tif sumA[i]+sumB[j] <= K {\n\t\t\t\tif J > j {\n\t\t\t\t\tJ = j\n\t\t\t\t}\n\n\t\t\t\tif max < i+j {\n\t\t\t\t\tmax = i + j\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t} else {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(max)\n}\n", "language": "Go", "metadata": {"date": 1599986634, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02623.html", "problem_id": "p02623", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02623/input.txt", "sample_output_relpath": "derived/input_output/data/p02623/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02623/Go/s187381369.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s187381369", "user_id": "u128015095"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\t// Code for C - Tsundoku\n\tvar N, M, K int\n\tfmt.Scan(&N, &M, &K)\n\n\tsc.Split(bufio.ScanWords)\n\tvar temp int\n\n\tA := make([]int, N+1)\n\tsumA := make([]int, N+1)\n\ttemp = 0\n\tfor i := 1; i <= N; i++ {\n\t\tA[i] = nextInt()\n\t\ttemp += A[i]\n\t\tsumA[i] = temp\n\t}\n\n\tB := make([]int, M+1)\n\tsumB := make([]int, M+1)\n\ttemp = 0\n\tfor i := 1; i <= M; i++ {\n\t\tB[i] = nextInt()\n\t\ttemp += B[i]\n\t\tsumB[i] = temp\n\t}\n\n\tvar J int = M\n\tvar max int = 0\n\tfor i := 0; i <= N; i++ {\n\t\tif sumA[i] > K {\n\t\t\tbreak\n\t\t}\n\t\tfor j := J; 0 <= j; j-- {\n\t\t\tif sumA[i]+sumB[j] <= K {\n\t\t\t\tif J > j {\n\t\t\t\t\tJ = j\n\t\t\t\t}\n\n\t\t\t\tif max < i+j {\n\t\t\t\t\tmax = i + j\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t} else {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(max)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "sample_input": "3 4 240\n60 90 120\n80 150 80 150\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02623", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 898, "cpu_time_ms": 58, "memory_kb": 9544}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s307301019", "group_id": "codeNet:p02623", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\t// Code for C - Tsundoku\n\tvar N, M, K int\n\tfmt.Scan(&N, &M, &K)\n\n\tsc.Split(bufio.ScanWords)\n\tvar temp int\n\n\tA := make([]int, N)\n\tsumA := make([]int, N)\n\ttemp = 0\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = nextInt()\n\t\ttemp += A[i]\n\t\tsumA[i] = temp\n\t}\n\n\tB := make([]int, M)\n\tsumB := make([]int, M)\n\ttemp = 0\n\tfor i := 0; i < M; i++ {\n\t\tB[i] = nextInt()\n\t\ttemp += B[i]\n\t\tsumB[i] = temp\n\t}\n\n\tvar J int = M - 1\n\tvar max int = 0\n\tfor i := 0; i < N; i++ {\n\t\tif sumA[i] > K {\n\t\t\tbreak\n\t\t}\n\t\tfor j := J; 0 <= j; j-- {\n\t\t\tif sumA[i]+sumB[j] <= K {\n\t\t\t\tif J > j {\n\t\t\t\t\tJ = j\n\t\t\t\t}\n\n\t\t\t\tif max < i+j+2 {\n\t\t\t\t\tmax = i + j + 2\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t} else {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(max)\n}\n", "language": "Go", "metadata": {"date": 1599986317, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02623.html", "problem_id": "p02623", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02623/input.txt", "sample_output_relpath": "derived/input_output/data/p02623/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02623/Go/s307301019.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s307301019", "user_id": "u128015095"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\t// Code for C - Tsundoku\n\tvar N, M, K int\n\tfmt.Scan(&N, &M, &K)\n\n\tsc.Split(bufio.ScanWords)\n\tvar temp int\n\n\tA := make([]int, N)\n\tsumA := make([]int, N)\n\ttemp = 0\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = nextInt()\n\t\ttemp += A[i]\n\t\tsumA[i] = temp\n\t}\n\n\tB := make([]int, M)\n\tsumB := make([]int, M)\n\ttemp = 0\n\tfor i := 0; i < M; i++ {\n\t\tB[i] = nextInt()\n\t\ttemp += B[i]\n\t\tsumB[i] = temp\n\t}\n\n\tvar J int = M - 1\n\tvar max int = 0\n\tfor i := 0; i < N; i++ {\n\t\tif sumA[i] > K {\n\t\t\tbreak\n\t\t}\n\t\tfor j := J; 0 <= j; j-- {\n\t\t\tif sumA[i]+sumB[j] <= K {\n\t\t\t\tif J > j {\n\t\t\t\t\tJ = j\n\t\t\t\t}\n\n\t\t\t\tif max < i+j+2 {\n\t\t\t\t\tmax = i + j + 2\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t} else {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(max)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "sample_input": "3 4 240\n60 90 120\n80 150 80 150\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02623", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 897, "cpu_time_ms": 55, "memory_kb": 9544}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s765260602", "group_id": "codeNet:p02623", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"flag\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"testing\"\n)\n\n/*-----------Main-----------*/\n\nfunc main() {\n\tN, M, K := readI(), readI(), readI()\n\ta := readIs(N)\n\tb := readIs(M)\n\n\tvar ans, aT int\n\tbT := sum(b)\n\tj := M\n\tfor i := 0; i <= N; i++ {\n\t\tif i != 0 {\n\t\t\taT += a[i-1]\n\t\t}\n\t\tif aT > K {\n\t\t\tbreak\n\t\t}\n\n\t\tfor j >= 0 {\n\t\t\tif aT+bT <= K {\n\t\t\t\ts := i + j\n\t\t\t\tif s > ans {\n\t\t\t\t\tans = s\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tj--\n\t\t\tbT -= b[j]\n\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\nfunc sum(a []int) int {\n\tb := 0\n\tfor _, v := range a {\n\t\tb += v\n\t}\n\treturn b\n}\n\n/*-----------Utilities-----------*/\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\ttesting.Init()\n\tif flag.Parse(); flag.Arg(0) == \"debug\" {\n\t\tdebug()\n\t}\n\tconst maxBuf = 200100\n\tvar buf []byte = make([]byte, maxBuf)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBuf)\n}\n\nfunc debug() {\n\ttestFile, err := os.Open(\"./test/sample-1.in\")\n\tif err != nil {\n\t\tfmt.Println(\"Error : There is no testfile.\")\n\t\tos.Exit(1)\n\t}\n\tsc = bufio.NewScanner(testFile)\n}\n\nfunc readS() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readSs(a int) []string {\n\tb := make([]string, a)\n\tfor i := 0; i < a; i++ {\n\t\tb[i] = readS()\n\t}\n\treturn b\n}\n\nfunc readI() int {\n\tsc.Scan()\n\tr, _ := strconv.Atoi(sc.Text())\n\treturn r\n}\n\nfunc readIs(a int) []int {\n\tb := make([]int, a)\n\tfor i := 0; i < a; i++ {\n\t\tb[i] = readI()\n\t}\n\treturn b\n}\n\nfunc readF() float64 {\n\tsc.Scan()\n\tr, _ := strconv.ParseFloat(sc.Text(), 64)\n\treturn r\n}\n\nfunc readFs(a int) []float64 {\n\tb := make([]float64, a)\n\tfor i := 0; i < a; i++ {\n\t\tb[i] = readF()\n\t}\n\treturn b\n}\n\nfunc max(a []int) int {\n\tl := len(a)\n\tm := a[0]\n\tfor i := 1; i < l; i++ {\n\t\tif a[i] > m {\n\t\t\tm = a[i]\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(a []int) int {\n\tl := len(a)\n\tm := a[0]\n\tfor i := 1; i < l; i++ {\n\t\tif a[i] < m {\n\t\t\tm = a[i]\n\t\t}\n\t}\n\treturn m\n}\n\nfunc sortI(a []int) []int {\n\tsort.Ints(a)\n\treturn a\n}\n\nfunc reverse(a []int) []int {\n\tl := len(a)\n\tr := make([]int, l)\n\tfor i := 0; i < l; i++ {\n\t\tr[i] = a[l-i-1]\n\t}\n\treturn r\n}\n\nfunc countI(a []int, b int) int {\n\tl := len(a)\n\tvar c int\n\tfor i := 0; i < l; i++ {\n\t\tif a[i] == b {\n\t\t\tc++\n\t\t}\n\t}\n\treturn c\n}\n", "language": "Go", "metadata": {"date": 1596907271, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02623.html", "problem_id": "p02623", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02623/input.txt", "sample_output_relpath": "derived/input_output/data/p02623/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02623/Go/s765260602.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s765260602", "user_id": "u533258444"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"flag\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"testing\"\n)\n\n/*-----------Main-----------*/\n\nfunc main() {\n\tN, M, K := readI(), readI(), readI()\n\ta := readIs(N)\n\tb := readIs(M)\n\n\tvar ans, aT int\n\tbT := sum(b)\n\tj := M\n\tfor i := 0; i <= N; i++ {\n\t\tif i != 0 {\n\t\t\taT += a[i-1]\n\t\t}\n\t\tif aT > K {\n\t\t\tbreak\n\t\t}\n\n\t\tfor j >= 0 {\n\t\t\tif aT+bT <= K {\n\t\t\t\ts := i + j\n\t\t\t\tif s > ans {\n\t\t\t\t\tans = s\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tj--\n\t\t\tbT -= b[j]\n\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\nfunc sum(a []int) int {\n\tb := 0\n\tfor _, v := range a {\n\t\tb += v\n\t}\n\treturn b\n}\n\n/*-----------Utilities-----------*/\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\ttesting.Init()\n\tif flag.Parse(); flag.Arg(0) == \"debug\" {\n\t\tdebug()\n\t}\n\tconst maxBuf = 200100\n\tvar buf []byte = make([]byte, maxBuf)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBuf)\n}\n\nfunc debug() {\n\ttestFile, err := os.Open(\"./test/sample-1.in\")\n\tif err != nil {\n\t\tfmt.Println(\"Error : There is no testfile.\")\n\t\tos.Exit(1)\n\t}\n\tsc = bufio.NewScanner(testFile)\n}\n\nfunc readS() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readSs(a int) []string {\n\tb := make([]string, a)\n\tfor i := 0; i < a; i++ {\n\t\tb[i] = readS()\n\t}\n\treturn b\n}\n\nfunc readI() int {\n\tsc.Scan()\n\tr, _ := strconv.Atoi(sc.Text())\n\treturn r\n}\n\nfunc readIs(a int) []int {\n\tb := make([]int, a)\n\tfor i := 0; i < a; i++ {\n\t\tb[i] = readI()\n\t}\n\treturn b\n}\n\nfunc readF() float64 {\n\tsc.Scan()\n\tr, _ := strconv.ParseFloat(sc.Text(), 64)\n\treturn r\n}\n\nfunc readFs(a int) []float64 {\n\tb := make([]float64, a)\n\tfor i := 0; i < a; i++ {\n\t\tb[i] = readF()\n\t}\n\treturn b\n}\n\nfunc max(a []int) int {\n\tl := len(a)\n\tm := a[0]\n\tfor i := 1; i < l; i++ {\n\t\tif a[i] > m {\n\t\t\tm = a[i]\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(a []int) int {\n\tl := len(a)\n\tm := a[0]\n\tfor i := 1; i < l; i++ {\n\t\tif a[i] < m {\n\t\t\tm = a[i]\n\t\t}\n\t}\n\treturn m\n}\n\nfunc sortI(a []int) []int {\n\tsort.Ints(a)\n\treturn a\n}\n\nfunc reverse(a []int) []int {\n\tl := len(a)\n\tr := make([]int, l)\n\tfor i := 0; i < l; i++ {\n\t\tr[i] = a[l-i-1]\n\t}\n\treturn r\n}\n\nfunc countI(a []int, b int) int {\n\tl := len(a)\n\tvar c int\n\tfor i := 0; i < l; i++ {\n\t\tif a[i] == b {\n\t\t\tc++\n\t\t}\n\t}\n\treturn c\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "sample_input": "3 4 240\n60 90 120\n80 150 80 150\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02623", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2122, "cpu_time_ms": 56, "memory_kb": 7972}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s936853260", "group_id": "codeNet:p02623", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc pa() int {\n\treader:=bufio.NewReader(os.Stdin)\n\tvar n,m,k int\n\tfmt.Fscan(reader, &n,&m,&k)\n\tA:=make([]int, n)\n\tfor i:=0;ik{\n\t\t\tbreak\n\t\t}\n\t\tkj:=k-ki\n\t\tfor lastKj>kj && j>0{\n\t\t\tj--\n\t\t\tlastKj-=B[j]\n\t\t}\n\t\tif i+j>ans{\n\t\t\tans=i+j\n\t\t}\n\t\tif ik{\n\t\t\tbreak\n\t\t}\n\t\tkj:=k-ki\n\t\tfor lastKj>kj && j>0{\n\t\t\tj--\n\t\t\tlastKj-=B[j]\n\t\t}\n\t\tif i+j>ans{\n\t\t\tans=i+j\n\t\t}\n\t\tif ikj{\n\t\t\tj--\n\t\t\tif j<=0{\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tlastKj-=B[j]\n\t\t}\n\t\tif i+j>ans{\n\t\t\tans=i+j\n\t\t}\n\n\t\tif ikj{\n\t\t\tj--\n\t\t\tif j<=0{\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tlastKj-=B[j]\n\t\t}\n\t\tif i+j>ans{\n\t\t\tans=i+j\n\t\t}\n\n\t\tif i a_index {\n\t\t\tx = intToInt64(a_array[a_index])\n\t\t} else {\n\t\t\tx = k\n\t\t}\n\n\t\tif m > b_index {\n\t\t\ty = intToInt64(b_array[b_index])\n\t\t} else {\n\t\t\ty = k\n\t\t}\n\n\t\tif (k < x && k < y) || k == 0 {\n\t\t\tbreak\n\t\t}\n\n\t\tif x <= y {\n\t\t\tk -= x\n\t\t\ta_index++\n\t\t} else if x > y {\n\t\t\tk -= y\n\t\t\tb_index++\n\t\t}\n\n\t\tcount++\n\t}\n\n\tfmt.Println(count)\n}\n", "language": "Go", "metadata": {"date": 1593911034, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02623.html", "problem_id": "p02623", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02623/input.txt", "sample_output_relpath": "derived/input_output/data/p02623/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02623/Go/s231593437.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s231593437", "user_id": "u414033039"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc intToInt64(x string) int64 {\n\ty, _ := strconv.Atoi(x)\n\treturn int64(y)\n}\n\nfunc main() {\n\ts, a, b := nextLine(), nextLine(), nextLine()\n\tinput := strings.Split(s, \" \")\n\ta_array := strings.Split(a, \" \")\n\tb_array := strings.Split(b, \" \")\n\tn := intToInt64(input[0])\n\tm := intToInt64(input[1])\n\tk := intToInt64(input[2])\n\tvar a_index int64 = int64(0)\n\tvar b_index int64 = int64(0)\n\tcount := 0\n\n\tvar x int64\n\tvar y int64\n\tfor {\n\t\tif n > a_index {\n\t\t\tx = intToInt64(a_array[a_index])\n\t\t} else {\n\t\t\tx = k\n\t\t}\n\n\t\tif m > b_index {\n\t\t\ty = intToInt64(b_array[b_index])\n\t\t} else {\n\t\t\ty = k\n\t\t}\n\n\t\tif (k < x && k < y) || k == 0 {\n\t\t\tbreak\n\t\t}\n\n\t\tif x <= y {\n\t\t\tk -= x\n\t\t\ta_index++\n\t\t} else if x > y {\n\t\t\tk -= y\n\t\t\tb_index++\n\t\t}\n\n\t\tcount++\n\t}\n\n\tfmt.Println(count)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "sample_input": "3 4 240\n60 90 120\n80 150 80 150\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02623", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 920, "cpu_time_ms": 6, "memory_kb": 2524}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s564559120", "group_id": "codeNet:p02623", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tvar n, m int\n\tvar k int64\n\tfmt.Fscan(r, &n, &m, &k)\n\ta := make([]int64, n+1)\n\tb := make([]int64, m+1)\n\tfor i := 0; i < n; i++ {\n\t\tvar tmp int64\n\t\tfmt.Fscan(r, &tmp)\n\t\ta[i+1] = a[i] + tmp\n\t}\n\tfor i := 0; i < m; i++ {\n\t\tvar tmp int64\n\t\tfmt.Fscan(r, &tmp)\n\t\tb[i+1] = b[i] + tmp\n\t}\n\tfor i := 0; i < m; i++ {\n\t\tvar tmp int64\n\t\tfmt.Fscan(r, &tmp)\n\t\tb[i+1] = b[i] + tmp\n\t}\n\tvar ans int\n\tj := m\n\tfor i := 0; i <= n; i++ {\n\t\tif a[i] > k{\n\t\t\tbreak\n\t\t}\n\t\tfor b[j] > k - a[i]{\n\t\t\tj--\n\t\t}\n\t\tif i+j > ans{\n\t\t\tans = i+j\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1593583842, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02623.html", "problem_id": "p02623", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02623/input.txt", "sample_output_relpath": "derived/input_output/data/p02623/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02623/Go/s564559120.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s564559120", "user_id": "u048004795"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tvar n, m int\n\tvar k int64\n\tfmt.Fscan(r, &n, &m, &k)\n\ta := make([]int64, n+1)\n\tb := make([]int64, m+1)\n\tfor i := 0; i < n; i++ {\n\t\tvar tmp int64\n\t\tfmt.Fscan(r, &tmp)\n\t\ta[i+1] = a[i] + tmp\n\t}\n\tfor i := 0; i < m; i++ {\n\t\tvar tmp int64\n\t\tfmt.Fscan(r, &tmp)\n\t\tb[i+1] = b[i] + tmp\n\t}\n\tfor i := 0; i < m; i++ {\n\t\tvar tmp int64\n\t\tfmt.Fscan(r, &tmp)\n\t\tb[i+1] = b[i] + tmp\n\t}\n\tvar ans int\n\tj := m\n\tfor i := 0; i <= n; i++ {\n\t\tif a[i] > k{\n\t\t\tbreak\n\t\t}\n\t\tfor b[j] > k - a[i]{\n\t\t\tj--\n\t\t}\n\t\tif i+j > ans{\n\t\t\tans = i+j\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "sample_input": "3 4 240\n60 90 120\n80 150 80 150\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02623", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 627, "cpu_time_ms": 484, "memory_kb": 8572}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s386462645", "group_id": "codeNet:p02623", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n, m, k int\n\tfmt.Scan(&n, &m, &k)\n\n\ta := make([]int, n)\n\tb := make([]int, m)\n\tfor i := range a {\n\t\tfmt.Scan(&a[i])\n\t}\n\tfor i := range b {\n\t\tfmt.Scan(&b[i])\n\t}\n\n\ttime := 0\n\tfor i := range a {\n\t\ttime += a[i]\n\t}\n\n\tans := 0\n\tj := 0\n\tfor i := range a {\n\t\tif time-a[len(a)-1-i] > k {\n\t\t\tcontinue\n\t\t}\n\t\tfor true {\n\t\t\tif j > len(b)-1 {\n\t\t\t\tans = max(ans, len(a)-i+j)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif time+b[j] > k {\n\t\t\t\tans = max(ans, len(a)-i+j)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tj++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n", "language": "Go", "metadata": {"date": 1593490089, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02623.html", "problem_id": "p02623", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02623/input.txt", "sample_output_relpath": "derived/input_output/data/p02623/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02623/Go/s386462645.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s386462645", "user_id": "u281109672"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n, m, k int\n\tfmt.Scan(&n, &m, &k)\n\n\ta := make([]int, n)\n\tb := make([]int, m)\n\tfor i := range a {\n\t\tfmt.Scan(&a[i])\n\t}\n\tfor i := range b {\n\t\tfmt.Scan(&b[i])\n\t}\n\n\ttime := 0\n\tfor i := range a {\n\t\ttime += a[i]\n\t}\n\n\tans := 0\n\tj := 0\n\tfor i := range a {\n\t\tif time-a[len(a)-1-i] > k {\n\t\t\tcontinue\n\t\t}\n\t\tfor true {\n\t\t\tif j > len(b)-1 {\n\t\t\t\tans = max(ans, len(a)-i+j)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif time+b[j] > k {\n\t\t\t\tans = max(ans, len(a)-i+j)\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tj++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "sample_input": "3 4 240\n60 90 120\n80 150 80 150\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02623", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 768, "cpu_time_ms": 2205, "memory_kb": 8616}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s126242831", "group_id": "codeNet:p02623", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n\nfunc scanInt64() int64 {\n\tsc.Scan()\n\ti, _ := strconv.ParseInt(sc.Text(), 10, 64)\n\treturn i\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t}\n\treturn res\n}\n\nfunc scanInts64(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := range res {\n\t\tres[i] = scanInt64()\n\t}\n\treturn res\n}\n\nfunc scanText() string {\n\tsc.Buffer([]byte{}, math.MaxInt64)\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn, m, k := scanInt(), scanInt(), scanInt()\n\tA := scanInts(n)\n\tB := scanInts(m)\n\n\ta, b := []int{0}, []int{0}\n\n\tfor _, ele := range A {\n\t\ta = append(a, ele)\n\t}\n\tfor _, ele := range B {\n\t\tb = append(b, ele)\n\t}\n\n\tans, j := 0, m\n\tfor i := 0; i < n+1; i++ {\n\t\tif a[i] > k {\n\t\t\tbreak\n\t\t}\n\t\tfor b[j]+a[i] > k {\n\t\t\tj--\n\t\t}\n\t\tif ans < i+j {\n\t\t\tans = i + j\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1593369553, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02623.html", "problem_id": "p02623", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02623/input.txt", "sample_output_relpath": "derived/input_output/data/p02623/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02623/Go/s126242831.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s126242831", "user_id": "u475329018"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n\nfunc scanInt64() int64 {\n\tsc.Scan()\n\ti, _ := strconv.ParseInt(sc.Text(), 10, 64)\n\treturn i\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t}\n\treturn res\n}\n\nfunc scanInts64(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := range res {\n\t\tres[i] = scanInt64()\n\t}\n\treturn res\n}\n\nfunc scanText() string {\n\tsc.Buffer([]byte{}, math.MaxInt64)\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn, m, k := scanInt(), scanInt(), scanInt()\n\tA := scanInts(n)\n\tB := scanInts(m)\n\n\ta, b := []int{0}, []int{0}\n\n\tfor _, ele := range A {\n\t\ta = append(a, ele)\n\t}\n\tfor _, ele := range B {\n\t\tb = append(b, ele)\n\t}\n\n\tans, j := 0, m\n\tfor i := 0; i < n+1; i++ {\n\t\tif a[i] > k {\n\t\t\tbreak\n\t\t}\n\t\tfor b[j]+a[i] > k {\n\t\t\tj--\n\t\t}\n\t\tif ans < i+j {\n\t\t\tans = i + j\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "sample_input": "3 4 240\n60 90 120\n80 150 80 150\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02623", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1023, "cpu_time_ms": 65, "memory_kb": 15060}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s860871111", "group_id": "codeNet:p02623", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\n/* sort */\ntype pair struct {\n\tindex int64\n\tp1, p2 interface{}\n}\ntype pairs []pair\n\nfunc (slice pairs) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice pairs) Less(i, j int) bool {\n\treturn slice[i].index < slice[j].index\n}\n\nfunc (slice pairs) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\n\n/* sort */\ntype Int64Slice []int64\n\nfunc (slice Int64Slice) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice Int64Slice) Less(i, j int) bool {\n\treturn slice[i] < slice[j]\n}\n\nfunc (slice Int64Slice) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\nfunc Int64s(a []int64) { sort.Sort(Int64Slice(a)) }\nfunc Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n\tINF = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tdi = []int64{-1, 0, 1, 0}\n\tdj = []int64{0, -1, 0, 1}\n\tdi8 = []int64{-1, -1, 0, 1, 1, 1, 0, -1}\n\tdj8 = []int64{0, -1, -1, -1, 0, 1, 1, 1}\n)\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tscanner.Buffer(buf, maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tN, M, K := readInt(), readInt(), readInt()\n\tA := make([]int64, N)\n\tB := make([]int64, M)\n\tSa := make([]int64, N+1)\n\tSb := make([]int64, M+1)\n\tSa[0] = 0\n\tSb[0] = 0\n\tfor i := int64(0); i < N; i++ {\n\t\tA[i] = readInt()\n\t}\n\tfor i := int64(0); i < M; i++ {\n\t\tB[i] = readInt()\n\t}\n\tfor i := int64(1); i <= N; i++ {\n\t\tSa[i] = Sa[i-1] + A[i-1]\n\t}\n\tfor i := int64(1); i <= M; i++ {\n\t\tSb[i] = Sb[i-1] + B[i-1]\n\t}\n\tvar ai int64 = 0\n\tvar ans int64\n\t// 累積和と二分探索で実装してみる\n\tfor ai <= N {\n\t\tif K >= Sa[ai] {\n\t\t\tbi := binarySearch(Sb, K-Sa[ai])\n\t\t\tans = max(ans, ai+bi)\n\t\t}\n\t\tai++\n\t}\n\tfmt.Println(ans)\n}\n\nfunc binarySearch(Sb []int64, search int64) int64 {\n\tok := int64(0)\n\tng := int64(len(Sb))\n\tfor abs(ok-ng) > 1 {\n\t\tmid := (ok + ng) / 2\n\t\tif Sb[mid] <= search {\n\t\t\tok = mid\n\t\t} else {\n\t\t\tng = mid\n\t\t}\n\t}\n\treturn ok\n}\n\n/*==========================================\n * Library\n *==========================================*/\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\nfunc doubleAry(h int64, w int64, init int64) (res [][]int64) {\n\tres = make([][]int64, h)\n\tfor i := int64(0); i < h; i++ {\n\t\tres[i] = make([]int64, w)\n\t\tfor j := int64(0); j < w; j++ {\n\t\t\tres[i][j] = init\n\t\t}\n\t}\n\treturn\n}\n\nfunc aryEq(a []int64, b []int64) bool {\n\treturn reflect.DeepEqual(a, b)\n}\n\nfunc clone(n []int64) (r []int64) {\n\tr = make([]int64, len(n))\n\tfor i := 0; i < len(n); i++ {\n\t\tr[i] = n[i]\n\t}\n\treturn\n}\nfunc write(s string) {\n\twriter.WriteString(s)\n}\n\nfunc print() {\n\twriter.Flush()\n}\n\n// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可\nfunc readLine() (s string) {\n\tif scanner.Scan() {\n\t\ts = scanner.Text()\n\t}\n\treturn s\n}\n\nfunc readInt() (read int64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseInt(scanner.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readFloat() (read float64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readRunes() (read []rune) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, v)\n\t}\n\treturn\n}\n\nfunc readString() (read string) {\n\tscanner.Scan()\n\tread = scanner.Text()\n\treturn\n}\n\nfunc readStrings() (read []string) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, string(v))\n\t}\n\treturn\n}\n\nfunc s2i(s string) int64 {\n\tvar intVal, e = strconv.ParseInt(s, 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int64) string {\n\tvar strVal = strconv.FormatInt(i, 10)\n\treturn strVal\n}\n\nfunc s2f(s string) float64 {\n\tvar floatVal, e = strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn floatVal\n}\n\nfunc abs(i int64) int64 {\n\treturn int64(math.Abs(float64(i)))\n}\n\nfunc max(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans < v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\nfunc min(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans > v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc sum(i []int64) int64 {\n\tsum := int64(0)\n\tfor _, val := range i {\n\t\tsum += val\n\t}\n\treturn sum\n}\n\nfunc split(s string) []string {\n\treturn strings.Fields(s)\n}\n\nfunc strAry2intAry(strs []string) []int64 {\n\tvar ret = make([]int64, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal = s2i(str)\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int64) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = i2s(num)\n\t\tret = append(ret, strVal)\n\t}\n\treturn ret\n}\n\nfunc ary2str(strs []string) string {\n\treturn strings.Join(strs, \" \")\n}\n\nfunc reverse(res []int64) []int64 {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\nfunc reverseStr(res []string) []string {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\n\nfunc ini(res []int, init int) {\n\tif len(res) == 0 {\n\t\treturn\n\t}\n\tres[0] = init\n\tfor i := 0; i < len(res); i++ {\n\t\tcopy(res[i:], res[:i])\n\t}\n}\n\n//\n// func regexpExample() {\n// // Your code here!\n// var str = \"13:20\"\n// r := regexp.MustCompile(`(\\d+):(\\d+)`)\n// fmt.Println(r.FindStringSubmatch(str))\n// }\n\n// type Country struct {\n// gold int\n// silver int\n// blonze int\n// }\n\n// // 複数ソートのサンプル\n// func stableSortExample() []Country{\n// var country = []Country {\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:3, blonze:2},\n// {gold:1, silver:3, blonze:3},\n// }\n// sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })\n// return country\n// }\n", "language": "Go", "metadata": {"date": 1593357985, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02623.html", "problem_id": "p02623", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02623/input.txt", "sample_output_relpath": "derived/input_output/data/p02623/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02623/Go/s860871111.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s860871111", "user_id": "u967669872"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\n/* sort */\ntype pair struct {\n\tindex int64\n\tp1, p2 interface{}\n}\ntype pairs []pair\n\nfunc (slice pairs) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice pairs) Less(i, j int) bool {\n\treturn slice[i].index < slice[j].index\n}\n\nfunc (slice pairs) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\n\n/* sort */\ntype Int64Slice []int64\n\nfunc (slice Int64Slice) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice Int64Slice) Less(i, j int) bool {\n\treturn slice[i] < slice[j]\n}\n\nfunc (slice Int64Slice) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\nfunc Int64s(a []int64) { sort.Sort(Int64Slice(a)) }\nfunc Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n\tINF = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tdi = []int64{-1, 0, 1, 0}\n\tdj = []int64{0, -1, 0, 1}\n\tdi8 = []int64{-1, -1, 0, 1, 1, 1, 0, -1}\n\tdj8 = []int64{0, -1, -1, -1, 0, 1, 1, 1}\n)\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tscanner.Buffer(buf, maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tN, M, K := readInt(), readInt(), readInt()\n\tA := make([]int64, N)\n\tB := make([]int64, M)\n\tSa := make([]int64, N+1)\n\tSb := make([]int64, M+1)\n\tSa[0] = 0\n\tSb[0] = 0\n\tfor i := int64(0); i < N; i++ {\n\t\tA[i] = readInt()\n\t}\n\tfor i := int64(0); i < M; i++ {\n\t\tB[i] = readInt()\n\t}\n\tfor i := int64(1); i <= N; i++ {\n\t\tSa[i] = Sa[i-1] + A[i-1]\n\t}\n\tfor i := int64(1); i <= M; i++ {\n\t\tSb[i] = Sb[i-1] + B[i-1]\n\t}\n\tvar ai int64 = 0\n\tvar ans int64\n\t// 累積和と二分探索で実装してみる\n\tfor ai <= N {\n\t\tif K >= Sa[ai] {\n\t\t\tbi := binarySearch(Sb, K-Sa[ai])\n\t\t\tans = max(ans, ai+bi)\n\t\t}\n\t\tai++\n\t}\n\tfmt.Println(ans)\n}\n\nfunc binarySearch(Sb []int64, search int64) int64 {\n\tok := int64(0)\n\tng := int64(len(Sb))\n\tfor abs(ok-ng) > 1 {\n\t\tmid := (ok + ng) / 2\n\t\tif Sb[mid] <= search {\n\t\t\tok = mid\n\t\t} else {\n\t\t\tng = mid\n\t\t}\n\t}\n\treturn ok\n}\n\n/*==========================================\n * Library\n *==========================================*/\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\nfunc doubleAry(h int64, w int64, init int64) (res [][]int64) {\n\tres = make([][]int64, h)\n\tfor i := int64(0); i < h; i++ {\n\t\tres[i] = make([]int64, w)\n\t\tfor j := int64(0); j < w; j++ {\n\t\t\tres[i][j] = init\n\t\t}\n\t}\n\treturn\n}\n\nfunc aryEq(a []int64, b []int64) bool {\n\treturn reflect.DeepEqual(a, b)\n}\n\nfunc clone(n []int64) (r []int64) {\n\tr = make([]int64, len(n))\n\tfor i := 0; i < len(n); i++ {\n\t\tr[i] = n[i]\n\t}\n\treturn\n}\nfunc write(s string) {\n\twriter.WriteString(s)\n}\n\nfunc print() {\n\twriter.Flush()\n}\n\n// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可\nfunc readLine() (s string) {\n\tif scanner.Scan() {\n\t\ts = scanner.Text()\n\t}\n\treturn s\n}\n\nfunc readInt() (read int64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseInt(scanner.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readFloat() (read float64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readRunes() (read []rune) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, v)\n\t}\n\treturn\n}\n\nfunc readString() (read string) {\n\tscanner.Scan()\n\tread = scanner.Text()\n\treturn\n}\n\nfunc readStrings() (read []string) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, string(v))\n\t}\n\treturn\n}\n\nfunc s2i(s string) int64 {\n\tvar intVal, e = strconv.ParseInt(s, 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int64) string {\n\tvar strVal = strconv.FormatInt(i, 10)\n\treturn strVal\n}\n\nfunc s2f(s string) float64 {\n\tvar floatVal, e = strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn floatVal\n}\n\nfunc abs(i int64) int64 {\n\treturn int64(math.Abs(float64(i)))\n}\n\nfunc max(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans < v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\nfunc min(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans > v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc sum(i []int64) int64 {\n\tsum := int64(0)\n\tfor _, val := range i {\n\t\tsum += val\n\t}\n\treturn sum\n}\n\nfunc split(s string) []string {\n\treturn strings.Fields(s)\n}\n\nfunc strAry2intAry(strs []string) []int64 {\n\tvar ret = make([]int64, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal = s2i(str)\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int64) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = i2s(num)\n\t\tret = append(ret, strVal)\n\t}\n\treturn ret\n}\n\nfunc ary2str(strs []string) string {\n\treturn strings.Join(strs, \" \")\n}\n\nfunc reverse(res []int64) []int64 {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\nfunc reverseStr(res []string) []string {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\n\nfunc ini(res []int, init int) {\n\tif len(res) == 0 {\n\t\treturn\n\t}\n\tres[0] = init\n\tfor i := 0; i < len(res); i++ {\n\t\tcopy(res[i:], res[:i])\n\t}\n}\n\n//\n// func regexpExample() {\n// // Your code here!\n// var str = \"13:20\"\n// r := regexp.MustCompile(`(\\d+):(\\d+)`)\n// fmt.Println(r.FindStringSubmatch(str))\n// }\n\n// type Country struct {\n// gold int\n// silver int\n// blonze int\n// }\n\n// // 複数ソートのサンプル\n// func stableSortExample() []Country{\n// var country = []Country {\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:3, blonze:2},\n// {gold:1, silver:3, blonze:3},\n// }\n// sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })\n// return country\n// }\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "sample_input": "3 4 240\n60 90 120\n80 150 80 150\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02623", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6391, "cpu_time_ms": 76, "memory_kb": 13520}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s138635340", "group_id": "codeNet:p02623", "input_text": "package main\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"sort\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc main(){\n\tbuf := make([]byte, 1024*1024)\n\tsc.Buffer(buf, bufio.MaxScanTokenSize)\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush()\n\tINF := 9*int(1e18)\n\tN, M, K := nextInt(), nextInt(), nextInt()\n\tA, B := append([]int{-INF}, nextInts(N)...), append([]int{-INF}, nextInts(M)...)\n\tA, B = append(A, INF), append(B, INF)\n\tfor i:=2; i<=N; i++{\n\t\tA[i] += A[i-1]\n\t}\n\tfor i:=2; i<=M; i++{\n\t\tB[i] += B[i-1]\n\t}\n\tans := min(M+1, sort.Search(len(B), func(j int)bool{return K<=B[j]}))-1\t// Aからひとつも取らない場合\n\tfor i:=1; i<=N; i++{\n\t\trest := K-A[i]\n\t\tif rest < 0{\n\t\t\tbreak\n\t\t}\n\t\t// golangでupper_boundどうやるんだ??????・\n\t\t/// bidx := max(0, sort.Search(len(B), func(j int)bool{return rest<=B[j]}))\n\t\t// bidx := sort.Search(len(B), func(j int)bool{return rest<=B[j]})-1\n\t\t// bidx := sort.SearchInts(B, rest)\n\t\t// わからんので仕方なく手書き\n\t\tleft, right := -1, len(B)\n\t\tfor right - left > 1{\n\t\t\tmid := (left+right)/2\n\t\t\tif rest-B[mid]>=0{\n\t\t\t\tleft = mid\n\t\t\t}else{\n\t\t\t\tright = mid\n\t\t\t}\n\t\t}\n\t\tbidx := left\n\t\tans = max(ans, i+bidx)\n\t}\n\tfmt.Fprintln(out, ans)\n}\n\nfunc min(a, b int) int {\n\tif a 1{\n\t\t\tmid := (left+right)/2\n\t\t\tif rest-B[mid]>=0{\n\t\t\t\tleft = mid\n\t\t\t}else{\n\t\t\t\tright = mid\n\t\t\t}\n\t\t}\n\t\tbidx := left\n\t\tans = max(ans, i+bidx)\n\t}\n\tfmt.Fprintln(out, ans)\n}\n\nfunc min(a, b int) int {\n\tif a y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc main() {\n\tn, m, k := scanInt(), scanInt(), scanInt()\n\ta := make([]int, n+1)\n\tfor i := 1; i <= n; i++ {\n\t\ta[i] = scanInt() + a[i-1]\n\t}\n\tb := make([]int, m+1)\n\tfor i := 1; i <= m; i++ {\n\t\tb[i] = scanInt() + b[i-1]\n\t}\n\n\tans := 0\n\tp := len(b) - 1\n\tfor i := range a {\n\t\tif a[i] > k {\n\t\t\tbreak\n\t\t}\n\t\tfor j := p; j >= 0; j-- {\n\t\t\tif a[i]+b[j] <= k {\n\t\t\t\tp = j\n\t\t\t\tans = max(ans, i+j)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1593318562, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02623.html", "problem_id": "p02623", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02623/input.txt", "sample_output_relpath": "derived/input_output/data/p02623/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02623/Go/s923868364.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s923868364", "user_id": "u461993794"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tsc.Scan()\n\tiv, _ := strconv.Atoi(sc.Text())\n\treturn iv\n}\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc main() {\n\tn, m, k := scanInt(), scanInt(), scanInt()\n\ta := make([]int, n+1)\n\tfor i := 1; i <= n; i++ {\n\t\ta[i] = scanInt() + a[i-1]\n\t}\n\tb := make([]int, m+1)\n\tfor i := 1; i <= m; i++ {\n\t\tb[i] = scanInt() + b[i-1]\n\t}\n\n\tans := 0\n\tp := len(b) - 1\n\tfor i := range a {\n\t\tif a[i] > k {\n\t\t\tbreak\n\t\t}\n\t\tfor j := p; j >= 0; j-- {\n\t\t\tif a[i]+b[j] <= k {\n\t\t\t\tp = j\n\t\t\t\tans = max(ans, i+j)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "sample_input": "3 4 240\n60 90 120\n80 150 80 150\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02623", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 708, "cpu_time_ms": 63, "memory_kb": 7824}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s089724075", "group_id": "codeNet:p02623", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc parse(books []int, ch int, sh int) (c, sum int) {\n\tfor _, v := range books {\n\t\tif sh < sum+v {\n\t\t\treturn\n\t\t}\n\t\tif ch <= c {\n\t\t\treturn\n\t\t}\n\t\tsum += v\n\t\tc++\n\t}\n\n\treturn\n}\n\nfunc run(a, b []int, n, m, k int) {\n\tans := 0\n\tfor i := 0; i <= n; i++ {\n\t\tac, as := parse(a, i, k)\n\t\tbc, _ := parse(b, 200000, k-as)\n\t\tif ans >= ac+bc {\n\t\t\tbreak\n\t\t}\n\t\tans = ac + bc\n\t}\n\tfmt.Printf(\"%d\", ans)\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tm := nextInt()\n\tk := nextInt()\n\n\tvar a []int\n\tvar b []int\n\tfor i := 0; i < n; i++ {\n\t\ta = append(a, nextInt())\n\t}\n\tfor i := 0; i < m; i++ {\n\t\tb = append(b, nextInt())\n\t}\n\n\tac, _ := parse(a, n, k)\n\tbc, _ := parse(b, m, k)\n\tif ac == n && bc == m {\n\t\tfmt.Printf(\"%d\", ac+bc)\n\t}\n\n\tif ac > bc {\n\t\trun(a, b, n, m, k)\n\t} else {\n\t\trun(b, a, m, n, k)\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1593316777, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02623.html", "problem_id": "p02623", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02623/input.txt", "sample_output_relpath": "derived/input_output/data/p02623/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02623/Go/s089724075.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s089724075", "user_id": "u017807842"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc parse(books []int, ch int, sh int) (c, sum int) {\n\tfor _, v := range books {\n\t\tif sh < sum+v {\n\t\t\treturn\n\t\t}\n\t\tif ch <= c {\n\t\t\treturn\n\t\t}\n\t\tsum += v\n\t\tc++\n\t}\n\n\treturn\n}\n\nfunc run(a, b []int, n, m, k int) {\n\tans := 0\n\tfor i := 0; i <= n; i++ {\n\t\tac, as := parse(a, i, k)\n\t\tbc, _ := parse(b, 200000, k-as)\n\t\tif ans >= ac+bc {\n\t\t\tbreak\n\t\t}\n\t\tans = ac + bc\n\t}\n\tfmt.Printf(\"%d\", ans)\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tm := nextInt()\n\tk := nextInt()\n\n\tvar a []int\n\tvar b []int\n\tfor i := 0; i < n; i++ {\n\t\ta = append(a, nextInt())\n\t}\n\tfor i := 0; i < m; i++ {\n\t\tb = append(b, nextInt())\n\t}\n\n\tac, _ := parse(a, n, k)\n\tbc, _ := parse(b, m, k)\n\tif ac == n && bc == m {\n\t\tfmt.Printf(\"%d\", ac+bc)\n\t}\n\n\tif ac > bc {\n\t\trun(a, b, n, m, k)\n\t} else {\n\t\trun(b, a, m, n, k)\n\t}\n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "sample_input": "3 4 240\n60 90 120\n80 150 80 150\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02623", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 996, "cpu_time_ms": 2206, "memory_kb": 12296}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s776330627", "group_id": "codeNet:p02623", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst (\n\tBUFSIZE = 10000000\n\tMOD = 1000000007\n\tINF_INT = math.MaxInt32\n\tINF_INT64 = math.MaxInt64\n)\n\nvar rdr *bufio.Reader\n\nfunc main() {\n\trdr = bufio.NewReaderSize(os.Stdin, BUFSIZE)\n\tsolve()\n}\n\nfunc solve() {\n\tvar N, M, K int64\n\tfmt.Scanf(\"%d %d %d\", &N, &M, &K)\n\tA := readInt64Slice(int(N))\n\tB := readInt64Slice(int(M))\n\n\tans := 0\n\ttotalTime := int64(0)\n\tbIndex := -1\n\tfor i, v := range B {\n\t\tif totalTime+v <= K {\n\t\t\ttotalTime += v\n\t\t\tans += 1\n\t\t} else {\n\t\t\tbIndex = i - 1\n\t\t\tbreak\n\t\t}\n\t\tbIndex = i - 1\n\t}\n\n\ttmp := ans\n\tfor _, v := range A {\n\t\ttotalTime += v\n\t\tfor {\n\t\t\tif totalTime <= K || bIndex == -1 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\ttotalTime -= B[bIndex]\n\t\t\ttmp -= 1\n\t\t\tbIndex -= 1\n\t\t}\n\t\tif totalTime <= K {\n\t\t\ttmp += 1\n\t\t}\n\t\tans = max(ans, tmp)\n\t}\n\tfmt.Println(ans)\n}\n\nfunc readline() string {\n\tbuf := make([]byte, 0, BUFSIZE)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tfmt.Println(e.Error())\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc readIntSlice(size int) []int {\n\tslice := make([]int, size)\n\tlines := strings.Split(readline(), \" \")\n\tfor i, v := range lines {\n\t\tslice[i] = s2i(v)\n\t}\n\treturn slice\n}\n\nfunc readInt64Slice(size int) []int64 {\n\tslice := make([]int64, size)\n\tlines := strings.Split(readline(), \" \")\n\tfor i, v := range lines {\n\t\tslice[i] = s2i64(v)\n\t}\n\treturn slice\n}\n\nfunc readint() int {\n\treturn s2i(readline())\n}\n\nfunc readint64() int64 {\n\treturn s2i64(readline())\n}\n\n// For int64\nfunc b2i64(b bool) int64 {\n\tif b {\n\t\treturn 1\n\t}\n\treturn 0\n}\n\nfunc abs64(v int64) int64 {\n\tif v < 0 {\n\t\treturn -v\n\t}\n\treturn v\n}\n\nfunc min64(values ...int64) int64 {\n\tret := int64(INF_INT64)\n\tfor _, v := range values {\n\t\tif ret > v {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc max64(values ...int64) int64 {\n\tret := -int64(INF_INT64)\n\tfor _, v := range values {\n\t\tif ret < v {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc s2i64(s string) int64 {\n\tv, ok := strconv.ParseInt(s, 10, 64)\n\tif ok != nil {\n\t\tpanic(\"Faild : \" + s + \" can't convert to int64\")\n\t}\n\treturn v\n}\n\n// For int\nfunc b2i(b bool) int {\n\tif b {\n\t\treturn 1\n\t}\n\treturn 0\n}\n\nfunc abs(v int) int {\n\tif v < 0 {\n\t\treturn -v\n\t}\n\treturn v\n}\n\nfunc min(values ...int) int {\n\tret := INF_INT\n\tfor _, v := range values {\n\t\tif ret > v {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc max(values ...int) int {\n\tret := -INF_INT\n\tfor _, v := range values {\n\t\tif ret < v {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc s2i(s string) int {\n\tv, ok := strconv.Atoi(s)\n\tif ok != nil {\n\t\tpanic(\"Faild : \" + s + \" can't convert to int\")\n\t}\n\treturn v\n}\n\nfunc lcm(v1, v2 int) int {\n\tif v1 > v2 {\n\t\tv1, v2 = v2, v1\n\t}\n\tfor v1 != 0 {\n\t\tv1, v2 = v2%v1, v1\n\t}\n\treturn v2\n}\n\nfunc gcd(v1, v2 int) int {\n\treturn v1 * v2 / lcm(v1, v2)\n}\n\n/* ------------------------------------------------ */\n/* Data stracture */\n/* ------------------------------------------------ */\ntype IntHeap []int\n\nfunc (h *IntHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IntHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc (h IntHeap) Len() int { return len(h) }\nfunc (h IntHeap) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h IntHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\n", "language": "Go", "metadata": {"date": 1593316627, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02623.html", "problem_id": "p02623", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02623/input.txt", "sample_output_relpath": "derived/input_output/data/p02623/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02623/Go/s776330627.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s776330627", "user_id": "u811202694"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst (\n\tBUFSIZE = 10000000\n\tMOD = 1000000007\n\tINF_INT = math.MaxInt32\n\tINF_INT64 = math.MaxInt64\n)\n\nvar rdr *bufio.Reader\n\nfunc main() {\n\trdr = bufio.NewReaderSize(os.Stdin, BUFSIZE)\n\tsolve()\n}\n\nfunc solve() {\n\tvar N, M, K int64\n\tfmt.Scanf(\"%d %d %d\", &N, &M, &K)\n\tA := readInt64Slice(int(N))\n\tB := readInt64Slice(int(M))\n\n\tans := 0\n\ttotalTime := int64(0)\n\tbIndex := -1\n\tfor i, v := range B {\n\t\tif totalTime+v <= K {\n\t\t\ttotalTime += v\n\t\t\tans += 1\n\t\t} else {\n\t\t\tbIndex = i - 1\n\t\t\tbreak\n\t\t}\n\t\tbIndex = i - 1\n\t}\n\n\ttmp := ans\n\tfor _, v := range A {\n\t\ttotalTime += v\n\t\tfor {\n\t\t\tif totalTime <= K || bIndex == -1 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\ttotalTime -= B[bIndex]\n\t\t\ttmp -= 1\n\t\t\tbIndex -= 1\n\t\t}\n\t\tif totalTime <= K {\n\t\t\ttmp += 1\n\t\t}\n\t\tans = max(ans, tmp)\n\t}\n\tfmt.Println(ans)\n}\n\nfunc readline() string {\n\tbuf := make([]byte, 0, BUFSIZE)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tfmt.Println(e.Error())\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc readIntSlice(size int) []int {\n\tslice := make([]int, size)\n\tlines := strings.Split(readline(), \" \")\n\tfor i, v := range lines {\n\t\tslice[i] = s2i(v)\n\t}\n\treturn slice\n}\n\nfunc readInt64Slice(size int) []int64 {\n\tslice := make([]int64, size)\n\tlines := strings.Split(readline(), \" \")\n\tfor i, v := range lines {\n\t\tslice[i] = s2i64(v)\n\t}\n\treturn slice\n}\n\nfunc readint() int {\n\treturn s2i(readline())\n}\n\nfunc readint64() int64 {\n\treturn s2i64(readline())\n}\n\n// For int64\nfunc b2i64(b bool) int64 {\n\tif b {\n\t\treturn 1\n\t}\n\treturn 0\n}\n\nfunc abs64(v int64) int64 {\n\tif v < 0 {\n\t\treturn -v\n\t}\n\treturn v\n}\n\nfunc min64(values ...int64) int64 {\n\tret := int64(INF_INT64)\n\tfor _, v := range values {\n\t\tif ret > v {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc max64(values ...int64) int64 {\n\tret := -int64(INF_INT64)\n\tfor _, v := range values {\n\t\tif ret < v {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc s2i64(s string) int64 {\n\tv, ok := strconv.ParseInt(s, 10, 64)\n\tif ok != nil {\n\t\tpanic(\"Faild : \" + s + \" can't convert to int64\")\n\t}\n\treturn v\n}\n\n// For int\nfunc b2i(b bool) int {\n\tif b {\n\t\treturn 1\n\t}\n\treturn 0\n}\n\nfunc abs(v int) int {\n\tif v < 0 {\n\t\treturn -v\n\t}\n\treturn v\n}\n\nfunc min(values ...int) int {\n\tret := INF_INT\n\tfor _, v := range values {\n\t\tif ret > v {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc max(values ...int) int {\n\tret := -INF_INT\n\tfor _, v := range values {\n\t\tif ret < v {\n\t\t\tret = v\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc s2i(s string) int {\n\tv, ok := strconv.Atoi(s)\n\tif ok != nil {\n\t\tpanic(\"Faild : \" + s + \" can't convert to int\")\n\t}\n\treturn v\n}\n\nfunc lcm(v1, v2 int) int {\n\tif v1 > v2 {\n\t\tv1, v2 = v2, v1\n\t}\n\tfor v1 != 0 {\n\t\tv1, v2 = v2%v1, v1\n\t}\n\treturn v2\n}\n\nfunc gcd(v1, v2 int) int {\n\treturn v1 * v2 / lcm(v1, v2)\n}\n\n/* ------------------------------------------------ */\n/* Data stracture */\n/* ------------------------------------------------ */\ntype IntHeap []int\n\nfunc (h *IntHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IntHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc (h IntHeap) Len() int { return len(h) }\nfunc (h IntHeap) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h IntHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "sample_input": "3 4 240\n60 90 120\n80 150 80 150\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02623", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3332, "cpu_time_ms": 54, "memory_kb": 23464}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s242531852", "group_id": "codeNet:p02623", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n//Util\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc maxInt(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc minInt(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absInt(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc absFloat64(a float64) float64 {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc maxFloat64(a, b float64) float64 {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc minFloat64(a, b float64) float64 {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc str2Int(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc powInt(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc isPrime(x int) bool {\n\tif x == 1 {\n\t\treturn false\n\t}\n\tif x == 2 {\n\t\treturn true\n\t}\n\tif x%2 == 0 {\n\t\treturn false\n\t}\n\n\tb := true\n\trootx := int(math.Sqrt(float64(x)))\n\ti := 3\n\tfor i <= rootx {\n\t\tif x%i == 0 {\n\t\t\tb = false\n\t\t\tbreak\n\t\t}\n\t\ti += 2\n\t}\n\treturn b\n}\n\nfunc PrimeFactors(n int) (pfs []int) {\n\t// Get the number of 2s that divide n\n\tfor n%2 == 0 {\n\t\tpfs = append(pfs, 2)\n\t\tn = n / 2\n\t}\n\n\t// n must be odd at this point. so we can skip one element\n\t// (note i = i + 2)\n\tfor i := 3; i*i <= n; i = i + 2 {\n\t\t// while i divides n, append i and divide n\n\t\tfor n%i == 0 {\n\t\t\tpfs = append(pfs, i)\n\t\t\tn = n / i\n\t\t}\n\t}\n\n\t// This condition is to handle the case when n is a prime number\n\t// greater than 2\n\tif n > 2 {\n\t\tpfs = append(pfs, n)\n\t}\n\n\treturn\n}\n\nfunc sumInts(x []int) int {\n\n\ttotal := 0\n\tfor _, v := range x {\n\t\ttotal += v\n\t}\n\n\treturn total\n}\n\n//Main\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\treturn sc\n\t}()\n)\n\nvar N, M, K int\n\nvar P = powInt(10, 10)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tN, M, K = nextInt(), nextInt(), nextInt()\n\tA := make([]int, N)\n\tB := make([]int, M)\n\tA[0] = nextInt()\n\tfor i := 1; i < N; i++ {\n\t\tA[i] = nextInt() + A[i-1]\n\t}\n\tB[0] = nextInt()\n\tfor i := 1; i < M; i++ {\n\t\tB[i] = nextInt() + B[i-1]\n\t}\n\n\tans := 0\n\tj := M - 1\n\tfor i := 0; i < N; i++ {\n\t\tif A[i] > K {\n\t\t\tbreak\n\t\t}\n\t\tfor B[j] > K-A[i] || j >= 0 {\n\t\t\tj--\n\t\t}\n\n\t\tans = maxInt(ans, i+j+2)\n\t}\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1593316444, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02623.html", "problem_id": "p02623", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02623/input.txt", "sample_output_relpath": "derived/input_output/data/p02623/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02623/Go/s242531852.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s242531852", "user_id": "u432333240"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n//Util\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc maxInt(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc minInt(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absInt(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc absFloat64(a float64) float64 {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc maxFloat64(a, b float64) float64 {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc minFloat64(a, b float64) float64 {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc str2Int(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc powInt(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc isPrime(x int) bool {\n\tif x == 1 {\n\t\treturn false\n\t}\n\tif x == 2 {\n\t\treturn true\n\t}\n\tif x%2 == 0 {\n\t\treturn false\n\t}\n\n\tb := true\n\trootx := int(math.Sqrt(float64(x)))\n\ti := 3\n\tfor i <= rootx {\n\t\tif x%i == 0 {\n\t\t\tb = false\n\t\t\tbreak\n\t\t}\n\t\ti += 2\n\t}\n\treturn b\n}\n\nfunc PrimeFactors(n int) (pfs []int) {\n\t// Get the number of 2s that divide n\n\tfor n%2 == 0 {\n\t\tpfs = append(pfs, 2)\n\t\tn = n / 2\n\t}\n\n\t// n must be odd at this point. so we can skip one element\n\t// (note i = i + 2)\n\tfor i := 3; i*i <= n; i = i + 2 {\n\t\t// while i divides n, append i and divide n\n\t\tfor n%i == 0 {\n\t\t\tpfs = append(pfs, i)\n\t\t\tn = n / i\n\t\t}\n\t}\n\n\t// This condition is to handle the case when n is a prime number\n\t// greater than 2\n\tif n > 2 {\n\t\tpfs = append(pfs, n)\n\t}\n\n\treturn\n}\n\nfunc sumInts(x []int) int {\n\n\ttotal := 0\n\tfor _, v := range x {\n\t\ttotal += v\n\t}\n\n\treturn total\n}\n\n//Main\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\treturn sc\n\t}()\n)\n\nvar N, M, K int\n\nvar P = powInt(10, 10)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tN, M, K = nextInt(), nextInt(), nextInt()\n\tA := make([]int, N)\n\tB := make([]int, M)\n\tA[0] = nextInt()\n\tfor i := 1; i < N; i++ {\n\t\tA[i] = nextInt() + A[i-1]\n\t}\n\tB[0] = nextInt()\n\tfor i := 1; i < M; i++ {\n\t\tB[i] = nextInt() + B[i-1]\n\t}\n\n\tans := 0\n\tj := M - 1\n\tfor i := 0; i < N; i++ {\n\t\tif A[i] > K {\n\t\t\tbreak\n\t\t}\n\t\tfor B[j] > K-A[i] || j >= 0 {\n\t\t\tj--\n\t\t}\n\n\t\tans = maxInt(ans, i+j+2)\n\t}\n\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "sample_input": "3 4 240\n60 90 120\n80 150 80 150\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02623", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2671, "cpu_time_ms": 70, "memory_kb": 8260}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s667235504", "group_id": "codeNet:p02623", "input_text": "// +build ignore\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve(sc *scanner, wr *bufio.Writer) int {\n\tN := sc.i()\n\tM := sc.i()\n\tK := sc.i()\n\tA := make([]int, N+1)\n\tfor i := 1; i <= N; i++ {\n\t\tA[i] = sc.i() + A[i-1]\n\t}\n\tB := make([]int, M+1)\n\tfor i := 1; i <= M; i++ {\n\t\tB[i] = sc.i() + B[i-1]\n\t}\n\n\tans := 0\n\tj := M\n\tfor i := 1; i <= N; i++ {\n\t\tif A[i] > K {\n\t\t\tbreak\n\t\t}\n\t\tfor B[j] > K-A[i] {\n\t\t\tj--\n\t\t}\n\t\tif ans < i+j {\n\t\t\tans = i + j\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n\n\treturn 0\n}\n\nfunc main() {\n\tsc := newScanner(os.Stdin)\n\twr := bufio.NewWriter(os.Stdout)\n\tret := solve(sc, wr)\n\twr.Flush()\n\tos.Exit(ret)\n}\n\n// I/O\ntype scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc newScanner(input io.Reader) *scanner {\n\tsc := bufio.NewScanner(input)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &scanner{sc}\n}\n\nfunc (s *scanner) s() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *scanner) i() int {\n\ti, e := strconv.Atoi(s.s())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *scanner) f() float64 {\n\tf, e := strconv.ParseFloat(s.s(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *scanner) bs() []byte {\n\treturn []byte(s.s())\n}\n\nfunc (s *scanner) is(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.i()\n\t}\n\treturn res\n}\n\nfunc (s *scanner) fs(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.f()\n\t}\n\treturn res\n}\n", "language": "Go", "metadata": {"date": 1593314377, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02623.html", "problem_id": "p02623", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02623/input.txt", "sample_output_relpath": "derived/input_output/data/p02623/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02623/Go/s667235504.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s667235504", "user_id": "u737368452"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "// +build ignore\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve(sc *scanner, wr *bufio.Writer) int {\n\tN := sc.i()\n\tM := sc.i()\n\tK := sc.i()\n\tA := make([]int, N+1)\n\tfor i := 1; i <= N; i++ {\n\t\tA[i] = sc.i() + A[i-1]\n\t}\n\tB := make([]int, M+1)\n\tfor i := 1; i <= M; i++ {\n\t\tB[i] = sc.i() + B[i-1]\n\t}\n\n\tans := 0\n\tj := M\n\tfor i := 1; i <= N; i++ {\n\t\tif A[i] > K {\n\t\t\tbreak\n\t\t}\n\t\tfor B[j] > K-A[i] {\n\t\t\tj--\n\t\t}\n\t\tif ans < i+j {\n\t\t\tans = i + j\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n\n\treturn 0\n}\n\nfunc main() {\n\tsc := newScanner(os.Stdin)\n\twr := bufio.NewWriter(os.Stdout)\n\tret := solve(sc, wr)\n\twr.Flush()\n\tos.Exit(ret)\n}\n\n// I/O\ntype scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc newScanner(input io.Reader) *scanner {\n\tsc := bufio.NewScanner(input)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &scanner{sc}\n}\n\nfunc (s *scanner) s() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *scanner) i() int {\n\ti, e := strconv.Atoi(s.s())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *scanner) f() float64 {\n\tf, e := strconv.ParseFloat(s.s(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *scanner) bs() []byte {\n\treturn []byte(s.s())\n}\n\nfunc (s *scanner) is(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.i()\n\t}\n\treturn res\n}\n\nfunc (s *scanner) fs(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.f()\n\t}\n\treturn res\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "sample_input": "3 4 240\n60 90 120\n80 150 80 150\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02623", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1434, "cpu_time_ms": 71, "memory_kb": 7820}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s282412269", "group_id": "codeNet:p02623", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tvar n int\n\tvar m int\n\tvar k int\n\tvar count int\n\tvar countTmp int\n\tvar tmp int\n\tvar aArr []int\n\tvar bArr []int\n\n\tsc.Split(bufio.ScanWords)\n\tn = nextInt()\n\tm = nextInt()\n\tk = nextInt()\n\n\tcountTmp = 0\n\tfor i := 0; i < n; i++ {\n\t\ttmp = nextInt()\n\t\tcountTmp = countTmp + tmp\n\t\taArr = append(aArr, countTmp)\n\t}\n\n\tcountTmp = 0\n\tfor i := 0; i < m; i++ {\n\t\ttmp = nextInt()\n\t\tcountTmp = countTmp + tmp\n\t\tbArr = append(bArr, countTmp)\n\t}\n\n\tcount = 0\n\ttmp = m - 1\n\tfor i := 0; i < n; i++ {\n\t\tif aArr[i] > k {\n\t\t\tbreak\n\t\t}\n\t\tfor j := tmp; j >= 0; j-- {\n\t\t\tcountTmp = i + 1 + j + 1\n\t\t\tif countTmp > count && aArr[i]+bArr[j] <= k {\n\t\t\t\tcount = countTmp\n\t\t\t\ttmp = j\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\\n\", count)\n}", "language": "Go", "metadata": {"date": 1593313074, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02623.html", "problem_id": "p02623", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02623/input.txt", "sample_output_relpath": "derived/input_output/data/p02623/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02623/Go/s282412269.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s282412269", "user_id": "u672040536"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tvar n int\n\tvar m int\n\tvar k int\n\tvar count int\n\tvar countTmp int\n\tvar tmp int\n\tvar aArr []int\n\tvar bArr []int\n\n\tsc.Split(bufio.ScanWords)\n\tn = nextInt()\n\tm = nextInt()\n\tk = nextInt()\n\n\tcountTmp = 0\n\tfor i := 0; i < n; i++ {\n\t\ttmp = nextInt()\n\t\tcountTmp = countTmp + tmp\n\t\taArr = append(aArr, countTmp)\n\t}\n\n\tcountTmp = 0\n\tfor i := 0; i < m; i++ {\n\t\ttmp = nextInt()\n\t\tcountTmp = countTmp + tmp\n\t\tbArr = append(bArr, countTmp)\n\t}\n\n\tcount = 0\n\ttmp = m - 1\n\tfor i := 0; i < n; i++ {\n\t\tif aArr[i] > k {\n\t\t\tbreak\n\t\t}\n\t\tfor j := tmp; j >= 0; j-- {\n\t\t\tcountTmp = i + 1 + j + 1\n\t\t\tif countTmp > count && aArr[i]+bArr[j] <= k {\n\t\t\t\tcount = countTmp\n\t\t\t\ttmp = j\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\\n\", count)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "sample_input": "3 4 240\n60 90 120\n80 150 80 150\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02623", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 919, "cpu_time_ms": 2206, "memory_kb": 12276}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s874676663", "group_id": "codeNet:p02623", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tm := nextInt()\n\tk := nextInt()\n\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = nextInt()\n\t}\n\n\tb := make([]int, m)\n\tfor i := 0; i < m; i++ {\n\t\tb[i] = nextInt()\n\t}\n\n\tmax := run(a, b, []int{0, 0}, k, 0, 0)\n\tfmt.Println(max)\n}\n\nfunc run(as []int, bs []int, ks []int, k int, n int, c int) int {\n\tap, bp := exec(as, bs, ks, k, n)\n\t//fmt.Println([]int{ap, bp})\n\tif ap == 0 && bp == 0 {\n\t\treturn c\n\t}\n\tc++\n\taret := c\n\tbret := c\n\tif ap != 0 {\n\t\tks[0]++\n\t\taret = run(as, bs, ks, k, ap, c)\n\t}\n\tif bp != 0 {\n\t\tks[1]++\n\t\tbret = run(as, bs, ks, k, bp, c)\n\t}\n\n\treturn max(aret, bret)\n}\n\nfunc exec(as []int, bs []int, ks []int, k int, n int) (int, int) {\n\tvar a, b int\n\tif len(as) > ks[0] && k >= n+as[ks[0]] {\n\t\ta = n + as[ks[0]]\n\t}\n\tif len(bs) > ks[1] && k >= n+bs[ks[1]] {\n\t\tb = n + bs[ks[1]]\n\t}\n\treturn a, b\n}\n\nfunc max(a int, b int) int {\n\treturn int(math.Max(float64(a), float64(b)))\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n", "language": "Go", "metadata": {"date": 1593312196, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02623.html", "problem_id": "p02623", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02623/input.txt", "sample_output_relpath": "derived/input_output/data/p02623/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02623/Go/s874676663.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s874676663", "user_id": "u137939942"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tm := nextInt()\n\tk := nextInt()\n\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = nextInt()\n\t}\n\n\tb := make([]int, m)\n\tfor i := 0; i < m; i++ {\n\t\tb[i] = nextInt()\n\t}\n\n\tmax := run(a, b, []int{0, 0}, k, 0, 0)\n\tfmt.Println(max)\n}\n\nfunc run(as []int, bs []int, ks []int, k int, n int, c int) int {\n\tap, bp := exec(as, bs, ks, k, n)\n\t//fmt.Println([]int{ap, bp})\n\tif ap == 0 && bp == 0 {\n\t\treturn c\n\t}\n\tc++\n\taret := c\n\tbret := c\n\tif ap != 0 {\n\t\tks[0]++\n\t\taret = run(as, bs, ks, k, ap, c)\n\t}\n\tif bp != 0 {\n\t\tks[1]++\n\t\tbret = run(as, bs, ks, k, bp, c)\n\t}\n\n\treturn max(aret, bret)\n}\n\nfunc exec(as []int, bs []int, ks []int, k int, n int) (int, int) {\n\tvar a, b int\n\tif len(as) > ks[0] && k >= n+as[ks[0]] {\n\t\ta = n + as[ks[0]]\n\t}\n\tif len(bs) > ks[1] && k >= n+bs[ks[1]] {\n\t\tb = n + bs[ks[1]]\n\t}\n\treturn a, b\n}\n\nfunc max(a int, b int) int {\n\treturn int(math.Max(float64(a), float64(b)))\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "sample_input": "3 4 240\n60 90 120\n80 150 80 150\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02623", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1154, "cpu_time_ms": 168, "memory_kb": 127824}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s681729392", "group_id": "codeNet:p02623", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc readLine() (ret string) {\n\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\treturn \"\"\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\ntype Utls struct {\n}\n\ntype uString string\n\nvar utls = &Utls{}\n\nfunc (u *Utls) readLineU() uString {\n\treturn uString(readLine())\n}\n\nfunc (u *Utls) atoi(str string) int {\n\tr, _ := strconv.Atoi(str)\n\treturn r\n}\nfunc (u *Utls) itoa(n int) string {\n\tr := strconv.Itoa(n)\n\treturn r\n}\nfunc (u uString) atoi() int {\n\tr, err := strconv.Atoi(string(u))\n\tif err != nil {\n\t\treturn -1\n\t}\n\treturn r\n}\nfunc (u uString) atoiArr() []int {\n\tret := make([]int, 0)\n\n\tl := strings.Split(string(u), \" \")\n\n\tfor i := 0; i < len(l); i++ {\n\t\ts := (uString(l[i]))\n\n\t\tret = append(ret, s.atoi())\n\n\t}\n\treturn ret\n}\nfunc (u uString) String() string {\n\treturn string(u)\n}\n\nvar memo map[string]int = make(map[string]int)\nvar cmp map[string]int= make(map[string]int)\n\nvar (\n\tN,M,K int\n\tA []int\n\tB []int\n)\ntype node struct {\n\n\tidx1,idx2 int\n\tcnt int\n\t\n\n}\nfunc newNode(i1,i2 int) *node{\n\tret:= &node{\n\n\t}\n\tret.idx1 = i1 \n\tret.idx2 = i2\n\treturn ret\n}\nfunc (n*node)newNode(i1,i2 int) (*node, bool){\n\tret:= &node{\n\n\t}\n\tif i1 >= N || i2>= M{\n\t\tcmp[n.String()] = n.idx1+n.idx2 + 2\n\t\n\t\treturn nil,false\n\t}\n\tret.idx1 = i1 \n\tret.idx2 = i2\n\tif n.idx1 != i1{\n\t\tret.cnt += n.cnt+ A[i1]\n\t} else {\n\t\tret.cnt += n.cnt+ B[i2]\n\t}\n\tif ret.cnt > K{\n\n\t\tcmp[n.String()] = n.idx1+n.idx2 + 2\n\t\t\n\t\treturn nil,false\n\t}\n\tif ret.cnt == K{\n\t\tcmp[ret.String()] = ret.idx1+ret.idx2 +2\n\t\n\t\treturn nil,false\n\t}\n\t\n\t\n\t_,ok:= memo[ret.String()]\n\tif ok {\n\t\treturn nil,false\n\t}\n\tr2 := newNode(i1+1,i2)\n\tr3:= newNode(i1,i2+1)\n\t_,ok2:= memo[r2.String()]\n\t_,ok3:= memo[r3.String()]\n\t\n\t\tif ok2 && ok3 {\n\t\t\treturn nil,false\n\t\t}\n\n\n\tmemo[ret.String()] = ret.cnt\n\treturn ret,true\n}\nfunc (n*node) String()string {\n\tret:= utls.itoa(n.idx1) +\" \"+ utls.itoa(n.idx2)\n\t\n\treturn ret\n\n}\nfunc (n*node) next ()[]*node {\n\tret:= make([]*node ,0)\n\tn1,b:=\tn.newNode(n.idx1+1, n.idx2)\n\tif b {\n\t\tret=append(ret,n1)\n\t}\n\tn2,b:=\tn.newNode(n.idx1, n.idx2+1)\n\tif b {\n\t\tret=append(ret,n2)\n\t}\n\treturn ret\n\n}\n\n\n\nfunc main() {\n\t l1 := utls.readLineU().atoiArr()\n\t A = utls.readLineU().atoiArr()\n\t B = utls.readLineU().atoiArr()\n N= l1[0]\n M= l1[1]\n\t K= l1[2]\n\t nodes:= make([]*node ,0)\n\n\t nodes= append(nodes, newNode(-1,-1))\n\n\t for len(nodes)>0 {\n\t\t n := nodes[0]\n\t\t\n\t\tnodes= nodes[1:]\n\t//\tfor _,n := range ns{\n\t\t\t nn :=n.next()\n\t\t\t if len(nn) > 0{\n\t\t\t\t nodes= append(nodes, nn...)\n\t\t\t\t// fmt.Println(len(nn))\n\t\t\t }\n\t\t\t\n\t\t\t sort. Slice(nodes , func (i,j int) bool{\n\n\t\t\t\t if nodes[i].idx1 + nodes[i].idx2 != nodes[j].idx1 + nodes[j].idx2{\n\t\t\t\t return \tnodes[i].idx1 + nodes[i].idx2 > nodes[j].idx1 + nodes[j].idx2\n\t\t\t\t }\n\t\t\t\t return nodes[i].cnt < nodes[j].cnt\n\t\t\t } )\n\t\t\t\n\t\t\n\t//\t}\n\t\t \n\t }\n\t \n//\t r := (a)+ (a*a) + (a*a*a)\n\nret:= 0\nfor _,v:= range cmp {\n\t//fmt.Println ( v)\n\tif ret< v{\n\t\t\nret= v\n\t}\n}\n\t fmt.Println ( ret)\n}", "language": "Go", "metadata": {"date": 1593311507, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02623.html", "problem_id": "p02623", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02623/input.txt", "sample_output_relpath": "derived/input_output/data/p02623/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02623/Go/s681729392.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s681729392", "user_id": "u482166699"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc readLine() (ret string) {\n\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\treturn \"\"\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\ntype Utls struct {\n}\n\ntype uString string\n\nvar utls = &Utls{}\n\nfunc (u *Utls) readLineU() uString {\n\treturn uString(readLine())\n}\n\nfunc (u *Utls) atoi(str string) int {\n\tr, _ := strconv.Atoi(str)\n\treturn r\n}\nfunc (u *Utls) itoa(n int) string {\n\tr := strconv.Itoa(n)\n\treturn r\n}\nfunc (u uString) atoi() int {\n\tr, err := strconv.Atoi(string(u))\n\tif err != nil {\n\t\treturn -1\n\t}\n\treturn r\n}\nfunc (u uString) atoiArr() []int {\n\tret := make([]int, 0)\n\n\tl := strings.Split(string(u), \" \")\n\n\tfor i := 0; i < len(l); i++ {\n\t\ts := (uString(l[i]))\n\n\t\tret = append(ret, s.atoi())\n\n\t}\n\treturn ret\n}\nfunc (u uString) String() string {\n\treturn string(u)\n}\n\nvar memo map[string]int = make(map[string]int)\nvar cmp map[string]int= make(map[string]int)\n\nvar (\n\tN,M,K int\n\tA []int\n\tB []int\n)\ntype node struct {\n\n\tidx1,idx2 int\n\tcnt int\n\t\n\n}\nfunc newNode(i1,i2 int) *node{\n\tret:= &node{\n\n\t}\n\tret.idx1 = i1 \n\tret.idx2 = i2\n\treturn ret\n}\nfunc (n*node)newNode(i1,i2 int) (*node, bool){\n\tret:= &node{\n\n\t}\n\tif i1 >= N || i2>= M{\n\t\tcmp[n.String()] = n.idx1+n.idx2 + 2\n\t\n\t\treturn nil,false\n\t}\n\tret.idx1 = i1 \n\tret.idx2 = i2\n\tif n.idx1 != i1{\n\t\tret.cnt += n.cnt+ A[i1]\n\t} else {\n\t\tret.cnt += n.cnt+ B[i2]\n\t}\n\tif ret.cnt > K{\n\n\t\tcmp[n.String()] = n.idx1+n.idx2 + 2\n\t\t\n\t\treturn nil,false\n\t}\n\tif ret.cnt == K{\n\t\tcmp[ret.String()] = ret.idx1+ret.idx2 +2\n\t\n\t\treturn nil,false\n\t}\n\t\n\t\n\t_,ok:= memo[ret.String()]\n\tif ok {\n\t\treturn nil,false\n\t}\n\tr2 := newNode(i1+1,i2)\n\tr3:= newNode(i1,i2+1)\n\t_,ok2:= memo[r2.String()]\n\t_,ok3:= memo[r3.String()]\n\t\n\t\tif ok2 && ok3 {\n\t\t\treturn nil,false\n\t\t}\n\n\n\tmemo[ret.String()] = ret.cnt\n\treturn ret,true\n}\nfunc (n*node) String()string {\n\tret:= utls.itoa(n.idx1) +\" \"+ utls.itoa(n.idx2)\n\t\n\treturn ret\n\n}\nfunc (n*node) next ()[]*node {\n\tret:= make([]*node ,0)\n\tn1,b:=\tn.newNode(n.idx1+1, n.idx2)\n\tif b {\n\t\tret=append(ret,n1)\n\t}\n\tn2,b:=\tn.newNode(n.idx1, n.idx2+1)\n\tif b {\n\t\tret=append(ret,n2)\n\t}\n\treturn ret\n\n}\n\n\n\nfunc main() {\n\t l1 := utls.readLineU().atoiArr()\n\t A = utls.readLineU().atoiArr()\n\t B = utls.readLineU().atoiArr()\n N= l1[0]\n M= l1[1]\n\t K= l1[2]\n\t nodes:= make([]*node ,0)\n\n\t nodes= append(nodes, newNode(-1,-1))\n\n\t for len(nodes)>0 {\n\t\t n := nodes[0]\n\t\t\n\t\tnodes= nodes[1:]\n\t//\tfor _,n := range ns{\n\t\t\t nn :=n.next()\n\t\t\t if len(nn) > 0{\n\t\t\t\t nodes= append(nodes, nn...)\n\t\t\t\t// fmt.Println(len(nn))\n\t\t\t }\n\t\t\t\n\t\t\t sort. Slice(nodes , func (i,j int) bool{\n\n\t\t\t\t if nodes[i].idx1 + nodes[i].idx2 != nodes[j].idx1 + nodes[j].idx2{\n\t\t\t\t return \tnodes[i].idx1 + nodes[i].idx2 > nodes[j].idx1 + nodes[j].idx2\n\t\t\t\t }\n\t\t\t\t return nodes[i].cnt < nodes[j].cnt\n\t\t\t } )\n\t\t\t\n\t\t\n\t//\t}\n\t\t \n\t }\n\t \n//\t r := (a)+ (a*a) + (a*a*a)\n\nret:= 0\nfor _,v:= range cmp {\n\t//fmt.Println ( v)\n\tif ret< v{\n\t\t\nret= v\n\t}\n}\n\t fmt.Println ( ret)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "sample_input": "3 4 240\n60 90 120\n80 150 80 150\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02623", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3064, "cpu_time_ms": 2207, "memory_kb": 72168}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s872085180", "group_id": "codeNet:p02623", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc readLine() (ret string) {\n\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\treturn \"\"\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\ntype Utls struct {\n}\n\ntype uString string\n\nvar utls = &Utls{}\n\nfunc (u *Utls) readLineU() uString {\n\treturn uString(readLine())\n}\n\nfunc (u *Utls) atoi(str string) int {\n\tr, _ := strconv.Atoi(str)\n\treturn r\n}\nfunc (u *Utls) itoa(n int) string {\n\tr := strconv.Itoa(n)\n\treturn r\n}\nfunc (u uString) atoi() int {\n\tr, err := strconv.Atoi(string(u))\n\tif err != nil {\n\t\treturn -1\n\t}\n\treturn r\n}\nfunc (u uString) atoiArr() []int {\n\tret := make([]int, 0)\n\n\tl := strings.Split(string(u), \" \")\n\n\tfor i := 0; i < len(l); i++ {\n\t\ts := (uString(l[i]))\n\n\t\tret = append(ret, s.atoi())\n\n\t}\n\treturn ret\n}\nfunc (u uString) String() string {\n\treturn string(u)\n}\n\nvar memo map[string]int = make(map[string]int)\nvar cmp map[string]int= make(map[string]int)\n\nvar (\n\tN,M,K int\n\tA []int\n\tB []int\n)\ntype node struct {\n\n\tidx1,idx2 int\n\tcnt int\n\t\n\n}\nfunc newNode(i1,i2 int) *node{\n\tret:= &node{\n\n\t}\n\tret.idx1 = i1 \n\tret.idx2 = i2\n\treturn ret\n}\nfunc (n*node)newNode(i1,i2 int) (*node, bool){\n\tret:= &node{\n\n\t}\n\tif i1 >= N || i2>= M{\n\t\tcmp[n.String()] = n.idx1+n.idx2 + 2\n\t\n\t\treturn nil,false\n\t}\n\tret.idx1 = i1 \n\tret.idx2 = i2\n\tif n.idx1 != i1{\n\t\tret.cnt += n.cnt+ A[i1]\n\t} else {\n\t\tret.cnt += n.cnt+ B[i2]\n\t}\n\tif ret.cnt > K{\n\n\t\tcmp[n.String()] = n.idx1+n.idx2 + 2\n\t\t\n\t\treturn nil,false\n\t}\n\tif ret.cnt == K{\n\t\tcmp[ret.String()] = ret.idx1+ret.idx2 +2\n\t\n\t\treturn nil,false\n\t}\n\t\n\t\n\t_,ok:= memo[ret.String()]\n\tif ok {\n\t\treturn nil,false\n\t}\n\tr2 := newNode(i1+1,i2)\n\tr3:= newNode(i1,i2+1)\n\t_,ok2:= memo[r2.String()]\n\t_,ok3:= memo[r3.String()]\n\t\n\t\tif ok2 && ok3 {\n\t\t\treturn nil,false\n\t\t}\n\n\n\tmemo[ret.String()] = ret.cnt\n\treturn ret,true\n}\nfunc (n*node) String()string {\n\tret:= utls.itoa(n.idx1) +\" \"+ utls.itoa(n.idx2)\n\t\n\treturn ret\n\n}\nfunc (n*node) next ()[]*node {\n\tret:= make([]*node ,0)\n\tn1,b:=\tn.newNode(n.idx1+1, n.idx2)\n\tif b {\n\t\tret=append(ret,n1)\n\t}\n\tn2,b:=\tn.newNode(n.idx1, n.idx2+1)\n\tif b {\n\t\tret=append(ret,n2)\n\t}\n\treturn ret\n\n}\n\n\n\nfunc main() {\n\t l1 := utls.readLineU().atoiArr()\n\t A = utls.readLineU().atoiArr()\n\t B = utls.readLineU().atoiArr()\n N= l1[0]\n M= l1[1]\n\t K= l1[2]\n\t nodes:= make([]*node ,0)\n\n\t nodes= append(nodes, newNode(-1,-1))\n\n\t for len(nodes)>0 {\n\t\t n := nodes[0]\n\t\t\n\t\tnodes= nodes[1:]\n\t//\tfor _,n := range ns{\n\t\t\t nn :=n.next()\n\t\t\t if len(nn) > 0{\n\t\t\t\t nodes= append(nodes, nn...)\n\t\t\t\t// fmt.Println(len(nn))\n\t\t\t }\n\t\t\t\n\t\t\t sort.Slice(nodes , func (i,j int) bool{\n\n\t\t\t\treturn nodes[i].cnt < nodes[j].cnt \n\t\t\t } )\n\t\t\t\n\t\t\n\t//\t}\n\t\t \n\t }\n\t \n//\t r := (a)+ (a*a) + (a*a*a)\n\nret:= 0\nfor _,v:= range cmp {\n\t//fmt.Println ( v)\n\tif ret< v{\n\t\t\nret= v\n\t}\n}\n\t fmt.Println ( ret)\n}", "language": "Go", "metadata": {"date": 1593311267, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02623.html", "problem_id": "p02623", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02623/input.txt", "sample_output_relpath": "derived/input_output/data/p02623/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02623/Go/s872085180.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s872085180", "user_id": "u482166699"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc readLine() (ret string) {\n\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\treturn \"\"\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\ntype Utls struct {\n}\n\ntype uString string\n\nvar utls = &Utls{}\n\nfunc (u *Utls) readLineU() uString {\n\treturn uString(readLine())\n}\n\nfunc (u *Utls) atoi(str string) int {\n\tr, _ := strconv.Atoi(str)\n\treturn r\n}\nfunc (u *Utls) itoa(n int) string {\n\tr := strconv.Itoa(n)\n\treturn r\n}\nfunc (u uString) atoi() int {\n\tr, err := strconv.Atoi(string(u))\n\tif err != nil {\n\t\treturn -1\n\t}\n\treturn r\n}\nfunc (u uString) atoiArr() []int {\n\tret := make([]int, 0)\n\n\tl := strings.Split(string(u), \" \")\n\n\tfor i := 0; i < len(l); i++ {\n\t\ts := (uString(l[i]))\n\n\t\tret = append(ret, s.atoi())\n\n\t}\n\treturn ret\n}\nfunc (u uString) String() string {\n\treturn string(u)\n}\n\nvar memo map[string]int = make(map[string]int)\nvar cmp map[string]int= make(map[string]int)\n\nvar (\n\tN,M,K int\n\tA []int\n\tB []int\n)\ntype node struct {\n\n\tidx1,idx2 int\n\tcnt int\n\t\n\n}\nfunc newNode(i1,i2 int) *node{\n\tret:= &node{\n\n\t}\n\tret.idx1 = i1 \n\tret.idx2 = i2\n\treturn ret\n}\nfunc (n*node)newNode(i1,i2 int) (*node, bool){\n\tret:= &node{\n\n\t}\n\tif i1 >= N || i2>= M{\n\t\tcmp[n.String()] = n.idx1+n.idx2 + 2\n\t\n\t\treturn nil,false\n\t}\n\tret.idx1 = i1 \n\tret.idx2 = i2\n\tif n.idx1 != i1{\n\t\tret.cnt += n.cnt+ A[i1]\n\t} else {\n\t\tret.cnt += n.cnt+ B[i2]\n\t}\n\tif ret.cnt > K{\n\n\t\tcmp[n.String()] = n.idx1+n.idx2 + 2\n\t\t\n\t\treturn nil,false\n\t}\n\tif ret.cnt == K{\n\t\tcmp[ret.String()] = ret.idx1+ret.idx2 +2\n\t\n\t\treturn nil,false\n\t}\n\t\n\t\n\t_,ok:= memo[ret.String()]\n\tif ok {\n\t\treturn nil,false\n\t}\n\tr2 := newNode(i1+1,i2)\n\tr3:= newNode(i1,i2+1)\n\t_,ok2:= memo[r2.String()]\n\t_,ok3:= memo[r3.String()]\n\t\n\t\tif ok2 && ok3 {\n\t\t\treturn nil,false\n\t\t}\n\n\n\tmemo[ret.String()] = ret.cnt\n\treturn ret,true\n}\nfunc (n*node) String()string {\n\tret:= utls.itoa(n.idx1) +\" \"+ utls.itoa(n.idx2)\n\t\n\treturn ret\n\n}\nfunc (n*node) next ()[]*node {\n\tret:= make([]*node ,0)\n\tn1,b:=\tn.newNode(n.idx1+1, n.idx2)\n\tif b {\n\t\tret=append(ret,n1)\n\t}\n\tn2,b:=\tn.newNode(n.idx1, n.idx2+1)\n\tif b {\n\t\tret=append(ret,n2)\n\t}\n\treturn ret\n\n}\n\n\n\nfunc main() {\n\t l1 := utls.readLineU().atoiArr()\n\t A = utls.readLineU().atoiArr()\n\t B = utls.readLineU().atoiArr()\n N= l1[0]\n M= l1[1]\n\t K= l1[2]\n\t nodes:= make([]*node ,0)\n\n\t nodes= append(nodes, newNode(-1,-1))\n\n\t for len(nodes)>0 {\n\t\t n := nodes[0]\n\t\t\n\t\tnodes= nodes[1:]\n\t//\tfor _,n := range ns{\n\t\t\t nn :=n.next()\n\t\t\t if len(nn) > 0{\n\t\t\t\t nodes= append(nodes, nn...)\n\t\t\t\t// fmt.Println(len(nn))\n\t\t\t }\n\t\t\t\n\t\t\t sort.Slice(nodes , func (i,j int) bool{\n\n\t\t\t\treturn nodes[i].cnt < nodes[j].cnt \n\t\t\t } )\n\t\t\t\n\t\t\n\t//\t}\n\t\t \n\t }\n\t \n//\t r := (a)+ (a*a) + (a*a*a)\n\nret:= 0\nfor _,v:= range cmp {\n\t//fmt.Println ( v)\n\tif ret< v{\n\t\t\nret= v\n\t}\n}\n\t fmt.Println ( ret)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "sample_input": "3 4 240\n60 90 120\n80 150 80 150\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02623", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2909, "cpu_time_ms": 2207, "memory_kb": 65720}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s409517670", "group_id": "codeNet:p02623", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tN := getInt()\n\tM := getInt()\n\tK := getInt()\n\tA := getIntArray(N)\n\tB := getIntArray(M)\n\n\tcntA := 0\n\tcntB := 0\n\tvar totalA []int\n\tvar totalB []int\n\tfor i, a := range A {\n\t\tif i != 0 && totalA[i-1] + a > K {\n\t\t\tbreak\n\t\t}\n\t\tcntA++\n\t\ttotal := a\n\t\tif i != 0 {\n\t\t\ttotal += totalA[i-1]\n\t\t}\n\t\ttotalA = append(totalA, total)\n\t}\n\tfor i, b := range B {\n\t\tif i != 0 && totalB[i-1] + b > K {\n\t\t\tbreak\n\t\t}\n\t\tcntB++\n\t\ttotal := b\n\t\tif i != 0 {\n\t\t\ttotal += totalB[i-1]\n\t\t}\n\t\ttotalB = append(totalB, total)\n\t}\n\n\t//fmt.Println(totalA)\n\t//fmt.Println(totalB)\n\n\tresult := 0\n\trest := K\n\tindexA := 0\n\tindexB := 0\n\tusedTotalA := 0\n\tusedTotalB := 0\n\tfor {\n\t\t//fmt.Println(cntA, cntB)\n\t\tif indexA >= cntA && indexB >= cntB {\n\t\t\tbreak\n\t\t} else if indexA >= cntA {\n\t\t\tif rest - B[indexB] < 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tresult++\n\t\t\trest -= B[indexB]\n\t\t\tusedTotalB += B[indexB]\n\t\t\tindexB++\n\t\t} else if indexB >= cntB {\n\t\t\tif rest - A[indexA] < 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tresult++\n\t\t\trest -= A[indexA]\n\t\t\tusedTotalA += A[indexA]\n\t\t\tindexA++\n\t\t} else {\n\t\t\tif (cntA - indexA) >= (cntB - indexB) {\n\t\t\t\tif rest-A[indexA] < 0 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tresult++\n\t\t\t\trest -= A[indexA]\n\t\t\t\tusedTotalA += A[indexA]\n\t\t\t\tindexA++\n\t\t\t} else {\n\t\t\t\tif rest - B[indexB] < 0 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tresult++\n\t\t\t\trest -= B[indexB]\n\t\t\t\tusedTotalB += B[indexB]\n\t\t\t\tindexB++\n\t\t\t}\n\t\t}\n\n\t\t//fmt.Println(usedTotalA, usedTotalB, rest)\n\t\tfor i := cntA; i > 0; i-- {\n\t\t\tif totalA[i-1] - usedTotalA <= rest {\n\t\t\t\tcntA = i\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tfor i := cntB; i > 0; i-- {\n\t\t\tif totalB[i-1] - usedTotalB <= rest {\n\t\t\t\tcntB = i\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(result)\n}\n\ntype Graph struct {\n\tn int\n\tedges []map[int]struct{}\n}\n\nfunc NewGraph(n int) *Graph {\n\tg := &Graph{\n\t\tn: n,\n\t\tedges: make([]map[int]struct{}, n),\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tg.edges[i] = make(map[int]struct{})\n\t}\n\treturn g\n}\n\nfunc (g *Graph) AddEdge(u, v int) {\n\tg.edges[v][u] = struct{}{}\n\tg.edges[u][v] = struct{}{}\n}\n\nfunc dfs(c int, edges []map[int]struct{}, visited map[int]struct{}) {\n\tvisited[c] = struct{}{}\n\n\tfor v := range edges[c] {\n\t\t_, flag := visited[v]\n\t\tif flag {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(v, edges, visited)\n\t}\n}\n\nfunc bfs(c int, graph *Graph) {\n\tstandby := make(map[int]struct{})\n\tnext := make([]int, 0)\n\tnext = append(next, c)\n\tvisited := make(map[int]struct{})\n\n\tfor ; len(next) != 0; {\n\t\tu := next[0]\n\t\tnext = next[1:]\n\t\tvisited[u] = struct{}{}\n\t\tdelete(standby, u)\n\n\t\tfor v := range graph.edges[u] {\n\t\t\t_, flag := visited[v]\n\t\t\tif flag {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// なにか処理\n\n\t\t\tif _, exists := standby[v]; !exists {\n\t\t\t\tnext = append(next, v)\n\t\t\t\tstandby[v] = struct{}{}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getIntArray(n int) []int {\n\tarray := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getInt()\n\t}\n\treturn array\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc getStringArray(n int) []string {\n\tarray := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getString()\n\t}\n\treturn array\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc powMod(n, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 0 {\n\t\tt := powMod(n, p/2)\n\t\treturn calcMod(t * t)\n\t} else {\n\t\treturn calcMod(n * powMod(n, p-1))\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n % 2 == 0 {\n\t\treturn false\n\t}\n\n\tsqrtN := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sqrtN; i += 2 {\n\t\tif n % i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}\n\nfunc powerset2(nums []int) [][]int {\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tindex := 0\n\tresult[index] = []int{}\n\tindex++\n\n\tfor _, n := range nums {\n\t\tmax := index\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[index] = copyAndAppend(result[i], n)\n\t\t\tindex++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc calcGcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t} else if x >= y {\n\t\treturn calcGcd(y, x % y)\n\t} else {\n\t\treturn calcGcd(x, y % x)\n\t}\n}\n\nfunc getDivisor(n int) []int {\n\tdivisor := make(map[int]struct{})\n\tdivisor[1] = struct{}{}\n\tif n != 1 {\n\t\tdivisor[n] = struct{}{}\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n % i == 0 {\n\t\t\tdivisor[i] = struct{}{}\n\t\t\tdivisor[n/i] = struct{}{}\n\t\t}\n\t}\n\n\tvar divisorArray []int\n\tfor d := range divisor {\n\t\tdivisorArray = append(divisorArray, d)\n\t}\n\treturn divisorArray\n}\n\ntype intHeap []int\n\nfunc (h intHeap) Len() int {\n\treturn len(h)\n}\n\nfunc (h intHeap) Less(i, j int) bool {\n\treturn h[i] > h[j]\n}\n\nfunc (h intHeap) Swap(i, j int) {\n\th[i], h[j] = h[j], h[i]\n}\n\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc initHeap() *intHeap {\n\tih := &intHeap{}\n\theap.Init(ih)\n\treturn ih\n}\n\nfunc (h *intHeap) pushHeap(n int) {\n\theap.Push(h, n)\n}\n\nfunc (h *intHeap) popHeap() int {\n\treturn heap.Pop(h).(int)\n}\n\nfunc factMod(n int) int {\n\tvalue := 1\n\tfor ; n > 1; n-- {\n\t\tvalue = calcMod(value * n)\n\t}\n\treturn value\n}\n\nfunc combinationMod(n, k int) int {\n\tfactN := factMod(n)\n\tfactK := factMod(k)\n\tfactNK := factMod(n - k)\n\tfactKR := powMod(factK, mod - 2)\n\tfactNKR := powMod(factNK, mod - 2)\n\treturn calcMod(factN * calcMod(factKR * factNKR))\n}\n\nfunc primeFactors(n int) [] int {\n\tfactors := make([]int, 0)\n\ti := 2\n\tfor i * i <= n {\n\t\tr := n % i\n\t\tif r != 0 {\n\t\t\ti += 1\n\t\t} else if r == 0 {\n\t\t\tn /= i\n\t\t\tfactors = append(factors, i)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfactors = append(factors, n)\n\t}\n\treturn factors\n}\n", "language": "Go", "metadata": {"date": 1593310991, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02623.html", "problem_id": "p02623", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02623/input.txt", "sample_output_relpath": "derived/input_output/data/p02623/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02623/Go/s409517670.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s409517670", "user_id": "u964273035"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tN := getInt()\n\tM := getInt()\n\tK := getInt()\n\tA := getIntArray(N)\n\tB := getIntArray(M)\n\n\tcntA := 0\n\tcntB := 0\n\tvar totalA []int\n\tvar totalB []int\n\tfor i, a := range A {\n\t\tif i != 0 && totalA[i-1] + a > K {\n\t\t\tbreak\n\t\t}\n\t\tcntA++\n\t\ttotal := a\n\t\tif i != 0 {\n\t\t\ttotal += totalA[i-1]\n\t\t}\n\t\ttotalA = append(totalA, total)\n\t}\n\tfor i, b := range B {\n\t\tif i != 0 && totalB[i-1] + b > K {\n\t\t\tbreak\n\t\t}\n\t\tcntB++\n\t\ttotal := b\n\t\tif i != 0 {\n\t\t\ttotal += totalB[i-1]\n\t\t}\n\t\ttotalB = append(totalB, total)\n\t}\n\n\t//fmt.Println(totalA)\n\t//fmt.Println(totalB)\n\n\tresult := 0\n\trest := K\n\tindexA := 0\n\tindexB := 0\n\tusedTotalA := 0\n\tusedTotalB := 0\n\tfor {\n\t\t//fmt.Println(cntA, cntB)\n\t\tif indexA >= cntA && indexB >= cntB {\n\t\t\tbreak\n\t\t} else if indexA >= cntA {\n\t\t\tif rest - B[indexB] < 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tresult++\n\t\t\trest -= B[indexB]\n\t\t\tusedTotalB += B[indexB]\n\t\t\tindexB++\n\t\t} else if indexB >= cntB {\n\t\t\tif rest - A[indexA] < 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tresult++\n\t\t\trest -= A[indexA]\n\t\t\tusedTotalA += A[indexA]\n\t\t\tindexA++\n\t\t} else {\n\t\t\tif (cntA - indexA) >= (cntB - indexB) {\n\t\t\t\tif rest-A[indexA] < 0 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tresult++\n\t\t\t\trest -= A[indexA]\n\t\t\t\tusedTotalA += A[indexA]\n\t\t\t\tindexA++\n\t\t\t} else {\n\t\t\t\tif rest - B[indexB] < 0 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tresult++\n\t\t\t\trest -= B[indexB]\n\t\t\t\tusedTotalB += B[indexB]\n\t\t\t\tindexB++\n\t\t\t}\n\t\t}\n\n\t\t//fmt.Println(usedTotalA, usedTotalB, rest)\n\t\tfor i := cntA; i > 0; i-- {\n\t\t\tif totalA[i-1] - usedTotalA <= rest {\n\t\t\t\tcntA = i\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tfor i := cntB; i > 0; i-- {\n\t\t\tif totalB[i-1] - usedTotalB <= rest {\n\t\t\t\tcntB = i\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(result)\n}\n\ntype Graph struct {\n\tn int\n\tedges []map[int]struct{}\n}\n\nfunc NewGraph(n int) *Graph {\n\tg := &Graph{\n\t\tn: n,\n\t\tedges: make([]map[int]struct{}, n),\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tg.edges[i] = make(map[int]struct{})\n\t}\n\treturn g\n}\n\nfunc (g *Graph) AddEdge(u, v int) {\n\tg.edges[v][u] = struct{}{}\n\tg.edges[u][v] = struct{}{}\n}\n\nfunc dfs(c int, edges []map[int]struct{}, visited map[int]struct{}) {\n\tvisited[c] = struct{}{}\n\n\tfor v := range edges[c] {\n\t\t_, flag := visited[v]\n\t\tif flag {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(v, edges, visited)\n\t}\n}\n\nfunc bfs(c int, graph *Graph) {\n\tstandby := make(map[int]struct{})\n\tnext := make([]int, 0)\n\tnext = append(next, c)\n\tvisited := make(map[int]struct{})\n\n\tfor ; len(next) != 0; {\n\t\tu := next[0]\n\t\tnext = next[1:]\n\t\tvisited[u] = struct{}{}\n\t\tdelete(standby, u)\n\n\t\tfor v := range graph.edges[u] {\n\t\t\t_, flag := visited[v]\n\t\t\tif flag {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// なにか処理\n\n\t\t\tif _, exists := standby[v]; !exists {\n\t\t\t\tnext = append(next, v)\n\t\t\t\tstandby[v] = struct{}{}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getIntArray(n int) []int {\n\tarray := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getInt()\n\t}\n\treturn array\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc getStringArray(n int) []string {\n\tarray := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getString()\n\t}\n\treturn array\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc powMod(n, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 0 {\n\t\tt := powMod(n, p/2)\n\t\treturn calcMod(t * t)\n\t} else {\n\t\treturn calcMod(n * powMod(n, p-1))\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n % 2 == 0 {\n\t\treturn false\n\t}\n\n\tsqrtN := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sqrtN; i += 2 {\n\t\tif n % i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}\n\nfunc powerset2(nums []int) [][]int {\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tindex := 0\n\tresult[index] = []int{}\n\tindex++\n\n\tfor _, n := range nums {\n\t\tmax := index\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[index] = copyAndAppend(result[i], n)\n\t\t\tindex++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc calcGcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t} else if x >= y {\n\t\treturn calcGcd(y, x % y)\n\t} else {\n\t\treturn calcGcd(x, y % x)\n\t}\n}\n\nfunc getDivisor(n int) []int {\n\tdivisor := make(map[int]struct{})\n\tdivisor[1] = struct{}{}\n\tif n != 1 {\n\t\tdivisor[n] = struct{}{}\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n % i == 0 {\n\t\t\tdivisor[i] = struct{}{}\n\t\t\tdivisor[n/i] = struct{}{}\n\t\t}\n\t}\n\n\tvar divisorArray []int\n\tfor d := range divisor {\n\t\tdivisorArray = append(divisorArray, d)\n\t}\n\treturn divisorArray\n}\n\ntype intHeap []int\n\nfunc (h intHeap) Len() int {\n\treturn len(h)\n}\n\nfunc (h intHeap) Less(i, j int) bool {\n\treturn h[i] > h[j]\n}\n\nfunc (h intHeap) Swap(i, j int) {\n\th[i], h[j] = h[j], h[i]\n}\n\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc initHeap() *intHeap {\n\tih := &intHeap{}\n\theap.Init(ih)\n\treturn ih\n}\n\nfunc (h *intHeap) pushHeap(n int) {\n\theap.Push(h, n)\n}\n\nfunc (h *intHeap) popHeap() int {\n\treturn heap.Pop(h).(int)\n}\n\nfunc factMod(n int) int {\n\tvalue := 1\n\tfor ; n > 1; n-- {\n\t\tvalue = calcMod(value * n)\n\t}\n\treturn value\n}\n\nfunc combinationMod(n, k int) int {\n\tfactN := factMod(n)\n\tfactK := factMod(k)\n\tfactNK := factMod(n - k)\n\tfactKR := powMod(factK, mod - 2)\n\tfactNKR := powMod(factNK, mod - 2)\n\treturn calcMod(factN * calcMod(factKR * factNKR))\n}\n\nfunc primeFactors(n int) [] int {\n\tfactors := make([]int, 0)\n\ti := 2\n\tfor i * i <= n {\n\t\tr := n % i\n\t\tif r != 0 {\n\t\t\ti += 1\n\t\t} else if r == 0 {\n\t\t\tn /= i\n\t\t\tfactors = append(factors, i)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfactors = append(factors, n)\n\t}\n\treturn factors\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "sample_input": "3 4 240\n60 90 120\n80 150 80 150\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02623", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 7309, "cpu_time_ms": 71, "memory_kb": 14628}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s040585351", "group_id": "codeNet:p02623", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewReaderSize(os.Stdin, 1024*1024*1)\n\nfunc main() {\n\tlist := getStdinIntArr64()\n\tN := uint64(list[0])\n\tM := uint64(list[1])\n\tK := uint64(list[2])\n\tA := getStdinIntArru64()\n\tB := getStdinIntArru64()\n\n\tvar cnta uint64 = 0\n\tvar cntb uint64 = 0\n\tvar time uint64 = 0\n\tfor {\n\t\tif cnta >= N && cntb >= M {\n\t\t\tbreak\n\t\t}\n\t\tif cnta >= N {\n\t\t\ttime += B[cntb]\n\t\t\tif time > K {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcntb++\n\t\t\tcontinue\n\t\t}\n\t\tif cntb >= M {\n\t\t\ttime += A[cnta]\n\t\t\tif time > K {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcnta++\n\t\t\tcontinue\n\t\t}\n\t\tif A[cnta] < B[cntb] {\n\t\t\ttime += A[cnta]\n\t\t\tif time > K {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcnta++\n\t\t} else {\n\t\t\ttime += B[cntb]\n\t\t\tif time > K {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcntb++\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\\n\", cnta+cntb)\n}\n\nfunc getStdin() string {\n\treturn readLine()\n}\nfunc getStdinInt() int {\n\tstr := getStdin()\n\trtn, _ := strconv.Atoi(str)\n\treturn rtn\n}\nfunc getStdinInt2() (int, int) {\n\tlist := getStdinIntArr()\n\treturn list[0], list[1]\n}\nfunc getStdinInt3() (int, int, int) {\n\tlist := getStdinIntArr()\n\treturn list[0], list[1], list[2]\n}\nfunc getStdinIntArr() []int {\n\tstr := getStdin()\n\tlist := strings.Split(str, \" \")\n\trtn := make([]int, len(list))\n\tfor idx, val := range list {\n\t\trtn[idx], _ = strconv.Atoi(val)\n\t}\n\treturn rtn\n}\n\nfunc getStdinIntArr64() []int64 {\n\tstr := getStdin()\n\tlist := strings.Split(str, \" \")\n\trtn := make([]int64, len(list))\n\tfor idx, val := range list {\n\t\trtn[idx], _ = strconv.ParseInt(val, 10, 64)\n\t}\n\treturn rtn\n}\n\nfunc getStdinIntArru64() []uint64 {\n\tstr := getStdin()\n\tlist := strings.Split(str, \" \")\n\trtn := make([]uint64, len(list))\n\tfor idx, val := range list {\n\t\tvar i int64\n\t\ti, _ = strconv.ParseInt(val, 10, 64)\n\t\trtn[idx] = uint64(i)\n\t}\n\treturn rtn\n}\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 0)\n\tfor {\n\t\tl, p, e := sc.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n", "language": "Go", "metadata": {"date": 1593310123, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02623.html", "problem_id": "p02623", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02623/input.txt", "sample_output_relpath": "derived/input_output/data/p02623/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02623/Go/s040585351.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s040585351", "user_id": "u149861487"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewReaderSize(os.Stdin, 1024*1024*1)\n\nfunc main() {\n\tlist := getStdinIntArr64()\n\tN := uint64(list[0])\n\tM := uint64(list[1])\n\tK := uint64(list[2])\n\tA := getStdinIntArru64()\n\tB := getStdinIntArru64()\n\n\tvar cnta uint64 = 0\n\tvar cntb uint64 = 0\n\tvar time uint64 = 0\n\tfor {\n\t\tif cnta >= N && cntb >= M {\n\t\t\tbreak\n\t\t}\n\t\tif cnta >= N {\n\t\t\ttime += B[cntb]\n\t\t\tif time > K {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcntb++\n\t\t\tcontinue\n\t\t}\n\t\tif cntb >= M {\n\t\t\ttime += A[cnta]\n\t\t\tif time > K {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcnta++\n\t\t\tcontinue\n\t\t}\n\t\tif A[cnta] < B[cntb] {\n\t\t\ttime += A[cnta]\n\t\t\tif time > K {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcnta++\n\t\t} else {\n\t\t\ttime += B[cntb]\n\t\t\tif time > K {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcntb++\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\\n\", cnta+cntb)\n}\n\nfunc getStdin() string {\n\treturn readLine()\n}\nfunc getStdinInt() int {\n\tstr := getStdin()\n\trtn, _ := strconv.Atoi(str)\n\treturn rtn\n}\nfunc getStdinInt2() (int, int) {\n\tlist := getStdinIntArr()\n\treturn list[0], list[1]\n}\nfunc getStdinInt3() (int, int, int) {\n\tlist := getStdinIntArr()\n\treturn list[0], list[1], list[2]\n}\nfunc getStdinIntArr() []int {\n\tstr := getStdin()\n\tlist := strings.Split(str, \" \")\n\trtn := make([]int, len(list))\n\tfor idx, val := range list {\n\t\trtn[idx], _ = strconv.Atoi(val)\n\t}\n\treturn rtn\n}\n\nfunc getStdinIntArr64() []int64 {\n\tstr := getStdin()\n\tlist := strings.Split(str, \" \")\n\trtn := make([]int64, len(list))\n\tfor idx, val := range list {\n\t\trtn[idx], _ = strconv.ParseInt(val, 10, 64)\n\t}\n\treturn rtn\n}\n\nfunc getStdinIntArru64() []uint64 {\n\tstr := getStdin()\n\tlist := strings.Split(str, \" \")\n\trtn := make([]uint64, len(list))\n\tfor idx, val := range list {\n\t\tvar i int64\n\t\ti, _ = strconv.ParseInt(val, 10, 64)\n\t\trtn[idx] = uint64(i)\n\t}\n\treturn rtn\n}\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 0)\n\tfor {\n\t\tl, p, e := sc.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "sample_input": "3 4 240\n60 90 120\n80 150 80 150\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02623", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1950, "cpu_time_ms": 53, "memory_kb": 20832}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s261686278", "group_id": "codeNet:p02623", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tio := NewIo(os.Stdin, os.Stdout)\n\tdefer io.Flush()\n\tn, m, k := io.NextInt(), io.NextInt(), io.NextInt()\n\ta := io.NextInts(n)\n\tb := io.NextInts(m)\n\tans := solve(k, a, b)\n\tio.Println(ans)\n}\n\nfunc solve(k int, a, b []int) (ans int) {\n\tn, m := len(a), len(b)\n\tfor i := 1; i < n; i++ {\n\t\ta[i] = a[i-1] + a[i]\n\t}\n\tfor i := 1; i < m; i++ {\n\t\tb[i] = b[i-1] + b[i]\n\t}\n\tmax := 0\n\tfor i := 0; i < n; i++ {\n\t\tif a[i] > k {\n\t\t\tbreak\n\t\t}\n\t\tj := sort.Search(m, func(j int) bool { return a[i]+b[j] > k })\n\t\tcount := (i + 1) + j\n\t\tif count > max {\n\t\t\tmax = count\n\t\t}\n\t}\n\treturn max\n}\n\n// Io is I/O object\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\n// NewIo returns a new Io instance\nfunc NewIo(r io.Reader, w io.Writer) *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(r),\n\t\twriter: bufio.NewWriter(w),\n\t}\n}\n\n// Flush flushes writer\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\n// NextLine scans a line from stdin\nfunc (io *Io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\n// Next return a word from stdin\nfunc (io *Io) Next() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\n// NextInt returns an integer from stdin\nfunc (io *Io) NextInt() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\n// NextInts returns n integers from stdin\nfunc (io *Io) NextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = io.NextInt()\n\t}\n\treturn ret\n}\n\n// Println is a wrapper of fmt.Fprintln\nfunc (io *Io) Println(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n", "language": "Go", "metadata": {"date": 1593309851, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02623.html", "problem_id": "p02623", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02623/input.txt", "sample_output_relpath": "derived/input_output/data/p02623/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02623/Go/s261686278.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s261686278", "user_id": "u914096063"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tio := NewIo(os.Stdin, os.Stdout)\n\tdefer io.Flush()\n\tn, m, k := io.NextInt(), io.NextInt(), io.NextInt()\n\ta := io.NextInts(n)\n\tb := io.NextInts(m)\n\tans := solve(k, a, b)\n\tio.Println(ans)\n}\n\nfunc solve(k int, a, b []int) (ans int) {\n\tn, m := len(a), len(b)\n\tfor i := 1; i < n; i++ {\n\t\ta[i] = a[i-1] + a[i]\n\t}\n\tfor i := 1; i < m; i++ {\n\t\tb[i] = b[i-1] + b[i]\n\t}\n\tmax := 0\n\tfor i := 0; i < n; i++ {\n\t\tif a[i] > k {\n\t\t\tbreak\n\t\t}\n\t\tj := sort.Search(m, func(j int) bool { return a[i]+b[j] > k })\n\t\tcount := (i + 1) + j\n\t\tif count > max {\n\t\t\tmax = count\n\t\t}\n\t}\n\treturn max\n}\n\n// Io is I/O object\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\n// NewIo returns a new Io instance\nfunc NewIo(r io.Reader, w io.Writer) *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(r),\n\t\twriter: bufio.NewWriter(w),\n\t}\n}\n\n// Flush flushes writer\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\n// NextLine scans a line from stdin\nfunc (io *Io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\n// Next return a word from stdin\nfunc (io *Io) Next() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\n// NextInt returns an integer from stdin\nfunc (io *Io) NextInt() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\n// NextInts returns n integers from stdin\nfunc (io *Io) NextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = io.NextInt()\n\t}\n\treturn ret\n}\n\n// Println is a wrapper of fmt.Fprintln\nfunc (io *Io) Println(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "sample_input": "3 4 240\n60 90 120\n80 150 80 150\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02623", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2010, "cpu_time_ms": 79, "memory_kb": 29104}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s885033871", "group_id": "codeNet:p02623", "input_text": "package main\nimport (\n \"fmt\"\n //\"math\"\n // \"sort\"\n //\"regexp\"\n)\n \nfunc main(){\n var na, nb, time, book, count, ca ,cb int\n fmt.Scan(&na)\n fmt.Scan(&nb)\n fmt.Scan(&time)\n a := make([]int, na + 1)\n b := make([]int, nb + 1)\n for i := 0; i < na; i++ {\n fmt.Scan(&book)\n a[i] = book\n }\n a[na] = 10000000001\n for i := 0; i < nb; i++ {\n fmt.Scan(&book)\n b[i] = book\n }\n b[nb] = 10000000001\n\n for time > 0 {\n //fmt.Printf(\"count %v, a %v, b %v, ca %v, cb %v\\n\", count, a, b, ca, cb)\n if a[ca] > b[cb] {\n time = time - b[cb]\n if b[cb] != 10000000001 {\n cb++\n }\n } else {\n time = time - a[ca]\n if a[ca] != 10000000001 {\n ca++\n }\n }\n if time >= 0 {\n count++\n }\n }\n fmt.Printf(\"%v\\n\", count)\n}", "language": "Go", "metadata": {"date": 1593309301, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02623.html", "problem_id": "p02623", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02623/input.txt", "sample_output_relpath": "derived/input_output/data/p02623/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02623/Go/s885033871.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s885033871", "user_id": "u467535434"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\nimport (\n \"fmt\"\n //\"math\"\n // \"sort\"\n //\"regexp\"\n)\n \nfunc main(){\n var na, nb, time, book, count, ca ,cb int\n fmt.Scan(&na)\n fmt.Scan(&nb)\n fmt.Scan(&time)\n a := make([]int, na + 1)\n b := make([]int, nb + 1)\n for i := 0; i < na; i++ {\n fmt.Scan(&book)\n a[i] = book\n }\n a[na] = 10000000001\n for i := 0; i < nb; i++ {\n fmt.Scan(&book)\n b[i] = book\n }\n b[nb] = 10000000001\n\n for time > 0 {\n //fmt.Printf(\"count %v, a %v, b %v, ca %v, cb %v\\n\", count, a, b, ca, cb)\n if a[ca] > b[cb] {\n time = time - b[cb]\n if b[cb] != 10000000001 {\n cb++\n }\n } else {\n time = time - a[ca]\n if a[ca] != 10000000001 {\n ca++\n }\n }\n if time >= 0 {\n count++\n }\n }\n fmt.Printf(\"%v\\n\", count)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "sample_input": "3 4 240\n60 90 120\n80 150 80 150\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02623", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 777, "cpu_time_ms": 2205, "memory_kb": 8628}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s842440553", "group_id": "codeNet:p02623", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tsc.Scan()\n\tiv, _ := strconv.Atoi(sc.Text())\n\treturn iv\n}\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc main() {\n\tn, m, k := scanInt(), scanInt(), scanInt()\n\ta := make([]int, n)\n\tfor i := range a {\n\t\ta[i] = scanInt()\n\t}\n\tb := make([]int, m)\n\tfor i := range b {\n\t\tb[i] = scanInt()\n\t}\n\n\tans := 0\n\tsum := 0\n\tvar pa int\n\tfor i := range a {\n\t\tif sum+a[i] > k {\n\t\t\tbreak\n\t\t}\n\t\tsum += a[i]\n\t\tpa = i\n\t\tans++\n\t}\n\tvar pb int\n\tfor i := range b {\n\t\tif sum+b[i] > k {\n\t\t\tbreak\n\t\t}\n\t\tsum += b[i]\n\t\tpb = i\n\t\tans++\n\t}\n\n\tt := ans\n\tfor i := pa - 1; i >= 0; i-- {\n\t\tsum -= a[i]\n\t\tt--\n\t\tfor j := pb + 1; j < len(b); j++ {\n\t\t\tif sum+b[j] > k {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tsum += b[j]\n\t\t\tpb = j\n\t\t\tt++\n\t\t}\n\t\tans = max(ans, t)\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1593309114, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02623.html", "problem_id": "p02623", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02623/input.txt", "sample_output_relpath": "derived/input_output/data/p02623/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02623/Go/s842440553.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s842440553", "user_id": "u461993794"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tsc.Scan()\n\tiv, _ := strconv.Atoi(sc.Text())\n\treturn iv\n}\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc main() {\n\tn, m, k := scanInt(), scanInt(), scanInt()\n\ta := make([]int, n)\n\tfor i := range a {\n\t\ta[i] = scanInt()\n\t}\n\tb := make([]int, m)\n\tfor i := range b {\n\t\tb[i] = scanInt()\n\t}\n\n\tans := 0\n\tsum := 0\n\tvar pa int\n\tfor i := range a {\n\t\tif sum+a[i] > k {\n\t\t\tbreak\n\t\t}\n\t\tsum += a[i]\n\t\tpa = i\n\t\tans++\n\t}\n\tvar pb int\n\tfor i := range b {\n\t\tif sum+b[i] > k {\n\t\t\tbreak\n\t\t}\n\t\tsum += b[i]\n\t\tpb = i\n\t\tans++\n\t}\n\n\tt := ans\n\tfor i := pa - 1; i >= 0; i-- {\n\t\tsum -= a[i]\n\t\tt--\n\t\tfor j := pb + 1; j < len(b); j++ {\n\t\t\tif sum+b[j] > k {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tsum += b[j]\n\t\t\tpb = j\n\t\t\tt++\n\t\t}\n\t\tans = max(ans, t)\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "sample_input": "3 4 240\n60 90 120\n80 150 80 150\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02623", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 902, "cpu_time_ms": 61, "memory_kb": 7848}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s072775084", "group_id": "codeNet:p02623", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tm := nextInt()\n\tk := nextInt()\n\ta := make([]int, n)\n\tb := make([]int, m)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = nextInt()\n\t}\n\tfor i := 0; i < m; i++ {\n\t\tb[i] = nextInt()\n\t}\n\tvar spent, aGone, bGone int\n\tfor {\n\t\tif spent > k {\n\t\t\taGone--\n\t\t\tbreak\n\t\t} else if spent == k {\n\t\t\tbreak\n\t\t}\n\t\tif aGone >= n && bGone < m {\n\t\t\tspent += b[bGone]\n\t\t\tbGone++\n\t\t\tcontinue\n\t\t} else if aGone >= n && bGone >= m {\n\t\t\tbreak\n\t\t}\n\t\tif bGone >= m && aGone < n {\n\t\t\tspent += a[aGone]\n\t\t\taGone++\n\t\t\tcontinue\n\t\t} else if aGone >= n && bGone >= m {\n\t\t\tbreak\n\t\t}\n\t\tif a[aGone] <= b[bGone] {\n\t\t\tspent += a[aGone]\n\t\t\taGone++\n\t\t} else {\n\t\t\tspent += b[bGone]\n\t\t\tbGone++\n\t\t}\n\t}\n\tfmt.Println(aGone + bGone)\n}\n", "language": "Go", "metadata": {"date": 1593308921, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02623.html", "problem_id": "p02623", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02623/input.txt", "sample_output_relpath": "derived/input_output/data/p02623/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02623/Go/s072775084.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s072775084", "user_id": "u167292194"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tm := nextInt()\n\tk := nextInt()\n\ta := make([]int, n)\n\tb := make([]int, m)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = nextInt()\n\t}\n\tfor i := 0; i < m; i++ {\n\t\tb[i] = nextInt()\n\t}\n\tvar spent, aGone, bGone int\n\tfor {\n\t\tif spent > k {\n\t\t\taGone--\n\t\t\tbreak\n\t\t} else if spent == k {\n\t\t\tbreak\n\t\t}\n\t\tif aGone >= n && bGone < m {\n\t\t\tspent += b[bGone]\n\t\t\tbGone++\n\t\t\tcontinue\n\t\t} else if aGone >= n && bGone >= m {\n\t\t\tbreak\n\t\t}\n\t\tif bGone >= m && aGone < n {\n\t\t\tspent += a[aGone]\n\t\t\taGone++\n\t\t\tcontinue\n\t\t} else if aGone >= n && bGone >= m {\n\t\t\tbreak\n\t\t}\n\t\tif a[aGone] <= b[bGone] {\n\t\t\tspent += a[aGone]\n\t\t\taGone++\n\t\t} else {\n\t\t\tspent += b[bGone]\n\t\t\tbGone++\n\t\t}\n\t}\n\tfmt.Println(aGone + bGone)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "sample_input": "3 4 240\n60 90 120\n80 150 80 150\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02623", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 935, "cpu_time_ms": 68, "memory_kb": 8288}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s992278434", "group_id": "codeNet:p02623", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int64 {\n\tsc.Scan()\n\ti, e := strconv.ParseInt(sc.Text(), 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tm := nextInt()\n\tk := nextInt()\n\ta := make([]int64, n+10)\n\tb := make([]int64, m+10)\n\ta[0] = 0\n\tb[0] = 0\n\tfor i := int64(1); i <= n; i++ {\n\t\ta[i] = a[i-1] + nextInt()\n\t}\n\tfor i := int64(1); i <= m; i++ {\n\t\tb[i] = b[i-1] + nextInt()\n\t}\n\tres := int64(0)\n\tj := int64(0)\n\tfor j = int64(0); j <= m && b[j] <= k; j++ {\n\t}\n\tif j == m+1 || b[j] > k {\n\t\tj--\n\t}\n\tres = j\n\tfor i := int64(1); i <= n; i++ {\n\t\tif a[i] > k {\n\t\t\tbreak\n\t\t}\n\t\tfor ; a[i]+b[j] > k && j > 0; j-- {\n\t\t}\n\t\tif i+j > res {\n\t\t\tres = i + j\n\t\t}\n\t}\n\tfmt.Println(res)\n}\n", "language": "Go", "metadata": {"date": 1593308648, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02623.html", "problem_id": "p02623", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02623/input.txt", "sample_output_relpath": "derived/input_output/data/p02623/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02623/Go/s992278434.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s992278434", "user_id": "u320354968"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int64 {\n\tsc.Scan()\n\ti, e := strconv.ParseInt(sc.Text(), 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tm := nextInt()\n\tk := nextInt()\n\ta := make([]int64, n+10)\n\tb := make([]int64, m+10)\n\ta[0] = 0\n\tb[0] = 0\n\tfor i := int64(1); i <= n; i++ {\n\t\ta[i] = a[i-1] + nextInt()\n\t}\n\tfor i := int64(1); i <= m; i++ {\n\t\tb[i] = b[i-1] + nextInt()\n\t}\n\tres := int64(0)\n\tj := int64(0)\n\tfor j = int64(0); j <= m && b[j] <= k; j++ {\n\t}\n\tif j == m+1 || b[j] > k {\n\t\tj--\n\t}\n\tres = j\n\tfor i := int64(1); i <= n; i++ {\n\t\tif a[i] > k {\n\t\t\tbreak\n\t\t}\n\t\tfor ; a[i]+b[j] > k && j > 0; j-- {\n\t\t}\n\t\tif i+j > res {\n\t\t\tres = i + j\n\t\t}\n\t}\n\tfmt.Println(res)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "sample_input": "3 4 240\n60 90 120\n80 150 80 150\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02623", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 798, "cpu_time_ms": 74, "memory_kb": 8260}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s194952601", "group_id": "codeNet:p02623", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tsc.Scan()\n\tiv, _ := strconv.Atoi(sc.Text())\n\treturn iv\n}\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc main() {\n\tn, m, k := scanInt(), scanInt(), scanInt()\n\ta := make([]int, n)\n\tfor i := range a {\n\t\ta[i] = scanInt()\n\t}\n\tb := make([]int, m)\n\tfor i := range b {\n\t\tb[i] = scanInt()\n\t}\n\n\tans := 0\n\tsum := 0\n\tvar pa int\n\tfor i := range a {\n\t\tif sum+a[i] > k {\n\t\t\tbreak\n\t\t}\n\t\tsum += a[i]\n\t\tpa = i\n\t\tans++\n\t}\n\tvar pb int\n\tfor i := range b {\n\t\tif sum+b[i] > k {\n\t\t\tbreak\n\t\t}\n\t\tsum += b[i]\n\t\tpb = i\n\t\tans++\n\t}\n\n\tt := ans\n\tfor pa > 0 {\n\t\tsum -= a[pa]\n\t\tpa--\n\t\tt--\n\t\tfor i := pb + 1; i < len(b); i++ {\n\t\t\tif sum+b[i] > k {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tsum += b[i]\n\t\t\tpb = i\n\t\t\tt++\n\t\t}\n\t\tans = max(ans, t)\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1593307586, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02623.html", "problem_id": "p02623", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02623/input.txt", "sample_output_relpath": "derived/input_output/data/p02623/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02623/Go/s194952601.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s194952601", "user_id": "u461993794"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tsc.Scan()\n\tiv, _ := strconv.Atoi(sc.Text())\n\treturn iv\n}\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc main() {\n\tn, m, k := scanInt(), scanInt(), scanInt()\n\ta := make([]int, n)\n\tfor i := range a {\n\t\ta[i] = scanInt()\n\t}\n\tb := make([]int, m)\n\tfor i := range b {\n\t\tb[i] = scanInt()\n\t}\n\n\tans := 0\n\tsum := 0\n\tvar pa int\n\tfor i := range a {\n\t\tif sum+a[i] > k {\n\t\t\tbreak\n\t\t}\n\t\tsum += a[i]\n\t\tpa = i\n\t\tans++\n\t}\n\tvar pb int\n\tfor i := range b {\n\t\tif sum+b[i] > k {\n\t\t\tbreak\n\t\t}\n\t\tsum += b[i]\n\t\tpb = i\n\t\tans++\n\t}\n\n\tt := ans\n\tfor pa > 0 {\n\t\tsum -= a[pa]\n\t\tpa--\n\t\tt--\n\t\tfor i := pb + 1; i < len(b); i++ {\n\t\t\tif sum+b[i] > k {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tsum += b[i]\n\t\t\tpb = i\n\t\t\tt++\n\t\t}\n\t\tans = max(ans, t)\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "sample_input": "3 4 240\n60 90 120\n80 150 80 150\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02623", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 892, "cpu_time_ms": 68, "memory_kb": 7828}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s437363197", "group_id": "codeNet:p02623", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\t/*/TODO:!!!!!!!テスト用!!!!!!!!!\n\tsc = bufio.NewScanner(strings.NewReader(`\n\n\t\t\t\t\t\t\t\t\t\t`))\n\t//TODO:!!!!!!!テスト用!!!!!!!!!*/\n\n\tbuf := make([]byte, 1024*1024)\n\tsc.Buffer(buf, bufio.MaxScanTokenSize)\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush() // !!!!caution!!!! you must use Fprint(out, ) not Print()\n\t/* --- code --- */\n\t//fmt.Fprintln(out, \"[DEBUG]\", time.Now())\n\n\tn := nextInt()\n\tm := nextInt()\n\tk := nextInt()\n\ta := nextInts(n)\n\tb := nextInts(m)\n\n\tatime := 0\n\tai := 0\n\n\tbi := 0\n\tbtime := 0\n\n\tfor i := 0; i < n; i++ {\n\t\tif atime+a[i] <= k {\n\t\t\tatime += a[i]\n\t\t\tai = i + 1\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tans := ai\n\n\tfor i := ai - 1; i >= -1; i-- {\n\t\tfor j := bi + 1; j < m; j++ {\n\t\t\tif atime+btime+b[j] <= k {\n\t\t\t\tbtime += b[j]\n\t\t\t\tbi = j + 1\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tans = maxInt(ans, ai+bi)\n\t\t/*\n\t\t\tfmt.Fprintln(out, \"[DEBUG]\", atime, btime)\n\t\t\tfmt.Fprintln(out, \"[DEBUG]\", ai, bi)\n\t\t\tfmt.Fprintln(out, \"[DEBUG]\", ans)\n\t\t*/\n\n\t\tif i >= 0 {\n\t\t\tatime -= a[i]\n\t\t\tai--\n\t\t}\n\t}\n\n\t//fmt.Fprintln(out, \"[DEBUG]\", a)\n\tfmt.Fprintln(out, ans)\n\n}\n\n//------------------------------------------------------------------------------\n\n// -*-*-*-*-*-*-*-*-\n// * I/O utilities *\n// -*-*-*-*-*-*-*-*-\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextFloat64() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\nfunc nextFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextFloat64()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\nfunc chars(s string) []string {\n\tret := make([]string, len([]rune(s)))\n\tfor i, v := range []rune(s) {\n\t\tret[i] = string(v)\n\t}\n\treturn ret\n}\n\nfunc printArray(a []int) {\n\tfor i := 0; i < len(a); i++ {\n\t\tif i >= 1 {\n\t\t\tfmt.Fprint(out, \" \")\n\t\t}\n\t\tfmt.Fprint(out, a[i])\n\t}\n\tfmt.Fprintln(out)\n}\n\nfunc absInt(x int) int {\n\treturn int(math.Abs(float64(x)))\n}\nfunc minInt(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\nfunc maxInt(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\nfunc log10(x int) float64 {\n\treturn math.Log10(float64(x))\n}\n\n// 挿入ソート配列\ntype slist struct {\n\tl []int\n}\n\nfunc makeSlist() slist {\n\treturn slist{[]int{}}\n}\n\nfunc (s *slist) add(a int) {\n\tpos := sort.Search(len(s.l), func(i int) bool { return s.l[i] >= a })\n\tif pos < len(s.l) {\n\t\ts.l = append(s.l[:pos+1], s.l[pos:]...)\n\t\ts.l[pos] = a\n\t} else {\n\t\ts.l = append(s.l, a)\n\t}\n}\nfunc (s slist) contains(a int) bool {\n\tpos := sort.Search(len(s.l), func(i int) bool { return s.l[i] >= a })\n\treturn pos < len(s.l) && s.l[pos] == a\n}\n", "language": "Go", "metadata": {"date": 1593307510, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02623.html", "problem_id": "p02623", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02623/input.txt", "sample_output_relpath": "derived/input_output/data/p02623/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02623/Go/s437363197.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s437363197", "user_id": "u805846052"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\t/*/TODO:!!!!!!!テスト用!!!!!!!!!\n\tsc = bufio.NewScanner(strings.NewReader(`\n\n\t\t\t\t\t\t\t\t\t\t`))\n\t//TODO:!!!!!!!テスト用!!!!!!!!!*/\n\n\tbuf := make([]byte, 1024*1024)\n\tsc.Buffer(buf, bufio.MaxScanTokenSize)\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush() // !!!!caution!!!! you must use Fprint(out, ) not Print()\n\t/* --- code --- */\n\t//fmt.Fprintln(out, \"[DEBUG]\", time.Now())\n\n\tn := nextInt()\n\tm := nextInt()\n\tk := nextInt()\n\ta := nextInts(n)\n\tb := nextInts(m)\n\n\tatime := 0\n\tai := 0\n\n\tbi := 0\n\tbtime := 0\n\n\tfor i := 0; i < n; i++ {\n\t\tif atime+a[i] <= k {\n\t\t\tatime += a[i]\n\t\t\tai = i + 1\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tans := ai\n\n\tfor i := ai - 1; i >= -1; i-- {\n\t\tfor j := bi + 1; j < m; j++ {\n\t\t\tif atime+btime+b[j] <= k {\n\t\t\t\tbtime += b[j]\n\t\t\t\tbi = j + 1\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tans = maxInt(ans, ai+bi)\n\t\t/*\n\t\t\tfmt.Fprintln(out, \"[DEBUG]\", atime, btime)\n\t\t\tfmt.Fprintln(out, \"[DEBUG]\", ai, bi)\n\t\t\tfmt.Fprintln(out, \"[DEBUG]\", ans)\n\t\t*/\n\n\t\tif i >= 0 {\n\t\t\tatime -= a[i]\n\t\t\tai--\n\t\t}\n\t}\n\n\t//fmt.Fprintln(out, \"[DEBUG]\", a)\n\tfmt.Fprintln(out, ans)\n\n}\n\n//------------------------------------------------------------------------------\n\n// -*-*-*-*-*-*-*-*-\n// * I/O utilities *\n// -*-*-*-*-*-*-*-*-\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextFloat64() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\nfunc nextFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextFloat64()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\nfunc chars(s string) []string {\n\tret := make([]string, len([]rune(s)))\n\tfor i, v := range []rune(s) {\n\t\tret[i] = string(v)\n\t}\n\treturn ret\n}\n\nfunc printArray(a []int) {\n\tfor i := 0; i < len(a); i++ {\n\t\tif i >= 1 {\n\t\t\tfmt.Fprint(out, \" \")\n\t\t}\n\t\tfmt.Fprint(out, a[i])\n\t}\n\tfmt.Fprintln(out)\n}\n\nfunc absInt(x int) int {\n\treturn int(math.Abs(float64(x)))\n}\nfunc minInt(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\nfunc maxInt(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\nfunc log10(x int) float64 {\n\treturn math.Log10(float64(x))\n}\n\n// 挿入ソート配列\ntype slist struct {\n\tl []int\n}\n\nfunc makeSlist() slist {\n\treturn slist{[]int{}}\n}\n\nfunc (s *slist) add(a int) {\n\tpos := sort.Search(len(s.l), func(i int) bool { return s.l[i] >= a })\n\tif pos < len(s.l) {\n\t\ts.l = append(s.l[:pos+1], s.l[pos:]...)\n\t\ts.l[pos] = a\n\t} else {\n\t\ts.l = append(s.l, a)\n\t}\n}\nfunc (s slist) contains(a int) bool {\n\tpos := sort.Search(len(s.l), func(i int) bool { return s.l[i] >= a })\n\treturn pos < len(s.l) && s.l[pos] == a\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "sample_input": "3 4 240\n60 90 120\n80 150 80 150\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02623", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2953, "cpu_time_ms": 57, "memory_kb": 8820}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s403736139", "group_id": "codeNet:p02623", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar n, m, k int\n\tfmt.Scan(&n, &m, &k)\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tas := make([]int, n)\n\tfor i := range as {\n\t\tsc.Scan()\n\t\tas[i], _ = strconv.Atoi(sc.Text())\n\t}\n\tbs := make([]int, m)\n\tfor i := range bs {\n\t\tsc.Scan()\n\t\tbs[i], _ = strconv.Atoi(sc.Text())\n\t}\n\n\tsbs := make([]int, m+1)\n\tfor i := range bs {\n\t\tsbs[i+1] += sbs[i] + bs[i]\n\t}\n\n\tvar mi, mc int\n\tfor i := 0; i <= n; i++ {\n\t\tri := k - mi\n\t\tif ri < 0 {\n\t\t\tbreak\n\t\t}\n\n\t\tl := 0\n\t\tr := m + 1\n\t\tfor r-l > 1 {\n\t\t\tmid := (l + r) / 2\n\t\t\tif sbs[mid] <= ri {\n\t\t\t\tl = mid\n\t\t\t} else {\n\t\t\t\tr = mid\n\t\t\t}\n\t\t}\n\t\tcnt := i + l\n\t\tmc = max(mc, cnt)\n\t\tif i < n {\n\t\t\tmi += as[i]\n\t\t}\n\t}\n\tfmt.Println(mc)\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n", "language": "Go", "metadata": {"date": 1593306795, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02623.html", "problem_id": "p02623", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02623/input.txt", "sample_output_relpath": "derived/input_output/data/p02623/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02623/Go/s403736139.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s403736139", "user_id": "u282164747"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar n, m, k int\n\tfmt.Scan(&n, &m, &k)\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tas := make([]int, n)\n\tfor i := range as {\n\t\tsc.Scan()\n\t\tas[i], _ = strconv.Atoi(sc.Text())\n\t}\n\tbs := make([]int, m)\n\tfor i := range bs {\n\t\tsc.Scan()\n\t\tbs[i], _ = strconv.Atoi(sc.Text())\n\t}\n\n\tsbs := make([]int, m+1)\n\tfor i := range bs {\n\t\tsbs[i+1] += sbs[i] + bs[i]\n\t}\n\n\tvar mi, mc int\n\tfor i := 0; i <= n; i++ {\n\t\tri := k - mi\n\t\tif ri < 0 {\n\t\t\tbreak\n\t\t}\n\n\t\tl := 0\n\t\tr := m + 1\n\t\tfor r-l > 1 {\n\t\t\tmid := (l + r) / 2\n\t\t\tif sbs[mid] <= ri {\n\t\t\t\tl = mid\n\t\t\t} else {\n\t\t\t\tr = mid\n\t\t\t}\n\t\t}\n\t\tcnt := i + l\n\t\tmc = max(mc, cnt)\n\t\tif i < n {\n\t\t\tmi += as[i]\n\t\t}\n\t}\n\tfmt.Println(mc)\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "sample_input": "3 4 240\n60 90 120\n80 150 80 150\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02623", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it.\n\nIt takes us A_i minutes to read the i-th book from the top on Desk A (1 \\leq i \\leq N), and B_i minutes to read the i-th book from the top on Desk B (1 \\leq i \\leq M).\n\nConsider the following action:\n\nChoose a desk with a book remaining, read the topmost book on that desk, and remove it from the desk.\n\nHow many books can we read at most by repeating this action so that it takes us at most K minutes in total? We ignore the time it takes to do anything other than reading.\n\nConstraints\n\n1 \\leq N, M \\leq 200000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq A_i, 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 M K\nA_1 A_2 \\ldots A_N\nB_1 B_2 \\ldots B_M\n\nOutput\n\nPrint an integer representing the maximum number of books that can be read.\n\nSample Input 1\n\n3 4 240\n60 90 120\n80 150 80 150\n\nSample Output 1\n\n3\n\nIn this case, it takes us 60, 90, 120 minutes to read the 1-st, 2-nd, 3-rd books from the top on Desk A, and 80, 150, 80, 150 minutes to read the 1-st, 2-nd, 3-rd, 4-th books from the top on Desk B, respectively.\n\nWe can read three books in 230 minutes, as shown below, and this is the maximum number of books we can read within 240 minutes.\n\nRead the topmost book on Desk A in 60 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk B in 80 minutes, and remove that book from the desk.\n\nRead the topmost book on Desk A in 90 minutes, and remove that book from the desk.\n\nSample Input 2\n\n3 4 730\n60 90 120\n80 150 80 150\n\nSample Output 2\n\n7\n\nSample Input 3\n\n5 4 1\n1000000000 1000000000 1000000000 1000000000 1000000000\n1000000000 1000000000 1000000000 1000000000\n\nSample Output 3\n\n0\n\nWatch out for integer overflows.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 66, "memory_kb": 9604}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s688664879", "group_id": "codeNet:p02624", "input_text": "package main\nimport \"fmt\"\n\nvar N int\n\nfunc main(){\n fmt.Scanf(\"%d\", &N)\n v := make([]int, N+1)\n for i:=1; i<=N; i++ {\n for j:=i; j<=N; j+=i {\n \tv[j]++\n } \n }\n ans := int64(0)\n for i:=1; i<=N; i++ {\n ans += int64(i)*int64(v[i])\n }\n fmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1597798727, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02624.html", "problem_id": "p02624", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02624/input.txt", "sample_output_relpath": "derived/input_output/data/p02624/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02624/Go/s688664879.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s688664879", "user_id": "u064438560"}, "prompt_components": {"gold_output": "23\n", "input_to_evaluate": "package main\nimport \"fmt\"\n\nvar N int\n\nfunc main(){\n fmt.Scanf(\"%d\", &N)\n v := make([]int, N+1)\n for i:=1; i<=N; i++ {\n for j:=i; j<=N; j+=i {\n \tv[j]++\n } \n }\n ans := int64(0)\n for i:=1; i<=N; i++ {\n ans += int64(i)*int64(v[i])\n }\n fmt.Println(ans)\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nFor a positive integer X, let f(X) be the number of positive divisors of X.\n\nGiven a positive integer N, find \\sum_{K=1}^N K\\times f(K).\n\nConstraints\n\n1 \\leq N \\leq 10^7\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the value \\sum_{K=1}^N K\\times f(K).\n\nSample Input 1\n\n4\n\nSample Output 1\n\n23\n\nWe have f(1)=1, f(2)=2, f(3)=2, and f(4)=3, so the answer is 1\\times 1 + 2\\times 2 + 3\\times 2 + 4\\times 3 =23.\n\nSample Input 2\n\n100\n\nSample Output 2\n\n26879\n\nSample Input 3\n\n10000000\n\nSample Output 3\n\n838627288460105\n\nWatch out for overflows.", "sample_input": "4\n"}, "reference_outputs": ["23\n"], "source_document_id": "p02624", "source_text": "Score : 400 points\n\nProblem Statement\n\nFor a positive integer X, let f(X) be the number of positive divisors of X.\n\nGiven a positive integer N, find \\sum_{K=1}^N K\\times f(K).\n\nConstraints\n\n1 \\leq N \\leq 10^7\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the value \\sum_{K=1}^N K\\times f(K).\n\nSample Input 1\n\n4\n\nSample Output 1\n\n23\n\nWe have f(1)=1, f(2)=2, f(3)=2, and f(4)=3, so the answer is 1\\times 1 + 2\\times 2 + 3\\times 2 + 4\\times 3 =23.\n\nSample Input 2\n\n100\n\nSample Output 2\n\n26879\n\nSample Input 3\n\n10000000\n\nSample Output 3\n\n838627288460105\n\nWatch out for overflows.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1395, "memory_kb": 82560}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s251891806", "group_id": "codeNet:p02624", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\n\tres := 0\n\tfor i := 1; i <= N; i++ {\n\t\tres += f(N,i)\n\t}\n\tfmt.Println(res)\n\t\n}\n\nfunc f(n, x int) int {\n\ty := n/x\n\treturn (y*(y+1) *x)/2\n}", "language": "Go", "metadata": {"date": 1593349727, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02624.html", "problem_id": "p02624", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02624/input.txt", "sample_output_relpath": "derived/input_output/data/p02624/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02624/Go/s251891806.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s251891806", "user_id": "u950580836"}, "prompt_components": {"gold_output": "23\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\n\tres := 0\n\tfor i := 1; i <= N; i++ {\n\t\tres += f(N,i)\n\t}\n\tfmt.Println(res)\n\t\n}\n\nfunc f(n, x int) int {\n\ty := n/x\n\treturn (y*(y+1) *x)/2\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nFor a positive integer X, let f(X) be the number of positive divisors of X.\n\nGiven a positive integer N, find \\sum_{K=1}^N K\\times f(K).\n\nConstraints\n\n1 \\leq N \\leq 10^7\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the value \\sum_{K=1}^N K\\times f(K).\n\nSample Input 1\n\n4\n\nSample Output 1\n\n23\n\nWe have f(1)=1, f(2)=2, f(3)=2, and f(4)=3, so the answer is 1\\times 1 + 2\\times 2 + 3\\times 2 + 4\\times 3 =23.\n\nSample Input 2\n\n100\n\nSample Output 2\n\n26879\n\nSample Input 3\n\n10000000\n\nSample Output 3\n\n838627288460105\n\nWatch out for overflows.", "sample_input": "4\n"}, "reference_outputs": ["23\n"], "source_document_id": "p02624", "source_text": "Score : 400 points\n\nProblem Statement\n\nFor a positive integer X, let f(X) be the number of positive divisors of X.\n\nGiven a positive integer N, find \\sum_{K=1}^N K\\times f(K).\n\nConstraints\n\n1 \\leq N \\leq 10^7\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the value \\sum_{K=1}^N K\\times f(K).\n\nSample Input 1\n\n4\n\nSample Output 1\n\n23\n\nWe have f(1)=1, f(2)=2, f(3)=2, and f(4)=3, so the answer is 1\\times 1 + 2\\times 2 + 3\\times 2 + 4\\times 3 =23.\n\nSample Input 2\n\n100\n\nSample Output 2\n\n26879\n\nSample Input 3\n\n10000000\n\nSample Output 3\n\n838627288460105\n\nWatch out for overflows.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 112, "memory_kb": 1792}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s328931645", "group_id": "codeNet:p02624", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e6 + 7\n)\n\nvar buf []byte = make([]byte, maxBufSize)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBufSize)\n}\n\n// 解説を参考にした\n\nfunc main() {\n\tN := nextInt()\n\tvar ans int\n\tfor i := 1; i <= N; i++ {\n\t\tj := N / i\n\t\tans += j * (j + 1) / 2 * i\n\t}\n\tfmt.Println(ans)\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc abs(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc pow(p, q int) int {\n\tres := p\n\tif q == 0 {\n\t\treturn 1\n\t}\n\tfor i := 0; i < q-1; i++ {\n\t\tres *= p\n\t}\n\treturn res\n}\n\nfunc MinOf(vars ...int) int {\n\tmin := vars[0]\n\tfor _, i := range vars {\n\t\tif min > i {\n\t\t\tmin = i\n\t\t}\n\t}\n\treturn min\n}\n\nfunc MaxOf(vars ...int) int {\n\tmax := vars[0]\n\tfor _, i := range vars {\n\t\tif max < i {\n\t\t\tmax = i\n\t\t}\n\t}\n\treturn max\n}\n\nfunc gcdof2numbers(a int, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcdof2numbers(b, a%b)\n}\n\nfunc lcmof2numbers(a int, b int) int {\n\treturn a / gcdof2numbers(a, b) * b\n}\n\n// マイナスの場合は考慮していない\nfunc fuctorial(a int) int {\n\tif a == 1 || a == 0 {\n\t\treturn 1\n\t} else {\n\t\treturn fuctorial(a-1) * a\n\t}\n}\n\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\n\n// 素因数分解したmapを返す\nfunc primeFuctorize(n int) map[int]int {\n\tpf := map[int]int{}\n\tfor i := 2; i*i <= n; i++ {\n\t\tfor n%i == 0 {\n\t\t\tpf[i]++\n\t\t\tn /= i\n\t\t}\n\t}\n\tif n != 1 {\n\t\tpf[n]++\n\t}\n\treturn pf\n}\n", "language": "Go", "metadata": {"date": 1593328583, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02624.html", "problem_id": "p02624", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02624/input.txt", "sample_output_relpath": "derived/input_output/data/p02624/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02624/Go/s328931645.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s328931645", "user_id": "u605443479"}, "prompt_components": {"gold_output": "23\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e6 + 7\n)\n\nvar buf []byte = make([]byte, maxBufSize)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBufSize)\n}\n\n// 解説を参考にした\n\nfunc main() {\n\tN := nextInt()\n\tvar ans int\n\tfor i := 1; i <= N; i++ {\n\t\tj := N / i\n\t\tans += j * (j + 1) / 2 * i\n\t}\n\tfmt.Println(ans)\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc abs(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc pow(p, q int) int {\n\tres := p\n\tif q == 0 {\n\t\treturn 1\n\t}\n\tfor i := 0; i < q-1; i++ {\n\t\tres *= p\n\t}\n\treturn res\n}\n\nfunc MinOf(vars ...int) int {\n\tmin := vars[0]\n\tfor _, i := range vars {\n\t\tif min > i {\n\t\t\tmin = i\n\t\t}\n\t}\n\treturn min\n}\n\nfunc MaxOf(vars ...int) int {\n\tmax := vars[0]\n\tfor _, i := range vars {\n\t\tif max < i {\n\t\t\tmax = i\n\t\t}\n\t}\n\treturn max\n}\n\nfunc gcdof2numbers(a int, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcdof2numbers(b, a%b)\n}\n\nfunc lcmof2numbers(a int, b int) int {\n\treturn a / gcdof2numbers(a, b) * b\n}\n\n// マイナスの場合は考慮していない\nfunc fuctorial(a int) int {\n\tif a == 1 || a == 0 {\n\t\treturn 1\n\t} else {\n\t\treturn fuctorial(a-1) * a\n\t}\n}\n\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\n\n// 素因数分解したmapを返す\nfunc primeFuctorize(n int) map[int]int {\n\tpf := map[int]int{}\n\tfor i := 2; i*i <= n; i++ {\n\t\tfor n%i == 0 {\n\t\t\tpf[i]++\n\t\t\tn /= i\n\t\t}\n\t}\n\tif n != 1 {\n\t\tpf[n]++\n\t}\n\treturn pf\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nFor a positive integer X, let f(X) be the number of positive divisors of X.\n\nGiven a positive integer N, find \\sum_{K=1}^N K\\times f(K).\n\nConstraints\n\n1 \\leq N \\leq 10^7\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the value \\sum_{K=1}^N K\\times f(K).\n\nSample Input 1\n\n4\n\nSample Output 1\n\n23\n\nWe have f(1)=1, f(2)=2, f(3)=2, and f(4)=3, so the answer is 1\\times 1 + 2\\times 2 + 3\\times 2 + 4\\times 3 =23.\n\nSample Input 2\n\n100\n\nSample Output 2\n\n26879\n\nSample Input 3\n\n10000000\n\nSample Output 3\n\n838627288460105\n\nWatch out for overflows.", "sample_input": "4\n"}, "reference_outputs": ["23\n"], "source_document_id": "p02624", "source_text": "Score : 400 points\n\nProblem Statement\n\nFor a positive integer X, let f(X) be the number of positive divisors of X.\n\nGiven a positive integer N, find \\sum_{K=1}^N K\\times f(K).\n\nConstraints\n\n1 \\leq N \\leq 10^7\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the value \\sum_{K=1}^N K\\times f(K).\n\nSample Input 1\n\n4\n\nSample Output 1\n\n23\n\nWe have f(1)=1, f(2)=2, f(3)=2, and f(4)=3, so the answer is 1\\times 1 + 2\\times 2 + 3\\times 2 + 4\\times 3 =23.\n\nSample Input 2\n\n100\n\nSample Output 2\n\n26879\n\nSample Input 3\n\n10000000\n\nSample Output 3\n\n838627288460105\n\nWatch out for overflows.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1883, "cpu_time_ms": 104, "memory_kb": 1828}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s339927845", "group_id": "codeNet:p02624", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\tc := make([]int, N+1)\n\tfor i := 1; i <= N; i++ {\n\t\tfor j := 1; i*j <= N; j++ {\n\t\t\tc[i*j]++\n\t\t}\n\t}\n\tans := 0\n\tfor i := 1; i <= N; i++ {\n\t\tans += i * c[i]\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1593324841, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02624.html", "problem_id": "p02624", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02624/input.txt", "sample_output_relpath": "derived/input_output/data/p02624/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02624/Go/s339927845.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s339927845", "user_id": "u328656362"}, "prompt_components": {"gold_output": "23\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\tc := make([]int, N+1)\n\tfor i := 1; i <= N; i++ {\n\t\tfor j := 1; i*j <= N; j++ {\n\t\t\tc[i*j]++\n\t\t}\n\t}\n\tans := 0\n\tfor i := 1; i <= N; i++ {\n\t\tans += i * c[i]\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nFor a positive integer X, let f(X) be the number of positive divisors of X.\n\nGiven a positive integer N, find \\sum_{K=1}^N K\\times f(K).\n\nConstraints\n\n1 \\leq N \\leq 10^7\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the value \\sum_{K=1}^N K\\times f(K).\n\nSample Input 1\n\n4\n\nSample Output 1\n\n23\n\nWe have f(1)=1, f(2)=2, f(3)=2, and f(4)=3, so the answer is 1\\times 1 + 2\\times 2 + 3\\times 2 + 4\\times 3 =23.\n\nSample Input 2\n\n100\n\nSample Output 2\n\n26879\n\nSample Input 3\n\n10000000\n\nSample Output 3\n\n838627288460105\n\nWatch out for overflows.", "sample_input": "4\n"}, "reference_outputs": ["23\n"], "source_document_id": "p02624", "source_text": "Score : 400 points\n\nProblem Statement\n\nFor a positive integer X, let f(X) be the number of positive divisors of X.\n\nGiven a positive integer N, find \\sum_{K=1}^N K\\times f(K).\n\nConstraints\n\n1 \\leq N \\leq 10^7\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the value \\sum_{K=1}^N K\\times f(K).\n\nSample Input 1\n\n4\n\nSample Output 1\n\n23\n\nWe have f(1)=1, f(2)=2, f(3)=2, and f(4)=3, so the answer is 1\\times 1 + 2\\times 2 + 3\\times 2 + 4\\times 3 =23.\n\nSample Input 2\n\n100\n\nSample Output 2\n\n26879\n\nSample Input 3\n\n10000000\n\nSample Output 3\n\n838627288460105\n\nWatch out for overflows.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1309, "memory_kb": 82556}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s188438936", "group_id": "codeNet:p02624", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e6 + 7\n)\n\nvar buf []byte = make([]byte, maxBufSize)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBufSize)\n}\n\nfunc main() {\n\tN := nextInt()\n\tvar ans int\n\t// 1はすべての約数なのでどこかで足す\n\t// wg := new(sync.WaitGroup)\n\t// wg.Add(1)\n\t// go func() {\n\tfor i := 2; i <= N; i++ {\n\t\tfor j := 1; i*j <= N; j++ {\n\t\t\tans += i * j\n\t\t}\n\t}\n\t// \twg.Done()\n\t// }()\n\t// wg.Wait()\n\tans += N * (N + 1) / 2\n\tfmt.Println(ans)\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc abs(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc pow(p, q int) int {\n\tres := p\n\tif q == 0 {\n\t\treturn 1\n\t}\n\tfor i := 0; i < q-1; i++ {\n\t\tres *= p\n\t}\n\treturn res\n}\n\nfunc MinOf(vars ...int) int {\n\tmin := vars[0]\n\tfor _, i := range vars {\n\t\tif min > i {\n\t\t\tmin = i\n\t\t}\n\t}\n\treturn min\n}\n\nfunc MaxOf(vars ...int) int {\n\tmax := vars[0]\n\tfor _, i := range vars {\n\t\tif max < i {\n\t\t\tmax = i\n\t\t}\n\t}\n\treturn max\n}\n\nfunc gcdof2numbers(a int, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcdof2numbers(b, a%b)\n}\n\nfunc lcmof2numbers(a int, b int) int {\n\treturn a / gcdof2numbers(a, b) * b\n}\n\n// マイナスの場合は考慮していない\nfunc fuctorial(a int) int {\n\tif a == 1 || a == 0 {\n\t\treturn 1\n\t} else {\n\t\treturn fuctorial(a-1) * a\n\t}\n}\n\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\n\n// 素因数分解したmapを返す\nfunc primeFuctorize(n int) map[int]int {\n\tpf := map[int]int{}\n\tfor i := 2; i*i <= n; i++ {\n\t\tfor n%i == 0 {\n\t\t\tpf[i]++\n\t\t\tn /= i\n\t\t}\n\t}\n\tif n != 1 {\n\t\tpf[n]++\n\t}\n\treturn pf\n}\n", "language": "Go", "metadata": {"date": 1593310189, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02624.html", "problem_id": "p02624", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02624/input.txt", "sample_output_relpath": "derived/input_output/data/p02624/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02624/Go/s188438936.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s188438936", "user_id": "u605443479"}, "prompt_components": {"gold_output": "23\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e6 + 7\n)\n\nvar buf []byte = make([]byte, maxBufSize)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBufSize)\n}\n\nfunc main() {\n\tN := nextInt()\n\tvar ans int\n\t// 1はすべての約数なのでどこかで足す\n\t// wg := new(sync.WaitGroup)\n\t// wg.Add(1)\n\t// go func() {\n\tfor i := 2; i <= N; i++ {\n\t\tfor j := 1; i*j <= N; j++ {\n\t\t\tans += i * j\n\t\t}\n\t}\n\t// \twg.Done()\n\t// }()\n\t// wg.Wait()\n\tans += N * (N + 1) / 2\n\tfmt.Println(ans)\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc abs(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc pow(p, q int) int {\n\tres := p\n\tif q == 0 {\n\t\treturn 1\n\t}\n\tfor i := 0; i < q-1; i++ {\n\t\tres *= p\n\t}\n\treturn res\n}\n\nfunc MinOf(vars ...int) int {\n\tmin := vars[0]\n\tfor _, i := range vars {\n\t\tif min > i {\n\t\t\tmin = i\n\t\t}\n\t}\n\treturn min\n}\n\nfunc MaxOf(vars ...int) int {\n\tmax := vars[0]\n\tfor _, i := range vars {\n\t\tif max < i {\n\t\t\tmax = i\n\t\t}\n\t}\n\treturn max\n}\n\nfunc gcdof2numbers(a int, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcdof2numbers(b, a%b)\n}\n\nfunc lcmof2numbers(a int, b int) int {\n\treturn a / gcdof2numbers(a, b) * b\n}\n\n// マイナスの場合は考慮していない\nfunc fuctorial(a int) int {\n\tif a == 1 || a == 0 {\n\t\treturn 1\n\t} else {\n\t\treturn fuctorial(a-1) * a\n\t}\n}\n\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\n\n// 素因数分解したmapを返す\nfunc primeFuctorize(n int) map[int]int {\n\tpf := map[int]int{}\n\tfor i := 2; i*i <= n; i++ {\n\t\tfor n%i == 0 {\n\t\t\tpf[i]++\n\t\t\tn /= i\n\t\t}\n\t}\n\tif n != 1 {\n\t\tpf[n]++\n\t}\n\treturn pf\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nFor a positive integer X, let f(X) be the number of positive divisors of X.\n\nGiven a positive integer N, find \\sum_{K=1}^N K\\times f(K).\n\nConstraints\n\n1 \\leq N \\leq 10^7\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the value \\sum_{K=1}^N K\\times f(K).\n\nSample Input 1\n\n4\n\nSample Output 1\n\n23\n\nWe have f(1)=1, f(2)=2, f(3)=2, and f(4)=3, so the answer is 1\\times 1 + 2\\times 2 + 3\\times 2 + 4\\times 3 =23.\n\nSample Input 2\n\n100\n\nSample Output 2\n\n26879\n\nSample Input 3\n\n10000000\n\nSample Output 3\n\n838627288460105\n\nWatch out for overflows.", "sample_input": "4\n"}, "reference_outputs": ["23\n"], "source_document_id": "p02624", "source_text": "Score : 400 points\n\nProblem Statement\n\nFor a positive integer X, let f(X) be the number of positive divisors of X.\n\nGiven a positive integer N, find \\sum_{K=1}^N K\\times f(K).\n\nConstraints\n\n1 \\leq N \\leq 10^7\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the value \\sum_{K=1}^N K\\times f(K).\n\nSample Input 1\n\n4\n\nSample Output 1\n\n23\n\nWe have f(1)=1, f(2)=2, f(3)=2, and f(4)=3, so the answer is 1\\times 1 + 2\\times 2 + 3\\times 2 + 4\\times 3 =23.\n\nSample Input 2\n\n100\n\nSample Output 2\n\n26879\n\nSample Input 3\n\n10000000\n\nSample Output 3\n\n838627288460105\n\nWatch out for overflows.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2037, "cpu_time_ms": 106, "memory_kb": 1828}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s248754576", "group_id": "codeNet:p02624", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, ans int64\n\tfmt.Scan(&n)\n\tF := make([]int64, n+1)\n\tfor i := int64(1); i < n+1; i++ {\n\t\tfor j := i; j < n+1; j += i {\n\t\t\tF[j] += j\n\t\t}\n\t}\n\tfor _, f := range F {\n\t\tans += f\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1593310177, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02624.html", "problem_id": "p02624", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02624/input.txt", "sample_output_relpath": "derived/input_output/data/p02624/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02624/Go/s248754576.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s248754576", "user_id": "u688522869"}, "prompt_components": {"gold_output": "23\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, ans int64\n\tfmt.Scan(&n)\n\tF := make([]int64, n+1)\n\tfor i := int64(1); i < n+1; i++ {\n\t\tfor j := i; j < n+1; j += i {\n\t\t\tF[j] += j\n\t\t}\n\t}\n\tfor _, f := range F {\n\t\tans += f\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nFor a positive integer X, let f(X) be the number of positive divisors of X.\n\nGiven a positive integer N, find \\sum_{K=1}^N K\\times f(K).\n\nConstraints\n\n1 \\leq N \\leq 10^7\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the value \\sum_{K=1}^N K\\times f(K).\n\nSample Input 1\n\n4\n\nSample Output 1\n\n23\n\nWe have f(1)=1, f(2)=2, f(3)=2, and f(4)=3, so the answer is 1\\times 1 + 2\\times 2 + 3\\times 2 + 4\\times 3 =23.\n\nSample Input 2\n\n100\n\nSample Output 2\n\n26879\n\nSample Input 3\n\n10000000\n\nSample Output 3\n\n838627288460105\n\nWatch out for overflows.", "sample_input": "4\n"}, "reference_outputs": ["23\n"], "source_document_id": "p02624", "source_text": "Score : 400 points\n\nProblem Statement\n\nFor a positive integer X, let f(X) be the number of positive divisors of X.\n\nGiven a positive integer N, find \\sum_{K=1}^N K\\times f(K).\n\nConstraints\n\n1 \\leq N \\leq 10^7\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the value \\sum_{K=1}^N K\\times f(K).\n\nSample Input 1\n\n4\n\nSample Output 1\n\n23\n\nWe have f(1)=1, f(2)=2, f(3)=2, and f(4)=3, so the answer is 1\\times 1 + 2\\times 2 + 3\\times 2 + 4\\times 3 =23.\n\nSample Input 2\n\n100\n\nSample Output 2\n\n26879\n\nSample Input 3\n\n10000000\n\nSample Output 3\n\n838627288460105\n\nWatch out for overflows.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1385, "memory_kb": 82560}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s808052724", "group_id": "codeNet:p02624", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 100000\n\tmaxBufSize = 10000000\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twt = bufio.NewWriter(os.Stdout)\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(next())\n\treturn i\n}\n\nfunc nextInt2() (int, int) {\n\treturn nextInt(), nextInt()\n}\n\nfunc nextInt3() (int, int, int) {\n\treturn nextInt(), nextInt(), nextInt()\n}\n\nfunc nextInt4() (int, int, int, int) {\n\treturn nextInt(), nextInt(), nextInt(), nextInt()\n}\n\nfunc nextInts(n int) []int {\n\tslice := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tslice[i] = nextInt()\n\t}\n\treturn slice\n}\n\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(next(), 64)\n\treturn f\n}\n\nfunc nextFloat64s(n int) []float64 {\n\tslice := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tslice[i] = nextFloat64()\n\t}\n\treturn slice\n}\n\nfunc putf(format string, a ...interface{}) {\n\tfmt.Fprintf(wt, format, a...)\n}\n\nfunc puts(a ...interface{}) {\n\tfmt.Fprintln(wt, a...)\n}\n\nfunc minFactors(n int) []int {\n\tmf := make([]int, n+1)\n\tfor i := range mf {\n\t\tmf[i] = i\n\t}\n\tfor i := 2; i*i <= n; i++ {\n\t\tif mf[i] != i {\n\t\t\tcontinue\n\t\t}\n\t\tfor j := i * i; j <= n; j += i {\n\t\t\tif mf[j] == j {\n\t\t\t\tmf[j] = i\n\t\t\t}\n\t\t}\n\t}\n\treturn mf\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer wt.Flush()\n\n\tn := nextInt()\n\n\tmf := minFactors(n)\n\n\tans := 0\n\tfor i := 1; i <= n; i++ {\n\t\tmp := map[int]int{}\n\t\tfor j := i; j > 1; j /= mf[j] {\n\t\t\tmp[mf[j]]++\n\t\t}\n\t\tadd := 1\n\t\tfor _, v := range mp {\n\t\t\tadd *= v + 1\n\t\t}\n\t\tans += i * add\n\t}\n\n\tputs(ans)\n}\n", "language": "Go", "metadata": {"date": 1593308683, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02624.html", "problem_id": "p02624", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02624/input.txt", "sample_output_relpath": "derived/input_output/data/p02624/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02624/Go/s808052724.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s808052724", "user_id": "u502813058"}, "prompt_components": {"gold_output": "23\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 100000\n\tmaxBufSize = 10000000\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twt = bufio.NewWriter(os.Stdout)\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(next())\n\treturn i\n}\n\nfunc nextInt2() (int, int) {\n\treturn nextInt(), nextInt()\n}\n\nfunc nextInt3() (int, int, int) {\n\treturn nextInt(), nextInt(), nextInt()\n}\n\nfunc nextInt4() (int, int, int, int) {\n\treturn nextInt(), nextInt(), nextInt(), nextInt()\n}\n\nfunc nextInts(n int) []int {\n\tslice := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tslice[i] = nextInt()\n\t}\n\treturn slice\n}\n\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(next(), 64)\n\treturn f\n}\n\nfunc nextFloat64s(n int) []float64 {\n\tslice := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tslice[i] = nextFloat64()\n\t}\n\treturn slice\n}\n\nfunc putf(format string, a ...interface{}) {\n\tfmt.Fprintf(wt, format, a...)\n}\n\nfunc puts(a ...interface{}) {\n\tfmt.Fprintln(wt, a...)\n}\n\nfunc minFactors(n int) []int {\n\tmf := make([]int, n+1)\n\tfor i := range mf {\n\t\tmf[i] = i\n\t}\n\tfor i := 2; i*i <= n; i++ {\n\t\tif mf[i] != i {\n\t\t\tcontinue\n\t\t}\n\t\tfor j := i * i; j <= n; j += i {\n\t\t\tif mf[j] == j {\n\t\t\t\tmf[j] = i\n\t\t\t}\n\t\t}\n\t}\n\treturn mf\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer wt.Flush()\n\n\tn := nextInt()\n\n\tmf := minFactors(n)\n\n\tans := 0\n\tfor i := 1; i <= n; i++ {\n\t\tmp := map[int]int{}\n\t\tfor j := i; j > 1; j /= mf[j] {\n\t\t\tmp[mf[j]]++\n\t\t}\n\t\tadd := 1\n\t\tfor _, v := range mp {\n\t\t\tadd *= v + 1\n\t\t}\n\t\tans += i * add\n\t}\n\n\tputs(ans)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nFor a positive integer X, let f(X) be the number of positive divisors of X.\n\nGiven a positive integer N, find \\sum_{K=1}^N K\\times f(K).\n\nConstraints\n\n1 \\leq N \\leq 10^7\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the value \\sum_{K=1}^N K\\times f(K).\n\nSample Input 1\n\n4\n\nSample Output 1\n\n23\n\nWe have f(1)=1, f(2)=2, f(3)=2, and f(4)=3, so the answer is 1\\times 1 + 2\\times 2 + 3\\times 2 + 4\\times 3 =23.\n\nSample Input 2\n\n100\n\nSample Output 2\n\n26879\n\nSample Input 3\n\n10000000\n\nSample Output 3\n\n838627288460105\n\nWatch out for overflows.", "sample_input": "4\n"}, "reference_outputs": ["23\n"], "source_document_id": "p02624", "source_text": "Score : 400 points\n\nProblem Statement\n\nFor a positive integer X, let f(X) be the number of positive divisors of X.\n\nGiven a positive integer N, find \\sum_{K=1}^N K\\times f(K).\n\nConstraints\n\n1 \\leq N \\leq 10^7\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the value \\sum_{K=1}^N K\\times f(K).\n\nSample Input 1\n\n4\n\nSample Output 1\n\n23\n\nWe have f(1)=1, f(2)=2, f(3)=2, and f(4)=3, so the answer is 1\\times 1 + 2\\times 2 + 3\\times 2 + 4\\times 3 =23.\n\nSample Input 2\n\n100\n\nSample Output 2\n\n26879\n\nSample Input 3\n\n10000000\n\nSample Output 3\n\n838627288460105\n\nWatch out for overflows.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1627, "cpu_time_ms": 3314, "memory_kb": 162664}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s025864566", "group_id": "codeNet:p02642", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"flag\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"testing\"\n)\n\n/*-----------Main-----------*/\n\nfunc main() {\n\tn := readI()\n\ta := readIs(n)\n\tsort.Ints(a)\n\tdel := make([]bool, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tif del[i] {\n\t\t\tcontinue\n\t\t}\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\tif del[j] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif a[j] == a[i] {\n\t\t\t\tdel[i], del[j] = true, true\n\t\t\t} else if a[j]%a[i] == 0 {\n\t\t\t\tdel[j] = true\n\t\t\t}\n\t\t}\n\t}\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tif !del[i] {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\n/*-----------Utilities-----------*/\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\ttesting.Init()\n\tif flag.Parse(); flag.Arg(0) == \"debug\" {\n\t\tdebug()\n\t}\n\tconst maxBuf = 200100\n\tvar buf []byte = make([]byte, maxBuf)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBuf)\n}\n\nfunc debug() {\n\ttestFile, err := os.Open(\"./test/sample-3.in\")\n\tif err != nil {\n\t\tfmt.Println(\"Error : There is no testfile.\")\n\t\tos.Exit(1)\n\t}\n\tsc = bufio.NewScanner(testFile)\n}\n\nfunc readS() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readSs(a int) []string {\n\tb := make([]string, a)\n\tfor i := 0; i < a; i++ {\n\t\tb[i] = readS()\n\t}\n\treturn b\n}\n\nfunc readI() int {\n\tsc.Scan()\n\tr, _ := strconv.Atoi(sc.Text())\n\treturn r\n}\n\nfunc readIs(a int) []int {\n\tb := make([]int, a)\n\tfor i := 0; i < a; i++ {\n\t\tb[i] = readI()\n\t}\n\treturn b\n}\n\nfunc readF() float64 {\n\tsc.Scan()\n\tr, _ := strconv.ParseFloat(sc.Text(), 64)\n\treturn r\n}\n\nfunc readFs(a int) []float64 {\n\tb := make([]float64, a)\n\tfor i := 0; i < a; i++ {\n\t\tb[i] = readF()\n\t}\n\treturn b\n}\n\nfunc max(a []int) int {\n\tl := len(a)\n\tm := a[0]\n\tfor i := 1; i < l; i++ {\n\t\tif a[i] > m {\n\t\t\tm = a[i]\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(a []int) int {\n\tl := len(a)\n\tm := a[0]\n\tfor i := 1; i < l; i++ {\n\t\tif a[i] < m {\n\t\t\tm = a[i]\n\t\t}\n\t}\n\treturn m\n}\n\nfunc sortI(a []int) []int {\n\tsort.Ints(a)\n\treturn a\n}\n\nfunc reverse(a []int) []int {\n\tl := len(a)\n\tr := make([]int, l)\n\tfor i := 0; i < l; i++ {\n\t\tr[i] = a[l-i-1]\n\t}\n\treturn r\n}\n\nfunc countI(a []int, b int) int {\n\tl := len(a)\n\tvar c int\n\tfor i := 0; i < l; i++ {\n\t\tif a[i] == b {\n\t\t\tc++\n\t\t}\n\t}\n\treturn c\n}\n", "language": "Go", "metadata": {"date": 1596918821, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02642.html", "problem_id": "p02642", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02642/input.txt", "sample_output_relpath": "derived/input_output/data/p02642/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02642/Go/s025864566.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s025864566", "user_id": "u533258444"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"flag\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"testing\"\n)\n\n/*-----------Main-----------*/\n\nfunc main() {\n\tn := readI()\n\ta := readIs(n)\n\tsort.Ints(a)\n\tdel := make([]bool, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tif del[i] {\n\t\t\tcontinue\n\t\t}\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\tif del[j] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif a[j] == a[i] {\n\t\t\t\tdel[i], del[j] = true, true\n\t\t\t} else if a[j]%a[i] == 0 {\n\t\t\t\tdel[j] = true\n\t\t\t}\n\t\t}\n\t}\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tif !del[i] {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\n/*-----------Utilities-----------*/\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\ttesting.Init()\n\tif flag.Parse(); flag.Arg(0) == \"debug\" {\n\t\tdebug()\n\t}\n\tconst maxBuf = 200100\n\tvar buf []byte = make([]byte, maxBuf)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBuf)\n}\n\nfunc debug() {\n\ttestFile, err := os.Open(\"./test/sample-3.in\")\n\tif err != nil {\n\t\tfmt.Println(\"Error : There is no testfile.\")\n\t\tos.Exit(1)\n\t}\n\tsc = bufio.NewScanner(testFile)\n}\n\nfunc readS() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readSs(a int) []string {\n\tb := make([]string, a)\n\tfor i := 0; i < a; i++ {\n\t\tb[i] = readS()\n\t}\n\treturn b\n}\n\nfunc readI() int {\n\tsc.Scan()\n\tr, _ := strconv.Atoi(sc.Text())\n\treturn r\n}\n\nfunc readIs(a int) []int {\n\tb := make([]int, a)\n\tfor i := 0; i < a; i++ {\n\t\tb[i] = readI()\n\t}\n\treturn b\n}\n\nfunc readF() float64 {\n\tsc.Scan()\n\tr, _ := strconv.ParseFloat(sc.Text(), 64)\n\treturn r\n}\n\nfunc readFs(a int) []float64 {\n\tb := make([]float64, a)\n\tfor i := 0; i < a; i++ {\n\t\tb[i] = readF()\n\t}\n\treturn b\n}\n\nfunc max(a []int) int {\n\tl := len(a)\n\tm := a[0]\n\tfor i := 1; i < l; i++ {\n\t\tif a[i] > m {\n\t\t\tm = a[i]\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(a []int) int {\n\tl := len(a)\n\tm := a[0]\n\tfor i := 1; i < l; i++ {\n\t\tif a[i] < m {\n\t\t\tm = a[i]\n\t\t}\n\t}\n\treturn m\n}\n\nfunc sortI(a []int) []int {\n\tsort.Ints(a)\n\treturn a\n}\n\nfunc reverse(a []int) []int {\n\tl := len(a)\n\tr := make([]int, l)\n\tfor i := 0; i < l; i++ {\n\t\tr[i] = a[l-i-1]\n\t}\n\treturn r\n}\n\nfunc countI(a []int, b int) int {\n\tl := len(a)\n\tvar c int\n\tfor i := 0; i < l; i++ {\n\t\tif a[i] == b {\n\t\t\tc++\n\t\t}\n\t}\n\treturn c\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "sample_input": "5\n24 11 8 3 16\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02642", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2082, "cpu_time_ms": 2205, "memory_kb": 5544}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s950833621", "group_id": "codeNet:p02642", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\ta := make([]int, n)\n\tm := make(map[int]int)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t\tm[a[i]]++\n\t}\n\tans := 0\n\tfor _, e := range a {\n\t\tfound := true\n\t\tif v, ok := m[e]; ok && v > 1 {\n\t\t\tfound = false\n\t\t}\n\t\tfor i := 2; i*i <= e; i++ {\n\t\t\tif e%i == 0 {\n\t\t\t\tif v, ok := m[i]; ok && v >= 1 {\n\t\t\t\t\tfound = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif v, ok := m[e/i]; i != e/i && ok && v >= 1 {\n\t\t\t\t\tfound = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif found {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1595728719, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02642.html", "problem_id": "p02642", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02642/input.txt", "sample_output_relpath": "derived/input_output/data/p02642/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02642/Go/s950833621.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s950833621", "user_id": "u150861392"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\ta := make([]int, n)\n\tm := make(map[int]int)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t\tm[a[i]]++\n\t}\n\tans := 0\n\tfor _, e := range a {\n\t\tfound := true\n\t\tif v, ok := m[e]; ok && v > 1 {\n\t\t\tfound = false\n\t\t}\n\t\tfor i := 2; i*i <= e; i++ {\n\t\t\tif e%i == 0 {\n\t\t\t\tif v, ok := m[i]; ok && v >= 1 {\n\t\t\t\t\tfound = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif v, ok := m[e/i]; i != e/i && ok && v >= 1 {\n\t\t\t\t\tfound = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif found {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "sample_input": "5\n24 11 8 3 16\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02642", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2206, "memory_kb": 17644}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s578674740", "group_id": "codeNet:p02642", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst MaxA = 1_000_000\n\nfunc main() {\n\tsc := NewScanner()\n\n\tn := sc.ReadInt()\n\tas := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tas[i] = sc.ReadInt()\n\t}\n\tsort.Ints(as)\n\n\tcount := 0\n\tsieve := make([]bool, MaxA+1)\n\tfor _, a := range as {\n\t\tif !sieve[a] {\n\t\t\tcount++\n\t\t\tfor j := a; j <= MaxA; j += a {\n\t\t\t\tsieve[j] = true\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(count)\n}\n\n// from [my library](https://github.com/ikngtty/go-contestlib)\n// - math/simple\n\nfunc Abs(x int) int {\n\tif x >= 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc Min(values ...int) int {\n\tif len(values) == 0 {\n\t\tpanic(\"no values\")\n\t}\n\n\tmin := values[0]\n\tfor _, v := range values {\n\t\tif v < min {\n\t\t\tmin = v\n\t\t}\n\t}\n\treturn min\n}\n\nfunc Max(values ...int) int {\n\tif len(values) == 0 {\n\t\tpanic(\"no values\")\n\t}\n\n\tmax := values[0]\n\tfor _, v := range values {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}\n\nfunc Pow(base, exponent int) int {\n\tif exponent < 0 {\n\t\tpanic(fmt.Sprintf(\"exponent (%d) should not be a minus\", exponent))\n\t}\n\n\tanswer := 1\n\tfor i := 0; i < exponent; i++ {\n\t\tanswer *= base\n\t}\n\treturn answer\n}\n\nfunc Ceil(divident, dividor int) int {\n\tif dividor == 0 {\n\t\tpanic(\"dividor should not be 0\")\n\t}\n\n\tquo := divident / dividor\n\trem := divident % dividor\n\n\tif rem != 0 {\n\t\tif (divident > 0 && dividor > 0) ||\n\t\t\t(divident < 0 && dividor < 0) {\n\t\t\treturn quo + 1\n\t\t}\n\t}\n\treturn quo\n}\n\n// - sortutil\n\nfunc ReverseInts(a []int) {\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n}\n\nfunc ReverseStrings(a []string) {\n\tsort.Sort(sort.Reverse(sort.StringSlice(a)))\n}\n\n// - io\n\ntype Scanner struct {\n\tbufScanner *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tbufSc := bufio.NewScanner(os.Stdin)\n\tbufSc.Split(bufio.ScanWords)\n\tbufSc.Buffer(nil, 100000000)\n\treturn &Scanner{bufSc}\n}\n\nfunc (sc *Scanner) ReadString() string {\n\tbufSc := sc.bufScanner\n\tbufSc.Scan()\n\treturn bufSc.Text()\n}\n\nfunc (sc *Scanner) ReadInt() int {\n\tbufSc := sc.bufScanner\n\tbufSc.Scan()\n\ttext := bufSc.Text()\n\n\tnum, err := strconv.Atoi(text)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn num\n}\n", "language": "Go", "metadata": {"date": 1595090106, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02642.html", "problem_id": "p02642", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02642/input.txt", "sample_output_relpath": "derived/input_output/data/p02642/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02642/Go/s578674740.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s578674740", "user_id": "u344542101"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst MaxA = 1_000_000\n\nfunc main() {\n\tsc := NewScanner()\n\n\tn := sc.ReadInt()\n\tas := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tas[i] = sc.ReadInt()\n\t}\n\tsort.Ints(as)\n\n\tcount := 0\n\tsieve := make([]bool, MaxA+1)\n\tfor _, a := range as {\n\t\tif !sieve[a] {\n\t\t\tcount++\n\t\t\tfor j := a; j <= MaxA; j += a {\n\t\t\t\tsieve[j] = true\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(count)\n}\n\n// from [my library](https://github.com/ikngtty/go-contestlib)\n// - math/simple\n\nfunc Abs(x int) int {\n\tif x >= 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc Min(values ...int) int {\n\tif len(values) == 0 {\n\t\tpanic(\"no values\")\n\t}\n\n\tmin := values[0]\n\tfor _, v := range values {\n\t\tif v < min {\n\t\t\tmin = v\n\t\t}\n\t}\n\treturn min\n}\n\nfunc Max(values ...int) int {\n\tif len(values) == 0 {\n\t\tpanic(\"no values\")\n\t}\n\n\tmax := values[0]\n\tfor _, v := range values {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}\n\nfunc Pow(base, exponent int) int {\n\tif exponent < 0 {\n\t\tpanic(fmt.Sprintf(\"exponent (%d) should not be a minus\", exponent))\n\t}\n\n\tanswer := 1\n\tfor i := 0; i < exponent; i++ {\n\t\tanswer *= base\n\t}\n\treturn answer\n}\n\nfunc Ceil(divident, dividor int) int {\n\tif dividor == 0 {\n\t\tpanic(\"dividor should not be 0\")\n\t}\n\n\tquo := divident / dividor\n\trem := divident % dividor\n\n\tif rem != 0 {\n\t\tif (divident > 0 && dividor > 0) ||\n\t\t\t(divident < 0 && dividor < 0) {\n\t\t\treturn quo + 1\n\t\t}\n\t}\n\treturn quo\n}\n\n// - sortutil\n\nfunc ReverseInts(a []int) {\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n}\n\nfunc ReverseStrings(a []string) {\n\tsort.Sort(sort.Reverse(sort.StringSlice(a)))\n}\n\n// - io\n\ntype Scanner struct {\n\tbufScanner *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tbufSc := bufio.NewScanner(os.Stdin)\n\tbufSc.Split(bufio.ScanWords)\n\tbufSc.Buffer(nil, 100000000)\n\treturn &Scanner{bufSc}\n}\n\nfunc (sc *Scanner) ReadString() string {\n\tbufSc := sc.bufScanner\n\tbufSc.Scan()\n\treturn bufSc.Text()\n}\n\nfunc (sc *Scanner) ReadInt() int {\n\tbufSc := sc.bufScanner\n\tbufSc.Scan()\n\ttext := bufSc.Text()\n\n\tnum, err := strconv.Atoi(text)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn num\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "sample_input": "5\n24 11 8 3 16\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02642", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2071, "cpu_time_ms": 81, "memory_kb": 6144}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s388373727", "group_id": "codeNet:p02642", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\n\tn := sc.ReadInt()\n\tas := make([]*aElem, n)\n\tfor i := 0; i < n; i++ {\n\t\tas[i] = &aElem{i, sc.ReadInt(), false}\n\t}\n\n\tfactorMap := make(map[int]*aElemList)\n\tfor _, a := range as {\n\t\tfactors := Factorize(a.value)\n\t\tfor _, factor := range factors {\n\t\t\tif factorMap[factor] == nil {\n\t\t\t\tfactorMap[factor] = newAElemList()\n\t\t\t}\n\t\t\tfactorMap[factor].Add(a)\n\t\t}\n\t}\n\n\tfor _, a := range as {\n\t\tfactorMap[a.value].Each(func(elem *aElem) {\n\t\t\tif elem != a {\n\t\t\t\telem.marked = true\n\t\t\t}\n\t\t})\n\t}\n\n\tcount := 0\n\tfor _, a := range as {\n\t\tif !a.marked {\n\t\t\tcount++\n\t\t}\n\t}\n\n\tfmt.Println(count)\n}\n\ntype aElem struct {\n\tindex int\n\tvalue int\n\tmarked bool\n}\n\ntype aElemList struct {\n\tfirst *aElemListNode\n\tlast *aElemListNode\n}\n\ntype aElemListNode struct {\n\tchild *aElemListNode\n\tvalue *aElem\n}\n\nfunc newAElemList() *aElemList {\n\troot := aElemListNode{nil, nil}\n\treturn &aElemList{&root, &root}\n}\n\nfunc (list *aElemList) Add(value *aElem) {\n\tnode := aElemListNode{nil, value}\n\tlist.last.child = &node\n\tlist.last = &node\n}\n\nfunc (list *aElemList) Each(f func(value *aElem)) {\n\tcur := list.first\n\tfor cur.child != nil {\n\t\tcur = cur.child\n\t\tf(cur.value)\n\t}\n}\n\nfunc Factorize(n int) []int {\n\tprimeCounts := PrimeFactorize(n)\n\tprimeLen := len(primeCounts)\n\tif primeLen == 0 {\n\t\treturn []int{1}\n\t}\n\n\tfactorsLen := 1\n\tfor _, primeCount := range primeCounts {\n\t\tfactorsLen *= primeCount.Count + 1\n\t}\n\n\tfactors := make([]int, 0, factorsLen)\n\tusePrimeCounts := make([]int, primeLen)\n\tlastPrimeCount := primeCounts[primeLen-1].Count\n\tfor usePrimeCounts[primeLen-1] <= lastPrimeCount {\n\t\tfactor := 1\n\t\tfor i, primeCount := range primeCounts {\n\t\t\tfactor *= Pow(primeCount.Value, usePrimeCounts[i])\n\t\t}\n\t\tfactors = append(factors, factor)\n\n\t\tusePrimeCounts[0]++\n\t\t// carry\n\t\tfor i := 0; i < primeLen-1; i++ {\n\t\t\tif usePrimeCounts[i] > primeCounts[i].Count {\n\t\t\t\tusePrimeCounts[i] = 0\n\t\t\t\tusePrimeCounts[i+1]++\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\treturn factors\n}\n\nfunc PrimeFactorize(n int) []ElemCount {\n\tprimeCounts := make([]ElemCount, 0)\n\n\taddCountIfExist := func(i int) {\n\t\tcount := 0\n\t\tfor n%i == 0 {\n\t\t\tcount++\n\t\t\tn /= i\n\t\t}\n\t\tif count > 0 {\n\t\t\tprimeCounts = append(primeCounts, ElemCount{i, count})\n\t\t}\n\t}\n\n\taddCountIfExist(2)\n\taddCountIfExist(3)\n\n\tflag := true\n\tfor i := 5; n > 1 && i*i <= n; {\n\t\taddCountIfExist(i)\n\n\t\tif flag {\n\t\t\ti += 2\n\t\t} else {\n\t\t\ti += 4\n\t\t}\n\t\tflag = !flag\n\t}\n\n\tif n > 1 {\n\t\tprimeCounts = append(primeCounts, ElemCount{n, 1})\n\t}\n\n\treturn primeCounts\n}\n\ntype ElemCount struct {\n\tValue int\n\tCount int\n}\n\n// util\n// * math/simple\n\nfunc Abs(x int) int {\n\tif x >= 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc Min(values ...int) int {\n\tif len(values) == 0 {\n\t\tpanic(\"no values\")\n\t}\n\tmin := values[0]\n\tfor _, v := range values {\n\t\tif v < min {\n\t\t\tmin = v\n\t\t}\n\t}\n\treturn min\n}\n\nfunc Max(values ...int) int {\n\tif len(values) == 0 {\n\t\tpanic(\"no values\")\n\t}\n\tmax := values[0]\n\tfor _, v := range values {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}\n\nfunc Pow(base int, exponent int) int {\n\tif exponent < 0 {\n\t\tpanic(fmt.Sprintf(\"exponent: %d\", exponent))\n\t}\n\tanswer := 1\n\tfor i := 0; i < exponent; i++ {\n\t\tanswer *= base\n\t}\n\treturn answer\n}\n\nfunc Ceil(divident, dividor int) int {\n\tquo := divident / dividor\n\trem := divident % dividor\n\n\tif rem != 0 {\n\t\tif (divident > 0 && dividor > 0) ||\n\t\t\t(divident < 0 && dividor < 0) {\n\t\t\treturn quo + 1\n\t\t}\n\t}\n\treturn quo\n}\n\n// * sortutil\n\nfunc ReverseInts(a []int) {\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n}\n\nfunc ReverseStrings(a []string) {\n\tsort.Sort(sort.Reverse(sort.StringSlice(a)))\n}\n\n// * io\n\ntype Scanner struct {\n\tbufScanner *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tbufSc := bufio.NewScanner(os.Stdin)\n\tbufSc.Split(bufio.ScanWords)\n\tbufSc.Buffer(nil, 100000000)\n\treturn &Scanner{bufSc}\n}\n\nfunc (sc *Scanner) ReadString() string {\n\tbufSc := sc.bufScanner\n\tbufSc.Scan()\n\treturn bufSc.Text()\n}\n\nfunc (sc *Scanner) ReadInt() int {\n\tbufSc := sc.bufScanner\n\tbufSc.Scan()\n\ttext := bufSc.Text()\n\n\tnum, err := strconv.Atoi(text)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn num\n}\n", "language": "Go", "metadata": {"date": 1593909624, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02642.html", "problem_id": "p02642", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02642/input.txt", "sample_output_relpath": "derived/input_output/data/p02642/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02642/Go/s388373727.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s388373727", "user_id": "u344542101"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\n\tn := sc.ReadInt()\n\tas := make([]*aElem, n)\n\tfor i := 0; i < n; i++ {\n\t\tas[i] = &aElem{i, sc.ReadInt(), false}\n\t}\n\n\tfactorMap := make(map[int]*aElemList)\n\tfor _, a := range as {\n\t\tfactors := Factorize(a.value)\n\t\tfor _, factor := range factors {\n\t\t\tif factorMap[factor] == nil {\n\t\t\t\tfactorMap[factor] = newAElemList()\n\t\t\t}\n\t\t\tfactorMap[factor].Add(a)\n\t\t}\n\t}\n\n\tfor _, a := range as {\n\t\tfactorMap[a.value].Each(func(elem *aElem) {\n\t\t\tif elem != a {\n\t\t\t\telem.marked = true\n\t\t\t}\n\t\t})\n\t}\n\n\tcount := 0\n\tfor _, a := range as {\n\t\tif !a.marked {\n\t\t\tcount++\n\t\t}\n\t}\n\n\tfmt.Println(count)\n}\n\ntype aElem struct {\n\tindex int\n\tvalue int\n\tmarked bool\n}\n\ntype aElemList struct {\n\tfirst *aElemListNode\n\tlast *aElemListNode\n}\n\ntype aElemListNode struct {\n\tchild *aElemListNode\n\tvalue *aElem\n}\n\nfunc newAElemList() *aElemList {\n\troot := aElemListNode{nil, nil}\n\treturn &aElemList{&root, &root}\n}\n\nfunc (list *aElemList) Add(value *aElem) {\n\tnode := aElemListNode{nil, value}\n\tlist.last.child = &node\n\tlist.last = &node\n}\n\nfunc (list *aElemList) Each(f func(value *aElem)) {\n\tcur := list.first\n\tfor cur.child != nil {\n\t\tcur = cur.child\n\t\tf(cur.value)\n\t}\n}\n\nfunc Factorize(n int) []int {\n\tprimeCounts := PrimeFactorize(n)\n\tprimeLen := len(primeCounts)\n\tif primeLen == 0 {\n\t\treturn []int{1}\n\t}\n\n\tfactorsLen := 1\n\tfor _, primeCount := range primeCounts {\n\t\tfactorsLen *= primeCount.Count + 1\n\t}\n\n\tfactors := make([]int, 0, factorsLen)\n\tusePrimeCounts := make([]int, primeLen)\n\tlastPrimeCount := primeCounts[primeLen-1].Count\n\tfor usePrimeCounts[primeLen-1] <= lastPrimeCount {\n\t\tfactor := 1\n\t\tfor i, primeCount := range primeCounts {\n\t\t\tfactor *= Pow(primeCount.Value, usePrimeCounts[i])\n\t\t}\n\t\tfactors = append(factors, factor)\n\n\t\tusePrimeCounts[0]++\n\t\t// carry\n\t\tfor i := 0; i < primeLen-1; i++ {\n\t\t\tif usePrimeCounts[i] > primeCounts[i].Count {\n\t\t\t\tusePrimeCounts[i] = 0\n\t\t\t\tusePrimeCounts[i+1]++\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\treturn factors\n}\n\nfunc PrimeFactorize(n int) []ElemCount {\n\tprimeCounts := make([]ElemCount, 0)\n\n\taddCountIfExist := func(i int) {\n\t\tcount := 0\n\t\tfor n%i == 0 {\n\t\t\tcount++\n\t\t\tn /= i\n\t\t}\n\t\tif count > 0 {\n\t\t\tprimeCounts = append(primeCounts, ElemCount{i, count})\n\t\t}\n\t}\n\n\taddCountIfExist(2)\n\taddCountIfExist(3)\n\n\tflag := true\n\tfor i := 5; n > 1 && i*i <= n; {\n\t\taddCountIfExist(i)\n\n\t\tif flag {\n\t\t\ti += 2\n\t\t} else {\n\t\t\ti += 4\n\t\t}\n\t\tflag = !flag\n\t}\n\n\tif n > 1 {\n\t\tprimeCounts = append(primeCounts, ElemCount{n, 1})\n\t}\n\n\treturn primeCounts\n}\n\ntype ElemCount struct {\n\tValue int\n\tCount int\n}\n\n// util\n// * math/simple\n\nfunc Abs(x int) int {\n\tif x >= 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc Min(values ...int) int {\n\tif len(values) == 0 {\n\t\tpanic(\"no values\")\n\t}\n\tmin := values[0]\n\tfor _, v := range values {\n\t\tif v < min {\n\t\t\tmin = v\n\t\t}\n\t}\n\treturn min\n}\n\nfunc Max(values ...int) int {\n\tif len(values) == 0 {\n\t\tpanic(\"no values\")\n\t}\n\tmax := values[0]\n\tfor _, v := range values {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}\n\nfunc Pow(base int, exponent int) int {\n\tif exponent < 0 {\n\t\tpanic(fmt.Sprintf(\"exponent: %d\", exponent))\n\t}\n\tanswer := 1\n\tfor i := 0; i < exponent; i++ {\n\t\tanswer *= base\n\t}\n\treturn answer\n}\n\nfunc Ceil(divident, dividor int) int {\n\tquo := divident / dividor\n\trem := divident % dividor\n\n\tif rem != 0 {\n\t\tif (divident > 0 && dividor > 0) ||\n\t\t\t(divident < 0 && dividor < 0) {\n\t\t\treturn quo + 1\n\t\t}\n\t}\n\treturn quo\n}\n\n// * sortutil\n\nfunc ReverseInts(a []int) {\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n}\n\nfunc ReverseStrings(a []string) {\n\tsort.Sort(sort.Reverse(sort.StringSlice(a)))\n}\n\n// * io\n\ntype Scanner struct {\n\tbufScanner *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tbufSc := bufio.NewScanner(os.Stdin)\n\tbufSc.Split(bufio.ScanWords)\n\tbufSc.Buffer(nil, 100000000)\n\treturn &Scanner{bufSc}\n}\n\nfunc (sc *Scanner) ReadString() string {\n\tbufSc := sc.bufScanner\n\tbufSc.Scan()\n\treturn bufSc.Text()\n}\n\nfunc (sc *Scanner) ReadInt() int {\n\tbufSc := sc.bufScanner\n\tbufSc.Scan()\n\ttext := bufSc.Text()\n\n\tnum, err := strconv.Atoi(text)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn num\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "sample_input": "5\n24 11 8 3 16\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02642", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4116, "cpu_time_ms": 2213, "memory_kb": 212504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s203488431", "group_id": "codeNet:p02642", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc configure(scanner *bufio.Scanner) {\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 1000005), 1000005)\n}\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanned := scanner.Scan()\n\tif !scanned {\n\t\tpanic(\"scan failed\")\n\t}\n\treturn scanner.Text()\n}\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\nfunc getNextFloat64(scanner *bufio.Scanner) float64 {\n\ti, _ := strconv.ParseFloat(getNextString(scanner), 64)\n\treturn i\n}\nfunc main() {\n\tfp := os.Stdin\n\twfp := os.Stdout\n\t\n\tscanner := bufio.NewScanner(fp)\n\tconfigure(scanner)\n\twriter := bufio.NewWriter(wfp)\n\tdefer func() {\n\t\tr := recover()\n\t\tif r != nil {\n\t\t\tfmt.Fprintln(writer, r)\n\t\t}\n\t\twriter.Flush()\n\t}()\n\tsolve(scanner, writer)\n}\nfunc solve(scanner *bufio.Scanner, writer *bufio.Writer) {\n\tN := getNextInt(scanner)\n\tA := make([]int, N)\n\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = getNextInt(scanner)\n\t}\n\n\tMAX := 1000005\n\tdp := make([]int, MAX)\n\tfor _, v := range A {\n\t\tif dp[v] != 0 {\n\t\t\tdp[v] = 2\n\t\t\tcontinue\n\t\t}\n\t\tfor i := v; i < MAX; i += v {\n\t\t\tdp[i]++\n\t\t}\n\t}\n\tans := 0\n\tfor _, v := range A {\n\t\tif dp[v] == 1 {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1593139848, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02642.html", "problem_id": "p02642", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02642/input.txt", "sample_output_relpath": "derived/input_output/data/p02642/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02642/Go/s203488431.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s203488431", "user_id": "u329799519"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc configure(scanner *bufio.Scanner) {\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 1000005), 1000005)\n}\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanned := scanner.Scan()\n\tif !scanned {\n\t\tpanic(\"scan failed\")\n\t}\n\treturn scanner.Text()\n}\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\nfunc getNextFloat64(scanner *bufio.Scanner) float64 {\n\ti, _ := strconv.ParseFloat(getNextString(scanner), 64)\n\treturn i\n}\nfunc main() {\n\tfp := os.Stdin\n\twfp := os.Stdout\n\t\n\tscanner := bufio.NewScanner(fp)\n\tconfigure(scanner)\n\twriter := bufio.NewWriter(wfp)\n\tdefer func() {\n\t\tr := recover()\n\t\tif r != nil {\n\t\t\tfmt.Fprintln(writer, r)\n\t\t}\n\t\twriter.Flush()\n\t}()\n\tsolve(scanner, writer)\n}\nfunc solve(scanner *bufio.Scanner, writer *bufio.Writer) {\n\tN := getNextInt(scanner)\n\tA := make([]int, N)\n\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = getNextInt(scanner)\n\t}\n\n\tMAX := 1000005\n\tdp := make([]int, MAX)\n\tfor _, v := range A {\n\t\tif dp[v] != 0 {\n\t\t\tdp[v] = 2\n\t\t\tcontinue\n\t\t}\n\t\tfor i := v; i < MAX; i += v {\n\t\t\tdp[i]++\n\t\t}\n\t}\n\tans := 0\n\tfor _, v := range A {\n\t\tif dp[v] == 1 {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "sample_input": "5\n24 11 8 3 16\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02642", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1349, "cpu_time_ms": 51, "memory_kb": 13920}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s750199492", "group_id": "codeNet:p02642", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\n\tA := make([]int, N)\n\tm := make(map[int]int)\n\tfor i := range A {\n\t\tsc.Scan()\n\t\tA[i], _ = strconv.Atoi(sc.Text())\n\t\tm[A[i]]++\n\t}\n\tvar keys []int\n\tfor k := range m {\n\t\tkeys = append(keys, k)\n\t}\n\tsort.Ints(keys)\n\tMAX := 1000000\n\tflags := make([]bool, MAX+1)\n\tfor i := range flags {\n\t\tflags[i] = true\n\t}\n\tsum := 0\n\tfor _, k := range keys {\n\t\tc := m[k]\n\t\tif !flags[k] {\n\t\t\tcontinue\n\t\t}\n\t\tif c == 1 {\n\t\t\tsum++\n\t\t}\n\t\tfor num := k; num <= MAX; num += k {\n\t\t\tflags[num] = false\n\t\t}\n\t}\n\tfmt.Println(sum)\n\n}\n", "language": "Go", "metadata": {"date": 1592802958, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02642.html", "problem_id": "p02642", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02642/input.txt", "sample_output_relpath": "derived/input_output/data/p02642/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02642/Go/s750199492.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s750199492", "user_id": "u162326103"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\n\tA := make([]int, N)\n\tm := make(map[int]int)\n\tfor i := range A {\n\t\tsc.Scan()\n\t\tA[i], _ = strconv.Atoi(sc.Text())\n\t\tm[A[i]]++\n\t}\n\tvar keys []int\n\tfor k := range m {\n\t\tkeys = append(keys, k)\n\t}\n\tsort.Ints(keys)\n\tMAX := 1000000\n\tflags := make([]bool, MAX+1)\n\tfor i := range flags {\n\t\tflags[i] = true\n\t}\n\tsum := 0\n\tfor _, k := range keys {\n\t\tc := m[k]\n\t\tif !flags[k] {\n\t\t\tcontinue\n\t\t}\n\t\tif c == 1 {\n\t\t\tsum++\n\t\t}\n\t\tfor num := k; num <= MAX; num += k {\n\t\t\tflags[num] = false\n\t\t}\n\t}\n\tfmt.Println(sum)\n\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "sample_input": "5\n24 11 8 3 16\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02642", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 666, "cpu_time_ms": 121, "memory_kb": 19748}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s571096596", "group_id": "codeNet:p02642", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\ta := make([]int, n)\n\tfor i, _ := range a {\n\t\tfmt.Scan(&a[i])\n\t}\n\tsort.Ints(a)\n\n\tsta := make(map[int]int, a[len(a)-1]+1)\n\tfor _, v := range a {\n\t\tfor i := 1; i <= a[len(a)-1]; i++ {\n\t\t\tif i%v == 0 {\n\t\t\t\tsta[i]++\n\t\t\t}\n\t\t}\n\t}\n\n\tans := 0\n\tfor _, v := range a {\n\t\tif sta[v] == 1 {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1592777337, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02642.html", "problem_id": "p02642", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02642/input.txt", "sample_output_relpath": "derived/input_output/data/p02642/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02642/Go/s571096596.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s571096596", "user_id": "u370270364"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\ta := make([]int, n)\n\tfor i, _ := range a {\n\t\tfmt.Scan(&a[i])\n\t}\n\tsort.Ints(a)\n\n\tsta := make(map[int]int, a[len(a)-1]+1)\n\tfor _, v := range a {\n\t\tfor i := 1; i <= a[len(a)-1]; i++ {\n\t\t\tif i%v == 0 {\n\t\t\t\tsta[i]++\n\t\t\t}\n\t\t}\n\t}\n\n\tans := 0\n\tfor _, v := range a {\n\t\tif sta[v] == 1 {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "sample_input": "5\n24 11 8 3 16\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02642", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2207, "memory_kb": 46872}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s615763662", "group_id": "codeNet:p02642", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tarr := scanNums(1)\n\tN := arr[0]\n\tAs := scanNums(N)\n\tif N == 0 {\n\t\tfmt.Print(0)\n\t\treturn\n\t}\n\tMySort(As)\n\tmax := As[len(As)-1]\n\tdpTable := make([]int, max+1)\n\tprev := 0\n\tfor _, el := range As {\n\t\tdpTable[el]++\n\t\tif prev == el {\n\t\t\tcontinue\n\t\t}\n\t\tif dpTable[el] > 0 {\n\t\t\tcontinue\n\t\t}\n\t\tfor i := 2 * el; i <= max; el += el {\n\t\t\tdpTable[i]++\n\t\t}\n\t}\n\tcount := 0\n\tfor _, el := range As {\n\t\tif dpTable[el] == 1 {\n\t\t\tcount++\n\t\t}\n\t}\n\tfmt.Print(count)\n}\nfunc MySort(a []int) {\n\tsort.Slice(a, func(i, j int) bool { return a[i] < a[j] })\n\n}\nfunc Abs(i int) int {\n\tif i < 0 {\n\t\treturn -1 * i\n\t}\n\treturn i\n}\nfunc Min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc CalcNum(tate int, yoko int, A int, B int, dp *map[[2]int]int) int {\n\tif (*dp)[[2]int{tate, yoko}] != 0 {\n\t\treturn (*dp)[[2]int{tate, yoko}]\n\t}\n\treturn yoko*CalcNum(tate-1, yoko, A, B, dp) + tate*CalcNum(tate, yoko-1, A, B, dp)\n}\nfunc scanNums(len int) (nums []int) {\n\tvar num int\n\tfor i := 0; i < len; i++ {\n\t\tfmt.Scan(&num)\n\t\tnums = append(nums, num)\n\t}\n\treturn\n}\n", "language": "Go", "metadata": {"date": 1592770116, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02642.html", "problem_id": "p02642", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02642/input.txt", "sample_output_relpath": "derived/input_output/data/p02642/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02642/Go/s615763662.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s615763662", "user_id": "u757474247"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tarr := scanNums(1)\n\tN := arr[0]\n\tAs := scanNums(N)\n\tif N == 0 {\n\t\tfmt.Print(0)\n\t\treturn\n\t}\n\tMySort(As)\n\tmax := As[len(As)-1]\n\tdpTable := make([]int, max+1)\n\tprev := 0\n\tfor _, el := range As {\n\t\tdpTable[el]++\n\t\tif prev == el {\n\t\t\tcontinue\n\t\t}\n\t\tif dpTable[el] > 0 {\n\t\t\tcontinue\n\t\t}\n\t\tfor i := 2 * el; i <= max; el += el {\n\t\t\tdpTable[i]++\n\t\t}\n\t}\n\tcount := 0\n\tfor _, el := range As {\n\t\tif dpTable[el] == 1 {\n\t\t\tcount++\n\t\t}\n\t}\n\tfmt.Print(count)\n}\nfunc MySort(a []int) {\n\tsort.Slice(a, func(i, j int) bool { return a[i] < a[j] })\n\n}\nfunc Abs(i int) int {\n\tif i < 0 {\n\t\treturn -1 * i\n\t}\n\treturn i\n}\nfunc Min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc CalcNum(tate int, yoko int, A int, B int, dp *map[[2]int]int) int {\n\tif (*dp)[[2]int{tate, yoko}] != 0 {\n\t\treturn (*dp)[[2]int{tate, yoko}]\n\t}\n\treturn yoko*CalcNum(tate-1, yoko, A, B, dp) + tate*CalcNum(tate, yoko-1, A, B, dp)\n}\nfunc scanNums(len int) (nums []int) {\n\tvar num int\n\tfor i := 0; i < len; i++ {\n\t\tfmt.Scan(&num)\n\t\tnums = append(nums, num)\n\t}\n\treturn\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "sample_input": "5\n24 11 8 3 16\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02642", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1145, "cpu_time_ms": 1313, "memory_kb": 16912}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s159708946", "group_id": "codeNet:p02642", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tarr := scanNums(1)\n\tN := arr[0]\n\tAs := scanNums(N)\n\tMySort(As)\n\tstack := []int{}\n\tindex := 0\n\tif len(As) == 0 {\n\t\tfmt.Print(0)\n\t\treturn\n\t}\n\tdb := 0\n\tfor {\n\t\tif index >= len(As) {\n\t\t\tbreak\n\t\t}\n\t\tprimer := As[index]\n\t\tstack = As[:index+1]\n\t\ttmp := 0\n\t\tif index+1 <= len(As) && As[index+1] == primer {\n\t\t\tdb++\n\t\t}\n\t\tfor i := index + 1; i < len(As); i++ {\n\t\t\tif As[i]%primer != 0 {\n\t\t\t\tstack = append(stack, As[i])\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\tAs = stack\n\t\tif index >= 1 && primer*As[index-1] > As[len(As)-1] {\n\t\t\tbreak\n\t\t}\n\t\tif tmp > 0 {\n\t\t\ttmp--\n\t\t}\n\t\tindex = index + tmp + 1\n\t}\n\tfmt.Print(len(As) - db)\n}\nfunc MySort(a []int) {\n\tsort.Slice(a, func(i, j int) bool { return a[i] < a[j] })\n\n}\nfunc Abs(i int) int {\n\tif i < 0 {\n\t\treturn -1 * i\n\t}\n\treturn i\n}\nfunc Min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc CalcNum(tate int, yoko int, A int, B int, dp *map[[2]int]int) int {\n\tif (*dp)[[2]int{tate, yoko}] != 0 {\n\t\treturn (*dp)[[2]int{tate, yoko}]\n\t}\n\treturn yoko*CalcNum(tate-1, yoko, A, B, dp) + tate*CalcNum(tate, yoko-1, A, B, dp)\n}\nfunc scanNums(len int) (nums []int) {\n\tvar num int\n\tfor i := 0; i < len; i++ {\n\t\tfmt.Scan(&num)\n\t\tnums = append(nums, num)\n\t}\n\treturn\n}\n", "language": "Go", "metadata": {"date": 1592761603, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02642.html", "problem_id": "p02642", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02642/input.txt", "sample_output_relpath": "derived/input_output/data/p02642/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02642/Go/s159708946.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s159708946", "user_id": "u757474247"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tarr := scanNums(1)\n\tN := arr[0]\n\tAs := scanNums(N)\n\tMySort(As)\n\tstack := []int{}\n\tindex := 0\n\tif len(As) == 0 {\n\t\tfmt.Print(0)\n\t\treturn\n\t}\n\tdb := 0\n\tfor {\n\t\tif index >= len(As) {\n\t\t\tbreak\n\t\t}\n\t\tprimer := As[index]\n\t\tstack = As[:index+1]\n\t\ttmp := 0\n\t\tif index+1 <= len(As) && As[index+1] == primer {\n\t\t\tdb++\n\t\t}\n\t\tfor i := index + 1; i < len(As); i++ {\n\t\t\tif As[i]%primer != 0 {\n\t\t\t\tstack = append(stack, As[i])\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\tAs = stack\n\t\tif index >= 1 && primer*As[index-1] > As[len(As)-1] {\n\t\t\tbreak\n\t\t}\n\t\tif tmp > 0 {\n\t\t\ttmp--\n\t\t}\n\t\tindex = index + tmp + 1\n\t}\n\tfmt.Print(len(As) - db)\n}\nfunc MySort(a []int) {\n\tsort.Slice(a, func(i, j int) bool { return a[i] < a[j] })\n\n}\nfunc Abs(i int) int {\n\tif i < 0 {\n\t\treturn -1 * i\n\t}\n\treturn i\n}\nfunc Min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc CalcNum(tate int, yoko int, A int, B int, dp *map[[2]int]int) int {\n\tif (*dp)[[2]int{tate, yoko}] != 0 {\n\t\treturn (*dp)[[2]int{tate, yoko}]\n\t}\n\treturn yoko*CalcNum(tate-1, yoko, A, B, dp) + tate*CalcNum(tate, yoko-1, A, B, dp)\n}\nfunc scanNums(len int) (nums []int) {\n\tvar num int\n\tfor i := 0; i < len; i++ {\n\t\tfmt.Scan(&num)\n\t\tnums = append(nums, num)\n\t}\n\treturn\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "sample_input": "5\n24 11 8 3 16\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02642", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1301, "cpu_time_ms": 1318, "memory_kb": 9968}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s343654495", "group_id": "codeNet:p02642", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\tsc.Buffer(make([]byte, 0), 1e6) // maxTokenSize\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush()\n\t/* --- code --- */\n\tn := nextInt64()\n\ta := make([]int64, n)\n\tfor i := int64(0); i < n; i++ {\n\t\ta[i] = nextInt64()\n\t}\n\tsort.Slice(a, func(i, j int) bool {\n\t\treturn a[i] < a[j]\n\t})\n\tsum := 1\n\tif a[0] == a[1] {\n\t\tsum--\n\t}\n\tfor i := int64(1); i < n; i++ {\n\t\tcanDivide := false\n\t\tfor j := int64(0); j < i; j++ {\n\t\t\tif a[i]%a[j] == 0 {\n\t\t\t\tcanDivide = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !canDivide {\n\t\t\tsum++\n\t\t}\n\t}\n\tfmt.Println(sum)\n\n}\n\n// -*-*-*-*-*-*-*-*-\n// * I/O utilities *\n// -*-*-*-*-*-*-*-*-\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextInt64() int64 {\n\ta, _ := strconv.ParseInt(next(), 10, 64)\n\treturn a\n}\n\nfunc nextFloat64() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\nfunc nextFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextFloat64()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\nfunc split(s string) []string {\n\tret := make([]string, len([]rune(s)))\n\tfor i, v := range []rune(s) {\n\t\tret[i] = string(v)\n\t}\n\treturn ret\n}\n\n// -*-*-*-*-*-*-*-*-\n// * tool snippets *\n// -*-*-*-*-*-*-*-*-\nfunc duplicate2Int(base [][]int) (ret [][]int) {\n\tret = make([][]int, len(base))\n\tfor i, v := range base {\n\t\tret[i] = append([]int{}, v...)\n\t}\n\treturn\n}\n\nfunc max(a, b int) int {\n\treturn int(max64(int64(a), int64(b)))\n}\n\nfunc max64(a int64, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc min(a, b int) int {\n\treturn int(min64(int64(a), int64(b)))\n}\n\nfunc min64(a int64, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-\n// * math flavor typical theories *\n// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-\nfunc gcd(a, b int) int {\n\tif a > b {\n\t\treturn gcd(b, a)\n\t}\n\tfor a != 0 {\n\t\ta, b = b%a, a\n\t}\n\treturn b\n}\n\nfunc pow(a, b int) (ret int) {\n\tret = a\n\tfor i := 0; i < b-1; i++ {\n\t\tret *= a\n\t}\n\treturn\n}\n\nfunc powMod(n, m, mod int) (ret int) {\n\tret = 1\n\tfor m > 0 {\n\t\tif m&1 == 1 {\n\t\t\tret *= n\n\t\t\tret %= mod\n\t\t}\n\t\tn *= n\n\t\tn %= mod\n\t\tm >>= 1\n\t}\n\treturn ret\n}\n", "language": "Go", "metadata": {"date": 1592673961, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02642.html", "problem_id": "p02642", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02642/input.txt", "sample_output_relpath": "derived/input_output/data/p02642/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02642/Go/s343654495.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s343654495", "user_id": "u532762536"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\tsc.Buffer(make([]byte, 0), 1e6) // maxTokenSize\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush()\n\t/* --- code --- */\n\tn := nextInt64()\n\ta := make([]int64, n)\n\tfor i := int64(0); i < n; i++ {\n\t\ta[i] = nextInt64()\n\t}\n\tsort.Slice(a, func(i, j int) bool {\n\t\treturn a[i] < a[j]\n\t})\n\tsum := 1\n\tif a[0] == a[1] {\n\t\tsum--\n\t}\n\tfor i := int64(1); i < n; i++ {\n\t\tcanDivide := false\n\t\tfor j := int64(0); j < i; j++ {\n\t\t\tif a[i]%a[j] == 0 {\n\t\t\t\tcanDivide = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !canDivide {\n\t\t\tsum++\n\t\t}\n\t}\n\tfmt.Println(sum)\n\n}\n\n// -*-*-*-*-*-*-*-*-\n// * I/O utilities *\n// -*-*-*-*-*-*-*-*-\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextInt64() int64 {\n\ta, _ := strconv.ParseInt(next(), 10, 64)\n\treturn a\n}\n\nfunc nextFloat64() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\nfunc nextFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextFloat64()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\nfunc split(s string) []string {\n\tret := make([]string, len([]rune(s)))\n\tfor i, v := range []rune(s) {\n\t\tret[i] = string(v)\n\t}\n\treturn ret\n}\n\n// -*-*-*-*-*-*-*-*-\n// * tool snippets *\n// -*-*-*-*-*-*-*-*-\nfunc duplicate2Int(base [][]int) (ret [][]int) {\n\tret = make([][]int, len(base))\n\tfor i, v := range base {\n\t\tret[i] = append([]int{}, v...)\n\t}\n\treturn\n}\n\nfunc max(a, b int) int {\n\treturn int(max64(int64(a), int64(b)))\n}\n\nfunc max64(a int64, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc min(a, b int) int {\n\treturn int(min64(int64(a), int64(b)))\n}\n\nfunc min64(a int64, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-\n// * math flavor typical theories *\n// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-\nfunc gcd(a, b int) int {\n\tif a > b {\n\t\treturn gcd(b, a)\n\t}\n\tfor a != 0 {\n\t\ta, b = b%a, a\n\t}\n\treturn b\n}\n\nfunc pow(a, b int) (ret int) {\n\tret = a\n\tfor i := 0; i < b-1; i++ {\n\t\tret *= a\n\t}\n\treturn\n}\n\nfunc powMod(n, m, mod int) (ret int) {\n\tret = 1\n\tfor m > 0 {\n\t\tif m&1 == 1 {\n\t\t\tret *= n\n\t\t\tret %= mod\n\t\t}\n\t\tn *= n\n\t\tn %= mod\n\t\tm >>= 1\n\t}\n\treturn ret\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "sample_input": "5\n24 11 8 3 16\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02642", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2493, "cpu_time_ms": 2205, "memory_kb": 5116}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s645948390", "group_id": "codeNet:p02642", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\ta_lis := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tvar a int\n\t\tfmt.Scan(&a)\n\t\ta_lis[i] = a\n\t}\n\n\tcnt := make([]int, 1e6+5)\n\tfor i := 0; i < N; i++ {\n\t\tx := a_lis[i]\n\t\tif cnt[x] != 0 {\n\t\t\tcnt[x] = 2\n\t\t\tcontinue\n\t\t}\n\t\tfor j := x; j < len(cnt); j += x {\n\t\t\tcnt[j]++\n\t\t}\n\t}\n\tans := 0\n\tfor i := 0; i < N; i++ {\n\t\tif cnt[a_lis[i]] == 1 {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1592593160, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02642.html", "problem_id": "p02642", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02642/input.txt", "sample_output_relpath": "derived/input_output/data/p02642/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02642/Go/s645948390.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s645948390", "user_id": "u828471505"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\ta_lis := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tvar a int\n\t\tfmt.Scan(&a)\n\t\ta_lis[i] = a\n\t}\n\n\tcnt := make([]int, 1e6+5)\n\tfor i := 0; i < N; i++ {\n\t\tx := a_lis[i]\n\t\tif cnt[x] != 0 {\n\t\t\tcnt[x] = 2\n\t\t\tcontinue\n\t\t}\n\t\tfor j := x; j < len(cnt); j += x {\n\t\t\tcnt[j]++\n\t\t}\n\t}\n\tans := 0\n\tfor i := 0; i < N; i++ {\n\t\tif cnt[a_lis[i]] == 1 {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "sample_input": "5\n24 11 8 3 16\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02642", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1318, "memory_kb": 14576}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s203879236", "group_id": "codeNet:p02642", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\n//Util\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc maxInt(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc minInt(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absInt(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc absFloat64(a float64) float64 {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc maxFloat64(a, b float64) float64 {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc minFloat64(a, b float64) float64 {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc str2Int(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc powInt(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc isPrime(x int) bool {\n\tif x == 1 {\n\t\treturn false\n\t}\n\tif x == 2 {\n\t\treturn true\n\t}\n\tif x%2 == 0 {\n\t\treturn false\n\t}\n\n\tb := true\n\trootx := int(math.Sqrt(float64(x)))\n\ti := 3\n\tfor i <= rootx {\n\t\tif x%i == 0 {\n\t\t\tb = false\n\t\t\tbreak\n\t\t}\n\t\ti += 2\n\t}\n\treturn b\n}\n\nfunc PrimeFactors(n int) (pfs []int) {\n\t// Get the number of 2s that divide n\n\tfor n%2 == 0 {\n\t\tpfs = append(pfs, 2)\n\t\tn = n / 2\n\t}\n\n\t// n must be odd at this point. so we can skip one element\n\t// (note i = i + 2)\n\tfor i := 3; i*i <= n; i = i + 2 {\n\t\t// while i divides n, append i and divide n\n\t\tfor n%i == 0 {\n\t\t\tpfs = append(pfs, i)\n\t\t\tn = n / i\n\t\t}\n\t}\n\n\t// This condition is to handle the case when n is a prime number\n\t// greater than 2\n\tif n > 2 {\n\t\tpfs = append(pfs, n)\n\t}\n\n\treturn\n}\n\nfunc sumInts(x []int) int {\n\n\ttotal := 0\n\tfor _, v := range x {\n\t\ttotal += v\n\t}\n\n\treturn total\n}\n\n//Main\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\treturn sc\n\t}()\n)\n\nvar N int\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tN = nextInt()\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = nextInt()\n\t}\n\tsort.Sort(SortBy(A))\n\t//fmt.Println(A)\n\n\tmaxA := A[len(A)-1]\n\t//trueで初期化\n\t//dp[i]=falseのとき、iより小さいiの約数が、Aに存在しない\n\tdp := make([]bool, maxA+1)\n\tans := 0\n\tfor i := 0; i < N-1; i++ {\n\t\tif dp[A[i]] == true {\n\t\t\tcontinue\n\t\t}\n\t\tfor j := 1; j <= maxA/A[i]; j++ {\n\t\t\tdp[j*A[i]] = true\n\t\t}\n\t\tif A[i] != A[i+1] {\n\t\t\tans++\n\t\t}\n\n\t}\n\n\tif dp[maxA] == false {\n\t\tans++\n\t}\n\n\tfmt.Println(ans)\n\n}\n\ntype SortBy []int\n\nfunc (a SortBy) Len() int { return len(a) }\nfunc (a SortBy) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a SortBy) Less(i, j int) bool { return a[i] < a[j] }\n", "language": "Go", "metadata": {"date": 1592287609, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02642.html", "problem_id": "p02642", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02642/input.txt", "sample_output_relpath": "derived/input_output/data/p02642/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02642/Go/s203879236.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s203879236", "user_id": "u432333240"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\n//Util\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc maxInt(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc minInt(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absInt(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc absFloat64(a float64) float64 {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc maxFloat64(a, b float64) float64 {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc minFloat64(a, b float64) float64 {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc str2Int(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc powInt(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc isPrime(x int) bool {\n\tif x == 1 {\n\t\treturn false\n\t}\n\tif x == 2 {\n\t\treturn true\n\t}\n\tif x%2 == 0 {\n\t\treturn false\n\t}\n\n\tb := true\n\trootx := int(math.Sqrt(float64(x)))\n\ti := 3\n\tfor i <= rootx {\n\t\tif x%i == 0 {\n\t\t\tb = false\n\t\t\tbreak\n\t\t}\n\t\ti += 2\n\t}\n\treturn b\n}\n\nfunc PrimeFactors(n int) (pfs []int) {\n\t// Get the number of 2s that divide n\n\tfor n%2 == 0 {\n\t\tpfs = append(pfs, 2)\n\t\tn = n / 2\n\t}\n\n\t// n must be odd at this point. so we can skip one element\n\t// (note i = i + 2)\n\tfor i := 3; i*i <= n; i = i + 2 {\n\t\t// while i divides n, append i and divide n\n\t\tfor n%i == 0 {\n\t\t\tpfs = append(pfs, i)\n\t\t\tn = n / i\n\t\t}\n\t}\n\n\t// This condition is to handle the case when n is a prime number\n\t// greater than 2\n\tif n > 2 {\n\t\tpfs = append(pfs, n)\n\t}\n\n\treturn\n}\n\nfunc sumInts(x []int) int {\n\n\ttotal := 0\n\tfor _, v := range x {\n\t\ttotal += v\n\t}\n\n\treturn total\n}\n\n//Main\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\treturn sc\n\t}()\n)\n\nvar N int\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tN = nextInt()\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = nextInt()\n\t}\n\tsort.Sort(SortBy(A))\n\t//fmt.Println(A)\n\n\tmaxA := A[len(A)-1]\n\t//trueで初期化\n\t//dp[i]=falseのとき、iより小さいiの約数が、Aに存在しない\n\tdp := make([]bool, maxA+1)\n\tans := 0\n\tfor i := 0; i < N-1; i++ {\n\t\tif dp[A[i]] == true {\n\t\t\tcontinue\n\t\t}\n\t\tfor j := 1; j <= maxA/A[i]; j++ {\n\t\t\tdp[j*A[i]] = true\n\t\t}\n\t\tif A[i] != A[i+1] {\n\t\t\tans++\n\t\t}\n\n\t}\n\n\tif dp[maxA] == false {\n\t\tans++\n\t}\n\n\tfmt.Println(ans)\n\n}\n\ntype SortBy []int\n\nfunc (a SortBy) Len() int { return len(a) }\nfunc (a SortBy) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a SortBy) Less(i, j int) bool { return a[i] < a[j] }\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "sample_input": "5\n24 11 8 3 16\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02642", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2946, "cpu_time_ms": 83, "memory_kb": 6148}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s906217035", "group_id": "codeNet:p02642", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\nvar mod = 1000000007\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tvar n int\n\tfmt.Fscan(r, &n)\n\tas := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscan(r, &as[i])\n\t}\n\tsort.Ints(as)\n\n\tmx := as[n-1]\n\tnums := make([]int, mx+1)\n\n\tfor _, v := range as {\n\t\tfor j := v; j <= mx; j = j + v {\n\t\t\tnums[j]++\n\t\t}\n\t}\n\n\tans := 0\n\tfor _, v := range as {\n\t\tif nums[v] == 1 {\n\t\t\tans++\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n\n}\n\n// Union-Find\ntype unionFind struct {\n\td []int\n}\n\nfunc newUnionFind(n int) *unionFind {\n\tuf := new(unionFind)\n\tuf.d = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tuf.d[i] = -1\n\t}\n\treturn uf\n}\n\nfunc (uf *unionFind) find(x int) int {\n\tif uf.d[x] < 0 {\n\t\treturn x\n\t}\n\tuf.d[x] = uf.find(uf.d[x])\n\treturn uf.d[x]\n}\n\nfunc (uf *unionFind) unite(x, y int) bool {\n\trootX := uf.find(x)\n\trootY := uf.find(y)\n\tif rootX == rootY {\n\t\treturn false\n\t}\n\n\tif uf.d[rootX] < uf.d[rootY] {\n\t\tuf.d[rootX] += uf.d[rootY]\n\t\tuf.d[rootY] = rootX\n\t} else {\n\t\tuf.d[rootY] += uf.d[rootX]\n\t\tuf.d[rootX] = rootY\n\t}\n\n\treturn true\n}\n\nfunc (uf *unionFind) same(x, y int) bool {\n\treturn uf.find(x) == uf.find(y)\n}\n\nfunc (uf *unionFind) size(x int) int {\n\treturn -uf.d[uf.find(x)]\n}\n\n// mod\nfunc modpow(a, n, mod int) int {\n\tres := 1\n\tfor n > 0 {\n\t\tif n%2 != 0 {\n\t\t\tres = res * a % mod\n\t\t}\n\t\ta = a * a % mod\n\t\tn = n / 2\n\t}\n\treturn res\n}\n\nfunc modinv(n, mod int) int {\n\treturn modpow(n, mod-2, mod)\n}\n\nfunc modcomb(n, a, mod int) int {\n\tx := 1\n\ty := 1\n\tfor i := 0; i < a; i++ {\n\t\tx = x * (n - i)\n\t\tx %= mod\n\t\ty = y * (i + 1)\n\t\ty %= mod\n\t}\n\treturn x * modpow(y, mod-2, mod) % mod\n}\n\nfunc modfactorial(n, mod int) int {\n\tresult := 1\n\tfor i := 1; i <= n; i++ {\n\t\tresult = (result * i) % mod\n\t}\n\treturn result\n}\n\n// Combination ...\ntype Combination struct {\n\tfacts, invs []int\n\tmod int\n}\n\n// NewCombination ...\nfunc NewCombination(n, mod int) Combination {\n\treturn Combination{\n\t\tfacts: make([]int, n+1),\n\t\tinvs: make([]int, n+1),\n\t\tmod: mod,\n\t}\n}\n\nfunc (cmb *Combination) calc(n, k int) int {\n\tret := cmb.facts[n] * cmb.invs[k]\n\tret %= cmb.mod\n\tret = ret * cmb.invs[n-k]\n\tret %= cmb.mod\n\treturn ret\n}\n\nfunc (cmb *Combination) init(n int) {\n\tcmb.facts[0] = 1\n\t// 階乗を算出\n\tfor i := 1; i <= n; i++ {\n\t\tcmb.facts[i] = cmb.facts[i-1] * i % cmb.mod\n\t}\n\t// 逆元を算出\n\tcmb.invs[n] = modinv(cmb.facts[n], cmb.mod)\n\tfor i := n - 1; i >= 0; i-- {\n\t\tcmb.invs[i] = cmb.invs[i+1] * (i + 1) % cmb.mod\n\t}\n}\n\n// Utility\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc primeFactor(x int) map[int]int {\n\tres := make(map[int]int)\n\tfor i := 2; i*i <= x; i++ {\n\t\tfor x%i == 0 {\n\t\t\tres[i]++\n\t\t\tx = x / i\n\t\t}\n\t}\n\tif x != 1 {\n\t\tres[x] = 1\n\t}\n\treturn res\n}\n\nfunc divisor(x int) []int {\n\tres := make([]int, 0)\n\tfor i := 1; i*i <= x; i++ {\n\t\tif x%i == 0 {\n\t\t\tres = append(res, i)\n\t\t\tif i != x/i {\n\t\t\t\tres = append(res, x/i)\n\t\t\t}\n\t\t}\n\t}\n\treturn res\n}\n\nfunc gcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t}\n\treturn gcd(y, x%y)\n}\n\nfunc lcm(x, y int) int {\n\treturn x / gcd(x, y) * y\n}\n\nfunc reverseString(s string) string {\n\tr := []rune(s)\n\tfor i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {\n\t\tr[i], r[j] = r[j], r[i]\n\t}\n\treturn string(r)\n}\n\nfunc pow(a, n int) int {\n\tret := 1\n\tfor i := 1; i <= n; i++ {\n\t\tret *= a\n\t}\n\treturn ret\n}\n\n// Queue ...\ntype Queue []int\n\n// pop ...\nfunc (q *Queue) empty() bool {\n\treturn len(*q) == 0\n}\n\n// push ...\nfunc (q *Queue) push(i int) {\n\t*q = append(*q, i)\n}\n\n// pop ...\nfunc (q *Queue) pop() (int, bool) {\n\tif q.empty() {\n\t\treturn 0, false\n\t} else {\n\t\tres := (*q)[0]\n\t\t*q = (*q)[1:]\n\t\treturn res, true\n\t}\n}\n\n// Stack ...\ntype Stack []int\n\n// pop ...\nfunc (s *Stack) empty() bool {\n\treturn len(*s) == 0\n}\n\n// push ...\nfunc (s *Stack) push(i int) {\n\t*s = append(*s, i)\n}\n\n// pop ...\nfunc (s *Stack) pop() (int, bool) {\n\tif s.empty() {\n\t\treturn 0, false\n\t} else {\n\t\tindex := len(*s) - 1\n\t\tres := (*s)[index]\n\t\t*s = (*s)[:index]\n\t\treturn res, true\n\t}\n}\n\n// priority_queue\ntype intHeap []int\n\nfunc (h intHeap) Len() int { return len(h) }\nfunc (h intHeap) Less(i, j int) bool { return h[i] > h[j] }\nfunc (h intHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\n// sortable points\ntype point struct {\n\tx int\n\ty int\n}\n\ntype points []point\n\nfunc (p points) Len() int {\n\treturn len(p)\n}\n\nfunc (p points) Less(i, j int) bool {\n\treturn p[i].x < p[j].x\n}\n\nfunc (p points) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n", "language": "Go", "metadata": {"date": 1592266232, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02642.html", "problem_id": "p02642", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02642/input.txt", "sample_output_relpath": "derived/input_output/data/p02642/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02642/Go/s906217035.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s906217035", "user_id": "u433254839"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\nvar mod = 1000000007\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tvar n int\n\tfmt.Fscan(r, &n)\n\tas := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscan(r, &as[i])\n\t}\n\tsort.Ints(as)\n\n\tmx := as[n-1]\n\tnums := make([]int, mx+1)\n\n\tfor _, v := range as {\n\t\tfor j := v; j <= mx; j = j + v {\n\t\t\tnums[j]++\n\t\t}\n\t}\n\n\tans := 0\n\tfor _, v := range as {\n\t\tif nums[v] == 1 {\n\t\t\tans++\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n\n}\n\n// Union-Find\ntype unionFind struct {\n\td []int\n}\n\nfunc newUnionFind(n int) *unionFind {\n\tuf := new(unionFind)\n\tuf.d = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tuf.d[i] = -1\n\t}\n\treturn uf\n}\n\nfunc (uf *unionFind) find(x int) int {\n\tif uf.d[x] < 0 {\n\t\treturn x\n\t}\n\tuf.d[x] = uf.find(uf.d[x])\n\treturn uf.d[x]\n}\n\nfunc (uf *unionFind) unite(x, y int) bool {\n\trootX := uf.find(x)\n\trootY := uf.find(y)\n\tif rootX == rootY {\n\t\treturn false\n\t}\n\n\tif uf.d[rootX] < uf.d[rootY] {\n\t\tuf.d[rootX] += uf.d[rootY]\n\t\tuf.d[rootY] = rootX\n\t} else {\n\t\tuf.d[rootY] += uf.d[rootX]\n\t\tuf.d[rootX] = rootY\n\t}\n\n\treturn true\n}\n\nfunc (uf *unionFind) same(x, y int) bool {\n\treturn uf.find(x) == uf.find(y)\n}\n\nfunc (uf *unionFind) size(x int) int {\n\treturn -uf.d[uf.find(x)]\n}\n\n// mod\nfunc modpow(a, n, mod int) int {\n\tres := 1\n\tfor n > 0 {\n\t\tif n%2 != 0 {\n\t\t\tres = res * a % mod\n\t\t}\n\t\ta = a * a % mod\n\t\tn = n / 2\n\t}\n\treturn res\n}\n\nfunc modinv(n, mod int) int {\n\treturn modpow(n, mod-2, mod)\n}\n\nfunc modcomb(n, a, mod int) int {\n\tx := 1\n\ty := 1\n\tfor i := 0; i < a; i++ {\n\t\tx = x * (n - i)\n\t\tx %= mod\n\t\ty = y * (i + 1)\n\t\ty %= mod\n\t}\n\treturn x * modpow(y, mod-2, mod) % mod\n}\n\nfunc modfactorial(n, mod int) int {\n\tresult := 1\n\tfor i := 1; i <= n; i++ {\n\t\tresult = (result * i) % mod\n\t}\n\treturn result\n}\n\n// Combination ...\ntype Combination struct {\n\tfacts, invs []int\n\tmod int\n}\n\n// NewCombination ...\nfunc NewCombination(n, mod int) Combination {\n\treturn Combination{\n\t\tfacts: make([]int, n+1),\n\t\tinvs: make([]int, n+1),\n\t\tmod: mod,\n\t}\n}\n\nfunc (cmb *Combination) calc(n, k int) int {\n\tret := cmb.facts[n] * cmb.invs[k]\n\tret %= cmb.mod\n\tret = ret * cmb.invs[n-k]\n\tret %= cmb.mod\n\treturn ret\n}\n\nfunc (cmb *Combination) init(n int) {\n\tcmb.facts[0] = 1\n\t// 階乗を算出\n\tfor i := 1; i <= n; i++ {\n\t\tcmb.facts[i] = cmb.facts[i-1] * i % cmb.mod\n\t}\n\t// 逆元を算出\n\tcmb.invs[n] = modinv(cmb.facts[n], cmb.mod)\n\tfor i := n - 1; i >= 0; i-- {\n\t\tcmb.invs[i] = cmb.invs[i+1] * (i + 1) % cmb.mod\n\t}\n}\n\n// Utility\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc primeFactor(x int) map[int]int {\n\tres := make(map[int]int)\n\tfor i := 2; i*i <= x; i++ {\n\t\tfor x%i == 0 {\n\t\t\tres[i]++\n\t\t\tx = x / i\n\t\t}\n\t}\n\tif x != 1 {\n\t\tres[x] = 1\n\t}\n\treturn res\n}\n\nfunc divisor(x int) []int {\n\tres := make([]int, 0)\n\tfor i := 1; i*i <= x; i++ {\n\t\tif x%i == 0 {\n\t\t\tres = append(res, i)\n\t\t\tif i != x/i {\n\t\t\t\tres = append(res, x/i)\n\t\t\t}\n\t\t}\n\t}\n\treturn res\n}\n\nfunc gcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t}\n\treturn gcd(y, x%y)\n}\n\nfunc lcm(x, y int) int {\n\treturn x / gcd(x, y) * y\n}\n\nfunc reverseString(s string) string {\n\tr := []rune(s)\n\tfor i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {\n\t\tr[i], r[j] = r[j], r[i]\n\t}\n\treturn string(r)\n}\n\nfunc pow(a, n int) int {\n\tret := 1\n\tfor i := 1; i <= n; i++ {\n\t\tret *= a\n\t}\n\treturn ret\n}\n\n// Queue ...\ntype Queue []int\n\n// pop ...\nfunc (q *Queue) empty() bool {\n\treturn len(*q) == 0\n}\n\n// push ...\nfunc (q *Queue) push(i int) {\n\t*q = append(*q, i)\n}\n\n// pop ...\nfunc (q *Queue) pop() (int, bool) {\n\tif q.empty() {\n\t\treturn 0, false\n\t} else {\n\t\tres := (*q)[0]\n\t\t*q = (*q)[1:]\n\t\treturn res, true\n\t}\n}\n\n// Stack ...\ntype Stack []int\n\n// pop ...\nfunc (s *Stack) empty() bool {\n\treturn len(*s) == 0\n}\n\n// push ...\nfunc (s *Stack) push(i int) {\n\t*s = append(*s, i)\n}\n\n// pop ...\nfunc (s *Stack) pop() (int, bool) {\n\tif s.empty() {\n\t\treturn 0, false\n\t} else {\n\t\tindex := len(*s) - 1\n\t\tres := (*s)[index]\n\t\t*s = (*s)[:index]\n\t\treturn res, true\n\t}\n}\n\n// priority_queue\ntype intHeap []int\n\nfunc (h intHeap) Len() int { return len(h) }\nfunc (h intHeap) Less(i, j int) bool { return h[i] > h[j] }\nfunc (h intHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\n// sortable points\ntype point struct {\n\tx int\n\ty int\n}\n\ntype points []point\n\nfunc (p points) Len() int {\n\treturn len(p)\n}\n\nfunc (p points) Less(i, j int) bool {\n\treturn p[i].x < p[j].x\n}\n\nfunc (p points) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "sample_input": "5\n24 11 8 3 16\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02642", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4692, "cpu_time_ms": 160, "memory_kb": 13268}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s066441793", "group_id": "codeNet:p02642", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\n\ta := make([]int, n)\n\tvar au []int\n\tvar ad []int\n\tfor i := 0; i < n; i++ {\n\t\tai := nextInt()\n\t\tif !contain(au, ai) {\n\t\t\tau = append(au, ai)\n\t\t} else {\n\t\t\tad = append(ad, ai)\n\t\t}\n\t\ta[i] = ai\n\t}\n\tsort.Slice(a, func(i, j int) bool { return a[i] < a[j] })\n\tsort.Slice(au, func(i, j int) bool { return au[i] < au[j] })\n\n\tmax := au[len(au)-1]\n\tsieve := make([]bool, max)\n\n\tfor k, _ := range sieve {\n\t\tsieve[k] = true\n\t}\n\n\tfor _, a := range au {\n\t\tsieve = knit(sieve, a, max)\n\t}\n\n\tr := 0\n\tfor _, ai := range a {\n\t\tif contain(ad, ai) {\n\t\t\tcontinue\n\t\t}\n\t\tif sieve[ai-1] == false {\n\t\t\tcontinue\n\t\t}\n\t\tr++\n\t}\n\n\tfmt.Println(r)\n}\n\nfunc knit(sieve []bool, n int, max int) []bool {\n\ti := 2\n\tt := n * 2\n\tfor t < max {\n\t\tif sieve[t-1] == false {\n\t\t\treturn sieve\n\t\t}\n\t\tsieve[t-1] = false\n\t\ti++\n\t\tt = n * i\n\t}\n\n\treturn sieve\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc contain(h []int, n int) bool {\n\tfor _, v := range h {\n\t\tif n == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n", "language": "Go", "metadata": {"date": 1592259472, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02642.html", "problem_id": "p02642", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02642/input.txt", "sample_output_relpath": "derived/input_output/data/p02642/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02642/Go/s066441793.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s066441793", "user_id": "u137939942"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\n\ta := make([]int, n)\n\tvar au []int\n\tvar ad []int\n\tfor i := 0; i < n; i++ {\n\t\tai := nextInt()\n\t\tif !contain(au, ai) {\n\t\t\tau = append(au, ai)\n\t\t} else {\n\t\t\tad = append(ad, ai)\n\t\t}\n\t\ta[i] = ai\n\t}\n\tsort.Slice(a, func(i, j int) bool { return a[i] < a[j] })\n\tsort.Slice(au, func(i, j int) bool { return au[i] < au[j] })\n\n\tmax := au[len(au)-1]\n\tsieve := make([]bool, max)\n\n\tfor k, _ := range sieve {\n\t\tsieve[k] = true\n\t}\n\n\tfor _, a := range au {\n\t\tsieve = knit(sieve, a, max)\n\t}\n\n\tr := 0\n\tfor _, ai := range a {\n\t\tif contain(ad, ai) {\n\t\t\tcontinue\n\t\t}\n\t\tif sieve[ai-1] == false {\n\t\t\tcontinue\n\t\t}\n\t\tr++\n\t}\n\n\tfmt.Println(r)\n}\n\nfunc knit(sieve []bool, n int, max int) []bool {\n\ti := 2\n\tt := n * 2\n\tfor t < max {\n\t\tif sieve[t-1] == false {\n\t\t\treturn sieve\n\t\t}\n\t\tsieve[t-1] = false\n\t\ti++\n\t\tt = n * i\n\t}\n\n\treturn sieve\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc contain(h []int, n int) bool {\n\tfor _, v := range h {\n\t\tif n == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "sample_input": "5\n24 11 8 3 16\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02642", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1188, "cpu_time_ms": 2210, "memory_kb": 11592}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s226539365", "group_id": "codeNet:p02642", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc newScanner() *bufio.Scanner {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\treturn scanner\n}\n\nvar sc = newScanner()\n\nfunc scanInt() int {\n\tsc.Scan()\n\tv, _ := strconv.Atoi(sc.Text())\n\treturn v\n}\n\nfunc scanInts(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = scanInt()\n\t}\n\treturn a\n}\n\nfunc scanString() string {\n\tif sc.Scan() {\n\t\treturn sc.Text()\n\t}\n\tpanic(sc.Err())\n}\n\nfunc main() {\n\tn := scanInt()\n\ta := scanInts(n)\n\tanswer := notDivisible(n, a)\n\tfmt.Println(answer)\n}\n\nfunc debug(a ...interface{}) {\n\t// fmt.Println(a...)\n}\n\nfunc notDivisible(n int, a []int) int {\n\tsort.Ints(a)\n\tprev := -1\n\tmaxA := a[n-1]\n\tdivisors := make([]int, maxA+1)\n\tfor i := 0; i < n; i++ {\n\t\tif prev == a[i] {\n\t\t\tcontinue\n\t\t}\n\t\tfor j := 1; a[i]*j <= maxA; j++ {\n\t\t\tdivisors[a[i]*j]++\n\t\t}\n\t}\n\tdebug(divisors)\n\tcount := 0\n\tfor i := 0; i < n; i++ {\n\t\tif divisors[a[i]] == 1 {\n\t\t\tcount++\n\t\t}\n\t}\n\treturn count\n}\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n", "language": "Go", "metadata": {"date": 1592224777, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02642.html", "problem_id": "p02642", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02642/input.txt", "sample_output_relpath": "derived/input_output/data/p02642/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02642/Go/s226539365.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s226539365", "user_id": "u238461782"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc newScanner() *bufio.Scanner {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\treturn scanner\n}\n\nvar sc = newScanner()\n\nfunc scanInt() int {\n\tsc.Scan()\n\tv, _ := strconv.Atoi(sc.Text())\n\treturn v\n}\n\nfunc scanInts(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = scanInt()\n\t}\n\treturn a\n}\n\nfunc scanString() string {\n\tif sc.Scan() {\n\t\treturn sc.Text()\n\t}\n\tpanic(sc.Err())\n}\n\nfunc main() {\n\tn := scanInt()\n\ta := scanInts(n)\n\tanswer := notDivisible(n, a)\n\tfmt.Println(answer)\n}\n\nfunc debug(a ...interface{}) {\n\t// fmt.Println(a...)\n}\n\nfunc notDivisible(n int, a []int) int {\n\tsort.Ints(a)\n\tprev := -1\n\tmaxA := a[n-1]\n\tdivisors := make([]int, maxA+1)\n\tfor i := 0; i < n; i++ {\n\t\tif prev == a[i] {\n\t\t\tcontinue\n\t\t}\n\t\tfor j := 1; a[i]*j <= maxA; j++ {\n\t\t\tdivisors[a[i]*j]++\n\t\t}\n\t}\n\tdebug(divisors)\n\tcount := 0\n\tfor i := 0; i < n; i++ {\n\t\tif divisors[a[i]] == 1 {\n\t\t\tcount++\n\t\t}\n\t}\n\treturn count\n}\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "sample_input": "5\n24 11 8 3 16\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02642", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1069, "cpu_time_ms": 80, "memory_kb": 13184}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s659451604", "group_id": "codeNet:p02642", "input_text": "// ソートすると、自分より小さいやつだけが対象となる\n// 自分iを割り切るjがいたとき、jはiの約数のどれかである\n// エラトステネス的に考えると、min(A)~max(A)までのすべてをA[i]の倍数で埋めていく感じになる?\n// 1を含む場合・同じのを複数含む場合みたいな探索上しんどそうなやつは省く(ほかなんかある?)\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\tbuf := make([]byte, 1024*1024)\n\tsc.Buffer(buf, bufio.MaxScanTokenSize)\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush()\n\tN := nextInt()\n\tpreA := nextInts(N)\n\tDistinct := make(map[int]bool)\n\tA := []int{}\n\tT := make([]bool, int(1e6+1))\n\tsort.Ints(A)\n\tfor _, a := range preA {\n\t\tif !Distinct[a] {\n\t\t\tDistinct[a] = true\n\t\t\tA = append(A, a)\n\t\t} else {\n\t\t\t// 同じのがあったらそれは駄目\n\t\t\tT[a] = true\n\t\t}\n\t}\n\tif A[0] == 1 {\n\t\tfmt.Println(1)\n\t\treturn\n\t}\n\tfor _, a := range A {\n\t\tfor x := a * 2; x <= int(1e6+1); x += a {\n\t\t\tT[x] = true\n\t\t}\n\t}\n\tans := 0\n\tfor _, a := range A {\n\t\tif T[a] == false {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Fprintln(out, ans)\n}\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}", "language": "Go", "metadata": {"date": 1592204881, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02642.html", "problem_id": "p02642", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02642/input.txt", "sample_output_relpath": "derived/input_output/data/p02642/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02642/Go/s659451604.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s659451604", "user_id": "u445624660"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "// ソートすると、自分より小さいやつだけが対象となる\n// 自分iを割り切るjがいたとき、jはiの約数のどれかである\n// エラトステネス的に考えると、min(A)~max(A)までのすべてをA[i]の倍数で埋めていく感じになる?\n// 1を含む場合・同じのを複数含む場合みたいな探索上しんどそうなやつは省く(ほかなんかある?)\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\tbuf := make([]byte, 1024*1024)\n\tsc.Buffer(buf, bufio.MaxScanTokenSize)\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush()\n\tN := nextInt()\n\tpreA := nextInts(N)\n\tDistinct := make(map[int]bool)\n\tA := []int{}\n\tT := make([]bool, int(1e6+1))\n\tsort.Ints(A)\n\tfor _, a := range preA {\n\t\tif !Distinct[a] {\n\t\t\tDistinct[a] = true\n\t\t\tA = append(A, a)\n\t\t} else {\n\t\t\t// 同じのがあったらそれは駄目\n\t\t\tT[a] = true\n\t\t}\n\t}\n\tif A[0] == 1 {\n\t\tfmt.Println(1)\n\t\treturn\n\t}\n\tfor _, a := range A {\n\t\tfor x := a * 2; x <= int(1e6+1); x += a {\n\t\t\tT[x] = true\n\t\t}\n\t}\n\tans := 0\n\tfor _, a := range A {\n\t\tif T[a] == false {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Fprintln(out, ans)\n}\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "sample_input": "5\n24 11 8 3 16\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02642", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1453, "cpu_time_ms": 67, "memory_kb": 17460}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s526450774", "group_id": "codeNet:p02642", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\ta := make([]int, n)\n\tfor i:= 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\tsort.Ints(a)\n\tm := int(1e6+10)\n\tcnt := make([]int, m)\n\tfor _,x := range a {\n\t\tif cnt[x] != 0 {\n\t\t\tcnt[x] = 2\n\t\t\tcontinue\n\t\t}\n\t\tfor i := x; i v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc sum(i []int64) int64 {\n\tsum := int64(0)\n\tfor _, val := range i {\n\t\tsum += val\n\t}\n\treturn sum\n}\n\nfunc split(s string) []string {\n\treturn strings.Fields(s)\n}\n\nfunc strAry2intAry(strs []string) []int64 {\n\tvar ret = make([]int64, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal = s2i(str)\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int64) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = i2s(num)\n\t\tret = append(ret, strVal)\n\t}\n\treturn ret\n}\n\nfunc ary2str(strs []string) string {\n\treturn strings.Join(strs, \" \")\n}\n\nfunc reverse(res []int64) []int64 {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\nfunc reverseStr(res []string) []string {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\n\nfunc ini(res []int, init int) {\n\tif len(res) == 0 {\n\t\treturn\n\t}\n\tres[0] = init\n\tfor i := 0; i < len(res); i++ {\n\t\tcopy(res[i:], res[:i])\n\t}\n}\n\n//\n// func regexpExample() {\n// // Your code here!\n// var str = \"13:20\"\n// r := regexp.MustCompile(`(\\d+):(\\d+)`)\n// fmt.Println(r.FindStringSubmatch(str))\n// }\n\n// type Country struct {\n// gold int\n// silver int\n// blonze int\n// }\n\n// // 複数ソートのサンプル\n// func stableSortExample() []Country{\n// var country = []Country {\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:3, blonze:2},\n// {gold:1, silver:3, blonze:3},\n// }\n// sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })\n// return country\n// }\n", "language": "Go", "metadata": {"date": 1592199229, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02642.html", "problem_id": "p02642", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02642/input.txt", "sample_output_relpath": "derived/input_output/data/p02642/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02642/Go/s050748321.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s050748321", "user_id": "u967669872"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\n/* sort */\ntype pair struct {\n\tindex int64\n\tp1, p2 interface{}\n}\ntype pairs []pair\n\nfunc (slice pairs) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice pairs) Less(i, j int) bool {\n\treturn slice[i].index < slice[j].index\n}\n\nfunc (slice pairs) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\n\n/* sort */\ntype Int64Slice []int64\n\nfunc (slice Int64Slice) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice Int64Slice) Less(i, j int) bool {\n\treturn slice[i] < slice[j]\n}\n\nfunc (slice Int64Slice) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\nfunc Int64s(a []int64) { sort.Sort(Int64Slice(a)) }\nfunc Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n\tINF = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tdi = []int64{-1, 0, 1, 0}\n\tdj = []int64{0, -1, 0, 1}\n\tdi8 = []int64{-1, -1, 0, 1, 1, 1, 0, -1}\n\tdj8 = []int64{0, -1, -1, -1, 0, 1, 1, 1}\n)\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tscanner.Buffer(buf, maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tN := readInt()\n\tA := make([]int64, N)\n\tfor i := int64(0); i < N; i++ {\n\t\tA[i] = readInt()\n\t}\n\tvar ans int64\n\tInt64s(A)\n\td := solve(1e6, A)\n\tfor i := 0; i < len(A); i++ {\n\t\tif d[A[i]] == 1 {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\n/** エラトステネスの篩より解を求める。 計算量: O(n) */\nfunc solve(N int64, numbers []int64) []int64 {\n\tdata := make([]int64, N+1)\n\tdata[0] = 0\n\n\tfor pointer := 0; pointer < len(numbers); pointer++ {\n\t\tm := numbers[pointer]\n\t\tif data[m] != 0 {\n\t\t\tdata[m] = 2\n\t\t\tcontinue\n\t\t}\n\t\tfor i := m; i <= N; i += m {\n\t\t\tdata[i]++\n\t\t}\n\t}\n\treturn data\n}\n\n/*==========================================\n * Library\n *==========================================*/\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\nfunc doubleAry(h int64, w int64, init int64) (res [][]int64) {\n\tres = make([][]int64, h)\n\tfor i := int64(0); i < h; i++ {\n\t\tres[i] = make([]int64, w)\n\t\tfor j := int64(0); j < w; j++ {\n\t\t\tres[i][j] = init\n\t\t}\n\t}\n\treturn\n}\n\nfunc aryEq(a []int64, b []int64) bool {\n\treturn reflect.DeepEqual(a, b)\n}\n\nfunc clone(n []int64) (r []int64) {\n\tr = make([]int64, len(n))\n\tfor i := 0; i < len(n); i++ {\n\t\tr[i] = n[i]\n\t}\n\treturn\n}\nfunc write(s string) {\n\twriter.WriteString(s)\n}\n\nfunc print() {\n\twriter.Flush()\n}\n\n// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可\nfunc readLine() (s string) {\n\tif scanner.Scan() {\n\t\ts = scanner.Text()\n\t}\n\treturn s\n}\n\nfunc readInt() (read int64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseInt(scanner.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readFloat() (read float64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readRunes() (read []rune) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, v)\n\t}\n\treturn\n}\n\nfunc readString() (read string) {\n\tscanner.Scan()\n\tread = scanner.Text()\n\treturn\n}\n\nfunc readStrings() (read []string) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, string(v))\n\t}\n\treturn\n}\n\nfunc s2i(s string) int64 {\n\tvar intVal, e = strconv.ParseInt(s, 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int64) string {\n\tvar strVal = strconv.FormatInt(i, 10)\n\treturn strVal\n}\n\nfunc s2f(s string) float64 {\n\tvar floatVal, e = strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn floatVal\n}\n\nfunc abs(i int64) int64 {\n\treturn int64(math.Abs(float64(i)))\n}\n\nfunc max(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans < v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\nfunc min(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans > v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc sum(i []int64) int64 {\n\tsum := int64(0)\n\tfor _, val := range i {\n\t\tsum += val\n\t}\n\treturn sum\n}\n\nfunc split(s string) []string {\n\treturn strings.Fields(s)\n}\n\nfunc strAry2intAry(strs []string) []int64 {\n\tvar ret = make([]int64, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal = s2i(str)\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int64) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = i2s(num)\n\t\tret = append(ret, strVal)\n\t}\n\treturn ret\n}\n\nfunc ary2str(strs []string) string {\n\treturn strings.Join(strs, \" \")\n}\n\nfunc reverse(res []int64) []int64 {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\nfunc reverseStr(res []string) []string {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\n\nfunc ini(res []int, init int) {\n\tif len(res) == 0 {\n\t\treturn\n\t}\n\tres[0] = init\n\tfor i := 0; i < len(res); i++ {\n\t\tcopy(res[i:], res[:i])\n\t}\n}\n\n//\n// func regexpExample() {\n// // Your code here!\n// var str = \"13:20\"\n// r := regexp.MustCompile(`(\\d+):(\\d+)`)\n// fmt.Println(r.FindStringSubmatch(str))\n// }\n\n// type Country struct {\n// gold int\n// silver int\n// blonze int\n// }\n\n// // 複数ソートのサンプル\n// func stableSortExample() []Country{\n// var country = []Country {\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:3, blonze:2},\n// {gold:1, silver:3, blonze:3},\n// }\n// sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })\n// return country\n// }\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "sample_input": "5\n24 11 8 3 16\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02642", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6149, "cpu_time_ms": 82, "memory_kb": 13204}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s977333505", "group_id": "codeNet:p02642", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewReaderSize(os.Stdin, 1024*1024*10)\n\nfunc main() {\n\tN := getStdinInt64()\n\tA := getStdinIntArr64()\n\tvar i int64 = 0\n\t//var j int64 = 0\n\t//var cnt int64 = 0\n\tvar max int64 = 0\n\n\t// 最大値を求める\n\tfor i = 0; i < N; i++ {\n\t\tif A[i] > max {\n\t\t\tmax = A[i]\n\t\t}\n\t}\n\n\t// 素数を求める\n\tisPrime := make([]bool, max+1)\n\tfor i := 2; i < len(isPrime); i++ {\n\t\tisPrime[i] = true\n\t}\n\tisPrime[0] = false\n\tisPrime[1] = false\n\tfor i := 2; i < len(isPrime); i++ {\n\t\tif isPrime[i] {\n\t\t\tfor j := i * 2; j < len(isPrime); j += i {\n\t\t\t\tisPrime[j] = false\n\t\t\t}\n\t\t}\n\t}\n\n\t// 個数\n\tcountMap := make(map[int64]int64)\n\tfor _, a := range A {\n\t\tcountMap[a]++\n\t}\n\n\t// 1が1個、または1が2個以上の場合\n\tif countMap[1] == 1 {\n\t\t// x % 1 == 0のみ\n\t\tfmt.Printf(\"%d\\n\", 1)\n\t\treturn\n\t}\n\tif countMap[1] >= 2 {\n\t\t// 全てが x % 1 == 0 になってしまう\n\t\tfmt.Printf(\"%d\\n\", 0)\n\t\treturn\n\t}\n\n\tvar ans int64 = 0\n\tfor _, a := range A {\n\t\tif countMap[a] >= 2 {\n\t\t\t// x % x == 0 になってしまう\n\t\t\tcontinue\n\t\t}\n\t\tif isPrime[a] {\n\t\t\t// 素数なので明らか\n\t\t\tans++\n\t\t\tcontinue\n\t\t}\n\n\t\t// 約数を求める\n\t\tfac := make([]int64, 0)\n\t\tfor i = 2; i*i <= a; i++ {\n\t\t\tif isPrime[i] && a%i == 0 {\n\t\t\t\tfac = append(fac, i) // 因数\n\t\t\t\tif i*i != a {\n\t\t\t\t\tfac = append(fac, a/i) // 因数で割ったもの\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tflag := true\n\t\tfor _, f := range fac {\n\t\t\tif countMap[f] >= 1 {\n\t\t\t\tflag = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif flag {\n\t\t\tans++\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\\n\", ans)\n}\n\nfunc getStdin() string {\n\treturn readLine()\n}\nfunc getStdinInt() int {\n\tstr := getStdin()\n\trtn, _ := strconv.Atoi(str)\n\treturn rtn\n}\nfunc getStdinInt64() int64 {\n\tstr := getStdin()\n\trtn, _ := strconv.ParseInt(str, 10, 64)\n\treturn rtn\n}\nfunc getStdinIntArr() []int {\n\tstr := getStdin()\n\tlist := strings.Split(str, \" \")\n\trtn := make([]int, len(list))\n\tfor idx, val := range list {\n\t\trtn[idx], _ = strconv.Atoi(val)\n\t}\n\treturn rtn\n}\n\nfunc getStdinIntArr64() []int64 {\n\tstr := getStdin()\n\tlist := strings.Split(str, \" \")\n\trtn := make([]int64, len(list))\n\tfor idx, val := range list {\n\t\trtn[idx], _ = strconv.ParseInt(val, 10, 64)\n\t}\n\treturn rtn\n}\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 0)\n\tfor {\n\t\tl, p, e := sc.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc gcdimpl(n, m int64) int64 {\n\tvar i int64 = 0\n\tfor i = 0; i < 10; i++ {\n\t\tvar t int64 = n - m\n\t\tq := false\n\t\tif m > t {\n\t\t\tq = true\n\t\t}\n\t\tif q {\n\t\t\tn = m\n\t\t} else {\n\t\t\tn = t\n\t\t}\n\t\tif q {\n\t\t\tm = t\n\t\t} else {\n\t\t}\n\t\tif m == 0 {\n\t\t\treturn n\n\t\t}\n\t}\n\treturn gcdimpl(m, n%m)\n}\n\nfunc gcd(n, m int64) int64 {\n\tif n > m {\n\t\treturn gcdimpl(n, m)\n\t}\n\treturn gcdimpl(m, n)\n}\n\nfunc reduce(x, N int64) int64 {\n\treturn (x * N) >> 32\n}\n", "language": "Go", "metadata": {"date": 1592197225, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02642.html", "problem_id": "p02642", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02642/input.txt", "sample_output_relpath": "derived/input_output/data/p02642/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02642/Go/s977333505.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s977333505", "user_id": "u149861487"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewReaderSize(os.Stdin, 1024*1024*10)\n\nfunc main() {\n\tN := getStdinInt64()\n\tA := getStdinIntArr64()\n\tvar i int64 = 0\n\t//var j int64 = 0\n\t//var cnt int64 = 0\n\tvar max int64 = 0\n\n\t// 最大値を求める\n\tfor i = 0; i < N; i++ {\n\t\tif A[i] > max {\n\t\t\tmax = A[i]\n\t\t}\n\t}\n\n\t// 素数を求める\n\tisPrime := make([]bool, max+1)\n\tfor i := 2; i < len(isPrime); i++ {\n\t\tisPrime[i] = true\n\t}\n\tisPrime[0] = false\n\tisPrime[1] = false\n\tfor i := 2; i < len(isPrime); i++ {\n\t\tif isPrime[i] {\n\t\t\tfor j := i * 2; j < len(isPrime); j += i {\n\t\t\t\tisPrime[j] = false\n\t\t\t}\n\t\t}\n\t}\n\n\t// 個数\n\tcountMap := make(map[int64]int64)\n\tfor _, a := range A {\n\t\tcountMap[a]++\n\t}\n\n\t// 1が1個、または1が2個以上の場合\n\tif countMap[1] == 1 {\n\t\t// x % 1 == 0のみ\n\t\tfmt.Printf(\"%d\\n\", 1)\n\t\treturn\n\t}\n\tif countMap[1] >= 2 {\n\t\t// 全てが x % 1 == 0 になってしまう\n\t\tfmt.Printf(\"%d\\n\", 0)\n\t\treturn\n\t}\n\n\tvar ans int64 = 0\n\tfor _, a := range A {\n\t\tif countMap[a] >= 2 {\n\t\t\t// x % x == 0 になってしまう\n\t\t\tcontinue\n\t\t}\n\t\tif isPrime[a] {\n\t\t\t// 素数なので明らか\n\t\t\tans++\n\t\t\tcontinue\n\t\t}\n\n\t\t// 約数を求める\n\t\tfac := make([]int64, 0)\n\t\tfor i = 2; i*i <= a; i++ {\n\t\t\tif isPrime[i] && a%i == 0 {\n\t\t\t\tfac = append(fac, i) // 因数\n\t\t\t\tif i*i != a {\n\t\t\t\t\tfac = append(fac, a/i) // 因数で割ったもの\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tflag := true\n\t\tfor _, f := range fac {\n\t\t\tif countMap[f] >= 1 {\n\t\t\t\tflag = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif flag {\n\t\t\tans++\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\\n\", ans)\n}\n\nfunc getStdin() string {\n\treturn readLine()\n}\nfunc getStdinInt() int {\n\tstr := getStdin()\n\trtn, _ := strconv.Atoi(str)\n\treturn rtn\n}\nfunc getStdinInt64() int64 {\n\tstr := getStdin()\n\trtn, _ := strconv.ParseInt(str, 10, 64)\n\treturn rtn\n}\nfunc getStdinIntArr() []int {\n\tstr := getStdin()\n\tlist := strings.Split(str, \" \")\n\trtn := make([]int, len(list))\n\tfor idx, val := range list {\n\t\trtn[idx], _ = strconv.Atoi(val)\n\t}\n\treturn rtn\n}\n\nfunc getStdinIntArr64() []int64 {\n\tstr := getStdin()\n\tlist := strings.Split(str, \" \")\n\trtn := make([]int64, len(list))\n\tfor idx, val := range list {\n\t\trtn[idx], _ = strconv.ParseInt(val, 10, 64)\n\t}\n\treturn rtn\n}\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 0)\n\tfor {\n\t\tl, p, e := sc.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc gcdimpl(n, m int64) int64 {\n\tvar i int64 = 0\n\tfor i = 0; i < 10; i++ {\n\t\tvar t int64 = n - m\n\t\tq := false\n\t\tif m > t {\n\t\t\tq = true\n\t\t}\n\t\tif q {\n\t\t\tn = m\n\t\t} else {\n\t\t\tn = t\n\t\t}\n\t\tif q {\n\t\t\tm = t\n\t\t} else {\n\t\t}\n\t\tif m == 0 {\n\t\t\treturn n\n\t\t}\n\t}\n\treturn gcdimpl(m, n%m)\n}\n\nfunc gcd(n, m int64) int64 {\n\tif n > m {\n\t\treturn gcdimpl(n, m)\n\t}\n\treturn gcdimpl(m, n)\n}\n\nfunc reduce(x, N int64) int64 {\n\treturn (x * N) >> 32\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "sample_input": "5\n24 11 8 3 16\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02642", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2821, "cpu_time_ms": 809, "memory_kb": 27424}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s094561666", "group_id": "codeNet:p02642", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\n\tn := sc.ReadInt()\n\tas := make([]*aElem, n)\n\tfor i := 0; i < n; i++ {\n\t\tas[i] = &aElem{i, sc.ReadInt(), false}\n\t}\n\n\tfactorMap := make(map[int]*aElemList)\n\tfor _, a := range as {\n\t\tfactors := Factorize(a.value)\n\t\tfor _, factor := range factors {\n\t\t\tif factorMap[factor] == nil {\n\t\t\t\tfactorMap[factor] = newAElemList()\n\t\t\t}\n\t\t\tfactorMap[factor].Add(a)\n\t\t}\n\t}\n\n\tfor _, a := range as {\n\t\tfactorMap[a.value].Each(func(elem *aElem) {\n\t\t\tif elem != a {\n\t\t\t\telem.marked = true\n\t\t\t}\n\t\t})\n\t}\n\n\tcount := 0\n\tfor _, a := range as {\n\t\tif !a.marked {\n\t\t\tcount++\n\t\t}\n\t}\n\n\tfmt.Println(count)\n}\n\ntype aElem struct {\n\tindex int\n\tvalue int\n\tmarked bool\n}\n\ntype aElemList struct {\n\tfirst *aElemListNode\n\tlast *aElemListNode\n}\n\ntype aElemListNode struct {\n\tchild *aElemListNode\n\tvalue *aElem\n}\n\nfunc newAElemList() *aElemList {\n\troot := aElemListNode{nil, nil}\n\treturn &aElemList{&root, &root}\n}\n\nfunc (list *aElemList) Add(value *aElem) {\n\tnode := aElemListNode{nil, value}\n\tlist.last.child = &node\n\tlist.last = &node\n}\n\nfunc (list *aElemList) Each(f func(value *aElem)) {\n\tcur := list.first\n\tfor cur.child != nil {\n\t\tcur = cur.child\n\t\tf(cur.value)\n\t}\n}\n\nfunc Factorize(n int) []int {\n\tprimeCounts := PrimeFactorize(n)\n\n\tprimeLen := len(primeCounts)\n\tprimes := make([]int, primeLen)\n\t{\n\t\ti := 0\n\t\tfor prime := range primeCounts {\n\t\t\tprimes[i] = prime\n\t\t\ti++\n\t\t}\n\t}\n\tsort.Ints(primes)\n\n\tfactorsLen := 1\n\tfor _, count := range primeCounts {\n\t\tfactorsLen *= count + 1\n\t}\n\n\tfactors := make([]int, 0, factorsLen)\n\tusePrimeCounts := make([]int, primeLen)\n\tlastPrimeCount := primeCounts[primes[primeLen-1]]\n\tfor usePrimeCounts[primeLen-1] <= lastPrimeCount {\n\t\tfactor := 1\n\t\tfor i, prime := range primes {\n\t\t\tusePrimeCount := usePrimeCounts[i]\n\t\t\tfor j := 0; j < usePrimeCount; j++ {\n\t\t\t\tfactor *= prime\n\t\t\t}\n\t\t}\n\t\tfactors = append(factors, factor)\n\n\t\tusePrimeCounts[0]++\n\t\t// carry\n\t\tfor i := 0; i < primeLen-1; i++ {\n\t\t\tprime := primes[i]\n\t\t\tprimeCount := primeCounts[prime]\n\t\t\tif usePrimeCounts[i] > primeCount {\n\t\t\t\tusePrimeCounts[i] = 0\n\t\t\t\tusePrimeCounts[i+1]++\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\t// TODO: sort\n\treturn factors\n}\n\nfunc PrimeFactorize(n int) map[int]int {\n\tprimeCounts := make(map[int]int)\n\n\tsqrtMax := int(math.Sqrt(float64(n)))\n\n\tfor n%2 == 0 {\n\t\tprimeCounts[2]++\n\t\tn /= 2\n\t}\n\tfor n%3 == 0 {\n\t\tprimeCounts[3]++\n\t\tn /= 3\n\t}\n\n\tflag := true\n\tfor i := 5; n > 1 && i <= sqrtMax; {\n\t\tfor n%i == 0 {\n\t\t\tprimeCounts[i]++\n\t\t\tn /= i\n\t\t}\n\n\t\tif flag {\n\t\t\ti += 2\n\t\t} else {\n\t\t\ti += 4\n\t\t}\n\t\tflag = !flag\n\t}\n\n\tif n > 1 {\n\t\tprimeCounts[n]++\n\t}\n\n\treturn primeCounts\n}\n\n// util\n// * math/simple\n\nfunc Abs(x int) int {\n\tif x >= 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc Min(values ...int) int {\n\tif len(values) == 0 {\n\t\tpanic(\"no values\")\n\t}\n\tmin := values[0]\n\tfor _, v := range values {\n\t\tif v < min {\n\t\t\tmin = v\n\t\t}\n\t}\n\treturn min\n}\n\nfunc Max(values ...int) int {\n\tif len(values) == 0 {\n\t\tpanic(\"no values\")\n\t}\n\tmax := values[0]\n\tfor _, v := range values {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}\n\nfunc Pow(base int, exponent uint) int {\n\tanswer := 1\n\tfor i := uint(0); i < exponent; i++ {\n\t\tanswer *= base\n\t}\n\treturn answer\n}\n\nfunc Ceil(divident, dividor int) int {\n\tquo := divident / dividor\n\trem := divident % dividor\n\n\tif rem != 0 {\n\t\tif (divident > 0 && dividor > 0) ||\n\t\t\t(divident < 0 && dividor < 0) {\n\t\t\treturn quo + 1\n\t\t}\n\t}\n\treturn quo\n}\n\n// * sortutil\n\nfunc ReverseInts(a []int) {\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n}\n\nfunc ReverseStrings(a []string) {\n\tsort.Sort(sort.Reverse(sort.StringSlice(a)))\n}\n\n// * io\n\ntype Scanner struct {\n\tbufScanner *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tbufSc := bufio.NewScanner(os.Stdin)\n\tbufSc.Split(bufio.ScanWords)\n\tbufSc.Buffer(nil, 100000000)\n\treturn &Scanner{bufSc}\n}\n\nfunc (sc *Scanner) ReadString() string {\n\tbufSc := sc.bufScanner\n\tbufSc.Scan()\n\treturn bufSc.Text()\n}\n\nfunc (sc *Scanner) ReadInt() int {\n\tbufSc := sc.bufScanner\n\tbufSc.Scan()\n\ttext := bufSc.Text()\n\n\tnum, err := strconv.Atoi(text)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn num\n}\n", "language": "Go", "metadata": {"date": 1592195191, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02642.html", "problem_id": "p02642", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02642/input.txt", "sample_output_relpath": "derived/input_output/data/p02642/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02642/Go/s094561666.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s094561666", "user_id": "u344542101"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\n\tn := sc.ReadInt()\n\tas := make([]*aElem, n)\n\tfor i := 0; i < n; i++ {\n\t\tas[i] = &aElem{i, sc.ReadInt(), false}\n\t}\n\n\tfactorMap := make(map[int]*aElemList)\n\tfor _, a := range as {\n\t\tfactors := Factorize(a.value)\n\t\tfor _, factor := range factors {\n\t\t\tif factorMap[factor] == nil {\n\t\t\t\tfactorMap[factor] = newAElemList()\n\t\t\t}\n\t\t\tfactorMap[factor].Add(a)\n\t\t}\n\t}\n\n\tfor _, a := range as {\n\t\tfactorMap[a.value].Each(func(elem *aElem) {\n\t\t\tif elem != a {\n\t\t\t\telem.marked = true\n\t\t\t}\n\t\t})\n\t}\n\n\tcount := 0\n\tfor _, a := range as {\n\t\tif !a.marked {\n\t\t\tcount++\n\t\t}\n\t}\n\n\tfmt.Println(count)\n}\n\ntype aElem struct {\n\tindex int\n\tvalue int\n\tmarked bool\n}\n\ntype aElemList struct {\n\tfirst *aElemListNode\n\tlast *aElemListNode\n}\n\ntype aElemListNode struct {\n\tchild *aElemListNode\n\tvalue *aElem\n}\n\nfunc newAElemList() *aElemList {\n\troot := aElemListNode{nil, nil}\n\treturn &aElemList{&root, &root}\n}\n\nfunc (list *aElemList) Add(value *aElem) {\n\tnode := aElemListNode{nil, value}\n\tlist.last.child = &node\n\tlist.last = &node\n}\n\nfunc (list *aElemList) Each(f func(value *aElem)) {\n\tcur := list.first\n\tfor cur.child != nil {\n\t\tcur = cur.child\n\t\tf(cur.value)\n\t}\n}\n\nfunc Factorize(n int) []int {\n\tprimeCounts := PrimeFactorize(n)\n\n\tprimeLen := len(primeCounts)\n\tprimes := make([]int, primeLen)\n\t{\n\t\ti := 0\n\t\tfor prime := range primeCounts {\n\t\t\tprimes[i] = prime\n\t\t\ti++\n\t\t}\n\t}\n\tsort.Ints(primes)\n\n\tfactorsLen := 1\n\tfor _, count := range primeCounts {\n\t\tfactorsLen *= count + 1\n\t}\n\n\tfactors := make([]int, 0, factorsLen)\n\tusePrimeCounts := make([]int, primeLen)\n\tlastPrimeCount := primeCounts[primes[primeLen-1]]\n\tfor usePrimeCounts[primeLen-1] <= lastPrimeCount {\n\t\tfactor := 1\n\t\tfor i, prime := range primes {\n\t\t\tusePrimeCount := usePrimeCounts[i]\n\t\t\tfor j := 0; j < usePrimeCount; j++ {\n\t\t\t\tfactor *= prime\n\t\t\t}\n\t\t}\n\t\tfactors = append(factors, factor)\n\n\t\tusePrimeCounts[0]++\n\t\t// carry\n\t\tfor i := 0; i < primeLen-1; i++ {\n\t\t\tprime := primes[i]\n\t\t\tprimeCount := primeCounts[prime]\n\t\t\tif usePrimeCounts[i] > primeCount {\n\t\t\t\tusePrimeCounts[i] = 0\n\t\t\t\tusePrimeCounts[i+1]++\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\t// TODO: sort\n\treturn factors\n}\n\nfunc PrimeFactorize(n int) map[int]int {\n\tprimeCounts := make(map[int]int)\n\n\tsqrtMax := int(math.Sqrt(float64(n)))\n\n\tfor n%2 == 0 {\n\t\tprimeCounts[2]++\n\t\tn /= 2\n\t}\n\tfor n%3 == 0 {\n\t\tprimeCounts[3]++\n\t\tn /= 3\n\t}\n\n\tflag := true\n\tfor i := 5; n > 1 && i <= sqrtMax; {\n\t\tfor n%i == 0 {\n\t\t\tprimeCounts[i]++\n\t\t\tn /= i\n\t\t}\n\n\t\tif flag {\n\t\t\ti += 2\n\t\t} else {\n\t\t\ti += 4\n\t\t}\n\t\tflag = !flag\n\t}\n\n\tif n > 1 {\n\t\tprimeCounts[n]++\n\t}\n\n\treturn primeCounts\n}\n\n// util\n// * math/simple\n\nfunc Abs(x int) int {\n\tif x >= 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc Min(values ...int) int {\n\tif len(values) == 0 {\n\t\tpanic(\"no values\")\n\t}\n\tmin := values[0]\n\tfor _, v := range values {\n\t\tif v < min {\n\t\t\tmin = v\n\t\t}\n\t}\n\treturn min\n}\n\nfunc Max(values ...int) int {\n\tif len(values) == 0 {\n\t\tpanic(\"no values\")\n\t}\n\tmax := values[0]\n\tfor _, v := range values {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}\n\nfunc Pow(base int, exponent uint) int {\n\tanswer := 1\n\tfor i := uint(0); i < exponent; i++ {\n\t\tanswer *= base\n\t}\n\treturn answer\n}\n\nfunc Ceil(divident, dividor int) int {\n\tquo := divident / dividor\n\trem := divident % dividor\n\n\tif rem != 0 {\n\t\tif (divident > 0 && dividor > 0) ||\n\t\t\t(divident < 0 && dividor < 0) {\n\t\t\treturn quo + 1\n\t\t}\n\t}\n\treturn quo\n}\n\n// * sortutil\n\nfunc ReverseInts(a []int) {\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n}\n\nfunc ReverseStrings(a []string) {\n\tsort.Sort(sort.Reverse(sort.StringSlice(a)))\n}\n\n// * io\n\ntype Scanner struct {\n\tbufScanner *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tbufSc := bufio.NewScanner(os.Stdin)\n\tbufSc.Split(bufio.ScanWords)\n\tbufSc.Buffer(nil, 100000000)\n\treturn &Scanner{bufSc}\n}\n\nfunc (sc *Scanner) ReadString() string {\n\tbufSc := sc.bufScanner\n\tbufSc.Scan()\n\treturn bufSc.Text()\n}\n\nfunc (sc *Scanner) ReadInt() int {\n\tbufSc := sc.bufScanner\n\tbufSc.Scan()\n\ttext := bufSc.Text()\n\n\tnum, err := strconv.Atoi(text)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn num\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "sample_input": "5\n24 11 8 3 16\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02642", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4114, "cpu_time_ms": 2212, "memory_kb": 210204}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s855053915", "group_id": "codeNet:p02642", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc solution(n int, a []int) int {\n c := 0\n for i := range a {\n for j := range a {\n if j > 1e3 {\n break\n }\n if i != j {\n if a[i]%a[j] == 0 {\n c++\n break\n }\n }\n }\n }\n return n - c\n}\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n a := make([]int, n)\n for i := range a {\n fmt.Scan(&a[i])\n }\n fmt.Println(solution(n, a))\n}", "language": "Go", "metadata": {"date": 1592190049, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02642.html", "problem_id": "p02642", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02642/input.txt", "sample_output_relpath": "derived/input_output/data/p02642/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02642/Go/s855053915.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s855053915", "user_id": "u568763892"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc solution(n int, a []int) int {\n c := 0\n for i := range a {\n for j := range a {\n if j > 1e3 {\n break\n }\n if i != j {\n if a[i]%a[j] == 0 {\n c++\n break\n }\n }\n }\n }\n return n - c\n}\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n a := make([]int, n)\n for i := range a {\n fmt.Scan(&a[i])\n }\n fmt.Println(solution(n, a))\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "sample_input": "5\n24 11 8 3 16\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02642", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 731, "cpu_time_ms": 2206, "memory_kb": 6432}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s895833779", "group_id": "codeNet:p02642", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\n/* sort */\ntype pair struct {\n\tindex int64\n\tp1, p2 interface{}\n}\ntype pairs []pair\n\nfunc (slice pairs) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice pairs) Less(i, j int) bool {\n\treturn slice[i].index < slice[j].index\n}\n\nfunc (slice pairs) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\n\n/* sort */\ntype Int64Slice []int64\n\nfunc (slice Int64Slice) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice Int64Slice) Less(i, j int) bool {\n\treturn slice[i] < slice[j]\n}\n\nfunc (slice Int64Slice) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\nfunc Int64s(a []int64) { sort.Sort(Int64Slice(a)) }\nfunc Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n\tINF = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tdi = []int64{-1, 0, 1, 0}\n\tdj = []int64{0, -1, 0, 1}\n\tdi8 = []int64{-1, -1, 0, 1, 1, 1, 0, -1}\n\tdj8 = []int64{0, -1, -1, -1, 0, 1, 1, 1}\n)\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tscanner.Buffer(buf, maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tN := readInt()\n\tA := make([]int64, N)\n\tvar B []int64\n\tm := make(map[int64]int64, N)\n\tfor i := int64(0); i < N; i++ {\n\t\tA[i] = readInt()\n\t\tm[A[i]]++\n\t}\n\tvar ans = N\n\tfor k, v := range m {\n\t\tB = append(B, k)\n\t\tif v > 1 {\n\t\t\tans = N - v\n\t\t}\n\t}\n\tInt64s(B)\n\td := solve(10e6, B)\n\tfor i := 0; i < len(B); i++ {\n\t\tif d[B[i]] >= 1 {\n\t\t\tans--\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\n/** エラトステネスの篩より解を求める。 計算量: O(n) */\nfunc solve(N int64, numbers []int64) []int64 {\n\tdata := make([]int64, N+1)\n\tdata[0] = 0\n\n\t// logic\n\tpointer := 0\n\tfor pointer < len(numbers) {\n\t\tm := numbers[pointer]\n\t\tfor i := m * 2; i <= N; i += m {\n\t\t\tdata[i]++\n\t\t}\n\t\tpointer++\n\t}\n\treturn data\n}\n\n/*==========================================\n * Library\n *==========================================*/\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\nfunc doubleAry(h int64, w int64, init int64) (res [][]int64) {\n\tres = make([][]int64, h)\n\tfor i := int64(0); i < h; i++ {\n\t\tres[i] = make([]int64, w)\n\t\tfor j := int64(0); j < w; j++ {\n\t\t\tres[i][j] = init\n\t\t}\n\t}\n\treturn\n}\n\nfunc aryEq(a []int64, b []int64) bool {\n\treturn reflect.DeepEqual(a, b)\n}\n\nfunc clone(n []int64) (r []int64) {\n\tr = make([]int64, len(n))\n\tfor i := 0; i < len(n); i++ {\n\t\tr[i] = n[i]\n\t}\n\treturn\n}\nfunc write(s string) {\n\twriter.WriteString(s)\n}\n\nfunc print() {\n\twriter.Flush()\n}\n\n// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可\nfunc readLine() (s string) {\n\tif scanner.Scan() {\n\t\ts = scanner.Text()\n\t}\n\treturn s\n}\n\nfunc readInt() (read int64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseInt(scanner.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readFloat() (read float64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readRunes() (read []rune) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, v)\n\t}\n\treturn\n}\n\nfunc readString() (read string) {\n\tscanner.Scan()\n\tread = scanner.Text()\n\treturn\n}\n\nfunc readStrings() (read []string) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, string(v))\n\t}\n\treturn\n}\n\nfunc s2i(s string) int64 {\n\tvar intVal, e = strconv.ParseInt(s, 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int64) string {\n\tvar strVal = strconv.FormatInt(i, 10)\n\treturn strVal\n}\n\nfunc s2f(s string) float64 {\n\tvar floatVal, e = strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn floatVal\n}\n\nfunc abs(i int64) int64 {\n\treturn int64(math.Abs(float64(i)))\n}\n\nfunc max(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans < v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\nfunc min(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans > v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc sum(i []int64) int64 {\n\tsum := int64(0)\n\tfor _, val := range i {\n\t\tsum += val\n\t}\n\treturn sum\n}\n\nfunc split(s string) []string {\n\treturn strings.Fields(s)\n}\n\nfunc strAry2intAry(strs []string) []int64 {\n\tvar ret = make([]int64, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal = s2i(str)\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int64) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = i2s(num)\n\t\tret = append(ret, strVal)\n\t}\n\treturn ret\n}\n\nfunc ary2str(strs []string) string {\n\treturn strings.Join(strs, \" \")\n}\n\nfunc reverse(res []int64) []int64 {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\nfunc reverseStr(res []string) []string {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\n\nfunc ini(res []int, init int) {\n\tif len(res) == 0 {\n\t\treturn\n\t}\n\tres[0] = init\n\tfor i := 0; i < len(res); i++ {\n\t\tcopy(res[i:], res[:i])\n\t}\n}\n\n//\n// func regexpExample() {\n// // Your code here!\n// var str = \"13:20\"\n// r := regexp.MustCompile(`(\\d+):(\\d+)`)\n// fmt.Println(r.FindStringSubmatch(str))\n// }\n\n// type Country struct {\n// gold int\n// silver int\n// blonze int\n// }\n\n// // 複数ソートのサンプル\n// func stableSortExample() []Country{\n// var country = []Country {\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:3, blonze:2},\n// {gold:1, silver:3, blonze:3},\n// }\n// sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })\n// return country\n// }\n", "language": "Go", "metadata": {"date": 1592188276, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02642.html", "problem_id": "p02642", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02642/input.txt", "sample_output_relpath": "derived/input_output/data/p02642/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02642/Go/s895833779.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s895833779", "user_id": "u967669872"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\n/* sort */\ntype pair struct {\n\tindex int64\n\tp1, p2 interface{}\n}\ntype pairs []pair\n\nfunc (slice pairs) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice pairs) Less(i, j int) bool {\n\treturn slice[i].index < slice[j].index\n}\n\nfunc (slice pairs) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\n\n/* sort */\ntype Int64Slice []int64\n\nfunc (slice Int64Slice) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice Int64Slice) Less(i, j int) bool {\n\treturn slice[i] < slice[j]\n}\n\nfunc (slice Int64Slice) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\nfunc Int64s(a []int64) { sort.Sort(Int64Slice(a)) }\nfunc Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n\tINF = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tdi = []int64{-1, 0, 1, 0}\n\tdj = []int64{0, -1, 0, 1}\n\tdi8 = []int64{-1, -1, 0, 1, 1, 1, 0, -1}\n\tdj8 = []int64{0, -1, -1, -1, 0, 1, 1, 1}\n)\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tscanner.Buffer(buf, maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tN := readInt()\n\tA := make([]int64, N)\n\tvar B []int64\n\tm := make(map[int64]int64, N)\n\tfor i := int64(0); i < N; i++ {\n\t\tA[i] = readInt()\n\t\tm[A[i]]++\n\t}\n\tvar ans = N\n\tfor k, v := range m {\n\t\tB = append(B, k)\n\t\tif v > 1 {\n\t\t\tans = N - v\n\t\t}\n\t}\n\tInt64s(B)\n\td := solve(10e6, B)\n\tfor i := 0; i < len(B); i++ {\n\t\tif d[B[i]] >= 1 {\n\t\t\tans--\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\n/** エラトステネスの篩より解を求める。 計算量: O(n) */\nfunc solve(N int64, numbers []int64) []int64 {\n\tdata := make([]int64, N+1)\n\tdata[0] = 0\n\n\t// logic\n\tpointer := 0\n\tfor pointer < len(numbers) {\n\t\tm := numbers[pointer]\n\t\tfor i := m * 2; i <= N; i += m {\n\t\t\tdata[i]++\n\t\t}\n\t\tpointer++\n\t}\n\treturn data\n}\n\n/*==========================================\n * Library\n *==========================================*/\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\nfunc doubleAry(h int64, w int64, init int64) (res [][]int64) {\n\tres = make([][]int64, h)\n\tfor i := int64(0); i < h; i++ {\n\t\tres[i] = make([]int64, w)\n\t\tfor j := int64(0); j < w; j++ {\n\t\t\tres[i][j] = init\n\t\t}\n\t}\n\treturn\n}\n\nfunc aryEq(a []int64, b []int64) bool {\n\treturn reflect.DeepEqual(a, b)\n}\n\nfunc clone(n []int64) (r []int64) {\n\tr = make([]int64, len(n))\n\tfor i := 0; i < len(n); i++ {\n\t\tr[i] = n[i]\n\t}\n\treturn\n}\nfunc write(s string) {\n\twriter.WriteString(s)\n}\n\nfunc print() {\n\twriter.Flush()\n}\n\n// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可\nfunc readLine() (s string) {\n\tif scanner.Scan() {\n\t\ts = scanner.Text()\n\t}\n\treturn s\n}\n\nfunc readInt() (read int64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseInt(scanner.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readFloat() (read float64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readRunes() (read []rune) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, v)\n\t}\n\treturn\n}\n\nfunc readString() (read string) {\n\tscanner.Scan()\n\tread = scanner.Text()\n\treturn\n}\n\nfunc readStrings() (read []string) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, string(v))\n\t}\n\treturn\n}\n\nfunc s2i(s string) int64 {\n\tvar intVal, e = strconv.ParseInt(s, 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int64) string {\n\tvar strVal = strconv.FormatInt(i, 10)\n\treturn strVal\n}\n\nfunc s2f(s string) float64 {\n\tvar floatVal, e = strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn floatVal\n}\n\nfunc abs(i int64) int64 {\n\treturn int64(math.Abs(float64(i)))\n}\n\nfunc max(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans < v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\nfunc min(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans > v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc sum(i []int64) int64 {\n\tsum := int64(0)\n\tfor _, val := range i {\n\t\tsum += val\n\t}\n\treturn sum\n}\n\nfunc split(s string) []string {\n\treturn strings.Fields(s)\n}\n\nfunc strAry2intAry(strs []string) []int64 {\n\tvar ret = make([]int64, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal = s2i(str)\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int64) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = i2s(num)\n\t\tret = append(ret, strVal)\n\t}\n\treturn ret\n}\n\nfunc ary2str(strs []string) string {\n\treturn strings.Join(strs, \" \")\n}\n\nfunc reverse(res []int64) []int64 {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\nfunc reverseStr(res []string) []string {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\n\nfunc ini(res []int, init int) {\n\tif len(res) == 0 {\n\t\treturn\n\t}\n\tres[0] = init\n\tfor i := 0; i < len(res); i++ {\n\t\tcopy(res[i:], res[:i])\n\t}\n}\n\n//\n// func regexpExample() {\n// // Your code here!\n// var str = \"13:20\"\n// r := regexp.MustCompile(`(\\d+):(\\d+)`)\n// fmt.Println(r.FindStringSubmatch(str))\n// }\n\n// type Country struct {\n// gold int\n// silver int\n// blonze int\n// }\n\n// // 複数ソートのサンプル\n// func stableSortExample() []Country{\n// var country = []Country {\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:3, blonze:2},\n// {gold:1, silver:3, blonze:3},\n// }\n// sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })\n// return country\n// }\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "sample_input": "5\n24 11 8 3 16\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02642", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6247, "cpu_time_ms": 1236, "memory_kb": 97984}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s122017450", "group_id": "codeNet:p02642", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\n\tn := sc.ReadInt()\n\tas := make([]*aElem, n)\n\tfor i := 0; i < n; i++ {\n\t\tas[i] = &aElem{i, sc.ReadInt(), false}\n\t}\n\n\tfactorMap := make(map[int]*aElemList)\n\tfor _, a := range as {\n\t\tfactors := Factorize(a.value)\n\t\tfor _, factor := range factors {\n\t\t\tif factorMap[factor] == nil {\n\t\t\t\tfactorMap[factor] = newAElemList()\n\t\t\t}\n\t\t\tfactorMap[factor].Add(a)\n\t\t}\n\t}\n\n\tfor _, a := range as {\n\t\tfactorMap[a.value].Each(func(elem *aElem) {\n\t\t\tif elem != a {\n\t\t\t\telem.marked = true\n\t\t\t}\n\t\t})\n\t}\n\n\tcount := 0\n\tfor _, a := range as {\n\t\tif !a.marked {\n\t\t\tcount++\n\t\t}\n\t}\n\n\tfmt.Println(count)\n}\n\ntype aElem struct {\n\tindex int\n\tvalue int\n\tmarked bool\n}\n\ntype aElemList struct {\n\tfirst *aElemListNode\n\tlast *aElemListNode\n}\n\ntype aElemListNode struct {\n\tchild *aElemListNode\n\tvalue *aElem\n}\n\nfunc newAElemList() *aElemList {\n\troot := aElemListNode{nil, nil}\n\treturn &aElemList{&root, &root}\n}\n\nfunc (list *aElemList) Add(value *aElem) {\n\tnode := aElemListNode{nil, value}\n\tlist.last.child = &node\n\tlist.last = &node\n}\n\nfunc (list *aElemList) Each(f func(value *aElem)) {\n\tcur := list.first\n\tfor cur.child != nil {\n\t\tcur = cur.child\n\t\tf(cur.value)\n\t}\n}\n\nfunc Cartesian(optionArrays [][]int) [][]int {\n\toptionArrayCount := len(optionArrays)\n\n\tproductLen := 1\n\tfor _, optionArray := range optionArrays {\n\t\tproductLen *= len(optionArray)\n\t}\n\n\tproduct := make([][]int, 0, productLen)\n\toptionArrayIndexes := make([]int, optionArrayCount)\n\tfor optionArrayIndexes[0] < len(optionArrays[0]) {\n\t\tvariation := make([]int, optionArrayCount)\n\t\tfor i, optionArray := range optionArrays {\n\t\t\toptionArrayIndex := optionArrayIndexes[i]\n\t\t\tvariation[i] = optionArray[optionArrayIndex]\n\t\t}\n\t\tproduct = append(product, variation)\n\n\t\toptionArrayIndexes[optionArrayCount-1]++\n\t\tfor i := optionArrayCount - 1; i > 0; i-- {\n\t\t\tif optionArrayIndexes[i] >= len(optionArrays[i]) {\n\t\t\t\toptionArrayIndexes[i] = 0\n\t\t\t\toptionArrayIndexes[i-1]++\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\treturn product\n}\n\nfunc Factorize(n int) []int {\n\tprimeCounts := PrimeFactorize(n)\n\n\tprimeMultiples := make([][]int, len(primeCounts))\n\t{\n\t\tindex := 0\n\t\tfor prime, count := range primeCounts {\n\t\t\tmultiples := make([]int, count+1)\n\t\t\tmultiples[0] = 1\n\t\t\tfor i := 1; i < count+1; i++ {\n\t\t\t\tmultiples[i] = multiples[i-1] * prime\n\t\t\t}\n\t\t\tprimeMultiples[index] = multiples\n\t\t\tindex++\n\t\t}\n\t}\n\n\tvariations := Cartesian(primeMultiples)\n\n\tfactors := make([]int, len(variations))\n\tfor i, variation := range variations {\n\t\tproduct := 1\n\t\tfor _, num := range variation {\n\t\t\tproduct *= num\n\t\t}\n\t\tfactors[i] = product\n\t}\n\t// TODO: sort\n\treturn factors\n}\n\nfunc PrimeFactorize(n int) map[int]int {\n\tprimeCounts := make(map[int]int)\n\n\tsqrtMax := int(math.Sqrt(float64(n)))\n\n\tfor n%2 == 0 {\n\t\tprimeCounts[2]++\n\t\tn /= 2\n\t}\n\tfor n%3 == 0 {\n\t\tprimeCounts[3]++\n\t\tn /= 3\n\t}\n\n\tflag := true\n\tfor i := 5; n > 1 && i <= sqrtMax; {\n\t\tfor n%i == 0 {\n\t\t\tprimeCounts[i]++\n\t\t\tn /= i\n\t\t}\n\n\t\tif flag {\n\t\t\ti += 2\n\t\t} else {\n\t\t\ti += 4\n\t\t}\n\t\tflag = !flag\n\t}\n\n\tif n > 1 {\n\t\tprimeCounts[n]++\n\t}\n\n\treturn primeCounts\n}\n\n// util\n// * math/simple\n\nfunc Abs(x int) int {\n\tif x >= 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc Min(values ...int) int {\n\tif len(values) == 0 {\n\t\tpanic(\"no values\")\n\t}\n\tmin := values[0]\n\tfor _, v := range values {\n\t\tif v < min {\n\t\t\tmin = v\n\t\t}\n\t}\n\treturn min\n}\n\nfunc Max(values ...int) int {\n\tif len(values) == 0 {\n\t\tpanic(\"no values\")\n\t}\n\tmax := values[0]\n\tfor _, v := range values {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}\n\nfunc Pow(base int, exponent uint) int {\n\tanswer := 1\n\tfor i := uint(0); i < exponent; i++ {\n\t\tanswer *= base\n\t}\n\treturn answer\n}\n\nfunc Ceil(divident, dividor int) int {\n\tquo := divident / dividor\n\trem := divident % dividor\n\n\tif rem != 0 {\n\t\tif (divident > 0 && dividor > 0) ||\n\t\t\t(divident < 0 && dividor < 0) {\n\t\t\treturn quo + 1\n\t\t}\n\t}\n\treturn quo\n}\n\n// * sortutil\n\nfunc ReverseInts(a []int) {\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n}\n\nfunc ReverseStrings(a []string) {\n\tsort.Sort(sort.Reverse(sort.StringSlice(a)))\n}\n\n// * io\n\ntype Scanner struct {\n\tbufScanner *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tbufSc := bufio.NewScanner(os.Stdin)\n\tbufSc.Split(bufio.ScanWords)\n\tbufSc.Buffer(nil, 100000000)\n\treturn &Scanner{bufSc}\n}\n\nfunc (sc *Scanner) ReadString() string {\n\tbufSc := sc.bufScanner\n\tbufSc.Scan()\n\treturn bufSc.Text()\n}\n\nfunc (sc *Scanner) ReadInt() int {\n\tbufSc := sc.bufScanner\n\tbufSc.Scan()\n\ttext := bufSc.Text()\n\n\tnum, err := strconv.Atoi(text)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn num\n}\n", "language": "Go", "metadata": {"date": 1592188062, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02642.html", "problem_id": "p02642", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02642/input.txt", "sample_output_relpath": "derived/input_output/data/p02642/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02642/Go/s122017450.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s122017450", "user_id": "u344542101"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\n\tn := sc.ReadInt()\n\tas := make([]*aElem, n)\n\tfor i := 0; i < n; i++ {\n\t\tas[i] = &aElem{i, sc.ReadInt(), false}\n\t}\n\n\tfactorMap := make(map[int]*aElemList)\n\tfor _, a := range as {\n\t\tfactors := Factorize(a.value)\n\t\tfor _, factor := range factors {\n\t\t\tif factorMap[factor] == nil {\n\t\t\t\tfactorMap[factor] = newAElemList()\n\t\t\t}\n\t\t\tfactorMap[factor].Add(a)\n\t\t}\n\t}\n\n\tfor _, a := range as {\n\t\tfactorMap[a.value].Each(func(elem *aElem) {\n\t\t\tif elem != a {\n\t\t\t\telem.marked = true\n\t\t\t}\n\t\t})\n\t}\n\n\tcount := 0\n\tfor _, a := range as {\n\t\tif !a.marked {\n\t\t\tcount++\n\t\t}\n\t}\n\n\tfmt.Println(count)\n}\n\ntype aElem struct {\n\tindex int\n\tvalue int\n\tmarked bool\n}\n\ntype aElemList struct {\n\tfirst *aElemListNode\n\tlast *aElemListNode\n}\n\ntype aElemListNode struct {\n\tchild *aElemListNode\n\tvalue *aElem\n}\n\nfunc newAElemList() *aElemList {\n\troot := aElemListNode{nil, nil}\n\treturn &aElemList{&root, &root}\n}\n\nfunc (list *aElemList) Add(value *aElem) {\n\tnode := aElemListNode{nil, value}\n\tlist.last.child = &node\n\tlist.last = &node\n}\n\nfunc (list *aElemList) Each(f func(value *aElem)) {\n\tcur := list.first\n\tfor cur.child != nil {\n\t\tcur = cur.child\n\t\tf(cur.value)\n\t}\n}\n\nfunc Cartesian(optionArrays [][]int) [][]int {\n\toptionArrayCount := len(optionArrays)\n\n\tproductLen := 1\n\tfor _, optionArray := range optionArrays {\n\t\tproductLen *= len(optionArray)\n\t}\n\n\tproduct := make([][]int, 0, productLen)\n\toptionArrayIndexes := make([]int, optionArrayCount)\n\tfor optionArrayIndexes[0] < len(optionArrays[0]) {\n\t\tvariation := make([]int, optionArrayCount)\n\t\tfor i, optionArray := range optionArrays {\n\t\t\toptionArrayIndex := optionArrayIndexes[i]\n\t\t\tvariation[i] = optionArray[optionArrayIndex]\n\t\t}\n\t\tproduct = append(product, variation)\n\n\t\toptionArrayIndexes[optionArrayCount-1]++\n\t\tfor i := optionArrayCount - 1; i > 0; i-- {\n\t\t\tif optionArrayIndexes[i] >= len(optionArrays[i]) {\n\t\t\t\toptionArrayIndexes[i] = 0\n\t\t\t\toptionArrayIndexes[i-1]++\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\treturn product\n}\n\nfunc Factorize(n int) []int {\n\tprimeCounts := PrimeFactorize(n)\n\n\tprimeMultiples := make([][]int, len(primeCounts))\n\t{\n\t\tindex := 0\n\t\tfor prime, count := range primeCounts {\n\t\t\tmultiples := make([]int, count+1)\n\t\t\tmultiples[0] = 1\n\t\t\tfor i := 1; i < count+1; i++ {\n\t\t\t\tmultiples[i] = multiples[i-1] * prime\n\t\t\t}\n\t\t\tprimeMultiples[index] = multiples\n\t\t\tindex++\n\t\t}\n\t}\n\n\tvariations := Cartesian(primeMultiples)\n\n\tfactors := make([]int, len(variations))\n\tfor i, variation := range variations {\n\t\tproduct := 1\n\t\tfor _, num := range variation {\n\t\t\tproduct *= num\n\t\t}\n\t\tfactors[i] = product\n\t}\n\t// TODO: sort\n\treturn factors\n}\n\nfunc PrimeFactorize(n int) map[int]int {\n\tprimeCounts := make(map[int]int)\n\n\tsqrtMax := int(math.Sqrt(float64(n)))\n\n\tfor n%2 == 0 {\n\t\tprimeCounts[2]++\n\t\tn /= 2\n\t}\n\tfor n%3 == 0 {\n\t\tprimeCounts[3]++\n\t\tn /= 3\n\t}\n\n\tflag := true\n\tfor i := 5; n > 1 && i <= sqrtMax; {\n\t\tfor n%i == 0 {\n\t\t\tprimeCounts[i]++\n\t\t\tn /= i\n\t\t}\n\n\t\tif flag {\n\t\t\ti += 2\n\t\t} else {\n\t\t\ti += 4\n\t\t}\n\t\tflag = !flag\n\t}\n\n\tif n > 1 {\n\t\tprimeCounts[n]++\n\t}\n\n\treturn primeCounts\n}\n\n// util\n// * math/simple\n\nfunc Abs(x int) int {\n\tif x >= 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc Min(values ...int) int {\n\tif len(values) == 0 {\n\t\tpanic(\"no values\")\n\t}\n\tmin := values[0]\n\tfor _, v := range values {\n\t\tif v < min {\n\t\t\tmin = v\n\t\t}\n\t}\n\treturn min\n}\n\nfunc Max(values ...int) int {\n\tif len(values) == 0 {\n\t\tpanic(\"no values\")\n\t}\n\tmax := values[0]\n\tfor _, v := range values {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}\n\nfunc Pow(base int, exponent uint) int {\n\tanswer := 1\n\tfor i := uint(0); i < exponent; i++ {\n\t\tanswer *= base\n\t}\n\treturn answer\n}\n\nfunc Ceil(divident, dividor int) int {\n\tquo := divident / dividor\n\trem := divident % dividor\n\n\tif rem != 0 {\n\t\tif (divident > 0 && dividor > 0) ||\n\t\t\t(divident < 0 && dividor < 0) {\n\t\t\treturn quo + 1\n\t\t}\n\t}\n\treturn quo\n}\n\n// * sortutil\n\nfunc ReverseInts(a []int) {\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n}\n\nfunc ReverseStrings(a []string) {\n\tsort.Sort(sort.Reverse(sort.StringSlice(a)))\n}\n\n// * io\n\ntype Scanner struct {\n\tbufScanner *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tbufSc := bufio.NewScanner(os.Stdin)\n\tbufSc.Split(bufio.ScanWords)\n\tbufSc.Buffer(nil, 100000000)\n\treturn &Scanner{bufSc}\n}\n\nfunc (sc *Scanner) ReadString() string {\n\tbufSc := sc.bufScanner\n\tbufSc.Scan()\n\treturn bufSc.Text()\n}\n\nfunc (sc *Scanner) ReadInt() int {\n\tbufSc := sc.bufScanner\n\tbufSc.Scan()\n\ttext := bufSc.Text()\n\n\tnum, err := strconv.Atoi(text)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn num\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "sample_input": "5\n24 11 8 3 16\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02642", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4576, "cpu_time_ms": 2211, "memory_kb": 158532}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s077813230", "group_id": "codeNet:p02642", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\ta := make([]int, 0, n)\n\tm := map[int]int{}\n\n\tfor i := 0; i < n; i++ {\n\t\tvar tmp int\n\t\tfmt.Scanf(\"%d\", &tmp)\n\t\tm[tmp]++\n\t\tif (m[tmp] <= 2) {\n\t\t\ta = append(a, tmp)\n\t\t}\n\t}\n\tsort.Ints(a)\n\t// fmt.Printf(\"%v\\n\", a)\n\n\tcount := 0\n\tfor i := 0; i < len(a); i++ {\n\t\tflag := true\n\t\tsqrt := int(math.Sqrt(float64(a[i])))\n\t\tfor j := 0; j < len(a); j++ {\n\t\t\tif (i == j) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (a[j] > sqrt + 1) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif ((a[i] % a[j]) == 0) {\n\t\t\t\tflag = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\t// 自分の前後の要素が重複要素かもしれない\n\t\tif (i > 0) && (a[i] % a[i-1]) == 0 {\n\t\t\tflag = false\n\t\t}\n\t\tif (i < len(a) -1) && (a[i] % a[i+1]) == 0 {\n\t\t\tflag = false\n\t\t}\n\t\tif (flag) {\n\t\t\tcount++\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\", count)\n}\n", "language": "Go", "metadata": {"date": 1592187907, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02642.html", "problem_id": "p02642", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02642/input.txt", "sample_output_relpath": "derived/input_output/data/p02642/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02642/Go/s077813230.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s077813230", "user_id": "u167600602"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\ta := make([]int, 0, n)\n\tm := map[int]int{}\n\n\tfor i := 0; i < n; i++ {\n\t\tvar tmp int\n\t\tfmt.Scanf(\"%d\", &tmp)\n\t\tm[tmp]++\n\t\tif (m[tmp] <= 2) {\n\t\t\ta = append(a, tmp)\n\t\t}\n\t}\n\tsort.Ints(a)\n\t// fmt.Printf(\"%v\\n\", a)\n\n\tcount := 0\n\tfor i := 0; i < len(a); i++ {\n\t\tflag := true\n\t\tsqrt := int(math.Sqrt(float64(a[i])))\n\t\tfor j := 0; j < len(a); j++ {\n\t\t\tif (i == j) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif (a[j] > sqrt + 1) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif ((a[i] % a[j]) == 0) {\n\t\t\t\tflag = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\t// 自分の前後の要素が重複要素かもしれない\n\t\tif (i > 0) && (a[i] % a[i-1]) == 0 {\n\t\t\tflag = false\n\t\t}\n\t\tif (i < len(a) -1) && (a[i] % a[i+1]) == 0 {\n\t\t\tflag = false\n\t\t}\n\t\tif (flag) {\n\t\t\tcount++\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\", count)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "sample_input": "5\n24 11 8 3 16\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02642", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 826, "cpu_time_ms": 1283, "memory_kb": 17692}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s420265570", "group_id": "codeNet:p02642", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc enumDivisors(n int) (res []int) {\n\tfor i := 1; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tres = append(res, i)\n\t\t\tif n/i != i {\n\t\t\t\tres = append(res, n/i)\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\nfunc lib_CountInt(values []int) map[int]int {\n\tm := map[int]int{}\n\tfor _, value := range values {\n\t\tm[value]++\n\t}\n\treturn m\n}\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tconst initialBufSize = 4096\n\tconst maxBufSize = 1000000\n\tscanner.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tvar N int\n\tscanner.Scan()\n\tN, _ = strconv.Atoi(scanner.Text())\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tscanner.Scan()\n\t\tA[i], _ = strconv.Atoi(scanner.Text())\n\t}\n\tfmt.Println(solve(N, A))\n}\nfunc solve(N int, A []int) (cnt int) {\n\tsort.Ints(A)\n\taCounts := lib_CountInt(A)\n\tfor _, a := range A {\n\t\tif aCounts[a] != 1 {\n\t\t\tcontinue\n\t\t}\n\t\tvalid := true\n\t\tfor _, e := range enumDivisors(a) {\n\t\t\tif _, ok := aCounts[e]; ok && e != a {\n\t\t\t\tvalid = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif valid {\n\t\t\tcnt++\n\t\t}\n\t}\n\treturn\n}\n", "language": "Go", "metadata": {"date": 1592187840, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02642.html", "problem_id": "p02642", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02642/input.txt", "sample_output_relpath": "derived/input_output/data/p02642/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02642/Go/s420265570.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s420265570", "user_id": "u562039972"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc enumDivisors(n int) (res []int) {\n\tfor i := 1; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tres = append(res, i)\n\t\t\tif n/i != i {\n\t\t\t\tres = append(res, n/i)\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}\nfunc lib_CountInt(values []int) map[int]int {\n\tm := map[int]int{}\n\tfor _, value := range values {\n\t\tm[value]++\n\t}\n\treturn m\n}\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tconst initialBufSize = 4096\n\tconst maxBufSize = 1000000\n\tscanner.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tvar N int\n\tscanner.Scan()\n\tN, _ = strconv.Atoi(scanner.Text())\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tscanner.Scan()\n\t\tA[i], _ = strconv.Atoi(scanner.Text())\n\t}\n\tfmt.Println(solve(N, A))\n}\nfunc solve(N int, A []int) (cnt int) {\n\tsort.Ints(A)\n\taCounts := lib_CountInt(A)\n\tfor _, a := range A {\n\t\tif aCounts[a] != 1 {\n\t\t\tcontinue\n\t\t}\n\t\tvalid := true\n\t\tfor _, e := range enumDivisors(a) {\n\t\t\tif _, ok := aCounts[e]; ok && e != a {\n\t\t\t\tvalid = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif valid {\n\t\t\tcnt++\n\t\t}\n\t}\n\treturn\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "sample_input": "5\n24 11 8 3 16\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02642", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1082, "cpu_time_ms": 2023, "memory_kb": 19708}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s395466480", "group_id": "codeNet:p02642", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar in []int\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Scan()\n\tn, _ := strconv.Atoi(sc.Text())\n\n\tsc.Scan()\n\tinst := strings.Split(sc.Text(), \" \")\n\tfor _, i := range inst {\n\t\tt, _ := strconv.Atoi(i)\n\t\tin = append(in, t)\n\t}\n\tan, ok := 0, 0\n\n\tfor j, i := range in {\n\t\tfor k, l := range in {\n\t\t\tif j != k {\n\t\t\t\tif i%l == 0 {\n\t\t\t\t\tan++\n\t\t\t\t\tok++\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ok == 1 {\n\t\t\t\tok--\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t}\n\n\tfmt.Println(n - an)\n}\n", "language": "Go", "metadata": {"date": 1592187548, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02642.html", "problem_id": "p02642", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02642/input.txt", "sample_output_relpath": "derived/input_output/data/p02642/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02642/Go/s395466480.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s395466480", "user_id": "u074996057"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar in []int\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Scan()\n\tn, _ := strconv.Atoi(sc.Text())\n\n\tsc.Scan()\n\tinst := strings.Split(sc.Text(), \" \")\n\tfor _, i := range inst {\n\t\tt, _ := strconv.Atoi(i)\n\t\tin = append(in, t)\n\t}\n\tan, ok := 0, 0\n\n\tfor j, i := range in {\n\t\tfor k, l := range in {\n\t\t\tif j != k {\n\t\t\t\tif i%l == 0 {\n\t\t\t\t\tan++\n\t\t\t\t\tok++\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ok == 1 {\n\t\t\t\tok--\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t}\n\n\tfmt.Println(n - an)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "sample_input": "5\n24 11 8 3 16\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02642", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 516, "cpu_time_ms": 115, "memory_kb": 3036}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s662798101", "group_id": "codeNet:p02642", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 10000000\n)\n\nvar (\n\tsc = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc nextFloat() float64 {\n\tsc.Scan()\n\tf, e := strconv.ParseFloat(sc.Text(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc main() {\n\tn := nextInt()\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = nextInt()\n\t}\n\n\tsort.Ints(a)\n\tflags := make(map[int]bool)\n\tdup := make(map[int]bool)\n\tok := make(map[int]bool)\n\tfor _, v := range a {\n\t\tflag := true\n\t\tfor i := 1; i*i <= v; i++ {\n\t\t\tif v%i == 0 {\n\t\t\t\tif flags[i] {\n\t\t\t\t\tflag = false\n\t\t\t\t}\n\t\t\t\tif i*i != v {\n\t\t\t\t\tif flags[v/i] {\n\t\t\t\t\t\tflag = false\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ok[v] {\n\t\t\tdup[v] = true\n\t\t}\n\t\tif flag && !flags[v] {\n\t\t\tok[v] = true\n\t\t}\n\t\tflags[v] = true\n\t}\n\tfmt.Println(len(ok) - len(dup))\n}\n", "language": "Go", "metadata": {"date": 1592187407, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02642.html", "problem_id": "p02642", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02642/input.txt", "sample_output_relpath": "derived/input_output/data/p02642/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02642/Go/s662798101.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s662798101", "user_id": "u275316733"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 10000000\n)\n\nvar (\n\tsc = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc nextFloat() float64 {\n\tsc.Scan()\n\tf, e := strconv.ParseFloat(sc.Text(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc main() {\n\tn := nextInt()\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = nextInt()\n\t}\n\n\tsort.Ints(a)\n\tflags := make(map[int]bool)\n\tdup := make(map[int]bool)\n\tok := make(map[int]bool)\n\tfor _, v := range a {\n\t\tflag := true\n\t\tfor i := 1; i*i <= v; i++ {\n\t\t\tif v%i == 0 {\n\t\t\t\tif flags[i] {\n\t\t\t\t\tflag = false\n\t\t\t\t}\n\t\t\t\tif i*i != v {\n\t\t\t\t\tif flags[v/i] {\n\t\t\t\t\t\tflag = false\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif ok[v] {\n\t\t\tdup[v] = true\n\t\t}\n\t\tif flag && !flags[v] {\n\t\t\tok[v] = true\n\t\t}\n\t\tflags[v] = true\n\t}\n\tfmt.Println(len(ok) - len(dup))\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "sample_input": "5\n24 11 8 3 16\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02642", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1142, "cpu_time_ms": 1986, "memory_kb": 17312}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s129167063", "group_id": "codeNet:p02642", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewReaderSize(os.Stdin, 1024*1024*10)\n\nfunc main() {\n\tN := getStdinInt64()\n\tA := getStdinIntArr64()\n\t//B := make([][]int64, N)\n\tvar i int64 = 0\n\tvar j int64 = 0\n\tvar cnt int64 = 0\n\tvar max int64 = 0\n\n\tfor _, val := range A {\n\t\tif val > max {\n\t\t\tmax = val\n\t\t}\n\t}\n\n\t/*\n\t\t//arr := make([]bool, int(math.Sqrt(float64(max)))+1)\n\t\tarr := make([]bool, int((float64(max)))+1)\n\t\t// 初期化\n\t\t// 素数を求める(falseが素数)\n\t\tarr[0] = true\n\t\tarr[1] = true\n\t\tfor i := 2; i < len(arr); i++ {\n\t\t\tif arr[i] {\n\t\t\t\tfor j := i * 2; j < len(arr); j += i {\n\t\t\t\t\tarr[j] = true\n\t\t\t\t}\n\t\t\t}\n\t\t}*/\n\n\t/*\n\t\tfor i = 0; i< N ; i++ {\n\t\t\tB[i] = make([]int64, N)\n\t\t}\n\t*/\n\n\tfor i = 0; i < N; i++ {\n\t\tflag := true\n\t\tflag2 := true\n\t\tfor j = 0; j < N; j++ {\n\t\t\tif i == j {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif A[i] == A[j] {\n\t\t\t\tflag2 = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif A[j] == 1 {\n\t\t\t\tflag = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !flag2 {\n\t\t\tcontinue\n\t\t}\n\t\tif !flag {\n\t\t\tcnt++\n\t\t\tcontinue\n\t\t}\n\t\t/*\n\t\t\tif arr[A[i]] == false {\n\t\t\t\tcnt++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t*/\n\t\tflag = true\n\t\tfor j = 0; j < N; j++ {\n\t\t\tif i == j {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif A[i]%A[j] == 0 {\n\t\t\t\tflag = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif flag {\n\t\t\tcnt++\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\\n\", cnt)\n}\n\nfunc getStdin() string {\n\treturn readLine()\n}\nfunc getStdinInt() int {\n\tstr := getStdin()\n\trtn, _ := strconv.Atoi(str)\n\treturn rtn\n}\nfunc getStdinInt64() int64 {\n\tstr := getStdin()\n\trtn, _ := strconv.ParseInt(str, 10, 64)\n\treturn rtn\n}\nfunc getStdinIntArr() []int {\n\tstr := getStdin()\n\tlist := strings.Split(str, \" \")\n\trtn := make([]int, len(list))\n\tfor idx, val := range list {\n\t\trtn[idx], _ = strconv.Atoi(val)\n\t}\n\treturn rtn\n}\n\nfunc getStdinIntArr64() []int64 {\n\tstr := getStdin()\n\tlist := strings.Split(str, \" \")\n\trtn := make([]int64, len(list))\n\tfor idx, val := range list {\n\t\trtn[idx], _ = strconv.ParseInt(val, 10, 64)\n\t}\n\treturn rtn\n}\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 0)\n\tfor {\n\t\tl, p, e := sc.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n", "language": "Go", "metadata": {"date": 1592187191, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02642.html", "problem_id": "p02642", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02642/input.txt", "sample_output_relpath": "derived/input_output/data/p02642/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02642/Go/s129167063.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s129167063", "user_id": "u149861487"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewReaderSize(os.Stdin, 1024*1024*10)\n\nfunc main() {\n\tN := getStdinInt64()\n\tA := getStdinIntArr64()\n\t//B := make([][]int64, N)\n\tvar i int64 = 0\n\tvar j int64 = 0\n\tvar cnt int64 = 0\n\tvar max int64 = 0\n\n\tfor _, val := range A {\n\t\tif val > max {\n\t\t\tmax = val\n\t\t}\n\t}\n\n\t/*\n\t\t//arr := make([]bool, int(math.Sqrt(float64(max)))+1)\n\t\tarr := make([]bool, int((float64(max)))+1)\n\t\t// 初期化\n\t\t// 素数を求める(falseが素数)\n\t\tarr[0] = true\n\t\tarr[1] = true\n\t\tfor i := 2; i < len(arr); i++ {\n\t\t\tif arr[i] {\n\t\t\t\tfor j := i * 2; j < len(arr); j += i {\n\t\t\t\t\tarr[j] = true\n\t\t\t\t}\n\t\t\t}\n\t\t}*/\n\n\t/*\n\t\tfor i = 0; i< N ; i++ {\n\t\t\tB[i] = make([]int64, N)\n\t\t}\n\t*/\n\n\tfor i = 0; i < N; i++ {\n\t\tflag := true\n\t\tflag2 := true\n\t\tfor j = 0; j < N; j++ {\n\t\t\tif i == j {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif A[i] == A[j] {\n\t\t\t\tflag2 = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif A[j] == 1 {\n\t\t\t\tflag = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !flag2 {\n\t\t\tcontinue\n\t\t}\n\t\tif !flag {\n\t\t\tcnt++\n\t\t\tcontinue\n\t\t}\n\t\t/*\n\t\t\tif arr[A[i]] == false {\n\t\t\t\tcnt++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t*/\n\t\tflag = true\n\t\tfor j = 0; j < N; j++ {\n\t\t\tif i == j {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif A[i]%A[j] == 0 {\n\t\t\t\tflag = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif flag {\n\t\t\tcnt++\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\\n\", cnt)\n}\n\nfunc getStdin() string {\n\treturn readLine()\n}\nfunc getStdinInt() int {\n\tstr := getStdin()\n\trtn, _ := strconv.Atoi(str)\n\treturn rtn\n}\nfunc getStdinInt64() int64 {\n\tstr := getStdin()\n\trtn, _ := strconv.ParseInt(str, 10, 64)\n\treturn rtn\n}\nfunc getStdinIntArr() []int {\n\tstr := getStdin()\n\tlist := strings.Split(str, \" \")\n\trtn := make([]int, len(list))\n\tfor idx, val := range list {\n\t\trtn[idx], _ = strconv.Atoi(val)\n\t}\n\treturn rtn\n}\n\nfunc getStdinIntArr64() []int64 {\n\tstr := getStdin()\n\tlist := strings.Split(str, \" \")\n\trtn := make([]int64, len(list))\n\tfor idx, val := range list {\n\t\trtn[idx], _ = strconv.ParseInt(val, 10, 64)\n\t}\n\treturn rtn\n}\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 0)\n\tfor {\n\t\tl, p, e := sc.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "sample_input": "5\n24 11 8 3 16\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02642", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2116, "cpu_time_ms": 2206, "memory_kb": 11808}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s707541537", "group_id": "codeNet:p02642", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\tw = bufio.NewWriter(os.Stdout)\n)\n\nfunc readInt() (read int) {\n\tscanner.Scan()\n\tread, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc main() {\n\tscanner.Split(bufio.ScanWords)\n\tdefer w.Flush()\n\n\tn := readInt()\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = readInt()\n\t}\n\n\tsort.Ints(a)\n\n\tcnt := 0\n\tfor i := 0; i < n; i++ {\n\t\ts := 0\n\t\tfor j := 0; j < n && a[i] >= a[j]; j++ {\n\t\t\tif i != j {\n\t\t\t\tif a[i]%a[j] == 0 {\n\t\t\t\t\ts++\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif s == 0 {\n\t\t\tcnt++\n\t\t}\n\t}\n\tfmt.Println(cnt)\n}\n", "language": "Go", "metadata": {"date": 1592186969, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02642.html", "problem_id": "p02642", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02642/input.txt", "sample_output_relpath": "derived/input_output/data/p02642/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02642/Go/s707541537.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s707541537", "user_id": "u655410252"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\tw = bufio.NewWriter(os.Stdout)\n)\n\nfunc readInt() (read int) {\n\tscanner.Scan()\n\tread, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc main() {\n\tscanner.Split(bufio.ScanWords)\n\tdefer w.Flush()\n\n\tn := readInt()\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = readInt()\n\t}\n\n\tsort.Ints(a)\n\n\tcnt := 0\n\tfor i := 0; i < n; i++ {\n\t\ts := 0\n\t\tfor j := 0; j < n && a[i] >= a[j]; j++ {\n\t\t\tif i != j {\n\t\t\t\tif a[i]%a[j] == 0 {\n\t\t\t\t\ts++\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif s == 0 {\n\t\t\tcnt++\n\t\t}\n\t}\n\tfmt.Println(cnt)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "sample_input": "5\n24 11 8 3 16\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02642", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 660, "cpu_time_ms": 2205, "memory_kb": 5088}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s557203697", "group_id": "codeNet:p02642", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar n int\n\tvar at []string\n\tvar a []int\n\tfmt.Scan(&n)\n\n\tsc := bufio.NewScanner(os.Stdin)\n\tif sc.Scan() {\n\t\tat = strings.Split(sc.Text(), \" \")\n\t}\n\n\tfor _, e := range at {\n\t\tnum, _ := strconv.Atoi(e)\n\t\ta = append(a, num)\n\t}\n\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\n\tvar count int\n\n\tif a[n-1] != a[n-2] {\n\t\tcount = 1\n\t} else {\n\t\tcount = 0\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\tif a[i] == 0 || a[j] == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif a[i]%a[j] == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif i != 0 && a[i] == a[i-1] {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif j == n-1 {\n\t\t\t\tcount += 1\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Print(count)\n\n}\n", "language": "Go", "metadata": {"date": 1592186783, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02642.html", "problem_id": "p02642", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02642/input.txt", "sample_output_relpath": "derived/input_output/data/p02642/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02642/Go/s557203697.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s557203697", "user_id": "u137025147"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar n int\n\tvar at []string\n\tvar a []int\n\tfmt.Scan(&n)\n\n\tsc := bufio.NewScanner(os.Stdin)\n\tif sc.Scan() {\n\t\tat = strings.Split(sc.Text(), \" \")\n\t}\n\n\tfor _, e := range at {\n\t\tnum, _ := strconv.Atoi(e)\n\t\ta = append(a, num)\n\t}\n\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\n\tvar count int\n\n\tif a[n-1] != a[n-2] {\n\t\tcount = 1\n\t} else {\n\t\tcount = 0\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\tif a[i] == 0 || a[j] == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif a[i]%a[j] == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif i != 0 && a[i] == a[i-1] {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif j == n-1 {\n\t\t\t\tcount += 1\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Print(count)\n\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "sample_input": "5\n24 11 8 3 16\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02642", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 692, "cpu_time_ms": 78, "memory_kb": 2988}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s710776706", "group_id": "codeNet:p02642", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar (\n\tfinv, inv, fac [MAX]int\n)\n\nfunc COM(n, k int) int {\n\tif n < k {\n\t\treturn 0\n\t}\n\tif n < 0 || k < 0 {\n\t\treturn 0\n\t}\n\treturn fac[n] * (finv[k] * finv[n-k] % MOD) % MOD\n}\n\nfunc init() {\n\tfac[0] = 1\n\tfac[1] = 1\n\tfinv[0] = 1\n\tfinv[1] = 1\n\tinv[1] = 1\n\tfor i := 2; i < MAX; i++ {\n\t\tfac[i] = fac[i-1] * i % MOD\n\t\tinv[i] = MOD - inv[MOD%i]*(MOD/i)%MOD\n\t\tfinv[i] = finv[i-1] * inv[i] % MOD\n\t}\n\t//sc.Split(bufio.ScanLines)\n\tsc.Split(bufio.ScanWords)\n\t//sc.Buffer([]byte{}, 200100)\n}\n\nconst (\n\tMOD = 1000000007\n\tMAX = 510000\n)\n\nfunc ModAdd(a, b int64) int64 {\n\treturn (a + b) % MOD\n}\n\nfunc ModMul(a, b int64) int64 {\n\treturn a * b % MOD\n}\n\nfunc ModSub(a, b int64) int64 {\n\tr := (a%MOD - b%MOD) % MOD\n\tif r < 0 {\n\t\tr += MOD\n\t}\n\treturn r\n}\n\nfunc ModDiv(a, b int64) int64 {\n\treturn a % MOD * ModInv(b) % MOD\n}\n\nfunc ModPow(a, n int64) int64 {\n\tvar r int64 = 1\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tr = r * a % MOD\n\t\t}\n\t\ta = a * a % MOD\n\t\tn >>= 1\n\t}\n\treturn r\n}\n\nfunc ModInv(a int64) int64 {\n\tvar b, u, v int64 = MOD, 1, 0\n\tfor b > 0 {\n\t\tt := a / b\n\t\ta -= t * b\n\t\ta, b = b, a\n\t\tu -= t * v\n\t\tu, v = v, u\n\t}\n\tu %= MOD\n\tif u < 0 {\n\t\tu += MOD\n\t}\n\treturn u\n}\n\ntype Q struct {\n\tvalue int\n\tindex int\n\tA, B int\n}\n\ntype QS []*Q\n\nfunc (p QS) Len() int { return len(p) }\nfunc (p QS) Less(i, j int) bool { return p[i].value > p[j].value }\nfunc (pq QS) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n\tpq[i].index = i\n\tpq[j].index = j\n}\n\nfunc (pq *QS) Push(x interface{}) {\n\tn := len(*pq)\n\titem := x.(*Q)\n\titem.index = n\n\t*pq = append(*pq, item)\n}\n\nfunc (pq *QS) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\told[n-1] = nil // avoid memory leak\n\titem.index = -1 // for safety\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\nfunc IsPrime(num int) bool {\n\tm := map[int]int{}\n\treturn factor(m, num, 2)\n}\n\nfunc factor(result map[int]int, num, pnum int) bool {\n\tif pnum*pnum > num {\n\t\tif num != 1 {\n\t\t\tif result[num] > 0 {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t}\n\t\treturn true\n\t}\n\n\tif num%pnum == 0 {\n\t\tnum /= pnum\n\t\tif result[pnum] > 0 {\n\t\t\treturn false\n\t\t}\n\t} else {\n\t\tpnum++\n\t}\n\treturn factor(result, num, pnum)\n}\n\nfunc GCD(a, b int64) int64 {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn GCD(b, a%b)\n}\n\nfunc LCM(a, b int64) int64 {\n\treturn a * b / GCD(a, b)\n}\n\ntype UnionFind struct {\n\tpar []int\n\tsize []int\n}\n\nfunc NewUnionFind(size int) *UnionFind {\n\treturn new(UnionFind).init(size)\n}\n\nfunc (uf *UnionFind) init(size int) *UnionFind {\n\tuf.par = make([]int, size)\n\tuf.size = make([]int, size)\n\n\tfor i := 0; i < size; i++ {\n\t\tuf.par[i] = i\n\t\tuf.size[i] = 1\n\t}\n\treturn uf\n}\n\nfunc (uf *UnionFind) Unite(p int, q int) {\n\trp := uf.Root(p)\n\trq := uf.Root(q)\n\tif rp == rq {\n\t\treturn\n\t}\n\tif uf.size[rp] < uf.size[rq] {\n\t\tuf.par[rp] = uf.par[rq]\n\t\tuf.size[rq] += uf.size[rp]\n\t} else {\n\t\tuf.par[rq] = uf.par[rp]\n\t\tuf.size[rp] += uf.size[rq]\n\t}\n}\n\nfunc (uf *UnionFind) Root(p int) int {\n\tfor uf.par[p] == p {\n\t\treturn p\n\t}\n\tuf.par[p] = uf.Root(uf.par[p])\n\treturn uf.par[p]\n}\n\nfunc (uf *UnionFind) Size(p int) int {\n\treturn uf.size[uf.Root(p)]\n}\n\nfunc (uf *UnionFind) Same(p int, q int) bool {\n\treturn uf.Root(p) == uf.Root(q)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tn, _ := strconv.Atoi(getStr())\n\treturn n\n}\n\nfunc getStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tN := getInt()\n\tA := make([]int, N)\n\tm := map[int]int{}\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = getInt()\n\t\tm[A[i]]++\n\t}\n\t//fmt.Println(m)\n\tif m[1] > 0 {\n\t\tif m[1] == 1 {\n\t\t\tfmt.Println(1)\n\t\t\treturn\n\t\t} else {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t}\n\t}\n\tsort.Ints(A)\n\tcnt := 0\n\tmax := A[N-1]\n\tfilled := map[int]bool{}\n\tfor i := 0; i < N; i++ {\n\t\ta := A[i]\n\t\tif filled[a] {\n\t\t\tcontinue\n\t\t}\n\t\t//fmt.Println(a, filled)\n\t\tif m[a] == 1 {\n\t\t\tcnt++\n\t\t}\n\t\tif a == 1 {\n\t\t\tfilled[a] = true\n\t\t} else {\n\t\t\tv := a\n\t\t\tfilled[a] = true\n\t\t\tfor v <= max {\n\t\t\t\tv += a\n\t\t\t\tfilled[v] = true\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(cnt)\n}\n\ntype IntHeap []int\n\nfunc (h IntHeap) Len() int { return len(h) }\nfunc (h IntHeap) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h IntHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\n\nfunc (h *IntHeap) Push(x interface{}) {\n\t// Push and Pop use pointer receivers because they modify the slice's length,\n\t// not just its contents.\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IntHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n", "language": "Go", "metadata": {"date": 1592186298, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02642.html", "problem_id": "p02642", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02642/input.txt", "sample_output_relpath": "derived/input_output/data/p02642/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02642/Go/s710776706.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s710776706", "user_id": "u534481484"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar (\n\tfinv, inv, fac [MAX]int\n)\n\nfunc COM(n, k int) int {\n\tif n < k {\n\t\treturn 0\n\t}\n\tif n < 0 || k < 0 {\n\t\treturn 0\n\t}\n\treturn fac[n] * (finv[k] * finv[n-k] % MOD) % MOD\n}\n\nfunc init() {\n\tfac[0] = 1\n\tfac[1] = 1\n\tfinv[0] = 1\n\tfinv[1] = 1\n\tinv[1] = 1\n\tfor i := 2; i < MAX; i++ {\n\t\tfac[i] = fac[i-1] * i % MOD\n\t\tinv[i] = MOD - inv[MOD%i]*(MOD/i)%MOD\n\t\tfinv[i] = finv[i-1] * inv[i] % MOD\n\t}\n\t//sc.Split(bufio.ScanLines)\n\tsc.Split(bufio.ScanWords)\n\t//sc.Buffer([]byte{}, 200100)\n}\n\nconst (\n\tMOD = 1000000007\n\tMAX = 510000\n)\n\nfunc ModAdd(a, b int64) int64 {\n\treturn (a + b) % MOD\n}\n\nfunc ModMul(a, b int64) int64 {\n\treturn a * b % MOD\n}\n\nfunc ModSub(a, b int64) int64 {\n\tr := (a%MOD - b%MOD) % MOD\n\tif r < 0 {\n\t\tr += MOD\n\t}\n\treturn r\n}\n\nfunc ModDiv(a, b int64) int64 {\n\treturn a % MOD * ModInv(b) % MOD\n}\n\nfunc ModPow(a, n int64) int64 {\n\tvar r int64 = 1\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tr = r * a % MOD\n\t\t}\n\t\ta = a * a % MOD\n\t\tn >>= 1\n\t}\n\treturn r\n}\n\nfunc ModInv(a int64) int64 {\n\tvar b, u, v int64 = MOD, 1, 0\n\tfor b > 0 {\n\t\tt := a / b\n\t\ta -= t * b\n\t\ta, b = b, a\n\t\tu -= t * v\n\t\tu, v = v, u\n\t}\n\tu %= MOD\n\tif u < 0 {\n\t\tu += MOD\n\t}\n\treturn u\n}\n\ntype Q struct {\n\tvalue int\n\tindex int\n\tA, B int\n}\n\ntype QS []*Q\n\nfunc (p QS) Len() int { return len(p) }\nfunc (p QS) Less(i, j int) bool { return p[i].value > p[j].value }\nfunc (pq QS) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n\tpq[i].index = i\n\tpq[j].index = j\n}\n\nfunc (pq *QS) Push(x interface{}) {\n\tn := len(*pq)\n\titem := x.(*Q)\n\titem.index = n\n\t*pq = append(*pq, item)\n}\n\nfunc (pq *QS) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\told[n-1] = nil // avoid memory leak\n\titem.index = -1 // for safety\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\nfunc IsPrime(num int) bool {\n\tm := map[int]int{}\n\treturn factor(m, num, 2)\n}\n\nfunc factor(result map[int]int, num, pnum int) bool {\n\tif pnum*pnum > num {\n\t\tif num != 1 {\n\t\t\tif result[num] > 0 {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t}\n\t\treturn true\n\t}\n\n\tif num%pnum == 0 {\n\t\tnum /= pnum\n\t\tif result[pnum] > 0 {\n\t\t\treturn false\n\t\t}\n\t} else {\n\t\tpnum++\n\t}\n\treturn factor(result, num, pnum)\n}\n\nfunc GCD(a, b int64) int64 {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn GCD(b, a%b)\n}\n\nfunc LCM(a, b int64) int64 {\n\treturn a * b / GCD(a, b)\n}\n\ntype UnionFind struct {\n\tpar []int\n\tsize []int\n}\n\nfunc NewUnionFind(size int) *UnionFind {\n\treturn new(UnionFind).init(size)\n}\n\nfunc (uf *UnionFind) init(size int) *UnionFind {\n\tuf.par = make([]int, size)\n\tuf.size = make([]int, size)\n\n\tfor i := 0; i < size; i++ {\n\t\tuf.par[i] = i\n\t\tuf.size[i] = 1\n\t}\n\treturn uf\n}\n\nfunc (uf *UnionFind) Unite(p int, q int) {\n\trp := uf.Root(p)\n\trq := uf.Root(q)\n\tif rp == rq {\n\t\treturn\n\t}\n\tif uf.size[rp] < uf.size[rq] {\n\t\tuf.par[rp] = uf.par[rq]\n\t\tuf.size[rq] += uf.size[rp]\n\t} else {\n\t\tuf.par[rq] = uf.par[rp]\n\t\tuf.size[rp] += uf.size[rq]\n\t}\n}\n\nfunc (uf *UnionFind) Root(p int) int {\n\tfor uf.par[p] == p {\n\t\treturn p\n\t}\n\tuf.par[p] = uf.Root(uf.par[p])\n\treturn uf.par[p]\n}\n\nfunc (uf *UnionFind) Size(p int) int {\n\treturn uf.size[uf.Root(p)]\n}\n\nfunc (uf *UnionFind) Same(p int, q int) bool {\n\treturn uf.Root(p) == uf.Root(q)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tn, _ := strconv.Atoi(getStr())\n\treturn n\n}\n\nfunc getStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tN := getInt()\n\tA := make([]int, N)\n\tm := map[int]int{}\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = getInt()\n\t\tm[A[i]]++\n\t}\n\t//fmt.Println(m)\n\tif m[1] > 0 {\n\t\tif m[1] == 1 {\n\t\t\tfmt.Println(1)\n\t\t\treturn\n\t\t} else {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t}\n\t}\n\tsort.Ints(A)\n\tcnt := 0\n\tmax := A[N-1]\n\tfilled := map[int]bool{}\n\tfor i := 0; i < N; i++ {\n\t\ta := A[i]\n\t\tif filled[a] {\n\t\t\tcontinue\n\t\t}\n\t\t//fmt.Println(a, filled)\n\t\tif m[a] == 1 {\n\t\t\tcnt++\n\t\t}\n\t\tif a == 1 {\n\t\t\tfilled[a] = true\n\t\t} else {\n\t\t\tv := a\n\t\t\tfilled[a] = true\n\t\t\tfor v <= max {\n\t\t\t\tv += a\n\t\t\t\tfilled[v] = true\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(cnt)\n}\n\ntype IntHeap []int\n\nfunc (h IntHeap) Len() int { return len(h) }\nfunc (h IntHeap) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h IntHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\n\nfunc (h *IntHeap) Push(x interface{}) {\n\t// Push and Pop use pointer receivers because they modify the slice's length,\n\t// not just its contents.\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IntHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "sample_input": "5\n24 11 8 3 16\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02642", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4400, "cpu_time_ms": 400, "memory_kb": 68468}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s776565198", "group_id": "codeNet:p02642", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tpl := make([]int, n)\n\tvar p int\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&p)\n\t\tpl[i] = p\n\t}\n\n\tcount := 0\n\tfor i := 0; i < n; i++ {\n\t\tflag := true\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif i == j {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif pl[i]%pl[j] == 0 {\n\t\t\t\tflag = false\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\tif flag {\n\t\t\tcount++\n\t\t}\n\t}\n\tfmt.Println(count)\n}\n", "language": "Go", "metadata": {"date": 1592185828, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02642.html", "problem_id": "p02642", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02642/input.txt", "sample_output_relpath": "derived/input_output/data/p02642/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02642/Go/s776565198.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s776565198", "user_id": "u473974118"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tpl := make([]int, n)\n\tvar p int\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&p)\n\t\tpl[i] = p\n\t}\n\n\tcount := 0\n\tfor i := 0; i < n; i++ {\n\t\tflag := true\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif i == j {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif pl[i]%pl[j] == 0 {\n\t\t\t\tflag = false\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\tif flag {\n\t\t\tcount++\n\t\t}\n\t}\n\tfmt.Println(count)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "sample_input": "5\n24 11 8 3 16\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02642", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2205, "memory_kb": 6428}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s570128479", "group_id": "codeNet:p02642", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\ta := make([]int, n)\n\tfor i:= 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\tsort.Ints(a)\n\n\tcounter := 0\n\tfor i :=n-1; 0 <= i; i-- {\n\t\tfor j :=0; j < n-1; j++ {\n\t\t\tif a[i] == a[j] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif a[i] % a[j] == 0 {\n\t\t\t\tcounter++\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tif counter == 0 {\n\t\tfmt.Println(counter)\n\t\treturn\n\t}\n\tfmt.Println(n-counter)\n\n\n\n}\n\n", "language": "Go", "metadata": {"date": 1592185762, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02642.html", "problem_id": "p02642", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02642/input.txt", "sample_output_relpath": "derived/input_output/data/p02642/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02642/Go/s570128479.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s570128479", "user_id": "u769765274"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\ta := make([]int, n)\n\tfor i:= 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\tsort.Ints(a)\n\n\tcounter := 0\n\tfor i :=n-1; 0 <= i; i-- {\n\t\tfor j :=0; j < n-1; j++ {\n\t\t\tif a[i] == a[j] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif a[i] % a[j] == 0 {\n\t\t\t\tcounter++\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tif counter == 0 {\n\t\tfmt.Println(counter)\n\t\treturn\n\t}\n\tfmt.Println(n-counter)\n\n\n\n}\n\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "sample_input": "5\n24 11 8 3 16\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02642", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 418, "cpu_time_ms": 2205, "memory_kb": 6444}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s070994453", "group_id": "codeNet:p02642", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc scanString() string { sc.Scan(); return sc.Text() }\nfunc scanRunes() []rune { return []rune(scanString()) }\nfunc scanInt() int { a, _ := strconv.Atoi(scanString()); return a }\nfunc scanInt64() int64 { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }\nfunc scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t}\n\treturn res\n}\n\nfunc debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n//•*¨*•.¸¸♪main•*¨*•.¸¸♪( -ω-)ノ ( ・ω・)\nfunc main() {\n\tdefer wr.Flush()\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1001001)\n\n\tn := scanInt()\n\ta := scanInts(n)\n\n\tcnt := map[int]int{}\n\tfor i := 0; i < n; i++ {\n\t\tcnt[a[i]]++\n\t}\n\n\tans := 0\n\n\tfor i := 0; i < n; i++ {\n\t\tf := true\n\t\tif cnt[1] != 0 {\n\t\t\tf = false\n\t\t}\n\t\tif cnt[a[i]] != 1 {\n\t\t\tf = false\n\t\t}\n\t\tfor j := 2; j*j <= a[i]; j++ {\n\t\t\tif a[i]%j == 0 {\n\t\t\t\tif cnt[a[i]/j] != 0 {\n\t\t\t\t\tf = false\n\t\t\t\t}\n\t\t\t\tif cnt[j] != 0 {\n\t\t\t\t\tf = false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif f {\n\t\t\tans++\n\t\t}\n\t}\n\n\tfmt.Fprintln(wr, ans)\n}\n", "language": "Go", "metadata": {"date": 1592185044, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02642.html", "problem_id": "p02642", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02642/input.txt", "sample_output_relpath": "derived/input_output/data/p02642/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02642/Go/s070994453.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s070994453", "user_id": "u548992197"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc scanString() string { sc.Scan(); return sc.Text() }\nfunc scanRunes() []rune { return []rune(scanString()) }\nfunc scanInt() int { a, _ := strconv.Atoi(scanString()); return a }\nfunc scanInt64() int64 { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }\nfunc scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t}\n\treturn res\n}\n\nfunc debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n//•*¨*•.¸¸♪main•*¨*•.¸¸♪( -ω-)ノ ( ・ω・)\nfunc main() {\n\tdefer wr.Flush()\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1001001)\n\n\tn := scanInt()\n\ta := scanInts(n)\n\n\tcnt := map[int]int{}\n\tfor i := 0; i < n; i++ {\n\t\tcnt[a[i]]++\n\t}\n\n\tans := 0\n\n\tfor i := 0; i < n; i++ {\n\t\tf := true\n\t\tif cnt[1] != 0 {\n\t\t\tf = false\n\t\t}\n\t\tif cnt[a[i]] != 1 {\n\t\t\tf = false\n\t\t}\n\t\tfor j := 2; j*j <= a[i]; j++ {\n\t\t\tif a[i]%j == 0 {\n\t\t\t\tif cnt[a[i]/j] != 0 {\n\t\t\t\t\tf = false\n\t\t\t\t}\n\t\t\t\tif cnt[j] != 0 {\n\t\t\t\t\tf = false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif f {\n\t\t\tans++\n\t\t}\n\t}\n\n\tfmt.Fprintln(wr, ans)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "sample_input": "5\n24 11 8 3 16\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02642", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1465, "cpu_time_ms": 2039, "memory_kb": 14960}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s663956812", "group_id": "codeNet:p02642", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tas := make([]int, n)\n\tm := make(map[int]bool)\n\tdup := make(map[int]bool)\n\tfor i := range as {\n\t\tsc.Scan()\n\t\tas[i], _ = strconv.Atoi(sc.Text())\n\t\tif _, ok := m[as[i]]; ok {\n\t\t\tdup[as[i]] = true\n\t\t}\n\t\tm[as[i]] = true\n\t}\n\tsort.Sort(sort.IntSlice(as))\n\tvar sum int\n\tms := make([]int, 1e6+1)\n\tfor i := range as {\n\t\tnum := as[i]\n\t\tif ms[num] == 1 {\n\t\t\tcontinue\n\t\t}\n\t\tif _, ok := dup[as[i]]; !ok {\n\t\t\tsum++\n\t\t}\n\t\tfor j := num; j <= 1e6; j += num {\n\t\t\tms[j] = 1\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n", "language": "Go", "metadata": {"date": 1592184837, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02642.html", "problem_id": "p02642", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02642/input.txt", "sample_output_relpath": "derived/input_output/data/p02642/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02642/Go/s663956812.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s663956812", "user_id": "u282164747"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tas := make([]int, n)\n\tm := make(map[int]bool)\n\tdup := make(map[int]bool)\n\tfor i := range as {\n\t\tsc.Scan()\n\t\tas[i], _ = strconv.Atoi(sc.Text())\n\t\tif _, ok := m[as[i]]; ok {\n\t\t\tdup[as[i]] = true\n\t\t}\n\t\tm[as[i]] = true\n\t}\n\tsort.Sort(sort.IntSlice(as))\n\tvar sum int\n\tms := make([]int, 1e6+1)\n\tfor i := range as {\n\t\tnum := as[i]\n\t\tif ms[num] == 1 {\n\t\t\tcontinue\n\t\t}\n\t\tif _, ok := dup[as[i]]; !ok {\n\t\t\tsum++\n\t\t}\n\t\tfor j := num; j <= 1e6; j += num {\n\t\t\tms[j] = 1\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "sample_input": "5\n24 11 8 3 16\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02642", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a number sequence A of length N.\n\nFind the number of integers i \\left(1 \\leq i \\leq N\\right) with the following property:\n\nFor every integer j \\left(1 \\leq j \\leq N\\right) such that i \\neq j , A_j does not divide A_i.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^6\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 answer.\n\nSample Input 1\n\n5\n24 11 8 3 16\n\nSample Output 1\n\n3\n\nThe integers with the property are 2, 3, and 4.\n\nSample Input 2\n\n4\n5 5 5 5\n\nSample Output 2\n\n0\n\nNote that there can be multiple equal numbers.\n\nSample Input 3\n\n10\n33 18 45 28 8 19 89 86 2 4\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 839, "cpu_time_ms": 95, "memory_kb": 19068}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s508064773", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\tlines, _ := scanLongIntSlices(1, 10000000)\n\tnums := lines[0]\n\n\tfor _, n := range nums {\n\t\tif n == 0 {\n\t\t\tfmt.Println(\"0\")\n\t\t\tos.Exit(0)\n\t\t}\n\t}\n\n\tprod := 1\n\tfor _, n := range nums {\n\t\tif n > 1000000000000000000/prod {\n\t\t\tfmt.Println(\"-1\")\n\t\t\tos.Exit(0)\n\t\t}\n\t\tprod *= n\n\t}\n\n\tfmt.Printf(\"%d\\n\", prod)\n}\n\nfunc scanLongIntSlices(lines int, maxBufSize int) ([][]int, error) {\n\n\tres := [][]int{}\n\n\tsc := bufio.NewScanner(os.Stdin)\n\tbuf := make([]byte, bufio.MaxScanTokenSize)\n\tsc.Buffer(buf, maxBufSize)\n\n\tfor sc.Scan() {\n\t\tline := sc.Text()\n\t\tstrs := strings.Split(line, \" \")\n\t\tints := make([]int, len(strs))\n\t\tfor i, c := range strs {\n\t\t\tn, err := strconv.Atoi(c)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tints[i] = n\n\t\t}\n\t\tres = append(res, ints)\n\t}\n\n\tif err := sc.Err(); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn res, nil\n}\n", "language": "Go", "metadata": {"date": 1597538776, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s508064773.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s508064773", "user_id": "u131131890"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\tlines, _ := scanLongIntSlices(1, 10000000)\n\tnums := lines[0]\n\n\tfor _, n := range nums {\n\t\tif n == 0 {\n\t\t\tfmt.Println(\"0\")\n\t\t\tos.Exit(0)\n\t\t}\n\t}\n\n\tprod := 1\n\tfor _, n := range nums {\n\t\tif n > 1000000000000000000/prod {\n\t\t\tfmt.Println(\"-1\")\n\t\t\tos.Exit(0)\n\t\t}\n\t\tprod *= n\n\t}\n\n\tfmt.Printf(\"%d\\n\", prod)\n}\n\nfunc scanLongIntSlices(lines int, maxBufSize int) ([][]int, error) {\n\n\tres := [][]int{}\n\n\tsc := bufio.NewScanner(os.Stdin)\n\tbuf := make([]byte, bufio.MaxScanTokenSize)\n\tsc.Buffer(buf, maxBufSize)\n\n\tfor sc.Scan() {\n\t\tline := sc.Text()\n\t\tstrs := strings.Split(line, \" \")\n\t\tints := make([]int, len(strs))\n\t\tfor i, c := range strs {\n\t\t\tn, err := strconv.Atoi(c)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tints[i] = n\n\t\t}\n\t\tres = append(res, ints)\n\t}\n\n\tif err := sc.Err(); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn res, nil\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 944, "cpu_time_ms": 26, "memory_kb": 9444}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s980351380", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math/big\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\tlines, _ := scanLongIntSlices(1, 10000000)\n\tnums := lines[0]\n\n\tprod := big.NewInt(1)\n\tfor _, n := range nums {\n\t\tprod.Mul(prod, big.NewInt(int64(n)))\n\t}\n\tif prod.Cmp(big.NewInt(1000000000000000000)) > 0 {\n\t\tfmt.Println(\"-1\")\n\t} else {\n\t\tfmt.Printf(\"%s\\n\", prod.String())\n\t}\n}\n\nfunc scanLongIntSlices(lines int, maxBufSize int) ([][]int, error) {\n\n\tres := [][]int{}\n\n\tsc := bufio.NewScanner(os.Stdin)\n\tbuf := make([]byte, bufio.MaxScanTokenSize)\n\tsc.Buffer(buf, maxBufSize)\n\n\tfor sc.Scan() {\n\t\tline := sc.Text()\n\t\tstrs := strings.Split(line, \" \")\n\t\tints := make([]int, len(strs))\n\t\tfor i, c := range strs {\n\t\t\tn, err := strconv.Atoi(c)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tints[i] = n\n\t\t}\n\t\tres = append(res, ints)\n\t}\n\n\tif err := sc.Err(); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn res, nil\n}\n", "language": "Go", "metadata": {"date": 1597538049, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s980351380.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s980351380", "user_id": "u131131890"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math/big\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\tlines, _ := scanLongIntSlices(1, 10000000)\n\tnums := lines[0]\n\n\tprod := big.NewInt(1)\n\tfor _, n := range nums {\n\t\tprod.Mul(prod, big.NewInt(int64(n)))\n\t}\n\tif prod.Cmp(big.NewInt(1000000000000000000)) > 0 {\n\t\tfmt.Println(\"-1\")\n\t} else {\n\t\tfmt.Printf(\"%s\\n\", prod.String())\n\t}\n}\n\nfunc scanLongIntSlices(lines int, maxBufSize int) ([][]int, error) {\n\n\tres := [][]int{}\n\n\tsc := bufio.NewScanner(os.Stdin)\n\tbuf := make([]byte, bufio.MaxScanTokenSize)\n\tsc.Buffer(buf, maxBufSize)\n\n\tfor sc.Scan() {\n\t\tline := sc.Text()\n\t\tstrs := strings.Split(line, \" \")\n\t\tints := make([]int, len(strs))\n\t\tfor i, c := range strs {\n\t\t\tn, err := strconv.Atoi(c)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tints[i] = n\n\t\t}\n\t\tres = append(res, ints)\n\t}\n\n\tif err := sc.Err(); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn res, nil\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 932, "cpu_time_ms": 2206, "memory_kb": 25104}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s072800545", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar (\n\t\tn int\n\t)\n\n\tfmt.Scan(&n)\n\tmax := 1000000000000000000\n\ta := make([]int, n)\n\tsum := 1\n\tfor i := range a {\n\t\tfmt.Scan(&a[i])\n\t\tif a[i] == 0 {\n\t\t\tfmt.Print(0)\n\t\t\treturn\n\t\t}\n\t}\n\tfor _, j := range a {\n\t\tif j <= max/sum {\n\t\t\tsum *= j\n\t\t} else {\n\t\t\tfmt.Print(-1)\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Print(sum)\n}\n", "language": "Go", "metadata": {"date": 1596954078, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s072800545.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s072800545", "user_id": "u403355272"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar (\n\t\tn int\n\t)\n\n\tfmt.Scan(&n)\n\tmax := 1000000000000000000\n\ta := make([]int, n)\n\tsum := 1\n\tfor i := range a {\n\t\tfmt.Scan(&a[i])\n\t\tif a[i] == 0 {\n\t\t\tfmt.Print(0)\n\t\t\treturn\n\t\t}\n\t}\n\tfor _, j := range a {\n\t\tif j <= max/sum {\n\t\t\tsum *= j\n\t\t} else {\n\t\t\tfmt.Print(-1)\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Print(sum)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1522, "memory_kb": 6300}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s246449202", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc configure(scanner *bufio.Scanner) {\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 1000005), 1000005)\n}\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanned := scanner.Scan()\n\tif !scanned {\n\t\tpanic(\"scan failed\")\n\t}\n\treturn scanner.Text()\n}\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\nfunc getNextFloat64(scanner *bufio.Scanner) float64 {\n\ti, _ := strconv.ParseFloat(getNextString(scanner), 64)\n\treturn i\n}\nfunc main() {\n\tfp := os.Stdin\n\twfp := os.Stdout\n\textra := 0\n\tif os.Getenv(\"I\") == \"IronMan\" {\n\t\tfp, _ = os.Open(os.Getenv(\"END_GAME\"))\n\t\textra = 100\n\t}\n\tscanner := bufio.NewScanner(fp)\n\tconfigure(scanner)\n\twriter := bufio.NewWriter(wfp)\n\tdefer func() {\n\t\tr := recover()\n\t\tif r != nil {\n\t\t\tfmt.Fprintln(writer, r)\n\t\t}\n\t\twriter.Flush()\n\t}()\n\tsolve(scanner, writer)\n\tfor i := 0; i < extra; i++ {\n\t\tfmt.Fprintln(writer, \"-----------------------------------\")\n\t\tsolve(scanner, writer)\n\t}\n}\nfunc solve(scanner *bufio.Scanner, writer *bufio.Writer) {\n\tn := getNextInt(scanner)\n\taa := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\taa[i] = getNextInt64(scanner)\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tif aa[i] == 0 {\n\t\t\tfmt.Fprintln(writer, 0)\n\t\t\treturn\n\t\t}\n\t}\n\tvar ans int64 = 1\n\tfor i := 0; i < n; i++ {\n\t\tif int64(1e18)/aa[i] < ans {\n\t\t\tfmt.Fprintln(writer, -1)\n\t\t\treturn\n\t\t}\n\t\tans *= aa[i]\n\t}\n\tfmt.Fprintln(writer, ans)\n}\n", "language": "Go", "metadata": {"date": 1593738104, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s246449202.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s246449202", "user_id": "u150542210"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc configure(scanner *bufio.Scanner) {\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 1000005), 1000005)\n}\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanned := scanner.Scan()\n\tif !scanned {\n\t\tpanic(\"scan failed\")\n\t}\n\treturn scanner.Text()\n}\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\nfunc getNextFloat64(scanner *bufio.Scanner) float64 {\n\ti, _ := strconv.ParseFloat(getNextString(scanner), 64)\n\treturn i\n}\nfunc main() {\n\tfp := os.Stdin\n\twfp := os.Stdout\n\textra := 0\n\tif os.Getenv(\"I\") == \"IronMan\" {\n\t\tfp, _ = os.Open(os.Getenv(\"END_GAME\"))\n\t\textra = 100\n\t}\n\tscanner := bufio.NewScanner(fp)\n\tconfigure(scanner)\n\twriter := bufio.NewWriter(wfp)\n\tdefer func() {\n\t\tr := recover()\n\t\tif r != nil {\n\t\t\tfmt.Fprintln(writer, r)\n\t\t}\n\t\twriter.Flush()\n\t}()\n\tsolve(scanner, writer)\n\tfor i := 0; i < extra; i++ {\n\t\tfmt.Fprintln(writer, \"-----------------------------------\")\n\t\tsolve(scanner, writer)\n\t}\n}\nfunc solve(scanner *bufio.Scanner, writer *bufio.Writer) {\n\tn := getNextInt(scanner)\n\taa := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\taa[i] = getNextInt64(scanner)\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tif aa[i] == 0 {\n\t\t\tfmt.Fprintln(writer, 0)\n\t\t\treturn\n\t\t}\n\t}\n\tvar ans int64 = 1\n\tfor i := 0; i < n; i++ {\n\t\tif int64(1e18)/aa[i] < ans {\n\t\t\tfmt.Fprintln(writer, -1)\n\t\t\treturn\n\t\t}\n\t\tans *= aa[i]\n\t}\n\tfmt.Fprintln(writer, ans)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1581, "cpu_time_ms": 37, "memory_kb": 6164}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s409102465", "group_id": "codeNet:p02658", "input_text": "package main \n \nimport \"fmt\"\n \nfunc main() {\n\tvar N int\n fmt.Scan(&N)\n nums := make([]int, N)\n for i := range nums{\n fmt.Scan(&nums[i])\n }\n ok := true\n ans := 1\n for _, num := range nums{\n \tans = ans * num\n if ans > 1000000000000000000{\n ok = false\n }\n }\n if ok == true {\n fmt.Println(ans)\n }else{\n fmt.Println(-1)\n }\n}", "language": "Go", "metadata": {"date": 1592665852, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s409102465.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s409102465", "user_id": "u470241748"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main \n \nimport \"fmt\"\n \nfunc main() {\n\tvar N int\n fmt.Scan(&N)\n nums := make([]int, N)\n for i := range nums{\n fmt.Scan(&nums[i])\n }\n ok := true\n ans := 1\n for _, num := range nums{\n \tans = ans * num\n if ans > 1000000000000000000{\n ok = false\n }\n }\n if ok == true {\n fmt.Println(ans)\n }else{\n fmt.Println(-1)\n }\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 351, "cpu_time_ms": 1514, "memory_kb": 6316}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s736200264", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tnum, _ := strconv.Atoi(scanString())\n\treturn num\n}\n\nfunc scanString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc main() {\n\tn := scanInt()\n\tarr := make([]int, n)\n\n\tans := 1\n\tfor i := range arr {\n\t\tnum := scanInt()\n\t\tif num == 0 {\n\t\t\tans = 0\n\t\t}\n\t\tarr[i] = num\n\t}\n\n\tif ans != 0 {\n\t\tfor _, e := range arr {\n\t\t\tif ans > 1e18/e {\n\t\t\t\tans = -1\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tans *= e\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1592443743, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s736200264.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s736200264", "user_id": "u315984289"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tnum, _ := strconv.Atoi(scanString())\n\treturn num\n}\n\nfunc scanString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc main() {\n\tn := scanInt()\n\tarr := make([]int, n)\n\n\tans := 1\n\tfor i := range arr {\n\t\tnum := scanInt()\n\t\tif num == 0 {\n\t\t\tans = 0\n\t\t}\n\t\tarr[i] = num\n\t}\n\n\tif ans != 0 {\n\t\tfor _, e := range arr {\n\t\t\tif ans > 1e18/e {\n\t\t\t\tans = -1\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tans *= e\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 559, "cpu_time_ms": 41, "memory_kb": 5868}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s244857041", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\ta:=make([]int,n)\n\tsum:=1\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t\tif a[i]!=0 && int(math.Pow(10.0, 18.0))/a[i] 18 {\n ans = -1\n continue\n }\n ans *= tmp\n if ans > upper {\n ans = -1\n }\n\n }\n fmt.Print(ans)\n}\n", "language": "Go", "metadata": {"date": 1592014428, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s239687603.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s239687603", "user_id": "u770423799"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\nimport \"strconv\"\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n var ans = 1\n var upper = 1000000000000000000\n for i := 0; i < n; i++ {\n var tmp int\n fmt.Scan(&tmp)\n if tmp == 0 {\n ans = 0\n break\n }\n if ans == -1 {\n continue\n }\n var a = strconv.Itoa(tmp)\n var b = strconv.Itoa(ans)\n if len(a)+len(b) > 18 {\n ans = -1\n continue\n }\n ans *= tmp\n if ans > upper {\n ans = -1\n }\n\n }\n fmt.Print(ans)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 797, "cpu_time_ms": 1366, "memory_kb": 6336}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s063045940", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t// \"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\n// 1行読み込み\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// 読み込みをint型へキャスト\nfunc nextInt() int {\n\tsc.Scan()\n\tnum, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn num\n}\n\nfunc nextFloat() float64 {\n\tsc.Scan()\n\tnum, err := strconv.ParseFloat(sc.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn num\n}\n\nconst max = 1000000000000000000\nfunc main() {\n\t// scannerの挙動を改行区切り → 空白区切りに変更\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tnum := 1\n\tfor i := 0; i < n; i++ {\n\t\tnum *= nextInt()\n\t\tif num > max {\n\t\t\tbreak\n\t\t}\n\t}\n\tif num <= max {\n\t\tfmt.Println(num)\n\t} else {\n\t\tfmt.Println(-1)\n\t}\n}", "language": "Go", "metadata": {"date": 1591999806, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s063045940.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s063045940", "user_id": "u966880389"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t// \"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\n// 1行読み込み\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// 読み込みをint型へキャスト\nfunc nextInt() int {\n\tsc.Scan()\n\tnum, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn num\n}\n\nfunc nextFloat() float64 {\n\tsc.Scan()\n\tnum, err := strconv.ParseFloat(sc.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn num\n}\n\nconst max = 1000000000000000000\nfunc main() {\n\t// scannerの挙動を改行区切り → 空白区切りに変更\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tnum := 1\n\tfor i := 0; i < n; i++ {\n\t\tnum *= nextInt()\n\t\tif num > max {\n\t\t\tbreak\n\t\t}\n\t}\n\tif num <= max {\n\t\tfmt.Println(num)\n\t} else {\n\t\tfmt.Println(-1)\n\t}\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 787, "cpu_time_ms": 12, "memory_kb": 1760}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s839945032", "group_id": "codeNet:p02658", "input_text": "package main\nimport (\n \"bufio\"\n \"fmt\"\n \"math/big\"\n \"os\"\n \"strconv\"\n \"strings\"\n)\n\nvar sc = bufio.NewReaderSize(os.Stdin, 1024*1024*10)\n\nfunc main() {\n N := getStdinInt()\n A := getStdinIntArr64()\n Abig := make([]*big.Int, N)\n for i := 0; i < N; i++ {\n Abig[i] = big.NewInt(A[i])\n }\n\n for i := range A {\n if A[i] == 0 {\n fmt.Println(0)\n return\n }\n if A[i] > 1000000000000000000 {\n fmt.Println(-1)\n return\n }\n }\n\n ans := big.NewInt(1)\n cmp := big.NewInt(1000000000000000000)\n\n for i := range Abig {\n ans = ans.Mul(ans, Abig[i])\n if ans.Cmp(cmp) == 1 {\n fmt.Println(-1)\n return\n }\n }\n\n fmt.Println(ans)\n}\n\n\nfunc getStdin() string {\n return readLine()\n}\nfunc getStdinInt() int {\n str := getStdin()\n res, _ := strconv.Atoi(str)\n return res\n}\nfunc getStdinintArr() []int {\n str := getStdin()\n list := strings.Split(str, \" \")\n res := make([]int, len(list))\n for idx, v := range list {\n res[idx], _ = strconv.Atoi(v)\n }\n return res\n}\nfunc getStdinIntArr64() []int64 {\n str := getStdin()\n list := strings.Split(str, \" \")\n res := make([]int64, len(list))\n for idx, v := range list {\n res[idx], _ = strconv.ParseInt(v, 10, 64)\n }\n return res\n}\nfunc readLine() string {\n buf := make([]byte, 0, 0)\n for {\n l, p, e := sc.ReadLine()\n if e != nil {\n panic(e)\n }\n buf = append(buf, l...)\n if !p {\n break\n }\n }\n return string(buf)\n}", "language": "Go", "metadata": {"date": 1591918787, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s839945032.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s839945032", "user_id": "u767664985"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\nimport (\n \"bufio\"\n \"fmt\"\n \"math/big\"\n \"os\"\n \"strconv\"\n \"strings\"\n)\n\nvar sc = bufio.NewReaderSize(os.Stdin, 1024*1024*10)\n\nfunc main() {\n N := getStdinInt()\n A := getStdinIntArr64()\n Abig := make([]*big.Int, N)\n for i := 0; i < N; i++ {\n Abig[i] = big.NewInt(A[i])\n }\n\n for i := range A {\n if A[i] == 0 {\n fmt.Println(0)\n return\n }\n if A[i] > 1000000000000000000 {\n fmt.Println(-1)\n return\n }\n }\n\n ans := big.NewInt(1)\n cmp := big.NewInt(1000000000000000000)\n\n for i := range Abig {\n ans = ans.Mul(ans, Abig[i])\n if ans.Cmp(cmp) == 1 {\n fmt.Println(-1)\n return\n }\n }\n\n fmt.Println(ans)\n}\n\n\nfunc getStdin() string {\n return readLine()\n}\nfunc getStdinInt() int {\n str := getStdin()\n res, _ := strconv.Atoi(str)\n return res\n}\nfunc getStdinintArr() []int {\n str := getStdin()\n list := strings.Split(str, \" \")\n res := make([]int, len(list))\n for idx, v := range list {\n res[idx], _ = strconv.Atoi(v)\n }\n return res\n}\nfunc getStdinIntArr64() []int64 {\n str := getStdin()\n list := strings.Split(str, \" \")\n res := make([]int64, len(list))\n for idx, v := range list {\n res[idx], _ = strconv.ParseInt(v, 10, 64)\n }\n return res\n}\nfunc readLine() string {\n buf := make([]byte, 0, 0)\n for {\n l, p, e := sc.ReadLine()\n if e != nil {\n panic(e)\n }\n buf = append(buf, l...)\n if !p {\n break\n }\n }\n return string(buf)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1626, "cpu_time_ms": 37, "memory_kb": 15476}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s630225690", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\ta := make([]int, n)\n\tfor i := range a {\n\t\tfmt.Scan(&a[i])\n\t}\n\n\tans := 1\n\tfor _, num := range a {\n\t\tans *= num\n\t}\n\tif float64(ans) > math.Pow(10.0, 18.0) {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1591574595, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s630225690.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s630225690", "user_id": "u475329018"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\ta := make([]int, n)\n\tfor i := range a {\n\t\tfmt.Scan(&a[i])\n\t}\n\n\tans := 1\n\tfor _, num := range a {\n\t\tans *= num\n\t}\n\tif float64(ans) > math.Pow(10.0, 18.0) {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1378, "memory_kb": 6328}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s626433946", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"math/big\"\n\t\"os\"\n)\n\nfunc main() {\n\tsc := NewScanner(os.Stdin)\n\tn := sc.Int()\n\ta := sc.Int64s(n)\n\n\tfor _, v := range a {\n\t\tif v == 0 {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t}\n\t}\n\n\tres := big.NewInt(1)\n\tmax := big.NewInt(1000000000000000000)\n\n\tfor _, v := range a {\n\t\tres = res.Mul(res, big.NewInt(v))\n\t\tif res.Cmp(max) == 1 {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(res)\n}\n\n// generated by https://github.com/murosan/gollect\n\ntype Scanner struct {\n\tr io.Reader\n\tbuf []byte\n\tdelim byte\n\tsize, eof,\n\tstart, end int\n}\n\nfunc NewScanner(r io.Reader) *Scanner { return NewScannerSize(r, 4096) }\nfunc NewScannerSize(r io.Reader, size int) *Scanner {\n\treturn &Scanner{\n\t\tr: r,\n\t\tbuf: make([]byte, size),\n\t\tdelim: ' ',\n\t\tsize: size, start: size, end: size,\n\t}\n}\n\nfunc (s *Scanner) Int() int { return ParseInt(s.bytes()) }\nfunc (s *Scanner) Int64() int64 { return ParseInt64(s.bytes()) }\n\nfunc (s *Scanner) Int64s(len int) []int64 {\n\ta := make([]int64, len)\n\tfor i := 0; i < len; i++ {\n\t\ta[i] = s.Int64()\n\t}\n\treturn a\n}\n\nfunc (s *Scanner) bytes() []byte { b, _ := s.next(); return b }\nfunc (s *Scanner) next() (b []byte, size int) {\n\tfor n := 0; ; {\n\t\tfor i := s.end; i < s.size; i++ {\n\t\t\tif s.buf[i] == s.delim || s.buf[i] == '\\n' || i == s.eof {\n\t\t\t\tb, size = s.buf[s.start:i], i-s.start\n\t\t\t\ts.start, s.end = i+1, i+1\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\ts.end = s.size\n\t\tif n++; n == 2 {\n\t\t\tpanic(\"lack of buffer size\")\n\t\t}\n\t\ts.read()\n\t}\n}\nfunc (s *Scanner) read() {\n\tcopy(s.buf, s.buf[s.start:s.end])\n\ts.end -= s.start\n\ts.start = 0\n\tn, _ := s.r.Read(s.buf[s.end:])\n\ts.eof = s.end + n\n}\n\nfunc ParseInt(b []byte) (n int) {\n\tvar i int\n\tif b[0] == '-' {\n\t\ti++\n\t}\n\tfor ; i < len(b); i++ {\n\t\tn *= 10\n\t\tn += int(b[i] - '0')\n\t}\n\tif b[0] == '-' {\n\t\treturn -n\n\t}\n\treturn\n}\n\nfunc ParseInt64(b []byte) (n int64) {\n\tvar i int\n\tif b[0] == '-' {\n\t\ti++\n\t}\n\tfor ; i < len(b); i++ {\n\t\tn *= 10\n\t\tn += int64(b[i] - '0')\n\t}\n\tif b[0] == '-' {\n\t\treturn -n\n\t}\n\treturn\n}\n", "language": "Go", "metadata": {"date": 1591515148, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s626433946.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s626433946", "user_id": "u478134456"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"math/big\"\n\t\"os\"\n)\n\nfunc main() {\n\tsc := NewScanner(os.Stdin)\n\tn := sc.Int()\n\ta := sc.Int64s(n)\n\n\tfor _, v := range a {\n\t\tif v == 0 {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t}\n\t}\n\n\tres := big.NewInt(1)\n\tmax := big.NewInt(1000000000000000000)\n\n\tfor _, v := range a {\n\t\tres = res.Mul(res, big.NewInt(v))\n\t\tif res.Cmp(max) == 1 {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(res)\n}\n\n// generated by https://github.com/murosan/gollect\n\ntype Scanner struct {\n\tr io.Reader\n\tbuf []byte\n\tdelim byte\n\tsize, eof,\n\tstart, end int\n}\n\nfunc NewScanner(r io.Reader) *Scanner { return NewScannerSize(r, 4096) }\nfunc NewScannerSize(r io.Reader, size int) *Scanner {\n\treturn &Scanner{\n\t\tr: r,\n\t\tbuf: make([]byte, size),\n\t\tdelim: ' ',\n\t\tsize: size, start: size, end: size,\n\t}\n}\n\nfunc (s *Scanner) Int() int { return ParseInt(s.bytes()) }\nfunc (s *Scanner) Int64() int64 { return ParseInt64(s.bytes()) }\n\nfunc (s *Scanner) Int64s(len int) []int64 {\n\ta := make([]int64, len)\n\tfor i := 0; i < len; i++ {\n\t\ta[i] = s.Int64()\n\t}\n\treturn a\n}\n\nfunc (s *Scanner) bytes() []byte { b, _ := s.next(); return b }\nfunc (s *Scanner) next() (b []byte, size int) {\n\tfor n := 0; ; {\n\t\tfor i := s.end; i < s.size; i++ {\n\t\t\tif s.buf[i] == s.delim || s.buf[i] == '\\n' || i == s.eof {\n\t\t\t\tb, size = s.buf[s.start:i], i-s.start\n\t\t\t\ts.start, s.end = i+1, i+1\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\ts.end = s.size\n\t\tif n++; n == 2 {\n\t\t\tpanic(\"lack of buffer size\")\n\t\t}\n\t\ts.read()\n\t}\n}\nfunc (s *Scanner) read() {\n\tcopy(s.buf, s.buf[s.start:s.end])\n\ts.end -= s.start\n\ts.start = 0\n\tn, _ := s.r.Read(s.buf[s.end:])\n\ts.eof = s.end + n\n}\n\nfunc ParseInt(b []byte) (n int) {\n\tvar i int\n\tif b[0] == '-' {\n\t\ti++\n\t}\n\tfor ; i < len(b); i++ {\n\t\tn *= 10\n\t\tn += int(b[i] - '0')\n\t}\n\tif b[0] == '-' {\n\t\treturn -n\n\t}\n\treturn\n}\n\nfunc ParseInt64(b []byte) (n int64) {\n\tvar i int\n\tif b[0] == '-' {\n\t\ti++\n\t}\n\tfor ; i < len(b); i++ {\n\t\tn *= 10\n\t\tn += int64(b[i] - '0')\n\t}\n\tif b[0] == '-' {\n\t\treturn -n\n\t}\n\treturn\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1980, "cpu_time_ms": 19, "memory_kb": 3392}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s327512537", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nfunc main() {\n\tsc := NewScanner(os.Stdin)\n\tn := sc.Int()\n\n\tres := sc.UInt64()\n\tfor i := 1; i < n; i++ {\n\t\tres *= sc.UInt64()\n\n\t\tif res == 0 {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t}\n\t\tif res > 1000000000000000000 {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(res)\n}\n\n// generated by https://github.com/murosan/gollect\n\ntype Scanner struct {\n\tr io.Reader\n\tbuf []byte\n\tdelim byte\n\tsize, eof,\n\tstart, end int\n}\n\nfunc NewScanner(r io.Reader) *Scanner { return NewScannerSize(r, 4096) }\nfunc NewScannerSize(r io.Reader, size int) *Scanner {\n\treturn &Scanner{\n\t\tr: r,\n\t\tbuf: make([]byte, size),\n\t\tdelim: ' ',\n\t\tsize: size, start: size, end: size,\n\t}\n}\n\nfunc (s *Scanner) Int() int { return ParseInt(s.bytes()) }\n\nfunc (s *Scanner) UInt64() uint64 { return ParseUInt64(s.bytes()) }\n\nfunc (s *Scanner) bytes() []byte { b, _ := s.next(); return b }\nfunc (s *Scanner) next() (b []byte, size int) {\n\tfor n := 0; ; {\n\t\tfor i := s.end; i < s.size; i++ {\n\t\t\tif s.buf[i] == s.delim || s.buf[i] == '\\n' || i == s.eof {\n\t\t\t\tb, size = s.buf[s.start:i], i-s.start\n\t\t\t\ts.start, s.end = i+1, i+1\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\ts.end = s.size\n\t\tif n++; n == 2 {\n\t\t\tpanic(\"lack of buffer size\")\n\t\t}\n\t\ts.read()\n\t}\n}\nfunc (s *Scanner) read() {\n\tcopy(s.buf, s.buf[s.start:s.end])\n\ts.end -= s.start\n\ts.start = 0\n\tn, _ := s.r.Read(s.buf[s.end:])\n\ts.eof = s.end + n\n}\n\nfunc ParseInt(b []byte) (n int) {\n\tvar i int\n\tif b[0] == '-' {\n\t\ti++\n\t}\n\tfor ; i < len(b); i++ {\n\t\tn *= 10\n\t\tn += int(b[i] - '0')\n\t}\n\tif b[0] == '-' {\n\t\treturn -n\n\t}\n\treturn\n}\n\nfunc ParseUInt64(b []byte) (n uint64) {\n\tvar i int\n\tif b[0] == '-' {\n\t\ti++\n\t}\n\tfor ; i < len(b); i++ {\n\t\tn *= 10\n\t\tn += uint64(b[i] - '0')\n\t}\n\tif b[0] == '-' {\n\t\treturn -n\n\t}\n\treturn\n}\n", "language": "Go", "metadata": {"date": 1591513941, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s327512537.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s327512537", "user_id": "u478134456"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nfunc main() {\n\tsc := NewScanner(os.Stdin)\n\tn := sc.Int()\n\n\tres := sc.UInt64()\n\tfor i := 1; i < n; i++ {\n\t\tres *= sc.UInt64()\n\n\t\tif res == 0 {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t}\n\t\tif res > 1000000000000000000 {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(res)\n}\n\n// generated by https://github.com/murosan/gollect\n\ntype Scanner struct {\n\tr io.Reader\n\tbuf []byte\n\tdelim byte\n\tsize, eof,\n\tstart, end int\n}\n\nfunc NewScanner(r io.Reader) *Scanner { return NewScannerSize(r, 4096) }\nfunc NewScannerSize(r io.Reader, size int) *Scanner {\n\treturn &Scanner{\n\t\tr: r,\n\t\tbuf: make([]byte, size),\n\t\tdelim: ' ',\n\t\tsize: size, start: size, end: size,\n\t}\n}\n\nfunc (s *Scanner) Int() int { return ParseInt(s.bytes()) }\n\nfunc (s *Scanner) UInt64() uint64 { return ParseUInt64(s.bytes()) }\n\nfunc (s *Scanner) bytes() []byte { b, _ := s.next(); return b }\nfunc (s *Scanner) next() (b []byte, size int) {\n\tfor n := 0; ; {\n\t\tfor i := s.end; i < s.size; i++ {\n\t\t\tif s.buf[i] == s.delim || s.buf[i] == '\\n' || i == s.eof {\n\t\t\t\tb, size = s.buf[s.start:i], i-s.start\n\t\t\t\ts.start, s.end = i+1, i+1\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\ts.end = s.size\n\t\tif n++; n == 2 {\n\t\t\tpanic(\"lack of buffer size\")\n\t\t}\n\t\ts.read()\n\t}\n}\nfunc (s *Scanner) read() {\n\tcopy(s.buf, s.buf[s.start:s.end])\n\ts.end -= s.start\n\ts.start = 0\n\tn, _ := s.r.Read(s.buf[s.end:])\n\ts.eof = s.end + n\n}\n\nfunc ParseInt(b []byte) (n int) {\n\tvar i int\n\tif b[0] == '-' {\n\t\ti++\n\t}\n\tfor ; i < len(b); i++ {\n\t\tn *= 10\n\t\tn += int(b[i] - '0')\n\t}\n\tif b[0] == '-' {\n\t\treturn -n\n\t}\n\treturn\n}\n\nfunc ParseUInt64(b []byte) (n uint64) {\n\tvar i int\n\tif b[0] == '-' {\n\t\ti++\n\t}\n\tfor ; i < len(b); i++ {\n\t\tn *= 10\n\t\tn += uint64(b[i] - '0')\n\t}\n\tif b[0] == '-' {\n\t\treturn -n\n\t}\n\treturn\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1749, "cpu_time_ms": 6, "memory_kb": 1756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s758734664", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tvar (\n\t\tans int64 = 1\n\t\ta int64\n\t\tover bool = false\n\t\tzero bool = false\n\t)\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a)\n\n\t\tif a >= math.MaxInt64/ans {\n\t\t\tover = true\n\t\t}\n\t\tif a == 0 {\n\t\t\tzero = true\n\t\t}\n\t\tif !over && !zero {\n\t\t\tans *= a\n\t\t}\n\t\tif ans > 1e18 {\n\t\t\tover = true\n\t\t}\n\t}\n\n\tif zero {\n\t\tfmt.Println(0)\n\t} else if over {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(ans)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1591378007, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s758734664.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s758734664", "user_id": "u216365880"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tvar (\n\t\tans int64 = 1\n\t\ta int64\n\t\tover bool = false\n\t\tzero bool = false\n\t)\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a)\n\n\t\tif a >= math.MaxInt64/ans {\n\t\t\tover = true\n\t\t}\n\t\tif a == 0 {\n\t\t\tzero = true\n\t\t}\n\t\tif !over && !zero {\n\t\t\tans *= a\n\t\t}\n\t\tif ans > 1e18 {\n\t\t\tover = true\n\t\t}\n\t}\n\n\tif zero {\n\t\tfmt.Println(0)\n\t} else if over {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(ans)\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 463, "cpu_time_ms": 1386, "memory_kb": 6316}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s991029586", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\n\tvar n int64\n\t// //fmt.Println(\"n\")\n\tfmt.Scanf(\"%d\", &n)\n\t// //fmt.Println(\"input\" + strconv.FormatInt(n, 10))\n\t// inputAarray := make([]uint64, 0, n)\n\n\t// for {\n\t//fmt.Println(\"A:\" + strconv.FormatInt(count, 10))\n\t// \tfmt.Scanf(\"%d\", &a)\n\t// \t//fmt.Println(\"input\" + strconv.FormatInt(a, 10))\n\t// \tinputAarray = append(inputAarray, a)\n\t// \tcount++\n\t// \tif count+1 > n {\n\t// \t\tbreak\n\t// \t}\n\t// }\n\tvar instr string\n\tvar sc = bufio.NewScanner(os.Stdin)\n\tif sc.Scan() {\n\t\tinstr = sc.Text()\n\t}\n\t// fmt.Println(\"instrnum:\" + instr)\n\tinarray := strings.Split(instr, \" \")\n\tvar vrslt int64\n\tvrslt = 1\n\t// fmt.Println(\"size:\" + strconv.Itoa(len(inarray)))\n\tiszero := 1\n\tfor _, v := range inarray {\n\t\tvar a int64\n\t\t//fmt.Println(\"vrslt:\" + strconv.FormatInt(vrslt, 10))\n\t\ta, err := strconv.ParseInt(v, 10, 64)\n\t\tif err != nil {\n\t\t\t// fmt.Println(err)\n\t\t}\n\t\t// fmt.Println(\"vrslt:\" + strconv.FormatUint(vrslt, 10))\n\t\tif a == 0 {\n\t\t\tiszero = 0\n\t\t\tbreak\n\t\t}\n\t\tif vrslt > 1000000000000000000/a {\n\t\t\tvrslt = -1\n\t\t}\n\t\tvrslt = vrslt * a\n\t}\n\n\tif iszero == 0 {\n\t\tfmt.Printf(\"%d\", 0)\n\t} else {\n\t\tfmt.Printf(\"%d\", vrslt)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1591349161, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s991029586.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s991029586", "user_id": "u378328718"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\n\tvar n int64\n\t// //fmt.Println(\"n\")\n\tfmt.Scanf(\"%d\", &n)\n\t// //fmt.Println(\"input\" + strconv.FormatInt(n, 10))\n\t// inputAarray := make([]uint64, 0, n)\n\n\t// for {\n\t//fmt.Println(\"A:\" + strconv.FormatInt(count, 10))\n\t// \tfmt.Scanf(\"%d\", &a)\n\t// \t//fmt.Println(\"input\" + strconv.FormatInt(a, 10))\n\t// \tinputAarray = append(inputAarray, a)\n\t// \tcount++\n\t// \tif count+1 > n {\n\t// \t\tbreak\n\t// \t}\n\t// }\n\tvar instr string\n\tvar sc = bufio.NewScanner(os.Stdin)\n\tif sc.Scan() {\n\t\tinstr = sc.Text()\n\t}\n\t// fmt.Println(\"instrnum:\" + instr)\n\tinarray := strings.Split(instr, \" \")\n\tvar vrslt int64\n\tvrslt = 1\n\t// fmt.Println(\"size:\" + strconv.Itoa(len(inarray)))\n\tiszero := 1\n\tfor _, v := range inarray {\n\t\tvar a int64\n\t\t//fmt.Println(\"vrslt:\" + strconv.FormatInt(vrslt, 10))\n\t\ta, err := strconv.ParseInt(v, 10, 64)\n\t\tif err != nil {\n\t\t\t// fmt.Println(err)\n\t\t}\n\t\t// fmt.Println(\"vrslt:\" + strconv.FormatUint(vrslt, 10))\n\t\tif a == 0 {\n\t\t\tiszero = 0\n\t\t\tbreak\n\t\t}\n\t\tif vrslt > 1000000000000000000/a {\n\t\t\tvrslt = -1\n\t\t}\n\t\tvrslt = vrslt * a\n\t}\n\n\tif iszero == 0 {\n\t\tfmt.Printf(\"%d\", 0)\n\t} else {\n\t\tfmt.Printf(\"%d\", vrslt)\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1190, "cpu_time_ms": 4, "memory_kb": 1948}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s186677649", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\n\tvar n int64\n\t// //fmt.Println(\"n\")\n\tfmt.Scanf(\"%d\", &n)\n\t// //fmt.Println(\"input\" + strconv.FormatInt(n, 10))\n\t// inputAarray := make([]uint64, 0, n)\n\n\t// for {\n\t//fmt.Println(\"A:\" + strconv.FormatInt(count, 10))\n\t// \tfmt.Scanf(\"%d\", &a)\n\t// \t//fmt.Println(\"input\" + strconv.FormatInt(a, 10))\n\t// \tinputAarray = append(inputAarray, a)\n\t// \tcount++\n\t// \tif count+1 > n {\n\t// \t\tbreak\n\t// \t}\n\t// }\n\tvar instr string\n\tvar sc = bufio.NewScanner(os.Stdin)\n\tif sc.Scan() {\n\t\tinstr = sc.Text()\n\t}\n\t// fmt.Println(\"instrnum:\" + instr)\n\tinarray := strings.Split(instr, \" \")\n\tvar vrslt int64\n\tvrslt = 1\n\t// fmt.Println(\"size:\" + strconv.Itoa(len(inarray)))\n\tfor _, v := range inarray {\n\t\tvar a int64\n\t\t//fmt.Println(\"vrslt:\" + strconv.FormatInt(vrslt, 10))\n\t\ta, err := strconv.ParseInt(v, 10, 64)\n\t\tif err != nil {\n\t\t\t// fmt.Println(err)\n\t\t}\n\t\t// fmt.Println(\"vrslt:\" + strconv.FormatUint(vrslt, 10))\n\t\tif a == 0 {\n\t\t\tvrslt = 0\n\t\t\tbreak\n\t\t}\n\t\tif vrslt > 1000000000000000000/a {\n\t\t\tvrslt = -1\n\t\t\tbreak\n\t\t}\n\t\tvrslt = vrslt * a\n\t}\n\n\tif vrslt > 1000000000000000000 {\n\t\tfmt.Printf(\"%d\", -1)\n\t} else {\n\t\tfmt.Printf(\"%d\", vrslt)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1591348899, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s186677649.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s186677649", "user_id": "u378328718"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\n\tvar n int64\n\t// //fmt.Println(\"n\")\n\tfmt.Scanf(\"%d\", &n)\n\t// //fmt.Println(\"input\" + strconv.FormatInt(n, 10))\n\t// inputAarray := make([]uint64, 0, n)\n\n\t// for {\n\t//fmt.Println(\"A:\" + strconv.FormatInt(count, 10))\n\t// \tfmt.Scanf(\"%d\", &a)\n\t// \t//fmt.Println(\"input\" + strconv.FormatInt(a, 10))\n\t// \tinputAarray = append(inputAarray, a)\n\t// \tcount++\n\t// \tif count+1 > n {\n\t// \t\tbreak\n\t// \t}\n\t// }\n\tvar instr string\n\tvar sc = bufio.NewScanner(os.Stdin)\n\tif sc.Scan() {\n\t\tinstr = sc.Text()\n\t}\n\t// fmt.Println(\"instrnum:\" + instr)\n\tinarray := strings.Split(instr, \" \")\n\tvar vrslt int64\n\tvrslt = 1\n\t// fmt.Println(\"size:\" + strconv.Itoa(len(inarray)))\n\tfor _, v := range inarray {\n\t\tvar a int64\n\t\t//fmt.Println(\"vrslt:\" + strconv.FormatInt(vrslt, 10))\n\t\ta, err := strconv.ParseInt(v, 10, 64)\n\t\tif err != nil {\n\t\t\t// fmt.Println(err)\n\t\t}\n\t\t// fmt.Println(\"vrslt:\" + strconv.FormatUint(vrslt, 10))\n\t\tif a == 0 {\n\t\t\tvrslt = 0\n\t\t\tbreak\n\t\t}\n\t\tif vrslt > 1000000000000000000/a {\n\t\t\tvrslt = -1\n\t\t\tbreak\n\t\t}\n\t\tvrslt = vrslt * a\n\t}\n\n\tif vrslt > 1000000000000000000 {\n\t\tfmt.Printf(\"%d\", -1)\n\t} else {\n\t\tfmt.Printf(\"%d\", vrslt)\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1202, "cpu_time_ms": 7, "memory_kb": 1948}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s669498949", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc solution(n int, a []int) int {\n var out int = 1\n\n for _, num := range a {\n if num == 0 {\n return 0\n }\n }\n for _, num := range a {\n out *= num\n if 1 > 1e18/out {\n return -1\n }\n }\n return out\n}\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n a := make([]int, 0, n)\n for i := 0; i < n; i++ {\n var t int\n fmt.Scan(&t)\n a = append(a, t)\n }\n fmt.Println(solution(n, a))\n}", "language": "Go", "metadata": {"date": 1591200486, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s669498949.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s669498949", "user_id": "u568763892"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc solution(n int, a []int) int {\n var out int = 1\n\n for _, num := range a {\n if num == 0 {\n return 0\n }\n }\n for _, num := range a {\n out *= num\n if 1 > 1e18/out {\n return -1\n }\n }\n return out\n}\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n a := make([]int, 0, n)\n for i := 0; i < n; i++ {\n var t int\n fmt.Scan(&t)\n a = append(a, t)\n }\n fmt.Println(solution(n, a))\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 653, "cpu_time_ms": 1367, "memory_kb": 6332}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s545568303", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar DEBUG = true\n\nfunc main() {\n\tdefer Flush()\n\t_, A := readInts(0)\n\n\tfor _, v := range A {\n\t\tif v == 0 {\n\t\t\tprintln(0)\n\t\t\treturn\n\t\t}\n\t}\n\n\tans := uint(1)\n\tfor i := range A {\n\t\tv := uint(A[i])\n\t\tnans := ans * v\n\t\tif 1000000000000000000 < nans || nans < ans {\n\t\t\tprintln(-1)\n\t\t\treturn\n\t\t}\n\t\tans = nans\n\t}\n\tprintln(ans)\n\n}\n\n// -----------------------------------------------------------------------------\n\n// IO helper functions\n\n// Returns next token from input. It must be initialized by SetInput()\n// before the first call.\nvar nextToken func() ([]byte, error)\nvar nextLine func() ([]byte, error)\n\n// Holds a buffer for output. It must be initialized by SetOutput().\n// All IO fucntions (read*() and [e]print*()) should write to OutputWriter\n// instead of this.\nvar OutputBuffer *bufio.Writer\n\n// Holds an io.Writer. It must be initialized by SetOutput()\nvar OutputWriter io.Writer\n\n// Set IO functions for interactive input/output.\nfunc SetInteractive(w io.Writer, r io.Reader) {\n\tSetUnbefferedInput(r)\n\tOutputBuffer = nil\n\tOutputWriter = w\n}\n\n// Setup OutputBuffer and OutputWriter.\nfunc SetOutput(w io.Writer) {\n\tOutputBuffer = bufio.NewWriter(w)\n\tOutputWriter = OutputBuffer\n}\n\n// Flushes OutputBuffer\nfunc Flush() {\n\tif OutputBuffer != nil {\n\t\tOutputBuffer.Flush()\n\t}\n}\n\n// Returns true if c is a white space\nfunc IsSpace(c byte) bool {\n\tswitch c {\n\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc IsNewLine(c byte) bool {\n\tswitch c {\n\tcase '\\n', '\\r':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Setup nextToken with input buffer.\nfunc SetInput(r io.Reader) {\n\tbuf := new(bytes.Buffer)\n\tvar b []byte\n\n\tvar i int\n\trest := func() ([]byte, error) {\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\tinitial := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextToken = rest\n\t\treturn rest()\n\t}\n\tnextToken = initial\n\n\trestLn := func() ([]byte, error) {\n\t\tfor i < len(b) && IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\n\tinitialLn := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextLine = restLn\n\t\treturn restLn()\n\t}\n\tnextLine = initialLn\n}\n\n// Setup nextToken without input buffer.\nfunc SetUnbefferedInput(r io.Reader) {\n\tbuf := bufio.NewReader(r)\n\tvar b []byte\n\n\tvar i int\n\tnextToken = func() ([]byte, error) {\n\t\tvar err error\n\t\tif i == len(b) {\n\t\t\tb, err = buf.ReadBytes('\\n')\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ti = 0\n\t\t\tj := len(b) - 1\n\t\t\tfor 0 <= j && IsSpace(b[j]) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tb = b[0 : j+1]\n\t\t}\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n}\n\n// -----------------------------------------------------------------------------\n\n// IO functions\n\n// Reads next token and return it as []byte\nfunc readb() []byte {\n\tb, err := nextToken()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\n// Reads next token and return it as string\nfunc reads() string {\n\treturn string(readb())\n}\n\n// Read next line as []byte. Trailing '\\n' will not be included.\n// See also comments on readb()\nfunc readbln() []byte {\n\tb, err := nextLine()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\n// Read next line as string\nfunc readsln() string {\n\treturn string(readbln())\n}\n\n// Reads next token and return it as int64\nfunc readll() int64 {\n\ti, err := strconv.ParseInt(reads(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// Reads next token and return it as int\nfunc readi() int {\n\treturn int(readll())\n}\n\n// Reads next token and return it as float64\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(reads(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// Write args to OutputWriter with the format f\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(OutputWriter, f, args...)\n}\n\n// Write args to OutputWriter without format\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(OutputWriter, args...)\n}\n\n// Write args to stderr with the format f\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// Write args to stderr without format\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\nfunc dbgf(f string, args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintf(os.Stderr, f, args...)\n}\n\nfunc dbg(args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintln(os.Stderr, args...)\n}\n\n// -----------------------------------------------------------------------------\n\n// Utilities\n\nfunc sumSlice(a []int) int {\n\tvar res int\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc sumSlicell(a []int64) int64 {\n\tvar res int64\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc readInts(N int) (int, []int) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int, N)\n\tfor i := range a {\n\t\ta[i] = readi()\n\t}\n\treturn N, a\n}\n\nfunc readIntsll(N int) (int, []int64) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int64, N)\n\tfor i := range a {\n\t\ta[i] = readll()\n\t}\n\treturn N, a\n}\n\n// -----------------------------------------------------------------------------\n\n// Simple math functions\n\nconst (\n\t// big prime\n\tINF = 1000000007\n\tINF2 = 1000000009\n\tINF3 = 998244353\n)\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minll(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minf(a, b float64) float64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxll(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxf(a, b float64) float64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absll(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absf(a float64) float64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// egcd(a, b) returns d, x, y:\n// d is gcd(a,b)\n// x, y are integers that satisfy ax + by = d\nfunc egcd(a, b int) (int, int, int) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcd(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc egcdll(a, b int64) (int64, int64, int64) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcdll(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc gcd(a, b int) int {\n\td, _, _ := egcd(a, b)\n\treturn d\n}\n\nfunc gcdll(a, b int64) int64 {\n\td, _, _ := egcdll(a, b)\n\treturn d\n}\n\n// set up IO functions\nfunc init() {\n\t// for non-interactive\n\tSetInput(os.Stdin)\n\tSetOutput(os.Stdout)\n\n\t// Enable below when interactive. Its ok to leave above intact.\n\t// SetInteractive(os.Stdout, os.Stdin)\n}\n", "language": "Go", "metadata": {"date": 1591149079, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s545568303.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s545568303", "user_id": "u705974985"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar DEBUG = true\n\nfunc main() {\n\tdefer Flush()\n\t_, A := readInts(0)\n\n\tfor _, v := range A {\n\t\tif v == 0 {\n\t\t\tprintln(0)\n\t\t\treturn\n\t\t}\n\t}\n\n\tans := uint(1)\n\tfor i := range A {\n\t\tv := uint(A[i])\n\t\tnans := ans * v\n\t\tif 1000000000000000000 < nans || nans < ans {\n\t\t\tprintln(-1)\n\t\t\treturn\n\t\t}\n\t\tans = nans\n\t}\n\tprintln(ans)\n\n}\n\n// -----------------------------------------------------------------------------\n\n// IO helper functions\n\n// Returns next token from input. It must be initialized by SetInput()\n// before the first call.\nvar nextToken func() ([]byte, error)\nvar nextLine func() ([]byte, error)\n\n// Holds a buffer for output. It must be initialized by SetOutput().\n// All IO fucntions (read*() and [e]print*()) should write to OutputWriter\n// instead of this.\nvar OutputBuffer *bufio.Writer\n\n// Holds an io.Writer. It must be initialized by SetOutput()\nvar OutputWriter io.Writer\n\n// Set IO functions for interactive input/output.\nfunc SetInteractive(w io.Writer, r io.Reader) {\n\tSetUnbefferedInput(r)\n\tOutputBuffer = nil\n\tOutputWriter = w\n}\n\n// Setup OutputBuffer and OutputWriter.\nfunc SetOutput(w io.Writer) {\n\tOutputBuffer = bufio.NewWriter(w)\n\tOutputWriter = OutputBuffer\n}\n\n// Flushes OutputBuffer\nfunc Flush() {\n\tif OutputBuffer != nil {\n\t\tOutputBuffer.Flush()\n\t}\n}\n\n// Returns true if c is a white space\nfunc IsSpace(c byte) bool {\n\tswitch c {\n\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc IsNewLine(c byte) bool {\n\tswitch c {\n\tcase '\\n', '\\r':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Setup nextToken with input buffer.\nfunc SetInput(r io.Reader) {\n\tbuf := new(bytes.Buffer)\n\tvar b []byte\n\n\tvar i int\n\trest := func() ([]byte, error) {\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\tinitial := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextToken = rest\n\t\treturn rest()\n\t}\n\tnextToken = initial\n\n\trestLn := func() ([]byte, error) {\n\t\tfor i < len(b) && IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\n\tinitialLn := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextLine = restLn\n\t\treturn restLn()\n\t}\n\tnextLine = initialLn\n}\n\n// Setup nextToken without input buffer.\nfunc SetUnbefferedInput(r io.Reader) {\n\tbuf := bufio.NewReader(r)\n\tvar b []byte\n\n\tvar i int\n\tnextToken = func() ([]byte, error) {\n\t\tvar err error\n\t\tif i == len(b) {\n\t\t\tb, err = buf.ReadBytes('\\n')\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ti = 0\n\t\t\tj := len(b) - 1\n\t\t\tfor 0 <= j && IsSpace(b[j]) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tb = b[0 : j+1]\n\t\t}\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n}\n\n// -----------------------------------------------------------------------------\n\n// IO functions\n\n// Reads next token and return it as []byte\nfunc readb() []byte {\n\tb, err := nextToken()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\n// Reads next token and return it as string\nfunc reads() string {\n\treturn string(readb())\n}\n\n// Read next line as []byte. Trailing '\\n' will not be included.\n// See also comments on readb()\nfunc readbln() []byte {\n\tb, err := nextLine()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\n// Read next line as string\nfunc readsln() string {\n\treturn string(readbln())\n}\n\n// Reads next token and return it as int64\nfunc readll() int64 {\n\ti, err := strconv.ParseInt(reads(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// Reads next token and return it as int\nfunc readi() int {\n\treturn int(readll())\n}\n\n// Reads next token and return it as float64\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(reads(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// Write args to OutputWriter with the format f\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(OutputWriter, f, args...)\n}\n\n// Write args to OutputWriter without format\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(OutputWriter, args...)\n}\n\n// Write args to stderr with the format f\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// Write args to stderr without format\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\nfunc dbgf(f string, args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintf(os.Stderr, f, args...)\n}\n\nfunc dbg(args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintln(os.Stderr, args...)\n}\n\n// -----------------------------------------------------------------------------\n\n// Utilities\n\nfunc sumSlice(a []int) int {\n\tvar res int\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc sumSlicell(a []int64) int64 {\n\tvar res int64\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc readInts(N int) (int, []int) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int, N)\n\tfor i := range a {\n\t\ta[i] = readi()\n\t}\n\treturn N, a\n}\n\nfunc readIntsll(N int) (int, []int64) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int64, N)\n\tfor i := range a {\n\t\ta[i] = readll()\n\t}\n\treturn N, a\n}\n\n// -----------------------------------------------------------------------------\n\n// Simple math functions\n\nconst (\n\t// big prime\n\tINF = 1000000007\n\tINF2 = 1000000009\n\tINF3 = 998244353\n)\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minll(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minf(a, b float64) float64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxll(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxf(a, b float64) float64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absll(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absf(a float64) float64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// egcd(a, b) returns d, x, y:\n// d is gcd(a,b)\n// x, y are integers that satisfy ax + by = d\nfunc egcd(a, b int) (int, int, int) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcd(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc egcdll(a, b int64) (int64, int64, int64) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcdll(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc gcd(a, b int) int {\n\td, _, _ := egcd(a, b)\n\treturn d\n}\n\nfunc gcdll(a, b int64) int64 {\n\td, _, _ := egcdll(a, b)\n\treturn d\n}\n\n// set up IO functions\nfunc init() {\n\t// for non-interactive\n\tSetInput(os.Stdin)\n\tSetOutput(os.Stdout)\n\n\t// Enable below when interactive. Its ok to leave above intact.\n\t// SetInteractive(os.Stdout, os.Stdin)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6911, "cpu_time_ms": 25, "memory_kb": 8092}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s149297392", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\n\tnums := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &nums[i])\n\t}\n\n\ttotal := 1\n\tfor i := 0; i < n; i++ {\n\t\tif nums[i] == 0 {\n\t\t\ttotal = 0\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif total == 0 {\n\t\tfmt.Println(total)\n\t} else {\n\t\tfor i := 0; i < n; i++ {\n\t\t\ttotal = total * nums[i]\n\t\t\tif nums[i] > 1000000000000000000/total {\n\t\t\t\ttotal = -1\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tfmt.Println(total)\n\t}\n}", "language": "Go", "metadata": {"date": 1591022782, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s149297392.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s149297392", "user_id": "u118800604"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scanf(\"%d\", &n)\n\n\tnums := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &nums[i])\n\t}\n\n\ttotal := 1\n\tfor i := 0; i < n; i++ {\n\t\tif nums[i] == 0 {\n\t\t\ttotal = 0\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif total == 0 {\n\t\tfmt.Println(total)\n\t} else {\n\t\tfor i := 0; i < n; i++ {\n\t\t\ttotal = total * nums[i]\n\t\t\tif nums[i] > 1000000000000000000/total {\n\t\t\t\ttotal = -1\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tfmt.Println(total)\n\t}\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1404, "memory_kb": 6320}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s164325716", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar limit uint64 = 1\n\nfunc init() {\n\tfor i := 0; i < 18; i++ {\n\t\tlimit *= 10\n\t}\n}\n\nfunc main() {\n\tN := readlineint()[0]\n\tIn := readlineint()\n\n\tfor _, v := range In {\n\t\tif v == 0 {\n\t\t\tfmt.Println(\"0\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tvar previous_result uint64 = 1\n\tvar result uint64 = 1\n\tfor i := 0; i < N; i++ {\n\t\tprevious_result = result\n\t\tresult *= uint64(In[i])\n\n\t\tif result > limit || previous_result > result {\n\t\t\tfmt.Println(\"-1\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(result)\n}\n\n/////////////////////////////////////////\n\nfunc fln(format string, elements ...interface{}) {\n\tfmt.Printf(format+\"\\n\", elements...)\n}\n\nvar bufreader = bufio.NewReaderSize(os.Stdin, 1e6)\n\nfunc readline() string {\n\ta, _, _ := bufreader.ReadLine()\n\treturn string(a)\n}\n\nfunc readlineint() (result []int) {\n\tin := strings.Split(readline(), \" \")\n\tresult = make([]int, 0, 2)\n\tfor _, v := range in {\n\t\tt, _ := strconv.Atoi(v)\n\t\tresult = append(result, t)\n\t}\n\treturn\n}", "language": "Go", "metadata": {"date": 1591017539, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s164325716.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s164325716", "user_id": "u121595121"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar limit uint64 = 1\n\nfunc init() {\n\tfor i := 0; i < 18; i++ {\n\t\tlimit *= 10\n\t}\n}\n\nfunc main() {\n\tN := readlineint()[0]\n\tIn := readlineint()\n\n\tfor _, v := range In {\n\t\tif v == 0 {\n\t\t\tfmt.Println(\"0\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tvar previous_result uint64 = 1\n\tvar result uint64 = 1\n\tfor i := 0; i < N; i++ {\n\t\tprevious_result = result\n\t\tresult *= uint64(In[i])\n\n\t\tif result > limit || previous_result > result {\n\t\t\tfmt.Println(\"-1\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(result)\n}\n\n/////////////////////////////////////////\n\nfunc fln(format string, elements ...interface{}) {\n\tfmt.Printf(format+\"\\n\", elements...)\n}\n\nvar bufreader = bufio.NewReaderSize(os.Stdin, 1e6)\n\nfunc readline() string {\n\ta, _, _ := bufreader.ReadLine()\n\treturn string(a)\n}\n\nfunc readlineint() (result []int) {\n\tin := strings.Split(readline(), \" \")\n\tresult = make([]int, 0, 2)\n\tfor _, v := range in {\n\t\tt, _ := strconv.Atoi(v)\n\t\tresult = append(result, t)\n\t}\n\treturn\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 994, "cpu_time_ms": 20, "memory_kb": 8092}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s396570091", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e6 + 7\n)\n\nvar buf []byte = make([]byte, maxBufSize)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBufSize)\n}\n\nfunc main() {\n\tN := nextInt()\n\tAn := make([]int, N)\n\tfor i := range An {\n\t\tAn[i] = nextInt()\n\t\tif An[i] == 0 {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t}\n\t}\n\tans := 1\n\tfor i := 0; i < N; i++ {\n\t\t// An[i]*ans <= int(1e18)を変形\n\t\tif An[i] <= int(1e18)/ans {\n\t\t\tans *= An[i]\n\t\t} else {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc abs(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc pow(p, q int) int {\n\tres := p\n\tif q == 0 {\n\t\treturn 1\n\t}\n\tfor i := 0; i < q-1; i++ {\n\t\tres *= p\n\t}\n\treturn res\n}\n\nfunc MinOf(vars ...int) int {\n\tmin := vars[0]\n\tfor _, i := range vars {\n\t\tif min > i {\n\t\t\tmin = i\n\t\t}\n\t}\n\treturn min\n}\n\nfunc MaxOf(vars ...int) int {\n\tmax := vars[0]\n\tfor _, i := range vars {\n\t\tif max < i {\n\t\t\tmax = i\n\t\t}\n\t}\n\treturn max\n}\n\nfunc gcdof2numbers(a int, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcdof2numbers(b, a%b)\n}\n\nfunc lcmof2numbers(a int, b int) int {\n\treturn a / gcdof2numbers(a, b) * b\n}\n\n// マイナスの場合は考慮していない\nfunc fuctorial(a int) int {\n\tif a == 1 || a == 0 {\n\t\treturn 1\n\t} else {\n\t\treturn fuctorial(a-1) * a\n\t}\n}\n\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\n\n// 素因数分解したmapを返す\nfunc primeFuctorize(n int) map[int]int {\n\tpf := map[int]int{}\n\tfor i := 2; i*i <= n; i++ {\n\t\tfor n%i == 0 {\n\t\t\tpf[i]++\n\t\t\tn /= i\n\t\t}\n\t}\n\tif n != 1 {\n\t\tpf[n]++\n\t}\n\treturn pf\n}\n", "language": "Go", "metadata": {"date": 1591003329, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s396570091.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s396570091", "user_id": "u605443479"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e6 + 7\n)\n\nvar buf []byte = make([]byte, maxBufSize)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBufSize)\n}\n\nfunc main() {\n\tN := nextInt()\n\tAn := make([]int, N)\n\tfor i := range An {\n\t\tAn[i] = nextInt()\n\t\tif An[i] == 0 {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t}\n\t}\n\tans := 1\n\tfor i := 0; i < N; i++ {\n\t\t// An[i]*ans <= int(1e18)を変形\n\t\tif An[i] <= int(1e18)/ans {\n\t\t\tans *= An[i]\n\t\t} else {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc abs(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc pow(p, q int) int {\n\tres := p\n\tif q == 0 {\n\t\treturn 1\n\t}\n\tfor i := 0; i < q-1; i++ {\n\t\tres *= p\n\t}\n\treturn res\n}\n\nfunc MinOf(vars ...int) int {\n\tmin := vars[0]\n\tfor _, i := range vars {\n\t\tif min > i {\n\t\t\tmin = i\n\t\t}\n\t}\n\treturn min\n}\n\nfunc MaxOf(vars ...int) int {\n\tmax := vars[0]\n\tfor _, i := range vars {\n\t\tif max < i {\n\t\t\tmax = i\n\t\t}\n\t}\n\treturn max\n}\n\nfunc gcdof2numbers(a int, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcdof2numbers(b, a%b)\n}\n\nfunc lcmof2numbers(a int, b int) int {\n\treturn a / gcdof2numbers(a, b) * b\n}\n\n// マイナスの場合は考慮していない\nfunc fuctorial(a int) int {\n\tif a == 1 || a == 0 {\n\t\treturn 1\n\t} else {\n\t\treturn fuctorial(a-1) * a\n\t}\n}\n\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\n\n// 素因数分解したmapを返す\nfunc primeFuctorize(n int) map[int]int {\n\tpf := map[int]int{}\n\tfor i := 2; i*i <= n; i++ {\n\t\tfor n%i == 0 {\n\t\t\tpf[i]++\n\t\t\tn /= i\n\t\t}\n\t}\n\tif n != 1 {\n\t\tpf[n]++\n\t}\n\treturn pf\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2051, "cpu_time_ms": 28, "memory_kb": 6128}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s432352701", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tvar result uint64\n\tfmt.Scan(&n)\n\tarr := make([]uint64, n)\n\tfor i:=0; i 1e18とは違う。割り算は切り捨てられるため。しかしこれで必要十分な理由を述べよ。\n\t\tif result > 1e18/value {\n\t\t\tfmt.Print(-1)\n\t\t\treturn\n\t\t}\n\t\tresult *= value\n\t}\n\tfmt.Printf(\"%d\", result)\n}\n", "language": "Go", "metadata": {"date": 1590992295, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s432352701.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s432352701", "user_id": "u344655022"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tvar result uint64\n\tfmt.Scan(&n)\n\tarr := make([]uint64, n)\n\tfor i:=0; i 1e18とは違う。割り算は切り捨てられるため。しかしこれで必要十分な理由を述べよ。\n\t\tif result > 1e18/value {\n\t\t\tfmt.Print(-1)\n\t\t\treturn\n\t\t}\n\t\tresult *= value\n\t}\n\tfmt.Printf(\"%d\", result)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 833, "cpu_time_ms": 1365, "memory_kb": 6328}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s253845232", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math/big\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tn := readInt64()\n\ta := readInt64Slice(n)\n\n\tanswer := big.NewInt(1)\n\tmax := big.NewInt(10).Exp(big.NewInt(10), big.NewInt(18), nil)\n\tfor _, v := range a {\n\t\tif v == 0 {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t}\n\t\tanswer.Mul(answer, big.NewInt(v))\n\t\tif answer.Cmp(max) > 0 {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t}\n\tif answer.Cmp(max) > 0 {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tfmt.Println(answer)\n}\n\nvar (\n\tscanner *bufio.Scanner\n)\n\nfunc init() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n}\n\nfunc readInt64() int64 {\n\tvar t string\n\n\tif scanner.Scan() {\n\t\tt = scanner.Text()\n\t}\n\n\tn, err := strconv.ParseInt(t, 10, 64)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\treturn n\n\n}\n\nfunc readInt64Slice(n int64) []int64 {\n\ts := make([]int64, n)\n\tvar t string\n\n\tfor i := 0; i < int(n); i++ {\n\t\tif scanner.Scan() {\n\t\t\tt = scanner.Text()\n\t\t}\n\n\t\tnum, err := strconv.ParseInt(t, 10, 64)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\ts[i] = num\n\t}\n\n\treturn s\n}\n", "language": "Go", "metadata": {"date": 1590986376, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s253845232.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s253845232", "user_id": "u340848688"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math/big\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tn := readInt64()\n\ta := readInt64Slice(n)\n\n\tanswer := big.NewInt(1)\n\tmax := big.NewInt(10).Exp(big.NewInt(10), big.NewInt(18), nil)\n\tfor _, v := range a {\n\t\tif v == 0 {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t}\n\t\tanswer.Mul(answer, big.NewInt(v))\n\t\tif answer.Cmp(max) > 0 {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t}\n\tif answer.Cmp(max) > 0 {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tfmt.Println(answer)\n}\n\nvar (\n\tscanner *bufio.Scanner\n)\n\nfunc init() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n}\n\nfunc readInt64() int64 {\n\tvar t string\n\n\tif scanner.Scan() {\n\t\tt = scanner.Text()\n\t}\n\n\tn, err := strconv.ParseInt(t, 10, 64)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\treturn n\n\n}\n\nfunc readInt64Slice(n int64) []int64 {\n\ts := make([]int64, n)\n\tvar t string\n\n\tfor i := 0; i < int(n); i++ {\n\t\tif scanner.Scan() {\n\t\t\tt = scanner.Text()\n\t\t}\n\n\t\tnum, err := strconv.ParseInt(t, 10, 64)\n\t\tif err != nil {\n\t\t\tlog.Fatal(err)\n\t\t}\n\t\ts[i] = num\n\t}\n\n\treturn s\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1037, "cpu_time_ms": 29, "memory_kb": 6092}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s831622812", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar t string\n\tvar s = bufio.NewScanner(os.Stdin)\n\ts.Split(bufio.ScanWords)\n\n\tif s.Scan() {\n\t\tt = s.Text()\n\t}\n\n\tN, err := strconv.Atoi(t)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tvar answer uint64\n\tanswer = 1\n\n\tfor i := 0; i < N; i++ {\n\t\tif s.Scan() {\n\t\t\tt = s.Text()\n\t\t}\n\n\t\tv, err := strconv.ParseUint(t, 10, 64)\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t\treturn\n\t\t}\n\t\tif v == 0 {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t}\n\n\t\tanswer *= v\n\t}\n\n\tif answer > uint64(math.Pow10(18)) {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tfmt.Println(answer)\n}\n", "language": "Go", "metadata": {"date": 1590985132, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s831622812.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s831622812", "user_id": "u340848688"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar t string\n\tvar s = bufio.NewScanner(os.Stdin)\n\ts.Split(bufio.ScanWords)\n\n\tif s.Scan() {\n\t\tt = s.Text()\n\t}\n\n\tN, err := strconv.Atoi(t)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tvar answer uint64\n\tanswer = 1\n\n\tfor i := 0; i < N; i++ {\n\t\tif s.Scan() {\n\t\t\tt = s.Text()\n\t\t}\n\n\t\tv, err := strconv.ParseUint(t, 10, 64)\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t\treturn\n\t\t}\n\t\tif v == 0 {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t}\n\n\t\tanswer *= v\n\t}\n\n\tif answer > uint64(math.Pow10(18)) {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tfmt.Println(answer)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 593, "cpu_time_ms": 30, "memory_kb": 5020}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s892288245", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math/big\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := NewBufScanner(os.Stdin)\n\tn := int(sc.Int())\n\n\tvar a int64\n\tsum := big.NewInt(1)\n\n\tupper := big.NewInt(1e18)\n\tas := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tas[i] = sc.Int()\n\t\tif a == 0 {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t}\n\t}\n\tfor i, v := range as {\n\t\tif i == 0 {\n\t\t\tsum = big.NewInt(v)\n\t\t\tcontinue\n\t\t}\n\t\tsum.Mul(sum, big.NewInt(v))\n\t\tif sum.Cmp(upper) >0 {\n\t\t\tfmt.Println(\"-1\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(sum.Int64())\n}\n\ntype BufScanner struct {\n\t*bufio.Scanner\n}\n\nfunc NewBufScanner(r io.Reader) *BufScanner {\n\ts := bufio.NewScanner(r)\n\ts.Split(bufio.ScanWords)\n\t// s.Split(scanWords)\n\treturn &BufScanner{s}\n}\n\nfunc scanWords(data []byte, atEOF bool) (advance int, token []byte, err error) {\n\tstart := 0\n\tfor isSpace(data[start]) {\n\t\tstart++\n\t}\n\tfor i := start; i < len(data); i++ {\n\t\tif isSpace(data[i]) {\n\t\t\treturn i+1, data[start:i], nil\n\t\t}\n\t}\n\tif atEOF && len(data) > start {\n\t\treturn len(data), data[start:], nil\n\t}\n\treturn start, nil, nil\n}\nfunc isSpace(b byte) bool {\n\treturn b == ' ' || b == '\\n' || b == '\\r' || b == '\\t'\n}\n\nfunc (s *BufScanner) String() string {\n\ts.Scan()\n\treturn s.Text()\n}\n\nfunc (s *BufScanner) Int() int64 {\n\treturn int64(s.UInt())\n}\n\n\nfunc (s *BufScanner) UInt() uint64 {\n\ts.Scan()\n\ti, e := strconv.ParseUint(s.Text(), 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n", "language": "Go", "metadata": {"date": 1590981165, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s892288245.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s892288245", "user_id": "u769765274"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math/big\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := NewBufScanner(os.Stdin)\n\tn := int(sc.Int())\n\n\tvar a int64\n\tsum := big.NewInt(1)\n\n\tupper := big.NewInt(1e18)\n\tas := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tas[i] = sc.Int()\n\t\tif a == 0 {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t}\n\t}\n\tfor i, v := range as {\n\t\tif i == 0 {\n\t\t\tsum = big.NewInt(v)\n\t\t\tcontinue\n\t\t}\n\t\tsum.Mul(sum, big.NewInt(v))\n\t\tif sum.Cmp(upper) >0 {\n\t\t\tfmt.Println(\"-1\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(sum.Int64())\n}\n\ntype BufScanner struct {\n\t*bufio.Scanner\n}\n\nfunc NewBufScanner(r io.Reader) *BufScanner {\n\ts := bufio.NewScanner(r)\n\ts.Split(bufio.ScanWords)\n\t// s.Split(scanWords)\n\treturn &BufScanner{s}\n}\n\nfunc scanWords(data []byte, atEOF bool) (advance int, token []byte, err error) {\n\tstart := 0\n\tfor isSpace(data[start]) {\n\t\tstart++\n\t}\n\tfor i := start; i < len(data); i++ {\n\t\tif isSpace(data[i]) {\n\t\t\treturn i+1, data[start:i], nil\n\t\t}\n\t}\n\tif atEOF && len(data) > start {\n\t\treturn len(data), data[start:], nil\n\t}\n\treturn start, nil, nil\n}\nfunc isSpace(b byte) bool {\n\treturn b == ' ' || b == '\\n' || b == '\\r' || b == '\\t'\n}\n\nfunc (s *BufScanner) String() string {\n\ts.Scan()\n\treturn s.Text()\n}\n\nfunc (s *BufScanner) Int() int64 {\n\treturn int64(s.UInt())\n}\n\n\nfunc (s *BufScanner) UInt() uint64 {\n\ts.Scan()\n\ti, e := strconv.ParseUint(s.Text(), 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1404, "cpu_time_ms": 5, "memory_kb": 1808}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s935499715", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tvar result uint64\n\tfmt.Scanf(\"%d\", &n)\n\tarr := make([]uint64, n)\n\tfor i:=0; i= 1e18 {\n\t\t\ttoobig = true\n\t\t}\n\t}\n\tif toobig || result > 1e18 {\n\t\tfmt.Printf(\"-1\")\n\t} else {\n\t\tfmt.Printf(\"%d\", result)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1590980230, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s935499715.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s935499715", "user_id": "u344655022"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tvar result uint64\n\tfmt.Scanf(\"%d\", &n)\n\tarr := make([]uint64, n)\n\tfor i:=0; i= 1e18 {\n\t\t\ttoobig = true\n\t\t}\n\t}\n\tif toobig || result > 1e18 {\n\t\tfmt.Printf(\"-1\")\n\t} else {\n\t\tfmt.Printf(\"%d\", result)\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1380, "memory_kb": 6332}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s476702872", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tstdin := bufio.NewScanner(os.Stdin)\n\tstdin.Scan()\n\ts := stdin.Text()\n\n\tis := strings.Split(s, \" \")\n\tinputs := stringsToInts(is)\n\n\tfor _, v := range inputs {\n\t\tif v == 0 {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t}\n\t}\n\n\tfor _, v := range inputs {\n\t\tif v >= int64(math.Pow(10, 18)) {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t}\n\n\tvar ans int64 = 1\n\tfor _, v := range inputs {\n\t\tif ans*v >= int64(math.Pow(10, 18)) {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t\tans *= v\n\t}\n\tfmt.Println(ans)\n}\n\nfunc stringsToInts(s []string) []int64 {\n\tarr := make([]int64, len(s))\n\tfor i, v := range s {\n\t\tarr[i], _ = strconv.ParseInt(v, 10, 64)\n\t}\n\treturn arr\n}\n", "language": "Go", "metadata": {"date": 1590980179, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s476702872.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s476702872", "user_id": "u298936763"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tstdin := bufio.NewScanner(os.Stdin)\n\tstdin.Scan()\n\ts := stdin.Text()\n\n\tis := strings.Split(s, \" \")\n\tinputs := stringsToInts(is)\n\n\tfor _, v := range inputs {\n\t\tif v == 0 {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t}\n\t}\n\n\tfor _, v := range inputs {\n\t\tif v >= int64(math.Pow(10, 18)) {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t}\n\n\tvar ans int64 = 1\n\tfor _, v := range inputs {\n\t\tif ans*v >= int64(math.Pow(10, 18)) {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t\tans *= v\n\t}\n\tfmt.Println(ans)\n}\n\nfunc stringsToInts(s []string) []int64 {\n\tarr := make([]int64, len(s))\n\tfor i, v := range s {\n\t\tarr[i], _ = strconv.ParseInt(v, 10, 64)\n\t}\n\treturn arr\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 734, "cpu_time_ms": 2, "memory_kb": 1948}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s723905860", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"math/big\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tsum := big.NewInt(1)\n\tvar fuck string\n\tfor i:=0; i 0 {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t\tt, _ := strconv.Atoi(fuck)\n\t\tsum = big.NewInt(int64(t))\n\t}\n\tc := new(big.Int).Sub(sum, big.NewInt(int64(math.Pow10(18)))).String()\n\td, _ := strconv.Atoi(c)\n\tif d > 0 {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(fuck)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1590979219, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s723905860.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s723905860", "user_id": "u548019578"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"math/big\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tsum := big.NewInt(1)\n\tvar fuck string\n\tfor i:=0; i 0 {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t\tt, _ := strconv.Atoi(fuck)\n\t\tsum = big.NewInt(int64(t))\n\t}\n\tc := new(big.Int).Sub(sum, big.NewInt(int64(math.Pow10(18)))).String()\n\td, _ := strconv.Atoi(c)\n\tif d > 0 {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(fuck)\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 682, "cpu_time_ms": 262, "memory_kb": 6732}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s220446904", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tn := readi()\n\ta := make([]uint64, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = readui64()\n\t}\n\n\tvar ans uint64 = 1\n\tfor i := 0; i < n; i++ {\n\t\tans = ans * a[i]\n\t}\n\n\tvar e1018 uint64 = 1000000000000000000\n\tif ans > e1018 {\n\t\tfmt.Println(\"-1\")\n\t\treturn\n\t}\n\tfmt.Println(ans)\n}\n\nfunc readui64() uint64 {\n\ti, err := strconv.ParseUint(readString(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n/*-------------------utilities-------------------*/\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc chmin(x *int, y int) bool {\n\tif *x > y {\n\t\t*x = y\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc chmax(x *int, y int) bool {\n\tif *x < y {\n\t\t*x = y\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\treturn (a * b) / gcd(a, b)\n}\n\nfunc permutations(arr []int) [][]int {\n\tvar helper func([]int, int)\n\tres := [][]int{}\n\n\thelper = func(arr []int, n int) {\n\t\tif n == 1 {\n\t\t\ttmp := make([]int, len(arr))\n\t\t\tcopy(tmp, arr)\n\t\t\tres = append(res, tmp)\n\t\t} else {\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\thelper(arr, n-1)\n\t\t\t\tif n%2 == 1 {\n\t\t\t\t\ttmp := arr[i]\n\t\t\t\t\tarr[i] = arr[n-1]\n\t\t\t\t\tarr[n-1] = tmp\n\t\t\t\t} else {\n\t\t\t\t\ttmp := arr[0]\n\t\t\t\t\tarr[0] = arr[n-1]\n\t\t\t\t\tarr[n-1] = tmp\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\thelper(arr, len(arr))\n\treturn res\n}\n\nfunc isPrime(n int) bool {\n\tif n == 1 {\n\t\treturn false\n\t}\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc divisor(n int) (res []int) {\n\tfor i := 1; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tres = append(res, i)\n\t\t\tif i*i != n {\n\t\t\t\tres = append(res, n/i)\n\t\t\t}\n\t\t}\n\t}\n\tsort.Ints(res)\n\treturn\n}\n\n/*-------------------init-------------------*/\n\nconst (\n\tINF = 1000000000000000000\n\tMOD = 1e9 + 7\n)\n\nvar (\n\treadString func() string\n)\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n}\n\n/*-------------------inputs-------------------*/\n\nfunc readi() int {\n\treturn int(readi64())\n}\n\nfunc readi64() int64 {\n\ti, err := strconv.ParseInt(readString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n", "language": "Go", "metadata": {"date": 1590978421, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s220446904.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s220446904", "user_id": "u183912232"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tn := readi()\n\ta := make([]uint64, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = readui64()\n\t}\n\n\tvar ans uint64 = 1\n\tfor i := 0; i < n; i++ {\n\t\tans = ans * a[i]\n\t}\n\n\tvar e1018 uint64 = 1000000000000000000\n\tif ans > e1018 {\n\t\tfmt.Println(\"-1\")\n\t\treturn\n\t}\n\tfmt.Println(ans)\n}\n\nfunc readui64() uint64 {\n\ti, err := strconv.ParseUint(readString(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n/*-------------------utilities-------------------*/\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc chmin(x *int, y int) bool {\n\tif *x > y {\n\t\t*x = y\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc chmax(x *int, y int) bool {\n\tif *x < y {\n\t\t*x = y\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\treturn (a * b) / gcd(a, b)\n}\n\nfunc permutations(arr []int) [][]int {\n\tvar helper func([]int, int)\n\tres := [][]int{}\n\n\thelper = func(arr []int, n int) {\n\t\tif n == 1 {\n\t\t\ttmp := make([]int, len(arr))\n\t\t\tcopy(tmp, arr)\n\t\t\tres = append(res, tmp)\n\t\t} else {\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\thelper(arr, n-1)\n\t\t\t\tif n%2 == 1 {\n\t\t\t\t\ttmp := arr[i]\n\t\t\t\t\tarr[i] = arr[n-1]\n\t\t\t\t\tarr[n-1] = tmp\n\t\t\t\t} else {\n\t\t\t\t\ttmp := arr[0]\n\t\t\t\t\tarr[0] = arr[n-1]\n\t\t\t\t\tarr[n-1] = tmp\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\thelper(arr, len(arr))\n\treturn res\n}\n\nfunc isPrime(n int) bool {\n\tif n == 1 {\n\t\treturn false\n\t}\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc divisor(n int) (res []int) {\n\tfor i := 1; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tres = append(res, i)\n\t\t\tif i*i != n {\n\t\t\t\tres = append(res, n/i)\n\t\t\t}\n\t\t}\n\t}\n\tsort.Ints(res)\n\treturn\n}\n\n/*-------------------init-------------------*/\n\nconst (\n\tINF = 1000000000000000000\n\tMOD = 1e9 + 7\n)\n\nvar (\n\treadString func() string\n)\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n}\n\n/*-------------------inputs-------------------*/\n\nfunc readi() int {\n\treturn int(readi64())\n}\n\nfunc readi64() int64 {\n\ti, err := strconv.ParseInt(readString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2624, "cpu_time_ms": 33, "memory_kb": 5852}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s969467269", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n int\n\tvar result uint64\n\tfmt.Scanf(\"%d\", &n)\n\tarr := make([]uint64, n)\n\tfor i:=0; i= uint64(math.Pow(10, 18)) {\n\t\t\ttoobig = true\n\t\t}\n\t}\n\tif containzero {\n\t\tfmt.Printf(\"%d\", result)\n\t} else if toobig || result > uint64(math.Pow(10, 18)) {\n\t\tfmt.Printf(\"-1\")\n\t} else {\n\t\tfmt.Printf(\"%d\", result)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1590978345, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s969467269.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s969467269", "user_id": "u344655022"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar n int\n\tvar result uint64\n\tfmt.Scanf(\"%d\", &n)\n\tarr := make([]uint64, n)\n\tfor i:=0; i= uint64(math.Pow(10, 18)) {\n\t\t\ttoobig = true\n\t\t}\n\t}\n\tif containzero {\n\t\tfmt.Printf(\"%d\", result)\n\t} else if toobig || result > uint64(math.Pow(10, 18)) {\n\t\tfmt.Printf(\"-1\")\n\t} else {\n\t\tfmt.Printf(\"%d\", result)\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 563, "cpu_time_ms": 1378, "memory_kb": 6340}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s356706933", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar N, A int64\n\tfmt.Scan(&N)\n\tAs := make([]int64, N)\n\n\tvar res int64\n\tres = 1\n\tfor i := 0; i < int(N); i++ {\n\t\tfmt.Scan(&A)\n\t\tAs[i] = A\n\t\tif A == 0 {\n\t\t\tfmt.Println(0)\n\t\t\tos.Exit(0)\n\t\t}\n\t}\n\n\tfor i := 0; i < int(N); i++ {\n\t\tn := As[i]\n\t\tres = add(res, n)\n\t\tif res == -1 {\n\t\t\tbreak;\n\t\t}\n\t\tif res > 1000000000000000000 || res < 0 {\n\t\t\tres = -1\n\t\t\tbreak;\n\t\t}\n\n\t}\n\t\n\tfmt.Println(res)\n\n}\n\nfunc add(a,b int64) (res int64) {\n\t\n defer func() {\n err := recover()\n if err != nil {\n res = -1\n\t\t}\n }()\n\t\n\tres = a*b\n\treturn res\n}\n", "language": "Go", "metadata": {"date": 1590977217, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s356706933.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s356706933", "user_id": "u950580836"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar N, A int64\n\tfmt.Scan(&N)\n\tAs := make([]int64, N)\n\n\tvar res int64\n\tres = 1\n\tfor i := 0; i < int(N); i++ {\n\t\tfmt.Scan(&A)\n\t\tAs[i] = A\n\t\tif A == 0 {\n\t\t\tfmt.Println(0)\n\t\t\tos.Exit(0)\n\t\t}\n\t}\n\n\tfor i := 0; i < int(N); i++ {\n\t\tn := As[i]\n\t\tres = add(res, n)\n\t\tif res == -1 {\n\t\t\tbreak;\n\t\t}\n\t\tif res > 1000000000000000000 || res < 0 {\n\t\t\tres = -1\n\t\t\tbreak;\n\t\t}\n\n\t}\n\t\n\tfmt.Println(res)\n\n}\n\nfunc add(a,b int64) (res int64) {\n\t\n defer func() {\n err := recover()\n if err != nil {\n res = -1\n\t\t}\n }()\n\t\n\tres = a*b\n\treturn res\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 601, "cpu_time_ms": 1362, "memory_kb": 6296}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s903380361", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar N uint64\n\tfmt.Scan(&N)\n\n\tvar ans uint64 = 1\n\tfor i := uint64(0); i < N; i++ {\n\t\tvar A uint64\n\t\tfmt.Scan(&A)\n\n\t\tans *= A\n\t}\n\n\tif ans > uint64(math.Pow10(18)) {\n\t\tfmt.Println(\"-1\")\n\t} else {\n\t\tfmt.Println(ans)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1590976606, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s903380361.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s903380361", "user_id": "u577448612"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar N uint64\n\tfmt.Scan(&N)\n\n\tvar ans uint64 = 1\n\tfor i := uint64(0); i < N; i++ {\n\t\tvar A uint64\n\t\tfmt.Scan(&A)\n\n\t\tans *= A\n\t}\n\n\tif ans > uint64(math.Pow10(18)) {\n\t\tfmt.Println(\"-1\")\n\t} else {\n\t\tfmt.Println(ans)\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1379, "memory_kb": 6312}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s228352650", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math/big\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn := nextInt()\n\tprod := big.NewInt(nextInt64())\n\tcons := big.NewInt(1000000000000000000)\n\n\t//alist := make([]int, n)\n\tfor i := 0; i < n-1; i++ {\n\t\tprod.Mul(prod, big.NewInt(nextInt64()))\n\t\t//prod *= nextInt()\n\t\t//alist[i] = nextInt()\n\t\t//fmt.Printf(\"[%d] %d\\n\", i, prod)\n\t}\n\tcompares := prod.Cmp(cons)\n\tif compares == 1 {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Printf(\"%d\\n\", prod)\n\t}\n}\n\n// ---- readfunc\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn int(i)\n}\nfunc nextInt64() int64 {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn int64(i)\n}\nfunc nextBigInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc nextF() float64 {\n\tsc.Scan()\n\ti, e := strconv.ParseFloat(sc.Text(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "language": "Go", "metadata": {"date": 1590976132, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s228352650.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s228352650", "user_id": "u756000295"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math/big\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn := nextInt()\n\tprod := big.NewInt(nextInt64())\n\tcons := big.NewInt(1000000000000000000)\n\n\t//alist := make([]int, n)\n\tfor i := 0; i < n-1; i++ {\n\t\tprod.Mul(prod, big.NewInt(nextInt64()))\n\t\t//prod *= nextInt()\n\t\t//alist[i] = nextInt()\n\t\t//fmt.Printf(\"[%d] %d\\n\", i, prod)\n\t}\n\tcompares := prod.Cmp(cons)\n\tif compares == 1 {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Printf(\"%d\\n\", prod)\n\t}\n}\n\n// ---- readfunc\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn int(i)\n}\nfunc nextInt64() int64 {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn int64(i)\n}\nfunc nextBigInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc nextF() float64 {\n\tsc.Scan()\n\ti, e := strconv.ParseFloat(sc.Text(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1061, "cpu_time_ms": 2206, "memory_kb": 8588}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s818456511", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar t string\n\tvar s = bufio.NewScanner(os.Stdin)\n\ts.Split(bufio.ScanWords)\n\n\tif s.Scan() {\n\t\tt = s.Text()\n\t}\n\n\tN, err := strconv.Atoi(t)\n\tif err != nil {\n\t\treturn\n\t}\n\n\t// var answer int64\n\t// answer = 1\n\n\t// for i := 0; i < N; i++ {\n\n\t// \tif s.Scan() {\n\t// \t\tt = s.Text()\n\t// \t}\n\n\t// \tv, err := strconv.ParseInt(t, 10, 64)\n\t// \tif err != nil {\n\t// \t\treturn\n\t// \t}\n\t// \tif v == 0 {\n\t// \t\tfmt.Println(0)\n\t// \t\treturn\n\t// \t} else {\n\t// \t\tanswer = answer * int64(v)\n\t// \t}\n\t// }\n\n\t// if answer > int64(math.Pow10(18)) {\n\t// \tfmt.Println(-1)\n\t// \treturn\n\t// }\n\t// fmt.Println(answer)\n\n\tvar arr []int64\n\tfor i := 0; i < N; i++ {\n\t\tif s.Scan() {\n\t\t\tt = s.Text()\n\t\t}\n\n\t\tv, err := strconv.ParseInt(t, 10, 64)\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t\treturn\n\t\t}\n\t\tif v == 0 {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t} else {\n\t\t\tarr = append(arr, v)\n\t\t}\n\t}\n\n\tvar answer int64\n\tanswer = 1\n\tfor _, v := range arr {\n\t\t// if v > int64(math.Pow10(18)) {\n\t\t// \tfmt.Println(-1)\n\t\t// \treturn\n\t\t// }\n\t\tanswer = int64(answer * v)\n\t\tif answer < 0 {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t}\n\n\tif answer > int64(math.Pow10(18)) {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tif answer < 0 {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tfmt.Println(answer)\n\n}\n", "language": "Go", "metadata": {"date": 1590976067, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s818456511.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s818456511", "user_id": "u340848688"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar t string\n\tvar s = bufio.NewScanner(os.Stdin)\n\ts.Split(bufio.ScanWords)\n\n\tif s.Scan() {\n\t\tt = s.Text()\n\t}\n\n\tN, err := strconv.Atoi(t)\n\tif err != nil {\n\t\treturn\n\t}\n\n\t// var answer int64\n\t// answer = 1\n\n\t// for i := 0; i < N; i++ {\n\n\t// \tif s.Scan() {\n\t// \t\tt = s.Text()\n\t// \t}\n\n\t// \tv, err := strconv.ParseInt(t, 10, 64)\n\t// \tif err != nil {\n\t// \t\treturn\n\t// \t}\n\t// \tif v == 0 {\n\t// \t\tfmt.Println(0)\n\t// \t\treturn\n\t// \t} else {\n\t// \t\tanswer = answer * int64(v)\n\t// \t}\n\t// }\n\n\t// if answer > int64(math.Pow10(18)) {\n\t// \tfmt.Println(-1)\n\t// \treturn\n\t// }\n\t// fmt.Println(answer)\n\n\tvar arr []int64\n\tfor i := 0; i < N; i++ {\n\t\tif s.Scan() {\n\t\t\tt = s.Text()\n\t\t}\n\n\t\tv, err := strconv.ParseInt(t, 10, 64)\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t\treturn\n\t\t}\n\t\tif v == 0 {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t} else {\n\t\t\tarr = append(arr, v)\n\t\t}\n\t}\n\n\tvar answer int64\n\tanswer = 1\n\tfor _, v := range arr {\n\t\t// if v > int64(math.Pow10(18)) {\n\t\t// \tfmt.Println(-1)\n\t\t// \treturn\n\t\t// }\n\t\tanswer = int64(answer * v)\n\t\tif answer < 0 {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t}\n\n\tif answer > int64(math.Pow10(18)) {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tif answer < 0 {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tfmt.Println(answer)\n\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1274, "cpu_time_ms": 34, "memory_kb": 6960}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s071549323", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, a int\n\tans := 1\n\n\tfmt.Scan(&n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a)\n\t\tans *= a\n\t}\n\tif ans > 1000000000000000000 {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(ans)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1590975647, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s071549323.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s071549323", "user_id": "u963686413"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, a int\n\tans := 1\n\n\tfmt.Scan(&n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a)\n\t\tans *= a\n\t}\n\tif ans > 1000000000000000000 {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(ans)\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 220, "cpu_time_ms": 1369, "memory_kb": 6320}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s266971111", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tft := 1\n\n\tfor i := 0; i < n; i++ {\n\t\tvar t int\n\t\tfmt.Scan(&t)\n\t\tft *= t\n\t\tif ft > 1000000000000000000 {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(ft)\n}\n", "language": "Go", "metadata": {"date": 1590975202, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s266971111.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s266971111", "user_id": "u008666209"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tft := 1\n\n\tfor i := 0; i < n; i++ {\n\t\tvar t int\n\t\tfmt.Scan(&t)\n\t\tft *= t\n\t\tif ft > 1000000000000000000 {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(ft)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 227, "cpu_time_ms": 198, "memory_kb": 6288}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s148378549", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tparseProblem(os.Stdin)\n}\n\nfunc parseProblem(r io.Reader) {\n\tconst (\n\t\tinitialBufSize = 100000\n\t\tmaxBufSize = 1000000\n\t)\n\tbuf := make([]byte, initialBufSize)\n\n\tsc := bufio.NewScanner(r)\n\tsc.Buffer(buf, maxBufSize)\n\tsc.Split(bufio.ScanWords) // bufio.ScanLines\n\n\tn := scanInt(sc)\n\tvar limit uint64 = 1\n\tfor i := 0; i < 18; i++ {\n\t\tlimit *= 10\n\t}\n\tvar res uint64 = 1\n\tover := false\n\tfor i := 0; i < n; i++ {\n\t\tc := scanUint(sc)\n\t\tif c == 0 {\n\t\t\tfmt.Println(\"0\")\n\t\t\treturn\n\t\t}\n\t\tif c > limit {\n\t\t\tover = true\n\t\t}\n\t\tres *= c\n\t\tif res > limit {\n\t\t\tover = true\n\t\t\tres = 1\n\t\t}\n\t}\n\tif over {\n\t\tfmt.Println(\"-1\")\n\t\treturn\n\t}\n\tfmt.Println(res)\n}\n\n// snip-scan-funcs\nfunc scanInt(sc *bufio.Scanner) int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn int(i)\n}\nfunc scanUint(sc *bufio.Scanner) uint64 {\n\tsc.Scan()\n\tu, _ := strconv.ParseUint(sc.Text(), 10, 64)\n\treturn u\n}\nfunc scanString(sc *bufio.Scanner) string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "language": "Go", "metadata": {"date": 1590975053, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s148378549.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s148378549", "user_id": "u623007471"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tparseProblem(os.Stdin)\n}\n\nfunc parseProblem(r io.Reader) {\n\tconst (\n\t\tinitialBufSize = 100000\n\t\tmaxBufSize = 1000000\n\t)\n\tbuf := make([]byte, initialBufSize)\n\n\tsc := bufio.NewScanner(r)\n\tsc.Buffer(buf, maxBufSize)\n\tsc.Split(bufio.ScanWords) // bufio.ScanLines\n\n\tn := scanInt(sc)\n\tvar limit uint64 = 1\n\tfor i := 0; i < 18; i++ {\n\t\tlimit *= 10\n\t}\n\tvar res uint64 = 1\n\tover := false\n\tfor i := 0; i < n; i++ {\n\t\tc := scanUint(sc)\n\t\tif c == 0 {\n\t\t\tfmt.Println(\"0\")\n\t\t\treturn\n\t\t}\n\t\tif c > limit {\n\t\t\tover = true\n\t\t}\n\t\tres *= c\n\t\tif res > limit {\n\t\t\tover = true\n\t\t\tres = 1\n\t\t}\n\t}\n\tif over {\n\t\tfmt.Println(\"-1\")\n\t\treturn\n\t}\n\tfmt.Println(res)\n}\n\n// snip-scan-funcs\nfunc scanInt(sc *bufio.Scanner) int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn int(i)\n}\nfunc scanUint(sc *bufio.Scanner) uint64 {\n\tsc.Scan()\n\tu, _ := strconv.ParseUint(sc.Text(), 10, 64)\n\treturn u\n}\nfunc scanString(sc *bufio.Scanner) string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1024, "cpu_time_ms": 31, "memory_kb": 5128}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s287360659", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\n\tvar i int64\n\tvar ret int64 = 1\n\tfor i = 1; i <= n; i++ {\n\t\ta := nextInt()\n\t\tret = ret * a\n\t}\n\tif ret > 1000000000000000000 || ret < 0 {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(ret)\n\t}\n\n}\n\nfunc nextInt() int64 {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn int64(i)\n}\n", "language": "Go", "metadata": {"date": 1590974938, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s287360659.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s287360659", "user_id": "u137939942"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\n\tvar i int64\n\tvar ret int64 = 1\n\tfor i = 1; i <= n; i++ {\n\t\ta := nextInt()\n\t\tret = ret * a\n\t}\n\tif ret > 1000000000000000000 || ret < 0 {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(ret)\n\t}\n\n}\n\nfunc nextInt() int64 {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn int64(i)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 460, "cpu_time_ms": 28, "memory_kb": 5016}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s261951848", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math/big\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scanf(\"%d\", &N)\n\n\tmul := big.NewInt(1)\n\ta := new(big.Int)\n\tMAX := big.NewInt(1000000000000000000)\n\tfor i := 0; i < N; i++ {\n\t\tvar s string\n\t\tfmt.Scanf(\"%s\", &s)\n\t\ta, _ = a.SetString(s, 10)\n\n\t\tmul = mul.Mul(mul, a)\n\t\tif mul.Cmp(MAX) == 1 {\n\t\t\tfmt.Println(\"-1\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(mul)\n}\n", "language": "Go", "metadata": {"date": 1590974793, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s261951848.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s261951848", "user_id": "u162326103"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math/big\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scanf(\"%d\", &N)\n\n\tmul := big.NewInt(1)\n\ta := new(big.Int)\n\tMAX := big.NewInt(1000000000000000000)\n\tfor i := 0; i < N; i++ {\n\t\tvar s string\n\t\tfmt.Scanf(\"%s\", &s)\n\t\ta, _ = a.SetString(s, 10)\n\n\t\tmul = mul.Mul(mul, a)\n\t\tif mul.Cmp(MAX) == 1 {\n\t\t\tfmt.Println(\"-1\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(mul)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 372, "cpu_time_ms": 200, "memory_kb": 6488}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s901183693", "group_id": "codeNet:p02658", "input_text": "// +build ignore\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc solve(sc *scanner, wr *bufio.Writer) int {\n\tN := sc.i()\n\tA := make([]uint64, N)\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = uint64(sc.i())\n\t}\n\tsort.Slice(A, func(i, j int) bool {\n\t\treturn A[i] < A[j]\n\t})\n\tif A[0] == 0 {\n\t\tfmt.Println(\"0\")\n\t\treturn 0\n\t}\n\tsort.Slice(A, func(i, j int) bool {\n\t\treturn A[i] > A[j]\n\t})\n\tsum := uint64(1)\n\tfor i := 0; i < N; i++ {\n\t\tsum *= A[i]\n\t\tif sum > uint64(1000000000000000000) {\n\t\t\tfmt.Println(\"-1\")\n\t\t\treturn 0\n\t\t}\n\t}\n\n\tfmt.Println(sum)\n\n\treturn 0\n}\n\nfunc main() {\n\tsc := newScanner(os.Stdin)\n\twr := bufio.NewWriter(os.Stdout)\n\tret := solve(sc, wr)\n\twr.Flush()\n\tos.Exit(ret)\n}\n\n// I/O\ntype scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc newScanner(input io.Reader) *scanner {\n\tsc := bufio.NewScanner(input)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &scanner{sc}\n}\n\nfunc (s *scanner) s() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *scanner) i() int {\n\ti, e := strconv.Atoi(s.s())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *scanner) f() float64 {\n\tf, e := strconv.ParseFloat(s.s(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *scanner) bs() []byte {\n\treturn []byte(s.s())\n}\n\nfunc (s *scanner) is(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.i()\n\t}\n\treturn res\n}\n\nfunc (s *scanner) fs(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.f()\n\t}\n\treturn res\n}\n", "language": "Go", "metadata": {"date": 1590974739, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s901183693.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s901183693", "user_id": "u737368452"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "// +build ignore\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc solve(sc *scanner, wr *bufio.Writer) int {\n\tN := sc.i()\n\tA := make([]uint64, N)\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = uint64(sc.i())\n\t}\n\tsort.Slice(A, func(i, j int) bool {\n\t\treturn A[i] < A[j]\n\t})\n\tif A[0] == 0 {\n\t\tfmt.Println(\"0\")\n\t\treturn 0\n\t}\n\tsort.Slice(A, func(i, j int) bool {\n\t\treturn A[i] > A[j]\n\t})\n\tsum := uint64(1)\n\tfor i := 0; i < N; i++ {\n\t\tsum *= A[i]\n\t\tif sum > uint64(1000000000000000000) {\n\t\t\tfmt.Println(\"-1\")\n\t\t\treturn 0\n\t\t}\n\t}\n\n\tfmt.Println(sum)\n\n\treturn 0\n}\n\nfunc main() {\n\tsc := newScanner(os.Stdin)\n\twr := bufio.NewWriter(os.Stdout)\n\tret := solve(sc, wr)\n\twr.Flush()\n\tos.Exit(ret)\n}\n\n// I/O\ntype scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc newScanner(input io.Reader) *scanner {\n\tsc := bufio.NewScanner(input)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &scanner{sc}\n}\n\nfunc (s *scanner) s() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *scanner) i() int {\n\ti, e := strconv.Atoi(s.s())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *scanner) f() float64 {\n\tf, e := strconv.ParseFloat(s.s(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *scanner) bs() []byte {\n\treturn []byte(s.s())\n}\n\nfunc (s *scanner) is(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.i()\n\t}\n\treturn res\n}\n\nfunc (s *scanner) fs(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.f()\n\t}\n\treturn res\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1502, "cpu_time_ms": 49, "memory_kb": 5852}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s519352409", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n \n// github.com/EndlessCheng/codeforces-go\n\n\nfunc main() {\n var N int\n fmt.Scanf(\"%d\", &N)\n\n A := make([]int, N)\n for i := range A{\n fmt.Scan(&A[i])\n if A[i] == 0 {\n fmt.Print(0)\n return\n }\n } \n \n retval := 1\n \n for i := range A{\n retval *= A[i]\n if retval > 1000000000000000000 {\n fmt.Print(-1)\n return\n }\n }\n fmt.Print(retval)\n}", "language": "Go", "metadata": {"date": 1590974425, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s519352409.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s519352409", "user_id": "u739468352"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n \n// github.com/EndlessCheng/codeforces-go\n\n\nfunc main() {\n var N int\n fmt.Scanf(\"%d\", &N)\n\n A := make([]int, N)\n for i := range A{\n fmt.Scan(&A[i])\n if A[i] == 0 {\n fmt.Print(0)\n return\n }\n } \n \n retval := 1\n \n for i := range A{\n retval *= A[i]\n if retval > 1000000000000000000 {\n fmt.Print(-1)\n return\n }\n }\n fmt.Print(retval)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 412, "cpu_time_ms": 1382, "memory_kb": 6300}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s441188967", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar t string\n\tvar s = bufio.NewScanner(os.Stdin)\n\ts.Split(bufio.ScanWords)\n\n\tif s.Scan() {\n\t\tt = s.Text()\n\t}\n\n\tN, err := strconv.Atoi(t)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tvar answer int64\n\tanswer = 1\n\tfor i := 0; i < N; i++ {\n\t\tif s.Scan() {\n\t\t\tt = s.Text()\n\t\t}\n\n\t\tN, err := strconv.ParseInt(t, 10, 64)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tif N == 0 {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t} else if answer*int64(N) > int64(math.Pow10(18)) {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t} else {\n\t\t\tanswer = answer * int64(N)\n\t\t}\n\t}\n\tfmt.Println(answer)\n}\n", "language": "Go", "metadata": {"date": 1590974400, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s441188967.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s441188967", "user_id": "u340848688"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar t string\n\tvar s = bufio.NewScanner(os.Stdin)\n\ts.Split(bufio.ScanWords)\n\n\tif s.Scan() {\n\t\tt = s.Text()\n\t}\n\n\tN, err := strconv.Atoi(t)\n\tif err != nil {\n\t\treturn\n\t}\n\n\tvar answer int64\n\tanswer = 1\n\tfor i := 0; i < N; i++ {\n\t\tif s.Scan() {\n\t\t\tt = s.Text()\n\t\t}\n\n\t\tN, err := strconv.ParseInt(t, 10, 64)\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tif N == 0 {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t} else if answer*int64(N) > int64(math.Pow10(18)) {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t} else {\n\t\t\tanswer = answer * int64(N)\n\t\t}\n\t}\n\tfmt.Println(answer)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 610, "cpu_time_ms": 15, "memory_kb": 1760}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s933455918", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar mod = 1000000007\nvar maxv int = 1000000000000000000\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tvar n int\n\tfmt.Fscan(r, &n)\n\n\tans := int(1)\n\tvar a int\n\tas := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscan(r, &a)\n\t\tas[i] = a\n\n\t\tans *= a\n\t\tif ans > maxv {\n\t\t\tans = -1\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tif as[i] == 0 {\n\t\t\tans = 0\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n\n}\n\n// Union-Find\ntype unionFind struct {\n\td []int\n}\n\nfunc newUnionFind(n int) *unionFind {\n\tuf := new(unionFind)\n\tuf.d = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tuf.d[i] = -1\n\t}\n\treturn uf\n}\n\nfunc (uf *unionFind) find(x int) int {\n\tif uf.d[x] < 0 {\n\t\treturn x\n\t}\n\tuf.d[x] = uf.find(uf.d[x])\n\treturn uf.d[x]\n}\n\nfunc (uf *unionFind) unite(x, y int) bool {\n\trootX := uf.find(x)\n\trootY := uf.find(y)\n\tif rootX == rootY {\n\t\treturn false\n\t}\n\n\tif uf.d[rootX] < uf.d[rootY] {\n\t\tuf.d[rootX] += uf.d[rootY]\n\t\tuf.d[rootY] = rootX\n\t} else {\n\t\tuf.d[rootY] += uf.d[rootX]\n\t\tuf.d[rootX] = rootY\n\t}\n\n\treturn true\n}\n\nfunc (uf *unionFind) same(x, y int) bool {\n\treturn uf.find(x) == uf.find(y)\n}\n\nfunc (uf *unionFind) size(x int) int {\n\treturn -uf.d[uf.find(x)]\n}\n\n// mod\nfunc modpow(a, n, mod int) int {\n\tres := 1\n\tfor n > 0 {\n\t\tif n%2 != 0 {\n\t\t\tres = res * a % mod\n\t\t}\n\t\ta = a * a % mod\n\t\tn = n / 2\n\t}\n\treturn res\n}\n\nfunc modinv(n, mod int) int {\n\treturn modpow(n, mod-2, mod)\n}\n\nfunc modcomb(n, a, mod int) int {\n\tx := 1\n\ty := 1\n\tfor i := 0; i < a; i++ {\n\t\tx = x * (n - i)\n\t\tx %= mod\n\t\ty = y * (i + 1)\n\t\ty %= mod\n\t}\n\treturn x * modpow(y, mod-2, mod) % mod\n}\n\nfunc modfactorial(n, mod int) int {\n\tresult := 1\n\tfor i := 1; i <= n; i++ {\n\t\tresult = (result * i) % mod\n\t}\n\treturn result\n}\n\n// Combination ...\ntype Combination struct {\n\tfacts, invs []int\n\tmod int\n}\n\n// NewCombination ...\nfunc NewCombination(n, mod int) Combination {\n\treturn Combination{\n\t\tfacts: make([]int, n+1),\n\t\tinvs: make([]int, n+1),\n\t\tmod: mod,\n\t}\n}\n\nfunc (cmb *Combination) calc(n, k int) int {\n\tret := cmb.facts[n] * cmb.invs[k]\n\tret %= cmb.mod\n\tret = ret * cmb.invs[n-k]\n\tret %= cmb.mod\n\treturn ret\n}\n\nfunc (cmb *Combination) init(n int) {\n\tcmb.facts[0] = 1\n\t// 階乗を算出\n\tfor i := 1; i <= n; i++ {\n\t\tcmb.facts[i] = cmb.facts[i-1] * i % cmb.mod\n\t}\n\t// 逆元を算出\n\tcmb.invs[n] = modinv(cmb.facts[n], cmb.mod)\n\tfor i := n - 1; i >= 0; i-- {\n\t\tcmb.invs[i] = cmb.invs[i+1] * (i + 1) % cmb.mod\n\t}\n}\n\n// Utility\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc primeFactor(x int) map[int]int {\n\tres := make(map[int]int)\n\tfor i := 2; i*i <= x; i++ {\n\t\tfor x%i == 0 {\n\t\t\tres[i]++\n\t\t\tx = x / i\n\t\t}\n\t}\n\tif x != 1 {\n\t\tres[x] = 1\n\t}\n\treturn res\n}\n\nfunc divisor(x int) []int {\n\tres := make([]int, 0)\n\tfor i := 1; i*i <= x; i++ {\n\t\tif x%i == 0 {\n\t\t\tres = append(res, i)\n\t\t\tif i != x/i {\n\t\t\t\tres = append(res, x/i)\n\t\t\t}\n\t\t}\n\t}\n\treturn res\n}\n\nfunc gcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t}\n\treturn gcd(y, x%y)\n}\n\nfunc lcm(x, y int) int {\n\treturn x / gcd(x, y) * y\n}\n\nfunc reverseString(s string) string {\n\tr := []rune(s)\n\tfor i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {\n\t\tr[i], r[j] = r[j], r[i]\n\t}\n\treturn string(r)\n}\n\n// Queue ...\ntype Queue []int\n\n// pop ...\nfunc (q *Queue) empty() bool {\n\treturn len(*q) == 0\n}\n\n// push ...\nfunc (q *Queue) push(i int) {\n\t*q = append(*q, i)\n}\n\n// pop ...\nfunc (q *Queue) pop() (int, bool) {\n\tif q.empty() {\n\t\treturn 0, false\n\t} else {\n\t\tres := (*q)[0]\n\t\t*q = (*q)[1:]\n\t\treturn res, true\n\t}\n}\n\n// Stack ...\ntype Stack []int\n\n// pop ...\nfunc (s *Stack) empty() bool {\n\treturn len(*s) == 0\n}\n\n// push ...\nfunc (s *Stack) push(i int) {\n\t*s = append(*s, i)\n}\n\n// pop ...\nfunc (s *Stack) pop() (int, bool) {\n\tif s.empty() {\n\t\treturn 0, false\n\t} else {\n\t\tindex := len(*s) - 1\n\t\tres := (*s)[index]\n\t\t*s = (*s)[:index]\n\t\treturn res, true\n\t}\n}\n\n// priority_queue\ntype intHeap []int\n\nfunc (h intHeap) Len() int { return len(h) }\nfunc (h intHeap) Less(i, j int) bool { return h[i] > h[j] }\nfunc (h intHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\n// sortable points\ntype point struct {\n\tx int\n\ty int\n}\n\ntype points []point\n\nfunc (p points) Len() int {\n\treturn len(p)\n}\n\nfunc (p points) Less(i, j int) bool {\n\treturn p[i].x < p[j].x\n}\n\nfunc (p points) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n", "language": "Go", "metadata": {"date": 1590974383, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s933455918.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s933455918", "user_id": "u433254839"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar mod = 1000000007\nvar maxv int = 1000000000000000000\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tvar n int\n\tfmt.Fscan(r, &n)\n\n\tans := int(1)\n\tvar a int\n\tas := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Fscan(r, &a)\n\t\tas[i] = a\n\n\t\tans *= a\n\t\tif ans > maxv {\n\t\t\tans = -1\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tif as[i] == 0 {\n\t\t\tans = 0\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n\n}\n\n// Union-Find\ntype unionFind struct {\n\td []int\n}\n\nfunc newUnionFind(n int) *unionFind {\n\tuf := new(unionFind)\n\tuf.d = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tuf.d[i] = -1\n\t}\n\treturn uf\n}\n\nfunc (uf *unionFind) find(x int) int {\n\tif uf.d[x] < 0 {\n\t\treturn x\n\t}\n\tuf.d[x] = uf.find(uf.d[x])\n\treturn uf.d[x]\n}\n\nfunc (uf *unionFind) unite(x, y int) bool {\n\trootX := uf.find(x)\n\trootY := uf.find(y)\n\tif rootX == rootY {\n\t\treturn false\n\t}\n\n\tif uf.d[rootX] < uf.d[rootY] {\n\t\tuf.d[rootX] += uf.d[rootY]\n\t\tuf.d[rootY] = rootX\n\t} else {\n\t\tuf.d[rootY] += uf.d[rootX]\n\t\tuf.d[rootX] = rootY\n\t}\n\n\treturn true\n}\n\nfunc (uf *unionFind) same(x, y int) bool {\n\treturn uf.find(x) == uf.find(y)\n}\n\nfunc (uf *unionFind) size(x int) int {\n\treturn -uf.d[uf.find(x)]\n}\n\n// mod\nfunc modpow(a, n, mod int) int {\n\tres := 1\n\tfor n > 0 {\n\t\tif n%2 != 0 {\n\t\t\tres = res * a % mod\n\t\t}\n\t\ta = a * a % mod\n\t\tn = n / 2\n\t}\n\treturn res\n}\n\nfunc modinv(n, mod int) int {\n\treturn modpow(n, mod-2, mod)\n}\n\nfunc modcomb(n, a, mod int) int {\n\tx := 1\n\ty := 1\n\tfor i := 0; i < a; i++ {\n\t\tx = x * (n - i)\n\t\tx %= mod\n\t\ty = y * (i + 1)\n\t\ty %= mod\n\t}\n\treturn x * modpow(y, mod-2, mod) % mod\n}\n\nfunc modfactorial(n, mod int) int {\n\tresult := 1\n\tfor i := 1; i <= n; i++ {\n\t\tresult = (result * i) % mod\n\t}\n\treturn result\n}\n\n// Combination ...\ntype Combination struct {\n\tfacts, invs []int\n\tmod int\n}\n\n// NewCombination ...\nfunc NewCombination(n, mod int) Combination {\n\treturn Combination{\n\t\tfacts: make([]int, n+1),\n\t\tinvs: make([]int, n+1),\n\t\tmod: mod,\n\t}\n}\n\nfunc (cmb *Combination) calc(n, k int) int {\n\tret := cmb.facts[n] * cmb.invs[k]\n\tret %= cmb.mod\n\tret = ret * cmb.invs[n-k]\n\tret %= cmb.mod\n\treturn ret\n}\n\nfunc (cmb *Combination) init(n int) {\n\tcmb.facts[0] = 1\n\t// 階乗を算出\n\tfor i := 1; i <= n; i++ {\n\t\tcmb.facts[i] = cmb.facts[i-1] * i % cmb.mod\n\t}\n\t// 逆元を算出\n\tcmb.invs[n] = modinv(cmb.facts[n], cmb.mod)\n\tfor i := n - 1; i >= 0; i-- {\n\t\tcmb.invs[i] = cmb.invs[i+1] * (i + 1) % cmb.mod\n\t}\n}\n\n// Utility\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc primeFactor(x int) map[int]int {\n\tres := make(map[int]int)\n\tfor i := 2; i*i <= x; i++ {\n\t\tfor x%i == 0 {\n\t\t\tres[i]++\n\t\t\tx = x / i\n\t\t}\n\t}\n\tif x != 1 {\n\t\tres[x] = 1\n\t}\n\treturn res\n}\n\nfunc divisor(x int) []int {\n\tres := make([]int, 0)\n\tfor i := 1; i*i <= x; i++ {\n\t\tif x%i == 0 {\n\t\t\tres = append(res, i)\n\t\t\tif i != x/i {\n\t\t\t\tres = append(res, x/i)\n\t\t\t}\n\t\t}\n\t}\n\treturn res\n}\n\nfunc gcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t}\n\treturn gcd(y, x%y)\n}\n\nfunc lcm(x, y int) int {\n\treturn x / gcd(x, y) * y\n}\n\nfunc reverseString(s string) string {\n\tr := []rune(s)\n\tfor i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {\n\t\tr[i], r[j] = r[j], r[i]\n\t}\n\treturn string(r)\n}\n\n// Queue ...\ntype Queue []int\n\n// pop ...\nfunc (q *Queue) empty() bool {\n\treturn len(*q) == 0\n}\n\n// push ...\nfunc (q *Queue) push(i int) {\n\t*q = append(*q, i)\n}\n\n// pop ...\nfunc (q *Queue) pop() (int, bool) {\n\tif q.empty() {\n\t\treturn 0, false\n\t} else {\n\t\tres := (*q)[0]\n\t\t*q = (*q)[1:]\n\t\treturn res, true\n\t}\n}\n\n// Stack ...\ntype Stack []int\n\n// pop ...\nfunc (s *Stack) empty() bool {\n\treturn len(*s) == 0\n}\n\n// push ...\nfunc (s *Stack) push(i int) {\n\t*s = append(*s, i)\n}\n\n// pop ...\nfunc (s *Stack) pop() (int, bool) {\n\tif s.empty() {\n\t\treturn 0, false\n\t} else {\n\t\tindex := len(*s) - 1\n\t\tres := (*s)[index]\n\t\t*s = (*s)[:index]\n\t\treturn res, true\n\t}\n}\n\n// priority_queue\ntype intHeap []int\n\nfunc (h intHeap) Len() int { return len(h) }\nfunc (h intHeap) Less(i, j int) bool { return h[i] > h[j] }\nfunc (h intHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\n// sortable points\ntype point struct {\n\tx int\n\ty int\n}\n\ntype points []point\n\nfunc (p points) Len() int {\n\treturn len(p)\n}\n\nfunc (p points) Less(i, j int) bool {\n\treturn p[i].x < p[j].x\n}\n\nfunc (p points) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4581, "cpu_time_ms": 36, "memory_kb": 2708}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s721967917", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\n/* sort */\ntype pair struct {\n\tindex int64\n\tp1, p2 interface{}\n}\ntype pairs []pair\n\nfunc (slice pairs) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice pairs) Less(i, j int) bool {\n\treturn slice[i].index < slice[j].index\n}\n\nfunc (slice pairs) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\n\n/* sort */\ntype Int64Slice []int64\n\nfunc (slice Int64Slice) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice Int64Slice) Less(i, j int) bool {\n\treturn slice[i] < slice[j]\n}\n\nfunc (slice Int64Slice) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\nfunc Int64s(a []int64) { sort.Sort(Int64Slice(a)) }\nfunc Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n\tINF = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tdi = []int64{-1, 0, 1, 0}\n\tdj = []int64{0, -1, 0, 1}\n\tdi8 = []int64{-1, -1, 0, 1, 1, 1, 0, -1}\n\tdj8 = []int64{0, -1, -1, -1, 0, 1, 1, 1}\n)\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tscanner.Buffer(buf, maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tN := readInt()\n\tA := make([]int64, N)\n\tvar prod int64\n\tprod = 1\n\tzero := false\n\tfor i := int64(0); i < N; i++ {\n\t\tA[i] = readInt()\n\t\tif A[i] == 0 {\n\t\t\tzero = true\n\t\t}\n\t}\n\tif zero {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tfor i := int64(0); i < N; i++ {\n\t\tif keta(prod)+keta(A[i]) >= 18 {\n\t\t\tif prod*A[i] != int64(1e18) {\n\t\t\t\tfmt.Println(-1)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tprod *= A[i]\n\t}\n\tfmt.Println(prod)\n}\n\nfunc keta(a int64) int64 {\n\treturn int64(len(i2s(a)))\n}\n\n/*==========================================\n * Library\n *==========================================*/\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\nfunc doubleAry(h int64, w int64, init int64) (res [][]int64) {\n\tres = make([][]int64, h)\n\tfor i := int64(0); i < h; i++ {\n\t\tres[i] = make([]int64, w)\n\t\tfor j := int64(0); j < w; j++ {\n\t\t\tres[i][j] = init\n\t\t}\n\t}\n\treturn\n}\n\nfunc aryEq(a []int64, b []int64) bool {\n\treturn reflect.DeepEqual(a, b)\n}\n\nfunc clone(n []int64) (r []int64) {\n\tr = make([]int64, len(n))\n\tfor i := 0; i < len(n); i++ {\n\t\tr[i] = n[i]\n\t}\n\treturn\n}\nfunc write(s string) {\n\twriter.WriteString(s)\n}\n\nfunc print() {\n\twriter.Flush()\n}\n\n// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可\nfunc readLine() (s string) {\n\tif scanner.Scan() {\n\t\ts = scanner.Text()\n\t}\n\treturn s\n}\n\nfunc readInt() (read int64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseInt(scanner.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readFloat() (read float64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readRunes() (read []rune) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, v)\n\t}\n\treturn\n}\n\nfunc readString() (read string) {\n\tscanner.Scan()\n\tread = scanner.Text()\n\treturn\n}\n\nfunc readStrings() (read []string) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, string(v))\n\t}\n\treturn\n}\n\nfunc s2i(s string) int64 {\n\tvar intVal, e = strconv.ParseInt(s, 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int64) string {\n\tvar strVal = strconv.FormatInt(i, 10)\n\treturn strVal\n}\n\nfunc s2f(s string) float64 {\n\tvar floatVal, e = strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn floatVal\n}\n\nfunc abs(i int64) int64 {\n\treturn int64(math.Abs(float64(i)))\n}\n\nfunc max(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans < v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\nfunc min(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans > v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc sum(i []int64) int64 {\n\tsum := int64(0)\n\tfor _, val := range i {\n\t\tsum += val\n\t}\n\treturn sum\n}\n\nfunc split(s string) []string {\n\treturn strings.Fields(s)\n}\n\nfunc strAry2intAry(strs []string) []int64 {\n\tvar ret = make([]int64, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal = s2i(str)\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int64) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = i2s(num)\n\t\tret = append(ret, strVal)\n\t}\n\treturn ret\n}\n\nfunc ary2str(strs []string) string {\n\treturn strings.Join(strs, \" \")\n}\n\nfunc reverse(res []int64) []int64 {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\nfunc reverseStr(res []string) []string {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\n\nfunc ini(res []int, init int) {\n\tif len(res) == 0 {\n\t\treturn\n\t}\n\tres[0] = init\n\tfor i := 0; i < len(res); i++ {\n\t\tcopy(res[i:], res[:i])\n\t}\n}\n\n//\n// func regexpExample() {\n// // Your code here!\n// var str = \"13:20\"\n// r := regexp.MustCompile(`(\\d+):(\\d+)`)\n// fmt.Println(r.FindStringSubmatch(str))\n// }\n\n// type Country struct {\n// gold int\n// silver int\n// blonze int\n// }\n\n// // 複数ソートのサンプル\n// func stableSortExample() []Country{\n// var country = []Country {\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:3, blonze:2},\n// {gold:1, silver:3, blonze:3},\n// }\n// sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })\n// return country\n// }\n", "language": "Go", "metadata": {"date": 1590974261, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s721967917.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s721967917", "user_id": "u967669872"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\n/* sort */\ntype pair struct {\n\tindex int64\n\tp1, p2 interface{}\n}\ntype pairs []pair\n\nfunc (slice pairs) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice pairs) Less(i, j int) bool {\n\treturn slice[i].index < slice[j].index\n}\n\nfunc (slice pairs) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\n\n/* sort */\ntype Int64Slice []int64\n\nfunc (slice Int64Slice) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice Int64Slice) Less(i, j int) bool {\n\treturn slice[i] < slice[j]\n}\n\nfunc (slice Int64Slice) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\nfunc Int64s(a []int64) { sort.Sort(Int64Slice(a)) }\nfunc Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n\tINF = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tdi = []int64{-1, 0, 1, 0}\n\tdj = []int64{0, -1, 0, 1}\n\tdi8 = []int64{-1, -1, 0, 1, 1, 1, 0, -1}\n\tdj8 = []int64{0, -1, -1, -1, 0, 1, 1, 1}\n)\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tscanner.Buffer(buf, maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tN := readInt()\n\tA := make([]int64, N)\n\tvar prod int64\n\tprod = 1\n\tzero := false\n\tfor i := int64(0); i < N; i++ {\n\t\tA[i] = readInt()\n\t\tif A[i] == 0 {\n\t\t\tzero = true\n\t\t}\n\t}\n\tif zero {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tfor i := int64(0); i < N; i++ {\n\t\tif keta(prod)+keta(A[i]) >= 18 {\n\t\t\tif prod*A[i] != int64(1e18) {\n\t\t\t\tfmt.Println(-1)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tprod *= A[i]\n\t}\n\tfmt.Println(prod)\n}\n\nfunc keta(a int64) int64 {\n\treturn int64(len(i2s(a)))\n}\n\n/*==========================================\n * Library\n *==========================================*/\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\nfunc doubleAry(h int64, w int64, init int64) (res [][]int64) {\n\tres = make([][]int64, h)\n\tfor i := int64(0); i < h; i++ {\n\t\tres[i] = make([]int64, w)\n\t\tfor j := int64(0); j < w; j++ {\n\t\t\tres[i][j] = init\n\t\t}\n\t}\n\treturn\n}\n\nfunc aryEq(a []int64, b []int64) bool {\n\treturn reflect.DeepEqual(a, b)\n}\n\nfunc clone(n []int64) (r []int64) {\n\tr = make([]int64, len(n))\n\tfor i := 0; i < len(n); i++ {\n\t\tr[i] = n[i]\n\t}\n\treturn\n}\nfunc write(s string) {\n\twriter.WriteString(s)\n}\n\nfunc print() {\n\twriter.Flush()\n}\n\n// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可\nfunc readLine() (s string) {\n\tif scanner.Scan() {\n\t\ts = scanner.Text()\n\t}\n\treturn s\n}\n\nfunc readInt() (read int64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseInt(scanner.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readFloat() (read float64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readRunes() (read []rune) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, v)\n\t}\n\treturn\n}\n\nfunc readString() (read string) {\n\tscanner.Scan()\n\tread = scanner.Text()\n\treturn\n}\n\nfunc readStrings() (read []string) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, string(v))\n\t}\n\treturn\n}\n\nfunc s2i(s string) int64 {\n\tvar intVal, e = strconv.ParseInt(s, 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int64) string {\n\tvar strVal = strconv.FormatInt(i, 10)\n\treturn strVal\n}\n\nfunc s2f(s string) float64 {\n\tvar floatVal, e = strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn floatVal\n}\n\nfunc abs(i int64) int64 {\n\treturn int64(math.Abs(float64(i)))\n}\n\nfunc max(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans < v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\nfunc min(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans > v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc sum(i []int64) int64 {\n\tsum := int64(0)\n\tfor _, val := range i {\n\t\tsum += val\n\t}\n\treturn sum\n}\n\nfunc split(s string) []string {\n\treturn strings.Fields(s)\n}\n\nfunc strAry2intAry(strs []string) []int64 {\n\tvar ret = make([]int64, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal = s2i(str)\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int64) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = i2s(num)\n\t\tret = append(ret, strVal)\n\t}\n\treturn ret\n}\n\nfunc ary2str(strs []string) string {\n\treturn strings.Join(strs, \" \")\n}\n\nfunc reverse(res []int64) []int64 {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\nfunc reverseStr(res []string) []string {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\n\nfunc ini(res []int, init int) {\n\tif len(res) == 0 {\n\t\treturn\n\t}\n\tres[0] = init\n\tfor i := 0; i < len(res); i++ {\n\t\tcopy(res[i:], res[:i])\n\t}\n}\n\n//\n// func regexpExample() {\n// // Your code here!\n// var str = \"13:20\"\n// r := regexp.MustCompile(`(\\d+):(\\d+)`)\n// fmt.Println(r.FindStringSubmatch(str))\n// }\n\n// type Country struct {\n// gold int\n// silver int\n// blonze int\n// }\n\n// // 複数ソートのサンプル\n// func stableSortExample() []Country{\n// var country = []Country {\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:3, blonze:2},\n// {gold:1, silver:3, blonze:3},\n// }\n// sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })\n// return country\n// }\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6009, "cpu_time_ms": 34, "memory_kb": 5820}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s508583570", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc scanNums(len int) (nums []int) {\n\tvar num int\n\tfor i := 0; i < len; i++ {\n\t\tnum = nextInt()\n\t\tnums = append(nums, num)\n\t}\n\treturn\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\ta := scanNums(n)\n\tvar sum int64\n\tsum = 1\n\tfor i := 0; i < n; i++ {\n\t\tsum *= int64(a[i])\n\t}\n\tif sum > int64(math.Pow(10, 18)) {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(int64(sum))\n\t}\n}\n", "language": "Go", "metadata": {"date": 1590974028, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s508583570.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s508583570", "user_id": "u651597583"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc scanNums(len int) (nums []int) {\n\tvar num int\n\tfor i := 0; i < len; i++ {\n\t\tnum = nextInt()\n\t\tnums = append(nums, num)\n\t}\n\treturn\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\ta := scanNums(n)\n\tvar sum int64\n\tsum = 1\n\tfor i := 0; i < n; i++ {\n\t\tsum *= int64(a[i])\n\t}\n\tif sum > int64(math.Pow(10, 18)) {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(int64(sum))\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 593, "cpu_time_ms": 32, "memory_kb": 7064}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s535368189", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a int\n\tfmt.Scan(&a)\n\n\tnums := make([]int, a)\n\n\tfor i := range nums {\n\t\tfmt.Scan(&nums[i])\n\t}\n\tans := 1\n\tfor i := range nums {\n\t\tans *= nums[i]\n\t}\n\n\tif ans > 1000000000000000000 {\n\t\tfmt.Print(-1)\n\t} else {\n\t\tfmt.Print(ans)\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1590974020, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s535368189.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s535368189", "user_id": "u196917985"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a int\n\tfmt.Scan(&a)\n\n\tnums := make([]int, a)\n\n\tfor i := range nums {\n\t\tfmt.Scan(&nums[i])\n\t}\n\tans := 1\n\tfor i := range nums {\n\t\tans *= nums[i]\n\t}\n\n\tif ans > 1000000000000000000 {\n\t\tfmt.Print(-1)\n\t} else {\n\t\tfmt.Print(ans)\n\t}\n\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1373, "memory_kb": 6324}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s734597791", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math/big\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc lowerBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] >= x\n\t})\n\treturn idx\n}\n\nfunc upperBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] > x\n\t})\n\treturn idx\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tN := getInt()\n\tsum := big.NewInt(1)\n\n\tover := big.NewInt(1000000000)\n\tover.Mul(over, over)\n\n\ta := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\ta[i] = getInt()\n\t\tif a[i] == 0 {\n\t\t\tout(0)\n\t\t\treturn\n\t\t}\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tb := big.NewInt(int64(a[i]))\n\t\tsum.Mul(sum, b)\n\t\tif sum.Cmp(over) > 0 {\n\t\t\tout(-1)\n\t\t\treturn\n\t\t}\n\t}\n\tout(sum)\n}\n", "language": "Go", "metadata": {"date": 1590973859, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s734597791.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s734597791", "user_id": "u814575783"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math/big\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc lowerBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] >= x\n\t})\n\treturn idx\n}\n\nfunc upperBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] > x\n\t})\n\treturn idx\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tN := getInt()\n\tsum := big.NewInt(1)\n\n\tover := big.NewInt(1000000000)\n\tover.Mul(over, over)\n\n\ta := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\ta[i] = getInt()\n\t\tif a[i] == 0 {\n\t\t\tout(0)\n\t\t\treturn\n\t\t}\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tb := big.NewInt(int64(a[i]))\n\t\tsum.Mul(sum, b)\n\t\tif sum.Cmp(over) > 0 {\n\t\t\tout(-1)\n\t\t\treturn\n\t\t}\n\t}\n\tout(sum)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1264, "cpu_time_ms": 32, "memory_kb": 5928}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s497586816", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar stdInScanner = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tstdInScanner.Scan()\n\ti, _ := strconv.Atoi(stdInScanner.Text())\n\treturn i\n}\n\nfunc main() {\n\tstdInScanner.Split(bufio.ScanWords)\n\n\tN := nextInt()\n\tanser := nextInt()\n\n\tfor i := 0; i < N-1; i++ {\n\t\tanser *= nextInt()\n\t\tif 1000000000000000000 < anser {\n\t\t\tanser = -1\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(anser)\n}\n", "language": "Go", "metadata": {"date": 1590973823, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s497586816.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s497586816", "user_id": "u589367761"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar stdInScanner = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tstdInScanner.Scan()\n\ti, _ := strconv.Atoi(stdInScanner.Text())\n\treturn i\n}\n\nfunc main() {\n\tstdInScanner.Split(bufio.ScanWords)\n\n\tN := nextInt()\n\tanser := nextInt()\n\n\tfor i := 0; i < N-1; i++ {\n\t\tanser *= nextInt()\n\t\tif 1000000000000000000 < anser {\n\t\t\tanser = -1\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(anser)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 429, "cpu_time_ms": 13, "memory_kb": 1760}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s933238281", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\ta := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\n\tmax := int64(1e18)\n\tans := int64(1)\n\tfor i := 0; i < n; i++ {\n\t\tif a[i] == 0 {\n\t\t\tans = 0\n\t\t\tbreak\n\t\t}\n\t\tif ans > max/a[i] {\n\t\t\tans = -1\n\t\t\tbreak\n\t\t}\n\t\tans *= a[i]\n\t\tif ans > max {\n\t\t\tans = -1\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1590973752, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s933238281.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s933238281", "user_id": "u448258717"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\ta := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\n\tmax := int64(1e18)\n\tans := int64(1)\n\tfor i := 0; i < n; i++ {\n\t\tif a[i] == 0 {\n\t\t\tans = 0\n\t\t\tbreak\n\t\t}\n\t\tif ans > max/a[i] {\n\t\t\tans = -1\n\t\t\tbreak\n\t\t}\n\t\tans *= a[i]\n\t\tif ans > max {\n\t\t\tans = -1\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1371, "memory_kb": 6324}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s446368090", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc scanNums(len int) (nums []int) {\n\tvar num int\n\tfor i := 0; i < len; i++ {\n\t\tnum = nextInt()\n\t\tnums = append(nums, num)\n\t}\n\treturn\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\ta := scanNums(n)\n\tsum := 1\n\tfor i := 0; i < n; i++ {\n\t\tsum *= a[i]\n\t}\n\tif sum > int(math.Pow(10, 18)) {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(sum)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1590973740, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s446368090.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s446368090", "user_id": "u651597583"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc scanNums(len int) (nums []int) {\n\tvar num int\n\tfor i := 0; i < len; i++ {\n\t\tnum = nextInt()\n\t\tnums = append(nums, num)\n\t}\n\treturn\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\ta := scanNums(n)\n\tsum := 1\n\tfor i := 0; i < n; i++ {\n\t\tsum *= a[i]\n\t}\n\tif sum > int(math.Pow(10, 18)) {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(sum)\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 563, "cpu_time_ms": 34, "memory_kb": 7068}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s280045858", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\ta := nextInt()\n\tmax := int(math.Pow(10, 18))\n\n\tans := 0\n\tfor i := 0; i < a; i++ {\n\t\tans *= a\n\t\tif ans > max {\n\t\t\tfmt.Println(-1)\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc isPrime(n int) bool {\n\tfor i := 2.0; i <= math.Sqrt(float64(n)); i++ {\n\t\tif n%int(i) == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n\nfunc slicePrint(s []int) {\n\tfor i, v := range s {\n\t\tif i != 0 {\n\t\t\tfmt.Printf(\" \")\n\t\t}\n\t\tfmt.Printf(\"%v\", v)\n\t}\n\tfmt.Println(\"\")\n}\n\nfunc abs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\treturn n\n}\n", "language": "Go", "metadata": {"date": 1590973620, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s280045858.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s280045858", "user_id": "u186893542"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\ta := nextInt()\n\tmax := int(math.Pow(10, 18))\n\n\tans := 0\n\tfor i := 0; i < a; i++ {\n\t\tans *= a\n\t\tif ans > max {\n\t\t\tfmt.Println(-1)\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc isPrime(n int) bool {\n\tfor i := 2.0; i <= math.Sqrt(float64(n)); i++ {\n\t\tif n%int(i) == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n\nfunc slicePrint(s []int) {\n\tfor i, v := range s {\n\t\tif i != 0 {\n\t\t\tfmt.Printf(\" \")\n\t\t}\n\t\tfmt.Printf(\"%v\", v)\n\t}\n\tfmt.Println(\"\")\n}\n\nfunc abs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\treturn n\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 743, "cpu_time_ms": 9, "memory_kb": 1760}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s327370425", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\tnum, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn num\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc getMin(x ...int) int {\n\tmin := math.MaxInt64\n\tfor i := 0; i < len(x); i++ {\n\t\tif x[i] < min {\n\t\t\tmin = x[i]\n\t\t}\n\t}\n\treturn min\n}\n\nfunc getMax(x ...int) int {\n\tmax := math.MinInt64\n\tfor i := 0; i < len(x); i++ {\n\t\tif x[i] > max {\n\t\t\tmax = x[i]\n\t\t}\n\t}\n\treturn max\n}\n\nfunc pow(x, pow int) int {\n\tans := x\n\tfor i := 1; i < pow; i++ {\n\t\tans = ans * x\n\t}\n\treturn ans\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc main() {\n\t// sc.Buffer([]byte{}, math.MaxInt64)\n\tsc.Split(bufio.ScanWords)\n\n\t// w := bufio.NewWriter(os.Stdout)\n\t// defer w.Flush()\n\n\tbar := 1000000000000000000\n\n\tn := nextInt()\n\tans := func() int {\n\t\ttotal := 1\n\t\tflag := false\n\t\tfor i := 0; i < n; i++ {\n\t\t\ta := nextInt()\n\t\t\tif a == 0 {\n\t\t\t\treturn 0\n\t\t\t}\n\t\t\ttotal = total * a\n\t\t\tif total > bar {\n\t\t\t\tflag = true\n\t\t\t\ttotal = 1\n\t\t\t}\n\t\t}\n\n\t\tif flag {\n\t\t\treturn -1\n\t\t}\n\t\treturn total\n\t}()\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1590973527, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s327370425.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s327370425", "user_id": "u481836184"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\tnum, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn num\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc getMin(x ...int) int {\n\tmin := math.MaxInt64\n\tfor i := 0; i < len(x); i++ {\n\t\tif x[i] < min {\n\t\t\tmin = x[i]\n\t\t}\n\t}\n\treturn min\n}\n\nfunc getMax(x ...int) int {\n\tmax := math.MinInt64\n\tfor i := 0; i < len(x); i++ {\n\t\tif x[i] > max {\n\t\t\tmax = x[i]\n\t\t}\n\t}\n\treturn max\n}\n\nfunc pow(x, pow int) int {\n\tans := x\n\tfor i := 1; i < pow; i++ {\n\t\tans = ans * x\n\t}\n\treturn ans\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc main() {\n\t// sc.Buffer([]byte{}, math.MaxInt64)\n\tsc.Split(bufio.ScanWords)\n\n\t// w := bufio.NewWriter(os.Stdout)\n\t// defer w.Flush()\n\n\tbar := 1000000000000000000\n\n\tn := nextInt()\n\tans := func() int {\n\t\ttotal := 1\n\t\tflag := false\n\t\tfor i := 0; i < n; i++ {\n\t\t\ta := nextInt()\n\t\t\tif a == 0 {\n\t\t\t\treturn 0\n\t\t\t}\n\t\t\ttotal = total * a\n\t\t\tif total > bar {\n\t\t\t\tflag = true\n\t\t\t\ttotal = 1\n\t\t\t}\n\t\t}\n\n\t\tif flag {\n\t\t\treturn -1\n\t\t}\n\t\treturn total\n\t}()\n\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1173, "cpu_time_ms": 28, "memory_kb": 5028}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s606915346", "group_id": "codeNet:p02658", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"math/big\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc run(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tvar n int\n\tFscan(in, &n)\n\ta := make([]int, n)\n\tfor i := range a {\n\t\tFscan(in, &a[i])\n\t\tif a[i] == 0 {\n\t\t\tFprintln(out, 0)\n\n\t\t\treturn\n\t\t}\n\t}\n\ts := big.NewInt(1)\n\tupper := big.NewInt(1e18)\n\tfor _, v := range a {\n\n\t\ts.Mul(s,big.NewInt(int64(v)))\n\t\tif s.Cmp( upper)>0 {\n\t\t\tFprintln(out, -1)\n\t\t\treturn\n\t\t}\n\t}\n\tFprintln(out, s.Int64())\n}\n\nfunc main() { run(os.Stdin, os.Stdout) }\n", "language": "Go", "metadata": {"date": 1590973442, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02658.html", "problem_id": "p02658", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02658/input.txt", "sample_output_relpath": "derived/input_output/data/p02658/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02658/Go/s606915346.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s606915346", "user_id": "u235132324"}, "prompt_components": {"gold_output": "1000000000000000000\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t. \"fmt\"\n\t\"io\"\n\t\"math/big\"\n\t\"os\"\n)\n\n// github.com/EndlessCheng/codeforces-go\nfunc run(_r io.Reader, _w io.Writer) {\n\tin := bufio.NewReader(_r)\n\tout := bufio.NewWriter(_w)\n\tdefer out.Flush()\n\n\tvar n int\n\tFscan(in, &n)\n\ta := make([]int, n)\n\tfor i := range a {\n\t\tFscan(in, &a[i])\n\t\tif a[i] == 0 {\n\t\t\tFprintln(out, 0)\n\n\t\t\treturn\n\t\t}\n\t}\n\ts := big.NewInt(1)\n\tupper := big.NewInt(1e18)\n\tfor _, v := range a {\n\n\t\ts.Mul(s,big.NewInt(int64(v)))\n\t\tif s.Cmp( upper)>0 {\n\t\t\tFprintln(out, -1)\n\t\t\treturn\n\t\t}\n\t}\n\tFprintln(out, s.Int64())\n}\n\nfunc main() { run(os.Stdin, os.Stdout) }\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "sample_input": "2\n1000000000 1000000000\n"}, "reference_outputs": ["1000000000000000000\n"], "source_document_id": "p02658", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven N integers A_1, ..., A_N, compute A_1 \\times ... \\times A_N.\n\nHowever, if the result exceeds 10^{18}, print -1 instead.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n0 \\leq A_i \\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\nA_1 ... A_N\n\nOutput\n\nPrint the value A_1 \\times ... \\times A_N as an integer, or -1 if the value exceeds 10^{18}.\n\nSample Input 1\n\n2\n1000000000 1000000000\n\nSample Output 1\n\n1000000000000000000\n\nWe have 1000000000 \\times 1000000000 = 1000000000000000000.\n\nSample Input 2\n\n3\n101 9901 999999000001\n\nSample Output 2\n\n-1\n\nWe have 101 \\times 9901 \\times 999999000001 = 1000000000000000001, which exceeds 10^{18}, so we should print -1 instead.\n\nSample Input 3\n\n31\n4 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 0\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 85, "memory_kb": 6152}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s063964022", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar A, B float64\n\tfmt.Scan(&A, &B)\n\ta := int(A)\n\tb := int(B * 100)\n\tfmt.Println(int(a * b / 100))\n}\n", "language": "Go", "metadata": {"date": 1601153633, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s063964022.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s063964022", "user_id": "u310790595"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar A, B float64\n\tfmt.Scan(&A, &B)\n\ta := int(A)\n\tb := int(B * 100)\n\tfmt.Println(int(a * b / 100))\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 7, "memory_kb": 1772}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s957752524", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar a int\n\tvar b float64\n\tfmt.Scanf(\"%d %f\", &a, &b)\n\n\tintB := int(math.Floor(b * 100))\n\tfmt.Printf(\"%d\\n\", (a*intB)/100)\n}\n\nfunc scanLongIntSlices(lines int, maxBufSize int) ([][]int, error) {\n\n\tres := [][]int{}\n\n\tsc := bufio.NewScanner(os.Stdin)\n\tbuf := make([]byte, bufio.MaxScanTokenSize)\n\tsc.Buffer(buf, maxBufSize)\n\n\tfor sc.Scan() {\n\t\tline := sc.Text()\n\t\tstrs := strings.Split(line, \" \")\n\t\tints := make([]int, len(strs))\n\t\tfor i, c := range strs {\n\t\t\tn, err := strconv.Atoi(c)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tints[i] = n\n\t\t}\n\t\tres = append(res, ints)\n\t}\n\n\tif err := sc.Err(); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn res, nil\n}\n", "language": "Go", "metadata": {"date": 1597539713, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s957752524.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s957752524", "user_id": "u131131890"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar a int\n\tvar b float64\n\tfmt.Scanf(\"%d %f\", &a, &b)\n\n\tintB := int(math.Floor(b * 100))\n\tfmt.Printf(\"%d\\n\", (a*intB)/100)\n}\n\nfunc scanLongIntSlices(lines int, maxBufSize int) ([][]int, error) {\n\n\tres := [][]int{}\n\n\tsc := bufio.NewScanner(os.Stdin)\n\tbuf := make([]byte, bufio.MaxScanTokenSize)\n\tsc.Buffer(buf, maxBufSize)\n\n\tfor sc.Scan() {\n\t\tline := sc.Text()\n\t\tstrs := strings.Split(line, \" \")\n\t\tints := make([]int, len(strs))\n\t\tfor i, c := range strs {\n\t\t\tn, err := strconv.Atoi(c)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tints[i] = n\n\t\t}\n\t\tres = append(res, ints)\n\t}\n\n\tif err := sc.Err(); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn res, nil\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 6, "memory_kb": 1836}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s777170374", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tlist := getStdinArr()\n\tN, _ := strconv.Atoi(list[0])\n\tM, _ := strconv.ParseFloat(list[1], 64)\n\tn := N\n\tm := int(math.Round(M * 100))\n\tfmt.Printf(\"%d\\n\", (n*m)/100)\n}\n\nvar sc = bufio.NewReaderSize(os.Stdin, 1024*1024*1)\n\nfunc getStdin() string {\n\treturn readLine()\n}\nfunc getStdinArr() []string {\n\tstr := getStdin()\n\tlist := strings.Split(str, \" \")\n\treturn list\n}\nfunc readLine() string {\n\tbuf := make([]byte, 0, 0)\n\tfor {\n\t\tl, p, _ := sc.ReadLine()\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n", "language": "Go", "metadata": {"date": 1593787634, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s777170374.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s777170374", "user_id": "u149861487"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tlist := getStdinArr()\n\tN, _ := strconv.Atoi(list[0])\n\tM, _ := strconv.ParseFloat(list[1], 64)\n\tn := N\n\tm := int(math.Round(M * 100))\n\tfmt.Printf(\"%d\\n\", (n*m)/100)\n}\n\nvar sc = bufio.NewReaderSize(os.Stdin, 1024*1024*1)\n\nfunc getStdin() string {\n\treturn readLine()\n}\nfunc getStdinArr() []string {\n\tstr := getStdin()\n\tlist := strings.Split(str, \" \")\n\treturn list\n}\nfunc readLine() string {\n\tbuf := make([]byte, 0, 0)\n\tfor {\n\t\tl, p, _ := sc.ReadLine()\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 616, "cpu_time_ms": 7, "memory_kb": 1784}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s792635715", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math/big\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\ta := readi64()\n\tb := readf()\n\t// https://twitter.com/kyopro_friends/status/1267095064804638720\n\t// 誤差が出たら嫌な問題はできるだけ整数の範囲で計算するのがよくて、\n\t// 今回はA×(B×100)/100みたいに計算すればいいんだけど、B×100を整数に変換するときの誤差にも気をつけないとダメだね。\n\t// 例えばB=2.51のとき、B×100=250.999999999999971…になるよー\n\tB := big.NewInt(int64(b*100 + 0.001))\n\n\tA := big.NewInt(a)\n\tA.Mul(A, B)\n\tA.Div(A, big.NewInt(100))\n\tfmt.Println(A)\n}\n\n/*-------------------utilities-------------------*/\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc chmin(x *int, y int) bool {\n\tif *x > y {\n\t\t*x = y\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc chmax(x *int, y int) bool {\n\tif *x < y {\n\t\t*x = y\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\treturn (a * b) / gcd(a, b)\n}\n\nfunc permutations(arr []int) [][]int {\n\tvar helper func([]int, int)\n\tres := [][]int{}\n\n\thelper = func(arr []int, n int) {\n\t\tif n == 1 {\n\t\t\ttmp := make([]int, len(arr))\n\t\t\tcopy(tmp, arr)\n\t\t\tres = append(res, tmp)\n\t\t} else {\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\thelper(arr, n-1)\n\t\t\t\tif n%2 == 1 {\n\t\t\t\t\ttmp := arr[i]\n\t\t\t\t\tarr[i] = arr[n-1]\n\t\t\t\t\tarr[n-1] = tmp\n\t\t\t\t} else {\n\t\t\t\t\ttmp := arr[0]\n\t\t\t\t\tarr[0] = arr[n-1]\n\t\t\t\t\tarr[n-1] = tmp\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\thelper(arr, len(arr))\n\treturn res\n}\n\nfunc isPrime(n int) bool {\n\tif n == 1 {\n\t\treturn false\n\t}\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc divisor(n int) (res []int) {\n\tfor i := 1; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tres = append(res, i)\n\t\t\tif i*i != n {\n\t\t\t\tres = append(res, n/i)\n\t\t\t}\n\t\t}\n\t}\n\tsort.Ints(res)\n\treturn\n}\n\n// func searchInts(a []int, k int) int {\n// \treturn binarySearch(len(a), func(i int) bool {\n// \t\treturn a[i] >= k\n// \t})\n// }\n\nfunc binarySearch(n int, f func(int) bool) int {\n\ti, j := 0, n\n\tfor i < j {\n\t\th := int(uint(i+j) >> 1)\n\t\tif !f(h) {\n\t\t\ti = h + 1\n\t\t} else {\n\t\t\tj = h\n\t\t}\n\t}\n\treturn i\n}\n\n/*-------------------init-------------------*/\n\nconst (\n\tINF = 1000000000000000000\n\tMOD = 1e9 + 7\n)\n\nvar (\n\treadString func() string\n)\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n}\n\n/*-------------------inputs-------------------*/\n\nfunc readi() int {\n\treturn int(readi64())\n}\n\nfunc readi64() int64 {\n\ti, err := strconv.ParseInt(readString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n", "language": "Go", "metadata": {"date": 1592883540, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s792635715.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s792635715", "user_id": "u183912232"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math/big\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\ta := readi64()\n\tb := readf()\n\t// https://twitter.com/kyopro_friends/status/1267095064804638720\n\t// 誤差が出たら嫌な問題はできるだけ整数の範囲で計算するのがよくて、\n\t// 今回はA×(B×100)/100みたいに計算すればいいんだけど、B×100を整数に変換するときの誤差にも気をつけないとダメだね。\n\t// 例えばB=2.51のとき、B×100=250.999999999999971…になるよー\n\tB := big.NewInt(int64(b*100 + 0.001))\n\n\tA := big.NewInt(a)\n\tA.Mul(A, B)\n\tA.Div(A, big.NewInt(100))\n\tfmt.Println(A)\n}\n\n/*-------------------utilities-------------------*/\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc chmin(x *int, y int) bool {\n\tif *x > y {\n\t\t*x = y\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc chmax(x *int, y int) bool {\n\tif *x < y {\n\t\t*x = y\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\treturn (a * b) / gcd(a, b)\n}\n\nfunc permutations(arr []int) [][]int {\n\tvar helper func([]int, int)\n\tres := [][]int{}\n\n\thelper = func(arr []int, n int) {\n\t\tif n == 1 {\n\t\t\ttmp := make([]int, len(arr))\n\t\t\tcopy(tmp, arr)\n\t\t\tres = append(res, tmp)\n\t\t} else {\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\thelper(arr, n-1)\n\t\t\t\tif n%2 == 1 {\n\t\t\t\t\ttmp := arr[i]\n\t\t\t\t\tarr[i] = arr[n-1]\n\t\t\t\t\tarr[n-1] = tmp\n\t\t\t\t} else {\n\t\t\t\t\ttmp := arr[0]\n\t\t\t\t\tarr[0] = arr[n-1]\n\t\t\t\t\tarr[n-1] = tmp\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\thelper(arr, len(arr))\n\treturn res\n}\n\nfunc isPrime(n int) bool {\n\tif n == 1 {\n\t\treturn false\n\t}\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc divisor(n int) (res []int) {\n\tfor i := 1; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tres = append(res, i)\n\t\t\tif i*i != n {\n\t\t\t\tres = append(res, n/i)\n\t\t\t}\n\t\t}\n\t}\n\tsort.Ints(res)\n\treturn\n}\n\n// func searchInts(a []int, k int) int {\n// \treturn binarySearch(len(a), func(i int) bool {\n// \t\treturn a[i] >= k\n// \t})\n// }\n\nfunc binarySearch(n int, f func(int) bool) int {\n\ti, j := 0, n\n\tfor i < j {\n\t\th := int(uint(i+j) >> 1)\n\t\tif !f(h) {\n\t\t\ti = h + 1\n\t\t} else {\n\t\t\tj = h\n\t\t}\n\t}\n\treturn i\n}\n\n/*-------------------init-------------------*/\n\nconst (\n\tINF = 1000000000000000000\n\tMOD = 1e9 + 7\n)\n\nvar (\n\treadString func() string\n)\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n}\n\n/*-------------------inputs-------------------*/\n\nfunc readi() int {\n\treturn int(readi64())\n}\n\nfunc readi64() int64 {\n\ti, err := strconv.ParseInt(readString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3090, "cpu_time_ms": 6, "memory_kb": 1916}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s208496501", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc main() {\n\tvar a,b float64\n\tfmt.Scan(&a,&b)\n\n\tfmt.Println(int(a*b))\n\n\n}\n", "language": "Go", "metadata": {"date": 1592358710, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s208496501.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s208496501", "user_id": "u369190981"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc main() {\n\tvar a,b float64\n\tfmt.Scan(&a,&b)\n\n\tfmt.Println(int(a*b))\n\n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 654, "cpu_time_ms": 6, "memory_kb": 1772}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s489337210", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\n)\n\n\nfunc main() {\n\tsolve(os.Stdin, os.Stdout)\n}\n\ntype ReaderEx struct {\n\tbaseScanner *bufio.Scanner\n\twords []string\n\tnextWordIdx func() int\n\tinitWordIdx func(int)\n}\n\nfunc NewScannerEx(stdin io.Reader) *ReaderEx {\n\tvar this ReaderEx\n\tvar idx int\n\tvar wordsCnt int\n\tthis.baseScanner = bufio.NewScanner(stdin)\n\tthis.baseScanner.Buffer(make([]byte, 0), 1E+11)\n\tthis.nextWordIdx = func() int {\n\t\tcur := idx\n\t\tidx = (idx + 1) % wordsCnt\n\t\treturn cur\n\t}\n\tthis.initWordIdx = func(wc int) {\n\t\tidx = 0\n\t\twordsCnt = wc\n\t}\n\treturn &this\n}\n\nfunc (me *ReaderEx) Scan(doSplit bool) (isScanned bool) {\n\tisScanned = me.baseScanner.Scan()\n\tif doSplit {\n\t\tme.words = strings.Fields(me.baseScanner.Text())\n\t} else {\n\t\tme.words = []string{me.baseScanner.Text()}\n\t}\n\tme.initWordIdx(len(me.words))\n\treturn\n}\n\nfunc (me *ReaderEx) nextBytes() []byte {\n\treturn []byte(me.words[me.nextWordIdx()])\n}\nfunc (me *ReaderEx) nextString() string {\n\treturn me.words[me.nextWordIdx()]\n}\n\ntype StringArray []string\n\nfunc (me *ReaderEx) nextStringArray() StringArray {\n\treturn me.words[me.nextWordIdx():]\n}\n\nfunc (me StringArray) toStrings() []string {\n\treturn me\n}\n\nfunc (me StringArray) toInts() []int {\n\tstrValues := me.toStrings()\n\tvalues := make([]int, len(strValues))\n\tfor i, v := range strValues {\n\t\tn, err := strconv.Atoi(v)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tvalues[i] = n\n\t}\n\treturn values\n}\nfunc (me *ReaderEx) nextInt() int {\n\tn, err := strconv.Atoi(me.words[me.nextWordIdx()])\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tpanic(fmt.Sprintf(\"getInt(%d)\", n))\n\t\t}\n\t}()\n\treturn n\n}\n\nfunc pow(x, y, mod int) (ans int) {\n\n\tans = 1\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(y)))); ; bit >>= 1 {\n\t\tif y&bit != 0 {\n\t\t\tans *= x\n\t\t\tif mod > 0 {\n\t\t\t\tans %= mod\n\t\t\t}\n\t\t}\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t\tans *= ans\n\t\tif mod > 0 {\n\t\t\tans %= mod\n\t\t}\n\t}\n}\n\ntype factType struct {\n\tprime int\n\tcount int\n}\n\nfunc fact(n int) (facts []*factType) {\n\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tfa := factType{prime: i}\n\t\t\tfor n%fa.prime == 0 {\n\t\t\t\tn /= fa.prime\n\t\t\t\tfa.count++\n\t\t\t}\n\t\t\tfacts = append(facts, &fa)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfacts = append(facts, &factType{prime: n, count: 1})\n\t}\n\treturn facts\n}\nfunc dec2bin(n int) (ret []bool) {\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(n)))); ; bit >>= 1 {\n\t\tret = append(ret, n&bit != 0)\n\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t}\n\n}\n\nfunc abs(v int) int {\n\tif v < 0 {\n\t\tv = -v\n\t}\n\treturn v\n}\n\nfunc b2i(b bool) (i int) {\n\tif b {\n\t\ti = 1\n\t} else {\n\t\ti = 0\n\t}\n\treturn\n}\n\nfunc solve(stdin io.Reader, stdout io.Writer) {\n\n\tr := NewScannerEx(stdin)\n\tr.Scan(true)\n\ta, bs := r.nextInt(), r.nextString()\n\tb, _ := strconv.ParseFloat(bs, 64)\n\n\tfmt.Fprintf(stdout, \"%.0f\\n\", math.Floor(float64(a)*math.Floor(b*100)/100))\n}\n", "language": "Go", "metadata": {"date": 1592242486, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s489337210.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s489337210", "user_id": "u463655976"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\n)\n\n\nfunc main() {\n\tsolve(os.Stdin, os.Stdout)\n}\n\ntype ReaderEx struct {\n\tbaseScanner *bufio.Scanner\n\twords []string\n\tnextWordIdx func() int\n\tinitWordIdx func(int)\n}\n\nfunc NewScannerEx(stdin io.Reader) *ReaderEx {\n\tvar this ReaderEx\n\tvar idx int\n\tvar wordsCnt int\n\tthis.baseScanner = bufio.NewScanner(stdin)\n\tthis.baseScanner.Buffer(make([]byte, 0), 1E+11)\n\tthis.nextWordIdx = func() int {\n\t\tcur := idx\n\t\tidx = (idx + 1) % wordsCnt\n\t\treturn cur\n\t}\n\tthis.initWordIdx = func(wc int) {\n\t\tidx = 0\n\t\twordsCnt = wc\n\t}\n\treturn &this\n}\n\nfunc (me *ReaderEx) Scan(doSplit bool) (isScanned bool) {\n\tisScanned = me.baseScanner.Scan()\n\tif doSplit {\n\t\tme.words = strings.Fields(me.baseScanner.Text())\n\t} else {\n\t\tme.words = []string{me.baseScanner.Text()}\n\t}\n\tme.initWordIdx(len(me.words))\n\treturn\n}\n\nfunc (me *ReaderEx) nextBytes() []byte {\n\treturn []byte(me.words[me.nextWordIdx()])\n}\nfunc (me *ReaderEx) nextString() string {\n\treturn me.words[me.nextWordIdx()]\n}\n\ntype StringArray []string\n\nfunc (me *ReaderEx) nextStringArray() StringArray {\n\treturn me.words[me.nextWordIdx():]\n}\n\nfunc (me StringArray) toStrings() []string {\n\treturn me\n}\n\nfunc (me StringArray) toInts() []int {\n\tstrValues := me.toStrings()\n\tvalues := make([]int, len(strValues))\n\tfor i, v := range strValues {\n\t\tn, err := strconv.Atoi(v)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tvalues[i] = n\n\t}\n\treturn values\n}\nfunc (me *ReaderEx) nextInt() int {\n\tn, err := strconv.Atoi(me.words[me.nextWordIdx()])\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tpanic(fmt.Sprintf(\"getInt(%d)\", n))\n\t\t}\n\t}()\n\treturn n\n}\n\nfunc pow(x, y, mod int) (ans int) {\n\n\tans = 1\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(y)))); ; bit >>= 1 {\n\t\tif y&bit != 0 {\n\t\t\tans *= x\n\t\t\tif mod > 0 {\n\t\t\t\tans %= mod\n\t\t\t}\n\t\t}\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t\tans *= ans\n\t\tif mod > 0 {\n\t\t\tans %= mod\n\t\t}\n\t}\n}\n\ntype factType struct {\n\tprime int\n\tcount int\n}\n\nfunc fact(n int) (facts []*factType) {\n\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tfa := factType{prime: i}\n\t\t\tfor n%fa.prime == 0 {\n\t\t\t\tn /= fa.prime\n\t\t\t\tfa.count++\n\t\t\t}\n\t\t\tfacts = append(facts, &fa)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfacts = append(facts, &factType{prime: n, count: 1})\n\t}\n\treturn facts\n}\nfunc dec2bin(n int) (ret []bool) {\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(n)))); ; bit >>= 1 {\n\t\tret = append(ret, n&bit != 0)\n\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t}\n\n}\n\nfunc abs(v int) int {\n\tif v < 0 {\n\t\tv = -v\n\t}\n\treturn v\n}\n\nfunc b2i(b bool) (i int) {\n\tif b {\n\t\ti = 1\n\t} else {\n\t\ti = 0\n\t}\n\treturn\n}\n\nfunc solve(stdin io.Reader, stdout io.Writer) {\n\n\tr := NewScannerEx(stdin)\n\tr.Scan(true)\n\ta, bs := r.nextInt(), r.nextString()\n\tb, _ := strconv.ParseFloat(bs, 64)\n\n\tfmt.Fprintf(stdout, \"%.0f\\n\", math.Floor(float64(a)*math.Floor(b*100)/100))\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2810, "cpu_time_ms": 5, "memory_kb": 1732}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s909959479", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n\nfunc scanInt64() int64 {\n\tsc.Scan()\n\ti, _ := strconv.ParseInt(sc.Text(), 10, 64)\n\treturn i\n}\n\nfunc scanFloat64() float64 {\n\tsc.Scan()\n\ti, _ := strconv.ParseFloat(sc.Text(), 64)\n\treturn i\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t}\n\treturn res\n}\n\nfunc scanInts64(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := range res {\n\t\tres[i] = scanInt64()\n\t}\n\treturn res\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\ta, b := scanInt64(), scanFloat64()\n\n\tfmt.Println((a * int64(math.Round(b*100))) / 100)\n}\n", "language": "Go", "metadata": {"date": 1591580365, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s909959479.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s909959479", "user_id": "u475329018"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n\nfunc scanInt64() int64 {\n\tsc.Scan()\n\ti, _ := strconv.ParseInt(sc.Text(), 10, 64)\n\treturn i\n}\n\nfunc scanFloat64() float64 {\n\tsc.Scan()\n\ti, _ := strconv.ParseFloat(sc.Text(), 64)\n\treturn i\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t}\n\treturn res\n}\n\nfunc scanInts64(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := range res {\n\t\tres[i] = scanInt64()\n\t}\n\treturn res\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\ta, b := scanInt64(), scanFloat64()\n\n\tfmt.Println((a * int64(math.Round(b*100))) / 100)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 741, "cpu_time_ms": 5, "memory_kb": 1724}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s680940274", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\t// a := big.NewInt(readInt64())\n\t// b := big.NewInt(int64(readFloat64() * 100))\n\n\t// ans := big.NewInt(1)\n\t// ans.Mul(a, b)\n\t// ans.Div(ans, big.NewInt(100))\n\t// fmt.Println(ans)\n\n\ta := readInt64()\n\tb := int64(readFloat64() * 100)\n\n\tfmt.Println((a * b) / 100)\n\n}\n\nvar (\n\tscanner *bufio.Scanner\n)\n\nfunc init() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n}\n\nfunc readInt64() int64 {\n\tvar t string\n\n\tif scanner.Scan() {\n\t\tt = scanner.Text()\n\t}\n\n\tn, err := strconv.ParseInt(t, 10, 64)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\treturn n\n\n}\n\nfunc readFloat64() float64 {\n\tvar t string\n\n\tif scanner.Scan() {\n\t\tt = scanner.Text()\n\t}\n\n\tn, err := strconv.ParseFloat(t, 64)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\treturn n\n}\n", "language": "Go", "metadata": {"date": 1591562446, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s680940274.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s680940274", "user_id": "u340848688"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\t// a := big.NewInt(readInt64())\n\t// b := big.NewInt(int64(readFloat64() * 100))\n\n\t// ans := big.NewInt(1)\n\t// ans.Mul(a, b)\n\t// ans.Div(ans, big.NewInt(100))\n\t// fmt.Println(ans)\n\n\ta := readInt64()\n\tb := int64(readFloat64() * 100)\n\n\tfmt.Println((a * b) / 100)\n\n}\n\nvar (\n\tscanner *bufio.Scanner\n)\n\nfunc init() {\n\tscanner = bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n}\n\nfunc readInt64() int64 {\n\tvar t string\n\n\tif scanner.Scan() {\n\t\tt = scanner.Text()\n\t}\n\n\tn, err := strconv.ParseInt(t, 10, 64)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\treturn n\n\n}\n\nfunc readFloat64() float64 {\n\tvar t string\n\n\tif scanner.Scan() {\n\t\tt = scanner.Text()\n\t}\n\n\tn, err := strconv.ParseFloat(t, 64)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\treturn n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 819, "cpu_time_ms": 2, "memory_kb": 1820}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s322402677", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a int\n\tvar b float64\n\tfmt.Scan(&a, &b)\n\n\tfmt.Println((a * int(b*100)) / 100)\n}", "language": "Go", "metadata": {"date": 1591484183, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s322402677.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s322402677", "user_id": "u760948618"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a int\n\tvar b float64\n\tfmt.Scan(&a, &b)\n\n\tfmt.Println((a * int(b*100)) / 100)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 1752}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s118269187", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a int\n\tvar b float64\n\tfmt.Scan(&a, &b)\n\tfmt.Println((a * int(100.0*b)) / 100)\n}\n", "language": "Go", "metadata": {"date": 1591420044, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s118269187.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s118269187", "user_id": "u275316733"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a int\n\tvar b float64\n\tfmt.Scan(&a, &b)\n\tfmt.Println((a * int(100.0*b)) / 100)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 1752}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s965498592", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a int\n\tvar b float64\n\n\tfmt.Scan(&a, &b)\n\n\tbsec := int(b * 100.0)\n\n\tansint := a * bsec\n\tans := ansint / 100\n\n\tfmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1591149645, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s965498592.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s965498592", "user_id": "u473974118"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a int\n\tvar b float64\n\n\tfmt.Scan(&a, &b)\n\n\tbsec := int(b * 100.0)\n\n\tansint := a * bsec\n\tans := ansint / 100\n\n\tfmt.Println(ans)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 1756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s343238822", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a int\n\tvar b float64\n\tfmt.Scan(&a, &b)\n\t// fmt.Println(b * 100)\n\tr := ((a * int(b*100)) / 100)\n\tfmt.Println(r)\n}\n", "language": "Go", "metadata": {"date": 1591063376, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s343238822.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s343238822", "user_id": "u435843540"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a int\n\tvar b float64\n\tfmt.Scan(&a, &b)\n\t// fmt.Println(b * 100)\n\tr := ((a * int(b*100)) / 100)\n\tfmt.Println(r)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 165, "cpu_time_ms": 10, "memory_kb": 1752}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s008275634", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a int\n\tvar b float64\n\tfmt.Scan(&a, &b)\n\t// fmt.Println(b * 100)\n\tr := int((float64(a) * (b * 100)) / 100)\n\tfmt.Println(r)\n}\n", "language": "Go", "metadata": {"date": 1591062821, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s008275634.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s008275634", "user_id": "u435843540"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a int\n\tvar b float64\n\tfmt.Scan(&a, &b)\n\t// fmt.Println(b * 100)\n\tr := int((float64(a) * (b * 100)) / 100)\n\tfmt.Println(r)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 1756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s471183528", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"math/big\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar buff []byte\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buff, bufio.MaxScanTokenSize*1024)\n\tlog.SetFlags(log.Lshortfile)\n}\n\nfunc main() {\n\tsolveBigFloat()\n\t// eps := 0.000000000001\n\t// A := nextInt()\n\t// B := nextFloat64()\n\t// log.Println(A, B)\n\t// ans := 0\n\t// for i := 0.0; i+eps < B; i += 0.01 {\n\t// \tans += A\n\t// }\n\t// fmt.Println(ans / 100)\n}\n\nfunc solveBigFloat() {\n\tA := nextString()\n\tB := nextString()\n\tvar a, b big.Float\n\ta.SetString(A)\n\tb.SetString(B)\n\tu, _ := a.Mul(&a, &b).Uint64()\n\tfmt.Println(u)\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextFloat64() float64 {\n\tsc.Scan()\n\tf, err := strconv.ParseFloat(sc.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn f\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc nextInts(n int) (r []int) {\n\tr = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt()\n\t}\n\treturn r\n}\n\nvar dy = []int{0, 1, 0, -1}\nvar dx = []int{1, 0, -1, 0}\nvar MAX = math.MaxInt32\n\nfunc pow(a, b int) int {\n\treturn int(math.Pow(float64(a), float64(b)))\n}\n\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\ntype Pair struct {\n\ta, b int\n}\n\ntype Pairs []Pair\n\nfunc (p Pairs) Len() int {\n\treturn len(p)\n}\nfunc (p Pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p Pairs) Less(i, j int) bool {\n\tif p[i].a == p[j].a {\n\t\treturn p[i].b < p[j].b\n\t}\n\treturn p[i].a < p[j].a\n}\n", "language": "Go", "metadata": {"date": 1591042021, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s471183528.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s471183528", "user_id": "u696272993"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"math/big\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar buff []byte\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buff, bufio.MaxScanTokenSize*1024)\n\tlog.SetFlags(log.Lshortfile)\n}\n\nfunc main() {\n\tsolveBigFloat()\n\t// eps := 0.000000000001\n\t// A := nextInt()\n\t// B := nextFloat64()\n\t// log.Println(A, B)\n\t// ans := 0\n\t// for i := 0.0; i+eps < B; i += 0.01 {\n\t// \tans += A\n\t// }\n\t// fmt.Println(ans / 100)\n}\n\nfunc solveBigFloat() {\n\tA := nextString()\n\tB := nextString()\n\tvar a, b big.Float\n\ta.SetString(A)\n\tb.SetString(B)\n\tu, _ := a.Mul(&a, &b).Uint64()\n\tfmt.Println(u)\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextFloat64() float64 {\n\tsc.Scan()\n\tf, err := strconv.ParseFloat(sc.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn f\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc nextInts(n int) (r []int) {\n\tr = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt()\n\t}\n\treturn r\n}\n\nvar dy = []int{0, 1, 0, -1}\nvar dx = []int{1, 0, -1, 0}\nvar MAX = math.MaxInt32\n\nfunc pow(a, b int) int {\n\treturn int(math.Pow(float64(a), float64(b)))\n}\n\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\ntype Pair struct {\n\ta, b int\n}\n\ntype Pairs []Pair\n\nfunc (p Pairs) Len() int {\n\treturn len(p)\n}\nfunc (p Pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p Pairs) Less(i, j int) bool {\n\tif p[i].a == p[j].a {\n\t\treturn p[i].b < p[j].b\n\t}\n\treturn p[i].a < p[j].a\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2006, "cpu_time_ms": 2, "memory_kb": 1904}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s338703611", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tfinv, inv, fac [MAX]int\n)\n\nfunc COM(n, k int) int {\n\tif n < k {\n\t\treturn 0\n\t}\n\tif n < 0 || k < 0 {\n\t\treturn 0\n\t}\n\treturn fac[n] * (finv[k] * finv[n-k] % MOD) % MOD\n}\n\nfunc init() {\n\tfac[0] = 1\n\tfac[1] = 1\n\tfinv[0] = 1\n\tfinv[1] = 1\n\tinv[1] = 1\n\tfor i := 2; i < MAX; i++ {\n\t\tfac[i] = fac[i-1] * i % MOD\n\t\tinv[i] = MOD - inv[MOD%i]*(MOD/i)%MOD\n\t\tfinv[i] = finv[i-1] * inv[i] % MOD\n\t}\n\t//sc.Split(bufio.ScanLines)\n\tsc.Split(bufio.ScanWords)\n\t//sc.Buffer([]byte{}, 100100)\n}\n\nconst (\n\tMOD = 1000000007\n\tMAX = 510000\n)\n\nfunc ModAdd(a, b int64) int64 {\n\treturn (a + b) % MOD\n}\n\nfunc ModMul(a, b int64) int64 {\n\treturn a * b % MOD\n}\n\nfunc ModSub(a, b int64) int64 {\n\tr := (a%MOD - b%MOD) % MOD\n\tif r < 0 {\n\t\tr += MOD\n\t}\n\treturn r\n}\n\nfunc ModDiv(a, b int64) int64 {\n\treturn a % MOD * ModInv(b) % MOD\n}\n\nfunc ModPow(a, n int64) int64 {\n\tvar r int64 = 1\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tr = r * a % MOD\n\t\t}\n\t\ta = a * a % MOD\n\t\tn >>= 1\n\t}\n\treturn r\n}\n\nfunc ModInv(a int64) int64 {\n\tvar b, u, v int64 = MOD, 1, 0\n\tfor b > 0 {\n\t\tt := a / b\n\t\ta -= t * b\n\t\ta, b = b, a\n\t\tu -= t * v\n\t\tu, v = v, u\n\t}\n\tu %= MOD\n\tif u < 0 {\n\t\tu += MOD\n\t}\n\treturn u\n}\n\ntype Q struct {\n\tvalue int\n\tindex int\n\tA, B int\n}\n\ntype QS []*Q\n\nfunc (p QS) Len() int { return len(p) }\nfunc (p QS) Less(i, j int) bool { return p[i].value > p[j].value }\nfunc (pq QS) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n\tpq[i].index = i\n\tpq[j].index = j\n}\n\nfunc (pq *QS) Push(x interface{}) {\n\tn := len(*pq)\n\titem := x.(*Q)\n\titem.index = n\n\t*pq = append(*pq, item)\n}\n\nfunc (pq *QS) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\told[n-1] = nil // avoid memory leak\n\titem.index = -1 // for safety\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\nfunc IsPrime(num int) bool {\n\tm := map[int]int{}\n\treturn factor(m, num, 2)\n}\n\nfunc factor(result map[int]int, num, pnum int) bool {\n\tif pnum*pnum > num {\n\t\tif num != 1 {\n\t\t\tif result[num] > 0 {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tresult[num] += 1\n\t\t}\n\t\treturn len(result) == 1\n\t}\n\n\tif num%pnum == 0 {\n\t\tnum /= pnum\n\t\tif result[pnum] > 0 {\n\t\t\treturn false\n\t\t}\n\t\tresult[pnum]++\n\t\tif len(result) > 1 {\n\t\t\treturn false\n\t\t}\n\t} else {\n\t\tpnum++\n\t}\n\treturn factor(result, num, pnum)\n}\n\nfunc GCD(a, b int64) int64 {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn GCD(b, a%b)\n}\n\nfunc LCM(a, b int64) int64 {\n\treturn a * b / GCD(a, b)\n}\n\ntype UnionFind struct {\n\tpar []int\n\tsize []int\n}\n\nfunc NewUnionFind(size int) *UnionFind {\n\treturn new(UnionFind).init(size)\n}\n\nfunc (uf *UnionFind) init(size int) *UnionFind {\n\tuf.par = make([]int, size)\n\tuf.size = make([]int, size)\n\n\tfor i := 0; i < size; i++ {\n\t\tuf.par[i] = i\n\t\tuf.size[i] = 1\n\t}\n\treturn uf\n}\n\nfunc (uf *UnionFind) Unite(p int, q int) {\n\trp := uf.Root(p)\n\trq := uf.Root(q)\n\tif rp == rq {\n\t\treturn\n\t}\n\tif uf.size[rp] < uf.size[rq] {\n\t\tuf.par[rp] = uf.par[rq]\n\t\tuf.size[rq] += uf.size[rp]\n\t} else {\n\t\tuf.par[rq] = uf.par[rp]\n\t\tuf.size[rp] += uf.size[rq]\n\t}\n}\n\nfunc (uf *UnionFind) Root(p int) int {\n\tfor uf.par[p] == p {\n\t\treturn p\n\t}\n\tuf.par[p] = uf.Root(uf.par[p])\n\treturn uf.par[p]\n}\n\nfunc (uf *UnionFind) Size(p int) int {\n\treturn uf.size[uf.Root(p)]\n}\n\nfunc (uf *UnionFind) Same(p int, q int) bool {\n\treturn uf.Root(p) == uf.Root(q)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tn, _ := strconv.Atoi(getStr())\n\treturn n\n}\n\nfunc getStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\ntype T struct {\n\tA interface{} `json:\"a\"`\n}\n\nfunc main() {\n\tA, S := getInt(), getStr()\n\tB, _ := strconv.ParseFloat(S, 64)\n\tif A%100 == 0 {\n\t\tA /= 100\n\t\tfmt.Println(uint64(A) * uint64(B*100))\n\t\treturn\n\t}\n\tfmt.Println(uint64(float64(A) * B))\n}\n\ntype IntHeap []int\n\nfunc (h IntHeap) Len() int { return len(h) }\nfunc (h IntHeap) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h IntHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\n\nfunc (h *IntHeap) Push(x interface{}) {\n\t// Push and Pop use pointer receivers because they modify the slice's length,\n\t// not just its contents.\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IntHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n", "language": "Go", "metadata": {"date": 1591039012, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s338703611.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s338703611", "user_id": "u534481484"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tfinv, inv, fac [MAX]int\n)\n\nfunc COM(n, k int) int {\n\tif n < k {\n\t\treturn 0\n\t}\n\tif n < 0 || k < 0 {\n\t\treturn 0\n\t}\n\treturn fac[n] * (finv[k] * finv[n-k] % MOD) % MOD\n}\n\nfunc init() {\n\tfac[0] = 1\n\tfac[1] = 1\n\tfinv[0] = 1\n\tfinv[1] = 1\n\tinv[1] = 1\n\tfor i := 2; i < MAX; i++ {\n\t\tfac[i] = fac[i-1] * i % MOD\n\t\tinv[i] = MOD - inv[MOD%i]*(MOD/i)%MOD\n\t\tfinv[i] = finv[i-1] * inv[i] % MOD\n\t}\n\t//sc.Split(bufio.ScanLines)\n\tsc.Split(bufio.ScanWords)\n\t//sc.Buffer([]byte{}, 100100)\n}\n\nconst (\n\tMOD = 1000000007\n\tMAX = 510000\n)\n\nfunc ModAdd(a, b int64) int64 {\n\treturn (a + b) % MOD\n}\n\nfunc ModMul(a, b int64) int64 {\n\treturn a * b % MOD\n}\n\nfunc ModSub(a, b int64) int64 {\n\tr := (a%MOD - b%MOD) % MOD\n\tif r < 0 {\n\t\tr += MOD\n\t}\n\treturn r\n}\n\nfunc ModDiv(a, b int64) int64 {\n\treturn a % MOD * ModInv(b) % MOD\n}\n\nfunc ModPow(a, n int64) int64 {\n\tvar r int64 = 1\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tr = r * a % MOD\n\t\t}\n\t\ta = a * a % MOD\n\t\tn >>= 1\n\t}\n\treturn r\n}\n\nfunc ModInv(a int64) int64 {\n\tvar b, u, v int64 = MOD, 1, 0\n\tfor b > 0 {\n\t\tt := a / b\n\t\ta -= t * b\n\t\ta, b = b, a\n\t\tu -= t * v\n\t\tu, v = v, u\n\t}\n\tu %= MOD\n\tif u < 0 {\n\t\tu += MOD\n\t}\n\treturn u\n}\n\ntype Q struct {\n\tvalue int\n\tindex int\n\tA, B int\n}\n\ntype QS []*Q\n\nfunc (p QS) Len() int { return len(p) }\nfunc (p QS) Less(i, j int) bool { return p[i].value > p[j].value }\nfunc (pq QS) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n\tpq[i].index = i\n\tpq[j].index = j\n}\n\nfunc (pq *QS) Push(x interface{}) {\n\tn := len(*pq)\n\titem := x.(*Q)\n\titem.index = n\n\t*pq = append(*pq, item)\n}\n\nfunc (pq *QS) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\told[n-1] = nil // avoid memory leak\n\titem.index = -1 // for safety\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\nfunc IsPrime(num int) bool {\n\tm := map[int]int{}\n\treturn factor(m, num, 2)\n}\n\nfunc factor(result map[int]int, num, pnum int) bool {\n\tif pnum*pnum > num {\n\t\tif num != 1 {\n\t\t\tif result[num] > 0 {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tresult[num] += 1\n\t\t}\n\t\treturn len(result) == 1\n\t}\n\n\tif num%pnum == 0 {\n\t\tnum /= pnum\n\t\tif result[pnum] > 0 {\n\t\t\treturn false\n\t\t}\n\t\tresult[pnum]++\n\t\tif len(result) > 1 {\n\t\t\treturn false\n\t\t}\n\t} else {\n\t\tpnum++\n\t}\n\treturn factor(result, num, pnum)\n}\n\nfunc GCD(a, b int64) int64 {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn GCD(b, a%b)\n}\n\nfunc LCM(a, b int64) int64 {\n\treturn a * b / GCD(a, b)\n}\n\ntype UnionFind struct {\n\tpar []int\n\tsize []int\n}\n\nfunc NewUnionFind(size int) *UnionFind {\n\treturn new(UnionFind).init(size)\n}\n\nfunc (uf *UnionFind) init(size int) *UnionFind {\n\tuf.par = make([]int, size)\n\tuf.size = make([]int, size)\n\n\tfor i := 0; i < size; i++ {\n\t\tuf.par[i] = i\n\t\tuf.size[i] = 1\n\t}\n\treturn uf\n}\n\nfunc (uf *UnionFind) Unite(p int, q int) {\n\trp := uf.Root(p)\n\trq := uf.Root(q)\n\tif rp == rq {\n\t\treturn\n\t}\n\tif uf.size[rp] < uf.size[rq] {\n\t\tuf.par[rp] = uf.par[rq]\n\t\tuf.size[rq] += uf.size[rp]\n\t} else {\n\t\tuf.par[rq] = uf.par[rp]\n\t\tuf.size[rp] += uf.size[rq]\n\t}\n}\n\nfunc (uf *UnionFind) Root(p int) int {\n\tfor uf.par[p] == p {\n\t\treturn p\n\t}\n\tuf.par[p] = uf.Root(uf.par[p])\n\treturn uf.par[p]\n}\n\nfunc (uf *UnionFind) Size(p int) int {\n\treturn uf.size[uf.Root(p)]\n}\n\nfunc (uf *UnionFind) Same(p int, q int) bool {\n\treturn uf.Root(p) == uf.Root(q)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tn, _ := strconv.Atoi(getStr())\n\treturn n\n}\n\nfunc getStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\ntype T struct {\n\tA interface{} `json:\"a\"`\n}\n\nfunc main() {\n\tA, S := getInt(), getStr()\n\tB, _ := strconv.ParseFloat(S, 64)\n\tif A%100 == 0 {\n\t\tA /= 100\n\t\tfmt.Println(uint64(A) * uint64(B*100))\n\t\treturn\n\t}\n\tfmt.Println(uint64(float64(A) * B))\n}\n\ntype IntHeap []int\n\nfunc (h IntHeap) Len() int { return len(h) }\nfunc (h IntHeap) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h IntHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\n\nfunc (h *IntHeap) Push(x interface{}) {\n\t// Push and Pop use pointer receivers because they modify the slice's length,\n\t// not just its contents.\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IntHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4121, "cpu_time_ms": 29, "memory_kb": 13716}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s884358545", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tfinv, inv, fac [MAX]int\n)\n\nfunc COM(n, k int) int {\n\tif n < k {\n\t\treturn 0\n\t}\n\tif n < 0 || k < 0 {\n\t\treturn 0\n\t}\n\treturn fac[n] * (finv[k] * finv[n-k] % MOD) % MOD\n}\n\nfunc init() {\n\tfac[0] = 1\n\tfac[1] = 1\n\tfinv[0] = 1\n\tfinv[1] = 1\n\tinv[1] = 1\n\tfor i := 2; i < MAX; i++ {\n\t\tfac[i] = fac[i-1] * i % MOD\n\t\tinv[i] = MOD - inv[MOD%i]*(MOD/i)%MOD\n\t\tfinv[i] = finv[i-1] * inv[i] % MOD\n\t}\n\t//sc.Split(bufio.ScanLines)\n\tsc.Split(bufio.ScanWords)\n\t//sc.Buffer([]byte{}, 100100)\n}\n\nconst (\n\tMOD = 1000000007\n\tMAX = 510000\n)\n\nfunc ModAdd(a, b int64) int64 {\n\treturn (a + b) % MOD\n}\n\nfunc ModMul(a, b int64) int64 {\n\treturn a * b % MOD\n}\n\nfunc ModSub(a, b int64) int64 {\n\tr := (a%MOD - b%MOD) % MOD\n\tif r < 0 {\n\t\tr += MOD\n\t}\n\treturn r\n}\n\nfunc ModDiv(a, b int64) int64 {\n\treturn a % MOD * ModInv(b) % MOD\n}\n\nfunc ModPow(a, n int64) int64 {\n\tvar r int64 = 1\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tr = r * a % MOD\n\t\t}\n\t\ta = a * a % MOD\n\t\tn >>= 1\n\t}\n\treturn r\n}\n\nfunc ModInv(a int64) int64 {\n\tvar b, u, v int64 = MOD, 1, 0\n\tfor b > 0 {\n\t\tt := a / b\n\t\ta -= t * b\n\t\ta, b = b, a\n\t\tu -= t * v\n\t\tu, v = v, u\n\t}\n\tu %= MOD\n\tif u < 0 {\n\t\tu += MOD\n\t}\n\treturn u\n}\n\ntype Q struct {\n\tvalue int\n\tindex int\n\tA, B int\n}\n\ntype QS []*Q\n\nfunc (p QS) Len() int { return len(p) }\nfunc (p QS) Less(i, j int) bool { return p[i].value > p[j].value }\nfunc (pq QS) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n\tpq[i].index = i\n\tpq[j].index = j\n}\n\nfunc (pq *QS) Push(x interface{}) {\n\tn := len(*pq)\n\titem := x.(*Q)\n\titem.index = n\n\t*pq = append(*pq, item)\n}\n\nfunc (pq *QS) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\told[n-1] = nil // avoid memory leak\n\titem.index = -1 // for safety\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\nfunc IsPrime(num int) bool {\n\tm := map[int]int{}\n\treturn factor(m, num, 2)\n}\n\nfunc factor(result map[int]int, num, pnum int) bool {\n\tif pnum*pnum > num {\n\t\tif num != 1 {\n\t\t\tif result[num] > 0 {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tresult[num] += 1\n\t\t}\n\t\treturn len(result) == 1\n\t}\n\n\tif num%pnum == 0 {\n\t\tnum /= pnum\n\t\tif result[pnum] > 0 {\n\t\t\treturn false\n\t\t}\n\t\tresult[pnum]++\n\t\tif len(result) > 1 {\n\t\t\treturn false\n\t\t}\n\t} else {\n\t\tpnum++\n\t}\n\treturn factor(result, num, pnum)\n}\n\nfunc GCD(a, b int64) int64 {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn GCD(b, a%b)\n}\n\nfunc LCM(a, b int64) int64 {\n\treturn a * b / GCD(a, b)\n}\n\ntype UnionFind struct {\n\tpar []int\n\tsize []int\n}\n\nfunc NewUnionFind(size int) *UnionFind {\n\treturn new(UnionFind).init(size)\n}\n\nfunc (uf *UnionFind) init(size int) *UnionFind {\n\tuf.par = make([]int, size)\n\tuf.size = make([]int, size)\n\n\tfor i := 0; i < size; i++ {\n\t\tuf.par[i] = i\n\t\tuf.size[i] = 1\n\t}\n\treturn uf\n}\n\nfunc (uf *UnionFind) Unite(p int, q int) {\n\trp := uf.Root(p)\n\trq := uf.Root(q)\n\tif rp == rq {\n\t\treturn\n\t}\n\tif uf.size[rp] < uf.size[rq] {\n\t\tuf.par[rp] = uf.par[rq]\n\t\tuf.size[rq] += uf.size[rp]\n\t} else {\n\t\tuf.par[rq] = uf.par[rp]\n\t\tuf.size[rp] += uf.size[rq]\n\t}\n}\n\nfunc (uf *UnionFind) Root(p int) int {\n\tfor uf.par[p] == p {\n\t\treturn p\n\t}\n\tuf.par[p] = uf.Root(uf.par[p])\n\treturn uf.par[p]\n}\n\nfunc (uf *UnionFind) Size(p int) int {\n\treturn uf.size[uf.Root(p)]\n}\n\nfunc (uf *UnionFind) Same(p int, q int) bool {\n\treturn uf.Root(p) == uf.Root(q)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tn, _ := strconv.Atoi(getStr())\n\treturn n\n}\n\nfunc getStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\ntype T struct {\n\tA interface{} `json:\"a\"`\n}\n\nfunc main() {\n\tA, S := getInt(), getStr()\n\tB, _ := strconv.ParseFloat(S, 64)\n\tfmt.Println(uint64(float64(A) * B))\n}\n\ntype IntHeap []int\n\nfunc (h IntHeap) Len() int { return len(h) }\nfunc (h IntHeap) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h IntHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\n\nfunc (h *IntHeap) Push(x interface{}) {\n\t// Push and Pop use pointer receivers because they modify the slice's length,\n\t// not just its contents.\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IntHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n", "language": "Go", "metadata": {"date": 1591038808, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s884358545.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s884358545", "user_id": "u534481484"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tfinv, inv, fac [MAX]int\n)\n\nfunc COM(n, k int) int {\n\tif n < k {\n\t\treturn 0\n\t}\n\tif n < 0 || k < 0 {\n\t\treturn 0\n\t}\n\treturn fac[n] * (finv[k] * finv[n-k] % MOD) % MOD\n}\n\nfunc init() {\n\tfac[0] = 1\n\tfac[1] = 1\n\tfinv[0] = 1\n\tfinv[1] = 1\n\tinv[1] = 1\n\tfor i := 2; i < MAX; i++ {\n\t\tfac[i] = fac[i-1] * i % MOD\n\t\tinv[i] = MOD - inv[MOD%i]*(MOD/i)%MOD\n\t\tfinv[i] = finv[i-1] * inv[i] % MOD\n\t}\n\t//sc.Split(bufio.ScanLines)\n\tsc.Split(bufio.ScanWords)\n\t//sc.Buffer([]byte{}, 100100)\n}\n\nconst (\n\tMOD = 1000000007\n\tMAX = 510000\n)\n\nfunc ModAdd(a, b int64) int64 {\n\treturn (a + b) % MOD\n}\n\nfunc ModMul(a, b int64) int64 {\n\treturn a * b % MOD\n}\n\nfunc ModSub(a, b int64) int64 {\n\tr := (a%MOD - b%MOD) % MOD\n\tif r < 0 {\n\t\tr += MOD\n\t}\n\treturn r\n}\n\nfunc ModDiv(a, b int64) int64 {\n\treturn a % MOD * ModInv(b) % MOD\n}\n\nfunc ModPow(a, n int64) int64 {\n\tvar r int64 = 1\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tr = r * a % MOD\n\t\t}\n\t\ta = a * a % MOD\n\t\tn >>= 1\n\t}\n\treturn r\n}\n\nfunc ModInv(a int64) int64 {\n\tvar b, u, v int64 = MOD, 1, 0\n\tfor b > 0 {\n\t\tt := a / b\n\t\ta -= t * b\n\t\ta, b = b, a\n\t\tu -= t * v\n\t\tu, v = v, u\n\t}\n\tu %= MOD\n\tif u < 0 {\n\t\tu += MOD\n\t}\n\treturn u\n}\n\ntype Q struct {\n\tvalue int\n\tindex int\n\tA, B int\n}\n\ntype QS []*Q\n\nfunc (p QS) Len() int { return len(p) }\nfunc (p QS) Less(i, j int) bool { return p[i].value > p[j].value }\nfunc (pq QS) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n\tpq[i].index = i\n\tpq[j].index = j\n}\n\nfunc (pq *QS) Push(x interface{}) {\n\tn := len(*pq)\n\titem := x.(*Q)\n\titem.index = n\n\t*pq = append(*pq, item)\n}\n\nfunc (pq *QS) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\told[n-1] = nil // avoid memory leak\n\titem.index = -1 // for safety\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\nfunc IsPrime(num int) bool {\n\tm := map[int]int{}\n\treturn factor(m, num, 2)\n}\n\nfunc factor(result map[int]int, num, pnum int) bool {\n\tif pnum*pnum > num {\n\t\tif num != 1 {\n\t\t\tif result[num] > 0 {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tresult[num] += 1\n\t\t}\n\t\treturn len(result) == 1\n\t}\n\n\tif num%pnum == 0 {\n\t\tnum /= pnum\n\t\tif result[pnum] > 0 {\n\t\t\treturn false\n\t\t}\n\t\tresult[pnum]++\n\t\tif len(result) > 1 {\n\t\t\treturn false\n\t\t}\n\t} else {\n\t\tpnum++\n\t}\n\treturn factor(result, num, pnum)\n}\n\nfunc GCD(a, b int64) int64 {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn GCD(b, a%b)\n}\n\nfunc LCM(a, b int64) int64 {\n\treturn a * b / GCD(a, b)\n}\n\ntype UnionFind struct {\n\tpar []int\n\tsize []int\n}\n\nfunc NewUnionFind(size int) *UnionFind {\n\treturn new(UnionFind).init(size)\n}\n\nfunc (uf *UnionFind) init(size int) *UnionFind {\n\tuf.par = make([]int, size)\n\tuf.size = make([]int, size)\n\n\tfor i := 0; i < size; i++ {\n\t\tuf.par[i] = i\n\t\tuf.size[i] = 1\n\t}\n\treturn uf\n}\n\nfunc (uf *UnionFind) Unite(p int, q int) {\n\trp := uf.Root(p)\n\trq := uf.Root(q)\n\tif rp == rq {\n\t\treturn\n\t}\n\tif uf.size[rp] < uf.size[rq] {\n\t\tuf.par[rp] = uf.par[rq]\n\t\tuf.size[rq] += uf.size[rp]\n\t} else {\n\t\tuf.par[rq] = uf.par[rp]\n\t\tuf.size[rp] += uf.size[rq]\n\t}\n}\n\nfunc (uf *UnionFind) Root(p int) int {\n\tfor uf.par[p] == p {\n\t\treturn p\n\t}\n\tuf.par[p] = uf.Root(uf.par[p])\n\treturn uf.par[p]\n}\n\nfunc (uf *UnionFind) Size(p int) int {\n\treturn uf.size[uf.Root(p)]\n}\n\nfunc (uf *UnionFind) Same(p int, q int) bool {\n\treturn uf.Root(p) == uf.Root(q)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tn, _ := strconv.Atoi(getStr())\n\treturn n\n}\n\nfunc getStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\ntype T struct {\n\tA interface{} `json:\"a\"`\n}\n\nfunc main() {\n\tA, S := getInt(), getStr()\n\tB, _ := strconv.ParseFloat(S, 64)\n\tfmt.Println(uint64(float64(A) * B))\n}\n\ntype IntHeap []int\n\nfunc (h IntHeap) Len() int { return len(h) }\nfunc (h IntHeap) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h IntHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\n\nfunc (h *IntHeap) Push(x interface{}) {\n\t// Push and Pop use pointer receivers because they modify the slice's length,\n\t// not just its contents.\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IntHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4040, "cpu_time_ms": 33, "memory_kb": 13716}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s262681101", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\ta := readInt()\n\tb := int(math.Round(readFloat64() * 100))\n\tfmt.Println(a * b / 100)\n}\n\nvar (\n\treadString func() string\n\treadBytes func() []byte\n)\n\nfunc init() {\n\tlog.SetFlags(log.Lshortfile)\n\treadString, readBytes = newReadString(os.Stdin)\n}\n\nfunc newReadString(ior io.Reader) (func() string, func() []byte) {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\tf1 := func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n\tf2 := func() []byte {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Bytes()\n\t}\n\treturn f1, f2\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc sum(a []int) int {\n\tvar ret int\n\tfor i := range a {\n\t\tret += a[i]\n\t}\n\treturn ret\n}\n\nfunc sumFloat64(a []float64) float64 {\n\tvar ret float64\n\tfor i := range a {\n\t\tret += a[i]\n\t}\n\treturn ret\n}\n\nfunc gcd(m, n int) int {\n\tfor m%n != 0 {\n\t\tm, n = n, m%n\n\t}\n\treturn n\n}\n\nfunc lcm(m, n int) int {\n\treturn m / gcd(m, n) * n\n}\n", "language": "Go", "metadata": {"date": 1591028468, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s262681101.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s262681101", "user_id": "u295946532"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\ta := readInt()\n\tb := int(math.Round(readFloat64() * 100))\n\tfmt.Println(a * b / 100)\n}\n\nvar (\n\treadString func() string\n\treadBytes func() []byte\n)\n\nfunc init() {\n\tlog.SetFlags(log.Lshortfile)\n\treadString, readBytes = newReadString(os.Stdin)\n}\n\nfunc newReadString(ior io.Reader) (func() string, func() []byte) {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\tf1 := func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n\tf2 := func() []byte {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Bytes()\n\t}\n\treturn f1, f2\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc sum(a []int) int {\n\tvar ret int\n\tfor i := range a {\n\t\tret += a[i]\n\t}\n\treturn ret\n}\n\nfunc sumFloat64(a []float64) float64 {\n\tvar ret float64\n\tfor i := range a {\n\t\tret += a[i]\n\t}\n\treturn ret\n}\n\nfunc gcd(m, n int) int {\n\tfor m%n != 0 {\n\t\tm, n = n, m%n\n\t}\n\treturn n\n}\n\nfunc lcm(m, n int) int {\n\treturn m / gcd(m, n) * n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1522, "cpu_time_ms": 2, "memory_kb": 1724}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s623975186", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\ta := readInt()\n\tb := int(readFloat64() * 100)\n\tfmt.Println(a * b / 100)\n}\n\nvar (\n\treadString func() string\n\treadBytes func() []byte\n)\n\nfunc init() {\n\tlog.SetFlags(log.Lshortfile)\n\treadString, readBytes = newReadString(os.Stdin)\n}\n\nfunc newReadString(ior io.Reader) (func() string, func() []byte) {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\tf1 := func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n\tf2 := func() []byte {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Bytes()\n\t}\n\treturn f1, f2\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc sum(a []int) int {\n\tvar ret int\n\tfor i := range a {\n\t\tret += a[i]\n\t}\n\treturn ret\n}\n\nfunc sumFloat64(a []float64) float64 {\n\tvar ret float64\n\tfor i := range a {\n\t\tret += a[i]\n\t}\n\treturn ret\n}\n\nfunc gcd(m, n int) int {\n\tfor m%n != 0 {\n\t\tm, n = n, m%n\n\t}\n\treturn n\n}\n\nfunc lcm(m, n int) int {\n\treturn m / gcd(m, n) * n\n}\n", "language": "Go", "metadata": {"date": 1591016140, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s623975186.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s623975186", "user_id": "u295946532"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\ta := readInt()\n\tb := int(readFloat64() * 100)\n\tfmt.Println(a * b / 100)\n}\n\nvar (\n\treadString func() string\n\treadBytes func() []byte\n)\n\nfunc init() {\n\tlog.SetFlags(log.Lshortfile)\n\treadString, readBytes = newReadString(os.Stdin)\n}\n\nfunc newReadString(ior io.Reader) (func() string, func() []byte) {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\tf1 := func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n\tf2 := func() []byte {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Bytes()\n\t}\n\treturn f1, f2\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc sum(a []int) int {\n\tvar ret int\n\tfor i := range a {\n\t\tret += a[i]\n\t}\n\treturn ret\n}\n\nfunc sumFloat64(a []float64) float64 {\n\tvar ret float64\n\tfor i := range a {\n\t\tret += a[i]\n\t}\n\treturn ret\n}\n\nfunc gcd(m, n int) int {\n\tfor m%n != 0 {\n\t\tm, n = n, m%n\n\t}\n\treturn n\n}\n\nfunc lcm(m, n int) int {\n\treturn m / gcd(m, n) * n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1502, "cpu_time_ms": 2, "memory_kb": 1724}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s083073749", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tfmt.Println(int(readFloat64() * readFloat64()))\n}\n\nvar (\n\treadString func() string\n\treadBytes func() []byte\n)\n\nfunc init() {\n\tlog.SetFlags(log.Lshortfile)\n\treadString, readBytes = newReadString(os.Stdin)\n}\n\nfunc newReadString(ior io.Reader) (func() string, func() []byte) {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\tf1 := func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n\tf2 := func() []byte {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Bytes()\n\t}\n\treturn f1, f2\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc sum(a []int) int {\n\tvar ret int\n\tfor i := range a {\n\t\tret += a[i]\n\t}\n\treturn ret\n}\n\nfunc sumFloat64(a []float64) float64 {\n\tvar ret float64\n\tfor i := range a {\n\t\tret += a[i]\n\t}\n\treturn ret\n}\n\nfunc gcd(m, n int) int {\n\tfor m%n != 0 {\n\t\tm, n = n, m%n\n\t}\n\treturn n\n}\n\nfunc lcm(m, n int) int {\n\treturn m / gcd(m, n) * n\n}\n", "language": "Go", "metadata": {"date": 1591011658, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s083073749.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s083073749", "user_id": "u295946532"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tfmt.Println(int(readFloat64() * readFloat64()))\n}\n\nvar (\n\treadString func() string\n\treadBytes func() []byte\n)\n\nfunc init() {\n\tlog.SetFlags(log.Lshortfile)\n\treadString, readBytes = newReadString(os.Stdin)\n}\n\nfunc newReadString(ior io.Reader) (func() string, func() []byte) {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\tf1 := func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n\tf2 := func() []byte {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Bytes()\n\t}\n\treturn f1, f2\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc sum(a []int) int {\n\tvar ret int\n\tfor i := range a {\n\t\tret += a[i]\n\t}\n\treturn ret\n}\n\nfunc sumFloat64(a []float64) float64 {\n\tvar ret float64\n\tfor i := range a {\n\t\tret += a[i]\n\t}\n\treturn ret\n}\n\nfunc gcd(m, n int) int {\n\tfor m%n != 0 {\n\t\tm, n = n, m%n\n\t}\n\treturn n\n}\n\nfunc lcm(m, n int) int {\n\treturn m / gcd(m, n) * n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1478, "cpu_time_ms": 5, "memory_kb": 1760}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s102482081", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e6 + 7\n)\n\nvar buf []byte = make([]byte, maxBufSize)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBufSize)\n}\n\n// こちらを参考にした\n// https://drken1215.hatenablog.com/\n\nfunc main() {\n\tvar A int\n\tvar B float64\n\tfmt.Scan(&A, &B)\n\tB100 := int(B*100 + 0.001)\n\tans := (A * B100) / 100\n\tfmt.Println(ans)\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc abs(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc pow(p, q int) int {\n\tres := p\n\tif q == 0 {\n\t\treturn 1\n\t}\n\tfor i := 0; i < q-1; i++ {\n\t\tres *= p\n\t}\n\treturn res\n}\n\nfunc MinOf(vars ...int) int {\n\tmin := vars[0]\n\tfor _, i := range vars {\n\t\tif min > i {\n\t\t\tmin = i\n\t\t}\n\t}\n\treturn min\n}\n\nfunc MaxOf(vars ...int) int {\n\tmax := vars[0]\n\tfor _, i := range vars {\n\t\tif max < i {\n\t\t\tmax = i\n\t\t}\n\t}\n\treturn max\n}\n\nfunc gcdof2numbers(a int, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcdof2numbers(b, a%b)\n}\n\nfunc lcmof2numbers(a int, b int) int {\n\treturn a / gcdof2numbers(a, b) * b\n}\n\n// マイナスの場合は考慮していない\nfunc fuctorial(a int) int {\n\tif a == 1 || a == 0 {\n\t\treturn 1\n\t} else {\n\t\treturn fuctorial(a-1) * a\n\t}\n}\n\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\n\n// 素因数分解したmapを返す\nfunc primeFuctorize(n int) map[int]int {\n\tpf := map[int]int{}\n\tfor i := 2; i*i <= n; i++ {\n\t\tfor n%i == 0 {\n\t\t\tpf[i]++\n\t\t\tn /= i\n\t\t}\n\t}\n\tif n != 1 {\n\t\tpf[n]++\n\t}\n\treturn pf\n}\n", "language": "Go", "metadata": {"date": 1590997630, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s102482081.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s102482081", "user_id": "u605443479"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e6 + 7\n)\n\nvar buf []byte = make([]byte, maxBufSize)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBufSize)\n}\n\n// こちらを参考にした\n// https://drken1215.hatenablog.com/\n\nfunc main() {\n\tvar A int\n\tvar B float64\n\tfmt.Scan(&A, &B)\n\tB100 := int(B*100 + 0.001)\n\tans := (A * B100) / 100\n\tfmt.Println(ans)\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc abs(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc pow(p, q int) int {\n\tres := p\n\tif q == 0 {\n\t\treturn 1\n\t}\n\tfor i := 0; i < q-1; i++ {\n\t\tres *= p\n\t}\n\treturn res\n}\n\nfunc MinOf(vars ...int) int {\n\tmin := vars[0]\n\tfor _, i := range vars {\n\t\tif min > i {\n\t\t\tmin = i\n\t\t}\n\t}\n\treturn min\n}\n\nfunc MaxOf(vars ...int) int {\n\tmax := vars[0]\n\tfor _, i := range vars {\n\t\tif max < i {\n\t\t\tmax = i\n\t\t}\n\t}\n\treturn max\n}\n\nfunc gcdof2numbers(a int, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcdof2numbers(b, a%b)\n}\n\nfunc lcmof2numbers(a int, b int) int {\n\treturn a / gcdof2numbers(a, b) * b\n}\n\n// マイナスの場合は考慮していない\nfunc fuctorial(a int) int {\n\tif a == 1 || a == 0 {\n\t\treturn 1\n\t} else {\n\t\treturn fuctorial(a-1) * a\n\t}\n}\n\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\n\n// 素因数分解したmapを返す\nfunc primeFuctorize(n int) map[int]int {\n\tpf := map[int]int{}\n\tfor i := 2; i*i <= n; i++ {\n\t\tfor n%i == 0 {\n\t\t\tpf[i]++\n\t\t\tn /= i\n\t\t}\n\t}\n\tif n != 1 {\n\t\tpf[n]++\n\t}\n\treturn pf\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1919, "cpu_time_ms": 2, "memory_kb": 1856}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s106547430", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc readInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc readString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readInt64() int64 {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn int64(i)\n}\n\nfunc readfloat64() float64 {\n\tsc.Scan()\n\ti, err := strconv.ParseFloat(sc.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn float64(i)\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn a * -1\n\t}\n\treturn a\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc gcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t}\n\treturn gcd(y, x%y)\n}\n\nconst Mod = 1000000007\n\nfunc ModComb(n, k int) int {\n\tif k == 0 {\n\t\treturn 1\n\t}\n\tx, y := n, k\n\tfor i := 1; i < k; i++ {\n\t\tx = x * (n - i) % Mod\n\t\ty = y * (k - i) % Mod\n\t}\n\tinv := ModInv(y)\n\treturn x * inv % Mod\n}\n\nfunc ModFact(x int) int {\n\tfact := 1\n\tfor i := 1; i <= x; i++ {\n\t\tfact = fact * i % Mod\n\t}\n\treturn fact\n}\n\nfunc ModInv(x int) int {\n\treturn ModPow(x, Mod-2)\n}\n\nfunc ModPow(a, n int) int {\n\tres := 1\n\tfor n > 0 {\n\t\tif n%2 != 0 {\n\t\t\tres = res * a % Mod\n\t\t}\n\t\ta = a * a % Mod\n\t\tn /= 2\n\t}\n\treturn res\n}\n\nfunc pow(a, n int) int {\n\tif n == 0 {\n\t\treturn 1\n\t}\n\n\tans := 0\n\tif n%2 == 0 {\n\t\tans = pow(a*a, n/2)\n\t} else {\n\t\tans = a * pow(a*a, (n-1)/2)\n\t}\n\treturn ans\n}\n\nfunc intSliceReverse(slice []int) []int {\n\tfor i, j := 0, len(slice)-1; i < j; i, j = i+1, j-1 {\n\t\tslice[i], slice[j] = slice[j], slice[i]\n\t}\n\treturn slice\n}\n\nfunc stringReverse(str string) string {\n\trunes := []rune(str)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\ta, b := readInt(), readfloat64()\n\n\tans := (uint64(a) * uint64(b*100)) / 100\n\tfmt.Printf(\"%d\\n\", ans)\n}\n", "language": "Go", "metadata": {"date": 1590994185, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s106547430.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s106547430", "user_id": "u309370374"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc readInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc readString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readInt64() int64 {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn int64(i)\n}\n\nfunc readfloat64() float64 {\n\tsc.Scan()\n\ti, err := strconv.ParseFloat(sc.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn float64(i)\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn a * -1\n\t}\n\treturn a\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc gcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t}\n\treturn gcd(y, x%y)\n}\n\nconst Mod = 1000000007\n\nfunc ModComb(n, k int) int {\n\tif k == 0 {\n\t\treturn 1\n\t}\n\tx, y := n, k\n\tfor i := 1; i < k; i++ {\n\t\tx = x * (n - i) % Mod\n\t\ty = y * (k - i) % Mod\n\t}\n\tinv := ModInv(y)\n\treturn x * inv % Mod\n}\n\nfunc ModFact(x int) int {\n\tfact := 1\n\tfor i := 1; i <= x; i++ {\n\t\tfact = fact * i % Mod\n\t}\n\treturn fact\n}\n\nfunc ModInv(x int) int {\n\treturn ModPow(x, Mod-2)\n}\n\nfunc ModPow(a, n int) int {\n\tres := 1\n\tfor n > 0 {\n\t\tif n%2 != 0 {\n\t\t\tres = res * a % Mod\n\t\t}\n\t\ta = a * a % Mod\n\t\tn /= 2\n\t}\n\treturn res\n}\n\nfunc pow(a, n int) int {\n\tif n == 0 {\n\t\treturn 1\n\t}\n\n\tans := 0\n\tif n%2 == 0 {\n\t\tans = pow(a*a, n/2)\n\t} else {\n\t\tans = a * pow(a*a, (n-1)/2)\n\t}\n\treturn ans\n}\n\nfunc intSliceReverse(slice []int) []int {\n\tfor i, j := 0, len(slice)-1; i < j; i, j = i+1, j-1 {\n\t\tslice[i], slice[j] = slice[j], slice[i]\n\t}\n\treturn slice\n}\n\nfunc stringReverse(str string) string {\n\trunes := []rune(str)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\ta, b := readInt(), readfloat64()\n\n\tans := (uint64(a) * uint64(b*100)) / 100\n\tfmt.Printf(\"%d\\n\", ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1964, "cpu_time_ms": 4, "memory_kb": 1732}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s101447764", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar (\n\t\ta uint64\n\t\tb float32\n\t)\n\n\tfmt.Scanln(&a, &b)\n\n\tif a == 0 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tfmt.Println((a * uint64(b*100+0.5)) / 100)\n}", "language": "Go", "metadata": {"date": 1590987769, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s101447764.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s101447764", "user_id": "u705866283"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar (\n\t\ta uint64\n\t\tb float32\n\t)\n\n\tfmt.Scanln(&a, &b)\n\n\tif a == 0 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tfmt.Println((a * uint64(b*100+0.5)) / 100)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 185, "cpu_time_ms": 2, "memory_kb": 1756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s559877895", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar (\n\t\ta uint64\n\t\tb float32\n\t)\n\n\tfmt.Scanln(&a, &b)\n\n\tb2 := uint64(b * 100)\n\n\tfmt.Println((a * b2) / 100)\n}", "language": "Go", "metadata": {"date": 1590987320, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s559877895.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s559877895", "user_id": "u705866283"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar (\n\t\ta uint64\n\t\tb float32\n\t)\n\n\tfmt.Scanln(&a, &b)\n\n\tb2 := uint64(b * 100)\n\n\tfmt.Println((a * b2) / 100)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 1756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s000789718", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar a int\n\tvar b string\n\n\tfmt.Scan(&a, &b)\n\tbInt, _ := strconv.Atoi(strings.Replace(b, \".\", \"\", -1))\n\tfmt.Println(a * bInt / 100)\n}", "language": "Go", "metadata": {"date": 1590986021, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s000789718.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s000789718", "user_id": "u910626128"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar a int\n\tvar b string\n\n\tfmt.Scan(&a, &b)\n\tbInt, _ := strconv.Atoi(strings.Replace(b, \".\", \"\", -1))\n\tfmt.Println(a * bInt / 100)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 6, "memory_kb": 1820}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s064945167", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar a int\n\tvar b string\n\tfmt.Scan(&a, &b)\n\tbInt, _ := strconv.Atoi(strings.Replace(b, \".\", \"\", -1))\n\tfmt.Println(a * bInt / 100)\n}\n\n", "language": "Go", "metadata": {"date": 1590983425, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s064945167.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s064945167", "user_id": "u717943620"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar a int\n\tvar b string\n\tfmt.Scan(&a, &b)\n\tbInt, _ := strconv.Atoi(strings.Replace(b, \".\", \"\", -1))\n\tfmt.Println(a * bInt / 100)\n}\n\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 203, "cpu_time_ms": 2, "memory_kb": 1820}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s310789385", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b float64\n\tfmt.Scan(&a, &b)\n\tb = b*100\n\n\tfmt.Println(int(a*b/100))\n\n}\n\n", "language": "Go", "metadata": {"date": 1590983403, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s310789385.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s310789385", "user_id": "u769765274"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b float64\n\tfmt.Scan(&a, &b)\n\tb = b*100\n\n\tfmt.Println(int(a*b/100))\n\n}\n\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1752}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s908144076", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport (\n \"fmt\"\n \"strconv\"\n)\n\nfunc solution(a int, b string) int {\n x := make([]byte, 0, len(b))\n for i := range b {\n if b[i] != '.' {\n x = append(x, b[i])\n }\n }\n bn, _ := strconv.Atoi(string(x))\n\n return a * bn / 100\n}\n\nfunc main() {\n var a int\n var b string\n fmt.Scan(&a, &b)\n fmt.Println(solution(a, b))\n}", "language": "Go", "metadata": {"date": 1590981830, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s908144076.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s908144076", "user_id": "u568763892"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"strconv\"\n)\n\nfunc solution(a int, b string) int {\n x := make([]byte, 0, len(b))\n for i := range b {\n if b[i] != '.' {\n x = append(x, b[i])\n }\n }\n bn, _ := strconv.Atoi(string(x))\n\n return a * bn / 100\n}\n\nfunc main() {\n var a int\n var b string\n fmt.Scan(&a, &b)\n fmt.Println(solution(a, b))\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 8, "memory_kb": 1756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s300989699", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar a, b float64\n\tfmt.Scan(&a, &b)\n\n\tfmt.Println(math.Round(a * b))\n}\n", "language": "Go", "metadata": {"date": 1590981023, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s300989699.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s300989699", "user_id": "u367908963"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar a, b float64\n\tfmt.Scan(&a, &b)\n\n\tfmt.Println(math.Round(a * b))\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 126, "cpu_time_ms": 9, "memory_kb": 1756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s069504759", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Scan()\n\tss := strings.Fields(sc.Text())\n\n\tA, _ := strconv.ParseUint(ss[0], 10, 64)\n\tB, _ := strconv.ParseFloat(ss[1], 64)\n\tBB := uint64(B * 100)\n\n\tresult := A * BB / 100\n\n\tfmt.Print(result)\n}\n", "language": "Go", "metadata": {"date": 1590979584, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s069504759.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s069504759", "user_id": "u679544838"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Scan()\n\tss := strings.Fields(sc.Text())\n\n\tA, _ := strconv.ParseUint(ss[0], 10, 64)\n\tB, _ := strconv.ParseFloat(ss[1], 64)\n\tBB := uint64(B * 100)\n\n\tresult := A * BB / 100\n\n\tfmt.Print(result)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 317, "cpu_time_ms": 4, "memory_kb": 1728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s246954902", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\n//Util\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc maxInt(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc minInt(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absInt(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc absFloat64(a float64) float64 {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc minFloat64(a, b float64) float64 {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc str2Int(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\n\n//Main\nvar sc = bufio.NewScanner(os.Stdin)\n\nconst MAX = 1000000000000000000\n\nvar A, B string\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tA, B = nextStr(), nextStr()\n\n\tif A == \"0\" || B == \"0.00\" {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tvar ans, b, c int64\n\ta, _ := strconv.ParseInt(A, 10, 64)\n\tans = 0\n\tb = 100\n\tfor i := 3; i >= 0; i-- {\n\t\tif i == 1 {\n\t\t\tcontinue\n\t\t}\n\t\tc, _ = strconv.ParseInt(string(B[i]), 10, 64)\n\t\tif c != 0 {\n\t\t\tans += int64(a/b) * c\n\t\t}\n\t\tb /= 10\n\t}\n\n\tfmt.Println(ans)\n\n}\n", "language": "Go", "metadata": {"date": 1590976745, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s246954902.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s246954902", "user_id": "u432333240"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\n//Util\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc maxInt(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc minInt(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absInt(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc absFloat64(a float64) float64 {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc minFloat64(a, b float64) float64 {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc str2Int(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\n\n//Main\nvar sc = bufio.NewScanner(os.Stdin)\n\nconst MAX = 1000000000000000000\n\nvar A, B string\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tA, B = nextStr(), nextStr()\n\n\tif A == \"0\" || B == \"0.00\" {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tvar ans, b, c int64\n\ta, _ := strconv.ParseInt(A, 10, 64)\n\tans = 0\n\tb = 100\n\tfor i := 3; i >= 0; i-- {\n\t\tif i == 1 {\n\t\t\tcontinue\n\t\t}\n\t\tc, _ = strconv.ParseInt(string(B[i]), 10, 64)\n\t\tif c != 0 {\n\t\t\tans += int64(a/b) * c\n\t\t}\n\t\tb /= 10\n\t}\n\n\tfmt.Println(ans)\n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1192, "cpu_time_ms": 5, "memory_kb": 1760}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s799028953", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar A int64\n\tvar B float64\n\tfmt.Scan(&A, &B)\n\n\tfmt.Println(int(math.Floor(float64(A) * B)))\n}\n", "language": "Go", "metadata": {"date": 1590976306, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s799028953.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s799028953", "user_id": "u577448612"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar A int64\n\tvar B float64\n\tfmt.Scan(&A, &B)\n\n\tfmt.Println(int(math.Floor(float64(A) * B)))\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 1756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s208350364", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a int\n\tvar b float64\n\n\tfmt.Scanf(\"%d %f\", &a, &b)\n\tvar out float64\n\tout = float64(a) * b\n\tfmt.Println(int(out))\n\n}", "language": "Go", "metadata": {"date": 1590976190, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s208350364.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s208350364", "user_id": "u474502175"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a int\n\tvar b float64\n\n\tfmt.Scanf(\"%d %f\", &a, &b)\n\tvar out float64\n\tout = float64(a) * b\n\tfmt.Println(int(out))\n\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 9, "memory_kb": 1816}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s365067449", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar a, b float64\n\tfmt.Scan(&a, &b)\n\tfmt.Println(int64(a*b))\n}", "language": "Go", "metadata": {"date": 1590975750, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s365067449.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s365067449", "user_id": "u223172005"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar a, b float64\n\tfmt.Scan(&a, &b)\n\tfmt.Println(int64(a*b))\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 1752}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s571274068", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewReaderSize(os.Stdin, 1024*1024*10)\n\nfunc main() {\n\tlist := getStdinArr()\n\tN, _ := strconv.Atoi(list[0])\n\tM, _ := strconv.ParseFloat(list[1], 64)\n\tans := float64(N) * M\n\ti := int(roundDown(ans, 0))\n\tfmt.Printf(\"%d\\n\", i)\n}\n\n// RoundDown 切り捨て\n\nfunc roundDown(num, places float64) float64 {\n\tshift := math.Pow(10, places)\n\n\treturn math.Trunc(num*shift) / shift\n\n}\n\nfunc getStdin() string {\n\treturn readLine()\n}\nfunc getStdinInt() int {\n\tstr := getStdin()\n\trtn, _ := strconv.Atoi(str)\n\treturn rtn\n}\nfunc getStdinIntArr() []int {\n\tstr := getStdin()\n\tlist := strings.Split(str, \" \")\n\trtn := make([]int, len(list))\n\tfor idx, val := range list {\n\t\trtn[idx], _ = strconv.Atoi(val)\n\t}\n\treturn rtn\n}\n\nfunc getStdinIntArr64() []int64 {\n\tstr := getStdin()\n\tlist := strings.Split(str, \" \")\n\trtn := make([]int64, len(list))\n\tfor idx, val := range list {\n\t\trtn[idx], _ = strconv.ParseInt(val, 10, 64)\n\t}\n\treturn rtn\n}\n\nfunc getStdinArr() []string {\n\tstr := getStdin()\n\tlist := strings.Split(str, \" \")\n\treturn list\n}\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 0)\n\tfor {\n\t\tl, p, e := sc.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n", "language": "Go", "metadata": {"date": 1590975731, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s571274068.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s571274068", "user_id": "u149861487"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewReaderSize(os.Stdin, 1024*1024*10)\n\nfunc main() {\n\tlist := getStdinArr()\n\tN, _ := strconv.Atoi(list[0])\n\tM, _ := strconv.ParseFloat(list[1], 64)\n\tans := float64(N) * M\n\ti := int(roundDown(ans, 0))\n\tfmt.Printf(\"%d\\n\", i)\n}\n\n// RoundDown 切り捨て\n\nfunc roundDown(num, places float64) float64 {\n\tshift := math.Pow(10, places)\n\n\treturn math.Trunc(num*shift) / shift\n\n}\n\nfunc getStdin() string {\n\treturn readLine()\n}\nfunc getStdinInt() int {\n\tstr := getStdin()\n\trtn, _ := strconv.Atoi(str)\n\treturn rtn\n}\nfunc getStdinIntArr() []int {\n\tstr := getStdin()\n\tlist := strings.Split(str, \" \")\n\trtn := make([]int, len(list))\n\tfor idx, val := range list {\n\t\trtn[idx], _ = strconv.Atoi(val)\n\t}\n\treturn rtn\n}\n\nfunc getStdinIntArr64() []int64 {\n\tstr := getStdin()\n\tlist := strings.Split(str, \" \")\n\trtn := make([]int64, len(list))\n\tfor idx, val := range list {\n\t\trtn[idx], _ = strconv.ParseInt(val, 10, 64)\n\t}\n\treturn rtn\n}\n\nfunc getStdinArr() []string {\n\tstr := getStdin()\n\tlist := strings.Split(str, \" \")\n\treturn list\n}\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 0)\n\tfor {\n\t\tl, p, e := sc.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1297, "cpu_time_ms": 3, "memory_kb": 2180}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s463254791", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc nextFloat() float64 {\n\tsc.Scan()\n\ti, e := strconv.ParseFloat(sc.Text(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tsc.Buffer(buf, maxBufSize)\n\tsc.Split(bufio.ScanWords)\n\ta, b := nextFloat(), nextFloat()\n\n\tfmt.Println(int(math.Floor(a*b)))\n}\n\nfunc isPrime(n int) bool {\n\tfor i := 2.0; i <= math.Sqrt(float64(n)); i++ {\n\t\tif n%int(i) == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n\nfunc slicePrint(s []int) {\n\tfor i, v := range s {\n\t\tif i != 0 {\n\t\t\tfmt.Printf(\" \")\n\t\t}\n\t\tfmt.Printf(\"%v\", v)\n\t}\n\tfmt.Println(\"\")\n}\n\nfunc abs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\treturn n\n}\n", "language": "Go", "metadata": {"date": 1590975133, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s463254791.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s463254791", "user_id": "u186893542"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc nextFloat() float64 {\n\tsc.Scan()\n\ti, e := strconv.ParseFloat(sc.Text(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tsc.Buffer(buf, maxBufSize)\n\tsc.Split(bufio.ScanWords)\n\ta, b := nextFloat(), nextFloat()\n\n\tfmt.Println(int(math.Floor(a*b)))\n}\n\nfunc isPrime(n int) bool {\n\tfor i := 2.0; i <= math.Sqrt(float64(n)); i++ {\n\t\tif n%int(i) == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n\nfunc slicePrint(s []int) {\n\tfor i, v := range s {\n\t\tif i != 0 {\n\t\t\tfmt.Printf(\" \")\n\t\t}\n\t\tfmt.Printf(\"%v\", v)\n\t}\n\tfmt.Println(\"\")\n}\n\nfunc abs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\treturn n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 901, "cpu_time_ms": 3, "memory_kb": 1756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s046883944", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar a int64\n\tvar b float64\n\tfmt.Scan(&a, &b)\n\taf := float64(a)\n\n\tans := af * b\n\tansi := int(math.Floor(ans))\n\tfmt.Println(ansi)\n}", "language": "Go", "metadata": {"date": 1590974847, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s046883944.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s046883944", "user_id": "u473974118"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar a int64\n\tvar b float64\n\tfmt.Scan(&a, &b)\n\taf := float64(a)\n\n\tans := af * b\n\tansi := int(math.Floor(ans))\n\tfmt.Println(ansi)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 185, "cpu_time_ms": 4, "memory_kb": 1756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s923823965", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// go run ./main.go < in\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tfor i := 0; i <= 0; i++ {\n\t\tsc.Scan()\n\t\tinputs := strings.Split(sc.Text(), \" \")\n\t\ta, _ := strconv.ParseFloat(inputs[0], 64)\n\t\tb, _ := strconv.ParseFloat(inputs[1], 64)\n\n\t\tfmt.Println(int(math.Floor(a * b)))\n\n\t}\n\n}", "language": "Go", "metadata": {"date": 1590974498, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s923823965.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s923823965", "user_id": "u046160726"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// go run ./main.go < in\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tfor i := 0; i <= 0; i++ {\n\t\tsc.Scan()\n\t\tinputs := strings.Split(sc.Text(), \" \")\n\t\ta, _ := strconv.ParseFloat(inputs[0], 64)\n\t\tb, _ := strconv.ParseFloat(inputs[1], 64)\n\n\t\tfmt.Println(int(math.Floor(a * b)))\n\n\t}\n\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 8, "memory_kb": 1724}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s981570113", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc readInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc readString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readInt64() int64 {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn int64(i)\n}\n\nfunc readfloat64() float64 {\n\tsc.Scan()\n\ti, err := strconv.ParseFloat(sc.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn float64(i)\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn a * -1\n\t}\n\treturn a\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc gcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t}\n\treturn gcd(y, x%y)\n}\n\nconst Mod = 1000000007\n\nfunc ModComb(n, k int) int {\n\tif k == 0 {\n\t\treturn 1\n\t}\n\tx, y := n, k\n\tfor i := 1; i < k; i++ {\n\t\tx = x * (n - i) % Mod\n\t\ty = y * (k - i) % Mod\n\t}\n\tinv := ModInv(y)\n\treturn x * inv % Mod\n}\n\nfunc ModFact(x int) int {\n\tfact := 1\n\tfor i := 1; i <= x; i++ {\n\t\tfact = fact * i % Mod\n\t}\n\treturn fact\n}\n\nfunc ModInv(x int) int {\n\treturn ModPow(x, Mod-2)\n}\n\nfunc ModPow(a, n int) int {\n\tres := 1\n\tfor n > 0 {\n\t\tif n%2 != 0 {\n\t\t\tres = res * a % Mod\n\t\t}\n\t\ta = a * a % Mod\n\t\tn /= 2\n\t}\n\treturn res\n}\n\nfunc pow(a, n int) int {\n\tif n == 0 {\n\t\treturn 1\n\t}\n\n\tans := 0\n\tif n%2 == 0 {\n\t\tans = pow(a*a, n/2)\n\t} else {\n\t\tans = a * pow(a*a, (n-1)/2)\n\t}\n\treturn ans\n}\n\nfunc intSliceReverse(slice []int) []int {\n\tfor i, j := 0, len(slice)-1; i < j; i, j = i+1, j-1 {\n\t\tslice[i], slice[j] = slice[j], slice[i]\n\t}\n\treturn slice\n}\n\nfunc stringReverse(str string) string {\n\trunes := []rune(str)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\ta, b := readfloat64(), readfloat64()\n\n\tfmt.Printf(\"%d\", int(math.Trunc(a*b)))\n}\n", "language": "Go", "metadata": {"date": 1590974465, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s981570113.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s981570113", "user_id": "u309370374"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc readInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc readString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readInt64() int64 {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn int64(i)\n}\n\nfunc readfloat64() float64 {\n\tsc.Scan()\n\ti, err := strconv.ParseFloat(sc.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn float64(i)\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn a * -1\n\t}\n\treturn a\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc gcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t}\n\treturn gcd(y, x%y)\n}\n\nconst Mod = 1000000007\n\nfunc ModComb(n, k int) int {\n\tif k == 0 {\n\t\treturn 1\n\t}\n\tx, y := n, k\n\tfor i := 1; i < k; i++ {\n\t\tx = x * (n - i) % Mod\n\t\ty = y * (k - i) % Mod\n\t}\n\tinv := ModInv(y)\n\treturn x * inv % Mod\n}\n\nfunc ModFact(x int) int {\n\tfact := 1\n\tfor i := 1; i <= x; i++ {\n\t\tfact = fact * i % Mod\n\t}\n\treturn fact\n}\n\nfunc ModInv(x int) int {\n\treturn ModPow(x, Mod-2)\n}\n\nfunc ModPow(a, n int) int {\n\tres := 1\n\tfor n > 0 {\n\t\tif n%2 != 0 {\n\t\t\tres = res * a % Mod\n\t\t}\n\t\ta = a * a % Mod\n\t\tn /= 2\n\t}\n\treturn res\n}\n\nfunc pow(a, n int) int {\n\tif n == 0 {\n\t\treturn 1\n\t}\n\n\tans := 0\n\tif n%2 == 0 {\n\t\tans = pow(a*a, n/2)\n\t} else {\n\t\tans = a * pow(a*a, (n-1)/2)\n\t}\n\treturn ans\n}\n\nfunc intSliceReverse(slice []int) []int {\n\tfor i, j := 0, len(slice)-1; i < j; i, j = i+1, j-1 {\n\t\tslice[i], slice[j] = slice[j], slice[i]\n\t}\n\treturn slice\n}\n\nfunc stringReverse(str string) string {\n\trunes := []rune(str)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\ta, b := readfloat64(), readfloat64()\n\n\tfmt.Printf(\"%d\", int(math.Trunc(a*b)))\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1949, "cpu_time_ms": 6, "memory_kb": 1724}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s934705957", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar (\n\t\ta int\n\t\tb float64\n\t)\n\tfmt.Scan(&a, &b)\n\tib := int(b * 100)\n\n\tfmt.Println(a * ib / 100)\n}\n", "language": "Go", "metadata": {"date": 1590974153, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s934705957.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s934705957", "user_id": "u461993794"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar (\n\t\ta int\n\t\tb float64\n\t)\n\tfmt.Scan(&a, &b)\n\tib := int(b * 100)\n\n\tfmt.Println(a * ib / 100)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 9, "memory_kb": 1756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s727160089", "group_id": "codeNet:p02659", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\ta := readi()\n\tb := readf()\n\n\tfmt.Println(int(float64(a) * b))\n}\n\n/*-------------------utilities-------------------*/\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc chmin(x *int, y int) bool {\n\tif *x > y {\n\t\t*x = y\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc chmax(x *int, y int) bool {\n\tif *x < y {\n\t\t*x = y\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\treturn (a * b) / gcd(a, b)\n}\n\nfunc permutations(arr []int) [][]int {\n\tvar helper func([]int, int)\n\tres := [][]int{}\n\n\thelper = func(arr []int, n int) {\n\t\tif n == 1 {\n\t\t\ttmp := make([]int, len(arr))\n\t\t\tcopy(tmp, arr)\n\t\t\tres = append(res, tmp)\n\t\t} else {\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\thelper(arr, n-1)\n\t\t\t\tif n%2 == 1 {\n\t\t\t\t\ttmp := arr[i]\n\t\t\t\t\tarr[i] = arr[n-1]\n\t\t\t\t\tarr[n-1] = tmp\n\t\t\t\t} else {\n\t\t\t\t\ttmp := arr[0]\n\t\t\t\t\tarr[0] = arr[n-1]\n\t\t\t\t\tarr[n-1] = tmp\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\thelper(arr, len(arr))\n\treturn res\n}\n\nfunc isPrime(n int) bool {\n\tif n == 1 {\n\t\treturn false\n\t}\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc divisor(n int) (res []int) {\n\tfor i := 1; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tres = append(res, i)\n\t\t\tif i*i != n {\n\t\t\t\tres = append(res, n/i)\n\t\t\t}\n\t\t}\n\t}\n\tsort.Ints(res)\n\treturn\n}\n\n/*-------------------init-------------------*/\n\nconst (\n\tINF = 1000000000000000000\n\tMOD = 1e9 + 7\n)\n\nvar (\n\treadString func() string\n)\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n}\n\n/*-------------------inputs-------------------*/\n\nfunc readi() int {\n\treturn int(readi64())\n}\n\nfunc readi64() int64 {\n\ti, err := strconv.ParseInt(readString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n", "language": "Go", "metadata": {"date": 1590974066, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02659.html", "problem_id": "p02659", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02659/input.txt", "sample_output_relpath": "derived/input_output/data/p02659/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02659/Go/s727160089.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s727160089", "user_id": "u183912232"}, "prompt_components": {"gold_output": "217\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\ta := readi()\n\tb := readf()\n\n\tfmt.Println(int(float64(a) * b))\n}\n\n/*-------------------utilities-------------------*/\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc chmin(x *int, y int) bool {\n\tif *x > y {\n\t\t*x = y\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc chmax(x *int, y int) bool {\n\tif *x < y {\n\t\t*x = y\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\treturn (a * b) / gcd(a, b)\n}\n\nfunc permutations(arr []int) [][]int {\n\tvar helper func([]int, int)\n\tres := [][]int{}\n\n\thelper = func(arr []int, n int) {\n\t\tif n == 1 {\n\t\t\ttmp := make([]int, len(arr))\n\t\t\tcopy(tmp, arr)\n\t\t\tres = append(res, tmp)\n\t\t} else {\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\thelper(arr, n-1)\n\t\t\t\tif n%2 == 1 {\n\t\t\t\t\ttmp := arr[i]\n\t\t\t\t\tarr[i] = arr[n-1]\n\t\t\t\t\tarr[n-1] = tmp\n\t\t\t\t} else {\n\t\t\t\t\ttmp := arr[0]\n\t\t\t\t\tarr[0] = arr[n-1]\n\t\t\t\t\tarr[n-1] = tmp\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\thelper(arr, len(arr))\n\treturn res\n}\n\nfunc isPrime(n int) bool {\n\tif n == 1 {\n\t\treturn false\n\t}\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc divisor(n int) (res []int) {\n\tfor i := 1; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tres = append(res, i)\n\t\t\tif i*i != n {\n\t\t\t\tres = append(res, n/i)\n\t\t\t}\n\t\t}\n\t}\n\tsort.Ints(res)\n\treturn\n}\n\n/*-------------------init-------------------*/\n\nconst (\n\tINF = 1000000000000000000\n\tMOD = 1e9 + 7\n)\n\nvar (\n\treadString func() string\n)\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n}\n\n/*-------------------inputs-------------------*/\n\nfunc readi() int {\n\treturn int(readi64())\n}\n\nfunc readi64() int64 {\n\ti, err := strconv.ParseInt(readString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "sample_input": "198 1.10\n"}, "reference_outputs": ["217\n"], "source_document_id": "p02659", "source_text": "Score : 300 points\n\nProblem Statement\n\nCompute A \\times B, truncate its fractional part, and print the result as an integer.\n\nConstraints\n\n0 \\leq A \\leq 10^{15}\n\n0 \\leq B < 10\n\nA is an integer.\n\nB is a number with two digits after the decimal point.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the answer as an integer.\n\nSample Input 1\n\n198 1.10\n\nSample Output 1\n\n217\n\nWe have 198 \\times 1.10 = 217.8. After truncating the fractional part, we have the answer: 217.\n\nSample Input 2\n\n1 0.01\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1000000000000000 9.99\n\nSample Output 3\n\n9990000000000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2292, "cpu_time_ms": 5, "memory_kb": 1728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s358801665", "group_id": "codeNet:p02684", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n)\n\nfunc main() {\n\tN, K := ReadInt(), ReadInt()\n\tA := ReadInts(N)\n\n\tmaxI := int(math.Ceil(math.Log2(float64(K))))\n\tnext := make([][]int, maxI+1)\n\tfor k := 0; k < maxI+1; k++ {\n\t\tnext[k] = make([]int, N)\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tnext[0][i] = A[i] - 1\n\t}\n\tfor k := 0; k < maxI; k++ {\n\t\tfor i := 0; i < N; i++ {\n\t\t\tnext[k+1][i] = next[k][next[k][i]]\n\t\t}\n\t}\n\n\tans := 0\n\tk := 0\n\tfor K > 0 {\n\t\tif K&1 == 1 {\n\t\t\tans = next[k][ans]\n\t\t}\n\t\tK >>= 1\n\t\tk++\n\t}\n\tfmt.Println(ans + 1)\n}\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadString() (s string) { Scan(&s); return }\nfunc ReadInts(n int) []int {\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tScan(&v[i])\n\t}\n\treturn v\n}\n", "language": "Go", "metadata": {"date": 1598838179, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02684.html", "problem_id": "p02684", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02684/input.txt", "sample_output_relpath": "derived/input_output/data/p02684/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02684/Go/s358801665.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s358801665", "user_id": "u328656362"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n)\n\nfunc main() {\n\tN, K := ReadInt(), ReadInt()\n\tA := ReadInts(N)\n\n\tmaxI := int(math.Ceil(math.Log2(float64(K))))\n\tnext := make([][]int, maxI+1)\n\tfor k := 0; k < maxI+1; k++ {\n\t\tnext[k] = make([]int, N)\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tnext[0][i] = A[i] - 1\n\t}\n\tfor k := 0; k < maxI; k++ {\n\t\tfor i := 0; i < N; i++ {\n\t\t\tnext[k+1][i] = next[k][next[k][i]]\n\t\t}\n\t}\n\n\tans := 0\n\tk := 0\n\tfor K > 0 {\n\t\tif K&1 == 1 {\n\t\t\tans = next[k][ans]\n\t\t}\n\t\tK >>= 1\n\t\tk++\n\t}\n\tfmt.Println(ans + 1)\n}\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadString() (s string) { Scan(&s); return }\nfunc ReadInts(n int) []int {\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tScan(&v[i])\n\t}\n\treturn v\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "sample_input": "4 5\n3 2 4 1\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02684", "source_text": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 875, "cpu_time_ms": 204, "memory_kb": 103652}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s115925298", "group_id": "codeNet:p02684", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n\nfunc scanInt64() int64 {\n\tsc.Scan()\n\ti, _ := strconv.ParseInt(sc.Text(), 10, 64)\n\treturn i\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t}\n\treturn res\n}\n\nfunc scanInts64(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := range res {\n\t\tres[i] = scanInt64()\n\t}\n\treturn res\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn, k := scanInt(), scanInt()\n\t// a := make([]int, n)\n\t// for i := range a {\n\t// \ta[i] = scanInt() - 1\n\t// }\n\ta := []int{0}\n\ta = append(a, scanInts(n)...)\n\n\tfg := []int{1}\n\tfor i := 0; i < n+n+100; i++ {\n\t\tfg = append(fg, a[fg[len(fg)-1]])\n\t}\n\n\tif k < n+1 {\n\t\tfmt.Println(fg[k])\n\t\treturn\n\t}\n\n\tloopEnd := n\n\tloopStart := n - 1\n\tfor fg[loopEnd] != fg[loopStart] {\n\t\tloopStart--\n\t}\n\tloopLen := loopEnd-loopStart\n\n\tk %= loopLen\n\tif k < n {\n\t\tk += loopLen\n\t}\n\n\tfmt.Println(fg[k])\n}\n", "language": "Go", "metadata": {"date": 1591719916, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02684.html", "problem_id": "p02684", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02684/input.txt", "sample_output_relpath": "derived/input_output/data/p02684/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02684/Go/s115925298.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s115925298", "user_id": "u475329018"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n\nfunc scanInt64() int64 {\n\tsc.Scan()\n\ti, _ := strconv.ParseInt(sc.Text(), 10, 64)\n\treturn i\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t}\n\treturn res\n}\n\nfunc scanInts64(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := range res {\n\t\tres[i] = scanInt64()\n\t}\n\treturn res\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn, k := scanInt(), scanInt()\n\t// a := make([]int, n)\n\t// for i := range a {\n\t// \ta[i] = scanInt() - 1\n\t// }\n\ta := []int{0}\n\ta = append(a, scanInts(n)...)\n\n\tfg := []int{1}\n\tfor i := 0; i < n+n+100; i++ {\n\t\tfg = append(fg, a[fg[len(fg)-1]])\n\t}\n\n\tif k < n+1 {\n\t\tfmt.Println(fg[k])\n\t\treturn\n\t}\n\n\tloopEnd := n\n\tloopStart := n - 1\n\tfor fg[loopEnd] != fg[loopStart] {\n\t\tloopStart--\n\t}\n\tloopLen := loopEnd-loopStart\n\n\tk %= loopLen\n\tif k < n {\n\t\tk += loopLen\n\t}\n\n\tfmt.Println(fg[k])\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "sample_input": "4 5\n3 2 4 1\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02684", "source_text": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1025, "cpu_time_ms": 51, "memory_kb": 16760}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s539918230", "group_id": "codeNet:p02684", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n\nfunc scanInt64() int64 {\n\tsc.Scan()\n\ti, _ := strconv.ParseInt(sc.Text(), 10, 64)\n\treturn i\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t}\n\treturn res\n}\n\nfunc scanInts64(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := range res {\n\t\tres[i] = scanInt64()\n\t}\n\treturn res\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn, k := scanInt(), scanInt()\n\ta := make([]int, n)\n\tfor i := range a {\n\t\ta[i] = scanInt() - 1\n\t}\n\tfg := []int{a[0]}\n\tfor i := 0; i < n+100; i++ {\n\t\tfg = append(fg, a[fg[len(fg)-1]])\n\t}\n\n\tif k <= n {\n\t\tfmt.Println(fg[k-1])\n\t}\n\n\tloopEnd := n - 1\n\tloopStart := n - 2\n\tloopLen := 0\n\tfor i := 0; i < n; i++ {\n\t\tif fg[loopEnd] == fg[loopStart] {\n\t\t\tloopLen = loopEnd - loopStart\n\t\t\tbreak\n\t\t}\n\t\tloopStart--\n\t}\n\n\tk %= loopLen\n\tif k < n {\n\t\tk += loopLen\n\t}\n\n\tfmt.Println(fg[k-1] + 1)\n}\n", "language": "Go", "metadata": {"date": 1591717924, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02684.html", "problem_id": "p02684", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02684/input.txt", "sample_output_relpath": "derived/input_output/data/p02684/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02684/Go/s539918230.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s539918230", "user_id": "u475329018"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n\nfunc scanInt64() int64 {\n\tsc.Scan()\n\ti, _ := strconv.ParseInt(sc.Text(), 10, 64)\n\treturn i\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t}\n\treturn res\n}\n\nfunc scanInts64(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := range res {\n\t\tres[i] = scanInt64()\n\t}\n\treturn res\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn, k := scanInt(), scanInt()\n\ta := make([]int, n)\n\tfor i := range a {\n\t\ta[i] = scanInt() - 1\n\t}\n\tfg := []int{a[0]}\n\tfor i := 0; i < n+100; i++ {\n\t\tfg = append(fg, a[fg[len(fg)-1]])\n\t}\n\n\tif k <= n {\n\t\tfmt.Println(fg[k-1])\n\t}\n\n\tloopEnd := n - 1\n\tloopStart := n - 2\n\tloopLen := 0\n\tfor i := 0; i < n; i++ {\n\t\tif fg[loopEnd] == fg[loopStart] {\n\t\t\tloopLen = loopEnd - loopStart\n\t\t\tbreak\n\t\t}\n\t\tloopStart--\n\t}\n\n\tk %= loopLen\n\tif k < n {\n\t\tk += loopLen\n\t}\n\n\tfmt.Println(fg[k-1] + 1)\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "sample_input": "4 5\n3 2 4 1\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02684", "source_text": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1025, "cpu_time_ms": 43, "memory_kb": 11852}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s558279880", "group_id": "codeNet:p02684", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N, K int\n\tfmt.Scanf(\"%d %d\", &N, &K)\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scanf(\"%d\", &A[i])\n\t}\n\n\tnext := A[0]\n\tpattern := []int{1}\n\tcounter := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tcounter[i] = 0\n\t}\n\tcounter[0]++\n\tfor {\n\t\tpattern = append(pattern, next)\n\t\tcounter[next-1]++\n\t\tif counter[next-1] > 1 {\n\t\t\tbreak\n\t\t}\n\t\tnext = A[next-1]\n\t}\n\tpatternFastIndex := next\n\tvar patternA, patternB []int\n\tif patternFastIndex == 1 {\n\t\tpatternA = pattern[:patternFastIndex-1]\n\t\tpatternB = pattern[patternFastIndex-1 : len(pattern)-1]\n\t} else {\n\t\tpatternA = pattern[:patternFastIndex]\n\t\tpatternB = pattern[patternFastIndex : len(pattern)-1]\n\t}\n\tif K >= len(patternA) {\n\t\tfmt.Println(patternB[(K-len(patternA))%len(patternB)])\n\t} else {\n\t\tfmt.Println(patternA[K%len(patternA)])\n\t}\n}\n", "language": "Go", "metadata": {"date": 1589949702, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02684.html", "problem_id": "p02684", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02684/input.txt", "sample_output_relpath": "derived/input_output/data/p02684/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02684/Go/s558279880.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s558279880", "user_id": "u589367761"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N, K int\n\tfmt.Scanf(\"%d %d\", &N, &K)\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scanf(\"%d\", &A[i])\n\t}\n\n\tnext := A[0]\n\tpattern := []int{1}\n\tcounter := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tcounter[i] = 0\n\t}\n\tcounter[0]++\n\tfor {\n\t\tpattern = append(pattern, next)\n\t\tcounter[next-1]++\n\t\tif counter[next-1] > 1 {\n\t\t\tbreak\n\t\t}\n\t\tnext = A[next-1]\n\t}\n\tpatternFastIndex := next\n\tvar patternA, patternB []int\n\tif patternFastIndex == 1 {\n\t\tpatternA = pattern[:patternFastIndex-1]\n\t\tpatternB = pattern[patternFastIndex-1 : len(pattern)-1]\n\t} else {\n\t\tpatternA = pattern[:patternFastIndex]\n\t\tpatternB = pattern[patternFastIndex : len(pattern)-1]\n\t}\n\tif K >= len(patternA) {\n\t\tfmt.Println(patternB[(K-len(patternA))%len(patternB)])\n\t} else {\n\t\tfmt.Println(patternA[K%len(patternA)])\n\t}\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "sample_input": "4 5\n3 2 4 1\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02684", "source_text": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1005, "memory_kb": 12968}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s693962598", "group_id": "codeNet:p02684", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N, K int\n\tfmt.Scanf(\"%d %d\", &N, &K)\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scanf(\"%d\", &A[i])\n\t}\n\n\tnext := A[0]\n\tpattern := []int{1}\n\tcounter := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tcounter[i] = 0\n\t}\n\tcounter[0]++\n\tfor {\n\t\tpattern = append(pattern, next)\n\t\tcounter[next-1]++\n\t\tnext = A[next-1]\n\t\tbreakFlag := false\n\t\tfor i := 0; i < N; i++ {\n\t\t\tif counter[i] > 1 {\n\t\t\t\tbreakFlag = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif breakFlag {\n\t\t\tbreak\n\t\t}\n\t}\n\tpatternFastIndex := -1\n\tfor i := 0; i < N; i++ {\n\t\tif counter[i] == 2 {\n\t\t\tpatternFastIndex = i + 1\n\t\t\tbreak\n\t\t}\n\t}\n\t// fmt.Println(patternFastIndex)\n\tvar patternA, patternB []int\n\tif patternFastIndex == 1 {\n\t\tpatternA = pattern[:patternFastIndex-1]\n\t\tpatternB = pattern[patternFastIndex-1 : len(pattern)-1]\n\t} else {\n\t\tpatternA = pattern[:patternFastIndex]\n\t\tpatternB = pattern[patternFastIndex : len(pattern)-1]\n\t}\n\tif K >= len(patternA) {\n\t\tfmt.Println(patternB[(K-len(patternA))%len(patternB)])\n\t} else {\n\t\tfmt.Println(patternA[K])\n\t}\n}\n", "language": "Go", "metadata": {"date": 1589947276, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02684.html", "problem_id": "p02684", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02684/input.txt", "sample_output_relpath": "derived/input_output/data/p02684/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02684/Go/s693962598.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s693962598", "user_id": "u589367761"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N, K int\n\tfmt.Scanf(\"%d %d\", &N, &K)\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scanf(\"%d\", &A[i])\n\t}\n\n\tnext := A[0]\n\tpattern := []int{1}\n\tcounter := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tcounter[i] = 0\n\t}\n\tcounter[0]++\n\tfor {\n\t\tpattern = append(pattern, next)\n\t\tcounter[next-1]++\n\t\tnext = A[next-1]\n\t\tbreakFlag := false\n\t\tfor i := 0; i < N; i++ {\n\t\t\tif counter[i] > 1 {\n\t\t\t\tbreakFlag = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif breakFlag {\n\t\t\tbreak\n\t\t}\n\t}\n\tpatternFastIndex := -1\n\tfor i := 0; i < N; i++ {\n\t\tif counter[i] == 2 {\n\t\t\tpatternFastIndex = i + 1\n\t\t\tbreak\n\t\t}\n\t}\n\t// fmt.Println(patternFastIndex)\n\tvar patternA, patternB []int\n\tif patternFastIndex == 1 {\n\t\tpatternA = pattern[:patternFastIndex-1]\n\t\tpatternB = pattern[patternFastIndex-1 : len(pattern)-1]\n\t} else {\n\t\tpatternA = pattern[:patternFastIndex]\n\t\tpatternB = pattern[patternFastIndex : len(pattern)-1]\n\t}\n\tif K >= len(patternA) {\n\t\tfmt.Println(patternB[(K-len(patternA))%len(patternB)])\n\t} else {\n\t\tfmt.Println(patternA[K])\n\t}\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "sample_input": "4 5\n3 2 4 1\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02684", "source_text": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1053, "cpu_time_ms": 2206, "memory_kb": 8112}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s786328913", "group_id": "codeNet:p02684", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst (\n\tmaxBufsize = 1000000\n)\n\nfunc inputs(lines int, rdr *bufio.Reader) []string {\n\tvar strSlice []string\n\n\t//rdr := bufio.NewReaderSize(os.Stdin, maxBufsize)\n\n\tfor i := 0; i < lines; i++ {\n\n\t\tline := ReadLine(rdr)\n\t\tstrSlice = append(strSlice, line)\n\n\t}\n\n\treturn strSlice\n}\n\n// ReadLine is to read long line\nfunc ReadLine(rdr *bufio.Reader) string {\n\tbuf := make([]byte, 0, maxBufsize)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn string(buf)\n}\n\n//DivideConvertInt is to divide and convert\nfunc DivideConvertInt(line string, num int) []int {\n\ttmp := strings.Split(line, \" \")\n\n\tintSlice := make([]int, num)\n\n\tfor i := 0; i < num; i++ {\n\t\tintTmp, _ := strconv.Atoi(tmp[i])\n\t\tintSlice[i] = intTmp\n\t}\n\n\treturn intSlice\n}\n\nfunc main() {\n\trdr := bufio.NewReaderSize(os.Stdin, maxBufsize)\n\tline0 := inputs(1, rdr)\n\n\tline0Int := DivideConvertInt(line0[0], 2)\n\n\tN := line0Int[0]\n\tK := line0Int[1]\n\n\tline1 := inputs(1, rdr)\n\n\tA := DivideConvertInt(line1[0], N)\n\n\tcheck := []int{}\n\tord := make([]int, N+1)\n\n\tfor i := 0; i < N+1; i++ {\n\t\tord[i] = -1\n\t}\n\n\ti := 1\n\n\tfor {\n\t\tif ord[i] == -1 {\n\t\t\tord[i] = len(check)\n\t\t\tcheck = append(check, i)\n\t\t\ti = A[i-1]\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tcycle := len(check) - ord[i]\n\n\tl := ord[i]\n\n\tif K < l {\n\t\tfmt.Println(check[K])\n\t} else {\n\t\tK -= l\n\t\tK %= cycle\n\t\tfmt.Println(check[l+K])\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1589853320, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02684.html", "problem_id": "p02684", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02684/input.txt", "sample_output_relpath": "derived/input_output/data/p02684/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02684/Go/s786328913.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s786328913", "user_id": "u549085051"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst (\n\tmaxBufsize = 1000000\n)\n\nfunc inputs(lines int, rdr *bufio.Reader) []string {\n\tvar strSlice []string\n\n\t//rdr := bufio.NewReaderSize(os.Stdin, maxBufsize)\n\n\tfor i := 0; i < lines; i++ {\n\n\t\tline := ReadLine(rdr)\n\t\tstrSlice = append(strSlice, line)\n\n\t}\n\n\treturn strSlice\n}\n\n// ReadLine is to read long line\nfunc ReadLine(rdr *bufio.Reader) string {\n\tbuf := make([]byte, 0, maxBufsize)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn string(buf)\n}\n\n//DivideConvertInt is to divide and convert\nfunc DivideConvertInt(line string, num int) []int {\n\ttmp := strings.Split(line, \" \")\n\n\tintSlice := make([]int, num)\n\n\tfor i := 0; i < num; i++ {\n\t\tintTmp, _ := strconv.Atoi(tmp[i])\n\t\tintSlice[i] = intTmp\n\t}\n\n\treturn intSlice\n}\n\nfunc main() {\n\trdr := bufio.NewReaderSize(os.Stdin, maxBufsize)\n\tline0 := inputs(1, rdr)\n\n\tline0Int := DivideConvertInt(line0[0], 2)\n\n\tN := line0Int[0]\n\tK := line0Int[1]\n\n\tline1 := inputs(1, rdr)\n\n\tA := DivideConvertInt(line1[0], N)\n\n\tcheck := []int{}\n\tord := make([]int, N+1)\n\n\tfor i := 0; i < N+1; i++ {\n\t\tord[i] = -1\n\t}\n\n\ti := 1\n\n\tfor {\n\t\tif ord[i] == -1 {\n\t\t\tord[i] = len(check)\n\t\t\tcheck = append(check, i)\n\t\t\ti = A[i-1]\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tcycle := len(check) - ord[i]\n\n\tl := ord[i]\n\n\tif K < l {\n\t\tfmt.Println(check[K])\n\t} else {\n\t\tK -= l\n\t\tK %= cycle\n\t\tfmt.Println(check[l+K])\n\t}\n\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "sample_input": "4 5\n3 2 4 1\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02684", "source_text": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1474, "cpu_time_ms": 39, "memory_kb": 17696}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s701357002", "group_id": "codeNet:p02684", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar startval int\n\nfunc solve() {\n\tn := scanInt()\n\tk := scanInt()\n\ta := make([]int, n)\n\tseen := map[int]bool{}\n\ttrace := []int{0}\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = scanInt()\n\t}\n\tfor i := 0; i < k; i++ {\n\t\tnext := a[trace[i]] - 1\n\t\t_, ok := seen[next]\n\t\tif ok {\n\t\t\tstartval = next\n\t\t\tbreak\n\t\t}\n\t\ttrace = append(trace, next)\n\t\tseen[next] = true\n\t}\n\tvar start int\n\tfor i := 0; i < k; i++ {\n\t\tif trace[i] == startval {\n\t\t\tstart = i\n\t\t\tbreak\n\t\t}\n\t}\n\trepetition := trace[start:]\n\tfmt.Println(repetition[(k-start)%(len(repetition))] + 1)\n\treturn\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc scanInt() int {\n\tsc.Scan()\n\ta, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\treturn a\n}\nfunc scanFloat64() float64 {\n\tf, _ := strconv.ParseFloat(scanString(), 64)\n\treturn f\n}\nfunc Permute(nums []int) [][]int {\n\tn := factorial(len(nums))\n\tret := make([][]int, 0, n)\n\tpermute(nums, &ret)\n\treturn ret\n}\nfunc permute(nums []int, ret *[][]int) {\n\t*ret = append(*ret, makeCopy(nums))\n\n\tn := len(nums)\n\tvar i, j int\n\tfor {\n\t\tfor i = n - 2; i >= 0; i-- {\n\t\t\tif nums[i] < nums[i+1] {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif i < 0 {\n\t\t\treturn\n\t\t}\n\t\tfor j = n - 1; ; j-- {\n\t\t\tif nums[j] > nums[i] {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tnums[i], nums[j] = nums[j], nums[i]\n\t\tfor k, l := i+1, n-1; k < l; {\n\t\t\tnums[k], nums[l] = nums[l], nums[k]\n\t\t\tk++\n\t\t\tl--\n\t\t}\n\t\t*ret = append(*ret, makeCopy(nums))\n\t}\n}\n\nfunc factorial(n int) int {\n\tret := 1\n\tfor i := 2; i <= n; i++ {\n\t\tret *= i\n\t}\n\treturn ret\n}\nfunc makeCopy(nums []int) []int {\n\treturn append([]int{}, nums...)\n}\nfunc gcd(a int, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsolve()\n}\n", "language": "Go", "metadata": {"date": 1589766531, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02684.html", "problem_id": "p02684", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02684/input.txt", "sample_output_relpath": "derived/input_output/data/p02684/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02684/Go/s701357002.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s701357002", "user_id": "u989654188"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar startval int\n\nfunc solve() {\n\tn := scanInt()\n\tk := scanInt()\n\ta := make([]int, n)\n\tseen := map[int]bool{}\n\ttrace := []int{0}\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = scanInt()\n\t}\n\tfor i := 0; i < k; i++ {\n\t\tnext := a[trace[i]] - 1\n\t\t_, ok := seen[next]\n\t\tif ok {\n\t\t\tstartval = next\n\t\t\tbreak\n\t\t}\n\t\ttrace = append(trace, next)\n\t\tseen[next] = true\n\t}\n\tvar start int\n\tfor i := 0; i < k; i++ {\n\t\tif trace[i] == startval {\n\t\t\tstart = i\n\t\t\tbreak\n\t\t}\n\t}\n\trepetition := trace[start:]\n\tfmt.Println(repetition[(k-start)%(len(repetition))] + 1)\n\treturn\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc scanInt() int {\n\tsc.Scan()\n\ta, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\treturn a\n}\nfunc scanFloat64() float64 {\n\tf, _ := strconv.ParseFloat(scanString(), 64)\n\treturn f\n}\nfunc Permute(nums []int) [][]int {\n\tn := factorial(len(nums))\n\tret := make([][]int, 0, n)\n\tpermute(nums, &ret)\n\treturn ret\n}\nfunc permute(nums []int, ret *[][]int) {\n\t*ret = append(*ret, makeCopy(nums))\n\n\tn := len(nums)\n\tvar i, j int\n\tfor {\n\t\tfor i = n - 2; i >= 0; i-- {\n\t\t\tif nums[i] < nums[i+1] {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif i < 0 {\n\t\t\treturn\n\t\t}\n\t\tfor j = n - 1; ; j-- {\n\t\t\tif nums[j] > nums[i] {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tnums[i], nums[j] = nums[j], nums[i]\n\t\tfor k, l := i+1, n-1; k < l; {\n\t\t\tnums[k], nums[l] = nums[l], nums[k]\n\t\t\tk++\n\t\t\tl--\n\t\t}\n\t\t*ret = append(*ret, makeCopy(nums))\n\t}\n}\n\nfunc factorial(n int) int {\n\tret := 1\n\tfor i := 2; i <= n; i++ {\n\t\tret *= i\n\t}\n\treturn ret\n}\nfunc makeCopy(nums []int) []int {\n\treturn append([]int{}, nums...)\n}\nfunc gcd(a int, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsolve()\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "sample_input": "4 5\n3 2 4 1\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02684", "source_text": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1781, "cpu_time_ms": 61, "memory_kb": 16176}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s846484232", "group_id": "codeNet:p02684", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\n// https://atcoder.jp/contests/abc167/tasks/abc167_d\nvar hashMap map[int]int\nvar history map[int]int\nvar muraCount int\nfunc main() {\n\n\tfirstLine := strings.Split(readLine(), \" \")\n\tsecondLine := strings.Split(readLine(), \" \")\n\n\t// line 1 N札 M個 目標値\n\t// line over 2 値段 アルゴ理解度......\n\tmuraCount, _ = strconv.Atoi(firstLine[0])\n\tjumpNum, _ := strconv.Atoi(firstLine[1])\n\n\thashMap = make(map[int]int, muraCount)\n\thistory = make(map[int]int, muraCount)\n\tfor i, v := range secondLine {\n\t\tn, _ := strconv.Atoi(v)\n\t\thashMap[i+1] = n\n\t}\n\n\tjump(jumpNum, 1, 0)\n\n}\n\nfunc jump(k int, index int, cnt int) {\n\n\tif cnt == k {\n\t\tfmt.Println(index)\n\t\tos.Exit(0)\n\t}\n\n\tfor i, v := range history {\n\t\tif v == index {\n\t\t\t// ループしたことになる 現在 cnt - i 分移動すると また香り高い街に移動する。\n\t\t\t// 残りの移動量は k - cnt となり、 (k-cnt) % (cnt - i) 分移動すれば答えとなる。\n\t\t\tnokori := (k - cnt) % (cnt - i)\n\t\t\thistory = make(map[int]int, muraCount)\n\t\t\tjump(nokori, index, 0)\n\t\t}\n\t}\n\thistory[cnt] = index\n\n\tjump(k, hashMap[index], cnt+1)\n\n}\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n", "language": "Go", "metadata": {"date": 1589672163, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02684.html", "problem_id": "p02684", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02684/input.txt", "sample_output_relpath": "derived/input_output/data/p02684/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02684/Go/s846484232.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s846484232", "user_id": "u347725303"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\n// https://atcoder.jp/contests/abc167/tasks/abc167_d\nvar hashMap map[int]int\nvar history map[int]int\nvar muraCount int\nfunc main() {\n\n\tfirstLine := strings.Split(readLine(), \" \")\n\tsecondLine := strings.Split(readLine(), \" \")\n\n\t// line 1 N札 M個 目標値\n\t// line over 2 値段 アルゴ理解度......\n\tmuraCount, _ = strconv.Atoi(firstLine[0])\n\tjumpNum, _ := strconv.Atoi(firstLine[1])\n\n\thashMap = make(map[int]int, muraCount)\n\thistory = make(map[int]int, muraCount)\n\tfor i, v := range secondLine {\n\t\tn, _ := strconv.Atoi(v)\n\t\thashMap[i+1] = n\n\t}\n\n\tjump(jumpNum, 1, 0)\n\n}\n\nfunc jump(k int, index int, cnt int) {\n\n\tif cnt == k {\n\t\tfmt.Println(index)\n\t\tos.Exit(0)\n\t}\n\n\tfor i, v := range history {\n\t\tif v == index {\n\t\t\t// ループしたことになる 現在 cnt - i 分移動すると また香り高い街に移動する。\n\t\t\t// 残りの移動量は k - cnt となり、 (k-cnt) % (cnt - i) 分移動すれば答えとなる。\n\t\t\tnokori := (k - cnt) % (cnt - i)\n\t\t\thistory = make(map[int]int, muraCount)\n\t\t\tjump(nokori, index, 0)\n\t\t}\n\t}\n\thistory[cnt] = index\n\n\tjump(k, hashMap[index], cnt+1)\n\n}\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "sample_input": "4 5\n3 2 4 1\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02684", "source_text": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1421, "cpu_time_ms": 2207, "memory_kb": 21880}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s966812149", "group_id": "codeNet:p02684", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\n\t// Reader\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n)\n\nconst BUFF_LIMIT = 1000000\n\nfunc main() {\n\tvar i Input\n\ti.Init(BUFF_LIMIT) \n\td := i.NextLine()\n\n\ttownCount, _ := strconv.Atoi(d[0])\n\tnumK, _ := strconv.Atoi(d[1])\n\t\n\ttl := i.NextLine()\n\tlines := make([]int, townCount)\n\tfor n := 0; n < townCount; n++ {\n\t\tti, _ := strconv.Atoi(tl[n])\n\t\tlines[n] = ti \n\t}\n\n\tpath, before, loop := parseLines(lines)\n\t//fmt.Println(path)\n\t//fmt.Println(before)\n\t//fmt.Println(loop)\n\tloopPos := (numK - before) % loop\n\ttownPos := path[before + loopPos]\n\t//fmt.Println(townPos)\n\n\tfmt.Printf(\"%d \\n\", townPos + 1)\n}\n\nfunc parseLines(lines []int) ([]int, int, int) {\n\tvar path []int \n\tfrom := 0\n\tpath = append(path, 0)\n\tfor {\n\t\tto := lines[from] - 1\n\t\tpos := contains(path, to)\n\t\tif pos == -1 {\n\t\t\t// 無いとき\n\t\t\tpath = append(path, to)\n\t\t\tfrom = to\n\t\t\tcontinue\n\t\t}\n\n\t\t// ある時 (どこかでloop してる\n\t\tbeforeCount := pos\n\t\tloopCount := len(path) - pos\n\t\treturn path, beforeCount, loopCount\n\t}\n}\n\n// Checker\nfunc contains(s []int, e int) int {\n\tfor k, v := range s {\n\t\tif e == v {\n\t\t\treturn k\n\t\t}\n\t}\n\treturn -1\n}\n\n// InputReader\ntype Input struct {\n\tlimit int\n\treader *bufio.Reader\n}\n\nfunc (i *Input) Init(l int) {\n\ti.limit = l\n\ti.reader = bufio.NewReaderSize(os.Stdin, i.limit)\n}\n\nfunc (i *Input) NextLine() []string {\n\treturn i.parseLine(i.readLine())\n}\n\nfunc (i *Input) readLine() string {\n\tbuf := make([]byte, 0, i.limit)\n\tfor {\n\t\tl, p, e := i.reader.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc (i *Input) parseLine(s string) []string {\n\tslice := strings.Split(s, \" \")\n\treturn slice\n}\n", "language": "Go", "metadata": {"date": 1589411266, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02684.html", "problem_id": "p02684", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02684/input.txt", "sample_output_relpath": "derived/input_output/data/p02684/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02684/Go/s966812149.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s966812149", "user_id": "u137939942"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\n\t// Reader\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n)\n\nconst BUFF_LIMIT = 1000000\n\nfunc main() {\n\tvar i Input\n\ti.Init(BUFF_LIMIT) \n\td := i.NextLine()\n\n\ttownCount, _ := strconv.Atoi(d[0])\n\tnumK, _ := strconv.Atoi(d[1])\n\t\n\ttl := i.NextLine()\n\tlines := make([]int, townCount)\n\tfor n := 0; n < townCount; n++ {\n\t\tti, _ := strconv.Atoi(tl[n])\n\t\tlines[n] = ti \n\t}\n\n\tpath, before, loop := parseLines(lines)\n\t//fmt.Println(path)\n\t//fmt.Println(before)\n\t//fmt.Println(loop)\n\tloopPos := (numK - before) % loop\n\ttownPos := path[before + loopPos]\n\t//fmt.Println(townPos)\n\n\tfmt.Printf(\"%d \\n\", townPos + 1)\n}\n\nfunc parseLines(lines []int) ([]int, int, int) {\n\tvar path []int \n\tfrom := 0\n\tpath = append(path, 0)\n\tfor {\n\t\tto := lines[from] - 1\n\t\tpos := contains(path, to)\n\t\tif pos == -1 {\n\t\t\t// 無いとき\n\t\t\tpath = append(path, to)\n\t\t\tfrom = to\n\t\t\tcontinue\n\t\t}\n\n\t\t// ある時 (どこかでloop してる\n\t\tbeforeCount := pos\n\t\tloopCount := len(path) - pos\n\t\treturn path, beforeCount, loopCount\n\t}\n}\n\n// Checker\nfunc contains(s []int, e int) int {\n\tfor k, v := range s {\n\t\tif e == v {\n\t\t\treturn k\n\t\t}\n\t}\n\treturn -1\n}\n\n// InputReader\ntype Input struct {\n\tlimit int\n\treader *bufio.Reader\n}\n\nfunc (i *Input) Init(l int) {\n\ti.limit = l\n\ti.reader = bufio.NewReaderSize(os.Stdin, i.limit)\n}\n\nfunc (i *Input) NextLine() []string {\n\treturn i.parseLine(i.readLine())\n}\n\nfunc (i *Input) readLine() string {\n\tbuf := make([]byte, 0, i.limit)\n\tfor {\n\t\tl, p, e := i.reader.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc (i *Input) parseLine(s string) []string {\n\tslice := strings.Split(s, \" \")\n\treturn slice\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "sample_input": "4 5\n3 2 4 1\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02684", "source_text": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1687, "cpu_time_ms": 2206, "memory_kb": 13144}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s901958838", "group_id": "codeNet:p02684", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\n\t// Reader\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n)\n\nconst BUFF_LIMIT = 1000\n\nfunc main() {\n\tvar i Input\n\ti.Init(BUFF_LIMIT) \n\td := i.NextLine()\n\n\ttownCount, _ := strconv.Atoi(d[0])\n\tnumK, _ := strconv.Atoi(d[1])\n\t\n\ttl := i.NextLine()\n\tlines := make([]int, townCount)\n\tfor n := 0; n < townCount; n++ {\n\t\tti, _ := strconv.Atoi(tl[n])\n\t\tlines[n] = ti \n\t}\n\n\tpath, before, loop := parseLines(lines)\n\t\n\tloopPos := (numK - before) % loop\n\ttownPos := path[before + loopPos]\n\n\tfmt.Printf(\"%d \\n\", townPos + 1)\n}\n\nfunc parseLines(lines []int) ([]int, int, int) {\n\tvar path []int \n\tfrom := 0\n\tpath = append(path, 0)\n\tfor {\n\t\tto := lines[from] - 1\n\t\tpos := contains(path, to)\n\t\tif pos == -1 {\n\t\t\t// 無いとき\n\t\t\tpath = append(path, to)\n\t\t\tfrom = to\n\t\t\tcontinue\n\t\t}\n\n\t\t// ある時 (どこかでloop してる\n\t\tbeforeCount := pos\n\t\tloopCount := len(path) - pos\n\t\treturn path, beforeCount, loopCount\n\t}\n}\n\n// Checker\nfunc contains(s []int, e int) int {\n\tfor k, v := range s {\n\t\tif e == v {\n\t\t\treturn k\n\t\t}\n\t}\n\treturn -1\n}\n\n// InputReader\ntype Input struct {\n\tlimit int\n\treader *bufio.Reader\n}\n\nfunc (i *Input) Init(l int) {\n\ti.limit = l\n\ti.reader = bufio.NewReaderSize(os.Stdin, i.limit)\n}\n\nfunc (i *Input) NextLine() []string {\n\treturn i.parseLine(i.readLine())\n}\n\nfunc (i *Input) readLine() string {\n\tbuf := make([]byte, 0, i.limit)\n\tfor {\n\t\tl, p, e := i.reader.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc (i *Input) parseLine(s string) []string {\n\tslice := strings.Split(s, \" \")\n\treturn slice\n}\n", "language": "Go", "metadata": {"date": 1589410811, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02684.html", "problem_id": "p02684", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02684/input.txt", "sample_output_relpath": "derived/input_output/data/p02684/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02684/Go/s901958838.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s901958838", "user_id": "u137939942"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\n\t// Reader\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n)\n\nconst BUFF_LIMIT = 1000\n\nfunc main() {\n\tvar i Input\n\ti.Init(BUFF_LIMIT) \n\td := i.NextLine()\n\n\ttownCount, _ := strconv.Atoi(d[0])\n\tnumK, _ := strconv.Atoi(d[1])\n\t\n\ttl := i.NextLine()\n\tlines := make([]int, townCount)\n\tfor n := 0; n < townCount; n++ {\n\t\tti, _ := strconv.Atoi(tl[n])\n\t\tlines[n] = ti \n\t}\n\n\tpath, before, loop := parseLines(lines)\n\t\n\tloopPos := (numK - before) % loop\n\ttownPos := path[before + loopPos]\n\n\tfmt.Printf(\"%d \\n\", townPos + 1)\n}\n\nfunc parseLines(lines []int) ([]int, int, int) {\n\tvar path []int \n\tfrom := 0\n\tpath = append(path, 0)\n\tfor {\n\t\tto := lines[from] - 1\n\t\tpos := contains(path, to)\n\t\tif pos == -1 {\n\t\t\t// 無いとき\n\t\t\tpath = append(path, to)\n\t\t\tfrom = to\n\t\t\tcontinue\n\t\t}\n\n\t\t// ある時 (どこかでloop してる\n\t\tbeforeCount := pos\n\t\tloopCount := len(path) - pos\n\t\treturn path, beforeCount, loopCount\n\t}\n}\n\n// Checker\nfunc contains(s []int, e int) int {\n\tfor k, v := range s {\n\t\tif e == v {\n\t\t\treturn k\n\t\t}\n\t}\n\treturn -1\n}\n\n// InputReader\ntype Input struct {\n\tlimit int\n\treader *bufio.Reader\n}\n\nfunc (i *Input) Init(l int) {\n\ti.limit = l\n\ti.reader = bufio.NewReaderSize(os.Stdin, i.limit)\n}\n\nfunc (i *Input) NextLine() []string {\n\treturn i.parseLine(i.readLine())\n}\n\nfunc (i *Input) readLine() string {\n\tbuf := make([]byte, 0, i.limit)\n\tfor {\n\t\tl, p, e := i.reader.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc (i *Input) parseLine(s string) []string {\n\tslice := strings.Split(s, \" \")\n\treturn slice\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "sample_input": "4 5\n3 2 4 1\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02684", "source_text": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1597, "cpu_time_ms": 2206, "memory_kb": 13000}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s404088061", "group_id": "codeNet:p02684", "input_text": "// +build ignore\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// I/O\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextFloat() float64 {\n\tf, e := strconv.ParseFloat(s.nextStr(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *Scanner) nextRuneSlice() []byte {\n\treturn []byte(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc (s *Scanner) nextFloatSlice(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextFloat()\n\t}\n\treturn res\n}\n\nfunc gcd(x, y int) int {\n\tif x%y != 0 {\n\t\treturn gcd(y, x%y)\n\t}\n\treturn y\n}\n\nconst D = 60\n\nfunc run(input io.Reader, output io.Writer) int {\n\tsc := NewScanner()\n\tN := sc.nextInt()\n\tK := sc.nextInt()\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = sc.nextInt() - 1\n\t}\n\n\tT := make([][]int, D)\n\tT[0] = make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tT[0][i] = A[i]\n\t}\n\n\tfor i := 1; i < D; i++ {\n\t\tT[i] = make([]int, N)\n\t\tfor j := 0; j < N; j++ {\n\t\t\tT[i][j] = T[i-1][T[i-1][j]]\n\t\t}\n\t}\n\n\tp := 0\n\tfor i := D; i >= 0; i-- {\n\t\tif K&(1<= 0; i-- {\n\t\tif K&(1<= 0; i-- {\n\t\tval, _ := strconv.Atoi(string(Kstr[i]))\n\t\tK = new(big.Int).Add(K, new(big.Int).Mul(big.NewInt(int64(val)), new(big.Int).Exp(ten, big.NewInt(ctr), nil)))\n\t\tctr++\n\t}\n\ttowns := make([]*town, N+1)\n\ttowns[0] = &town{\n\t\tnext: 1,\n\t\tcame: false,\n\t}\n\tfor i := 1; i <= N; i++ {\n\t\tvar next int\n\t\tfmt.Scan(&next)\n\t\ttowns[i] = &town{\n\t\t\tnext: next,\n\t\t\tcame: false,\n\t\t}\n\t}\n\ts := 1\n\tcur := 1\n\tfor {\n\t\tif towns[cur].came {\n\t\t\tcycleStartAt = cur\n\t\t\tcycleStart = s\n\t\t\tbreak\n\t\t}\n\t\ttowns[cur].came = true\n\t\tcur = towns[cur].next\n\t\ts++\n\t}\n\tcur = 0\n\tfor i := 0; i <= N; i++ {\n\t\tif towns[cur].next == cycleStartAt {\n\t\t\tt := towns[cur]\n\t\t\tfor {\n\t\t\t\tcycle = append(cycle, t.next)\n\t\t\t\tt = towns[t.next]\n\t\t\t\tif t.next == cycleStartAt {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tcur = towns[cur].next\n\t}\n\tstep := big.NewInt(0)\n\tcur = 1\n\tif K.Int64() <= int64(cycleStart) {\n\t\tfor i := int64(1); i <= K.Int64(); i++ {\n\t\t\tcur = towns[cur].next\n\t\t}\n\t\tfmt.Println(cur)\n\t\treturn\n\t}\n\tfor {\n\t\tstep = new(big.Int).Add(step, big.NewInt(1))\n\t\tcurrentTown := towns[cur]\n\t\tif currentTown.next == cycleStartAt {\n\t\t\taddr := new(big.Int).Mod(new(big.Int).Sub(K, step), big.NewInt(int64(len(cycle))))\n\t\t\tfmt.Print(cycle[addr.Int64()])\n\t\t\treturn\n\t\t}\n\t\tcur = currentTown.next\n\t}\n}\n\ntype town struct {\n\tnext int\n\tcame bool\n}\n", "language": "Go", "metadata": {"date": 1589167736, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02684.html", "problem_id": "p02684", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02684/input.txt", "sample_output_relpath": "derived/input_output/data/p02684/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02684/Go/s483585933.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s483585933", "user_id": "u686302771"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math/big\"\n\t\"strconv\"\n)\n\nvar N int\nvar Kstr string\nvar K = big.NewInt(0)\nvar cycleStartAt, cycleStart int\nvar cycle []int\n\nfunc main() {\n\tfmt.Scan(&N, &Kstr)\n\tctr := int64(0)\n\tten := big.NewInt(10)\n\tfor i := len(Kstr) - 1; i >= 0; i-- {\n\t\tval, _ := strconv.Atoi(string(Kstr[i]))\n\t\tK = new(big.Int).Add(K, new(big.Int).Mul(big.NewInt(int64(val)), new(big.Int).Exp(ten, big.NewInt(ctr), nil)))\n\t\tctr++\n\t}\n\ttowns := make([]*town, N+1)\n\ttowns[0] = &town{\n\t\tnext: 1,\n\t\tcame: false,\n\t}\n\tfor i := 1; i <= N; i++ {\n\t\tvar next int\n\t\tfmt.Scan(&next)\n\t\ttowns[i] = &town{\n\t\t\tnext: next,\n\t\t\tcame: false,\n\t\t}\n\t}\n\ts := 1\n\tcur := 1\n\tfor {\n\t\tif towns[cur].came {\n\t\t\tcycleStartAt = cur\n\t\t\tcycleStart = s\n\t\t\tbreak\n\t\t}\n\t\ttowns[cur].came = true\n\t\tcur = towns[cur].next\n\t\ts++\n\t}\n\tcur = 0\n\tfor i := 0; i <= N; i++ {\n\t\tif towns[cur].next == cycleStartAt {\n\t\t\tt := towns[cur]\n\t\t\tfor {\n\t\t\t\tcycle = append(cycle, t.next)\n\t\t\t\tt = towns[t.next]\n\t\t\t\tif t.next == cycleStartAt {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tcur = towns[cur].next\n\t}\n\tstep := big.NewInt(0)\n\tcur = 1\n\tif K.Int64() <= int64(cycleStart) {\n\t\tfor i := int64(1); i <= K.Int64(); i++ {\n\t\t\tcur = towns[cur].next\n\t\t}\n\t\tfmt.Println(cur)\n\t\treturn\n\t}\n\tfor {\n\t\tstep = new(big.Int).Add(step, big.NewInt(1))\n\t\tcurrentTown := towns[cur]\n\t\tif currentTown.next == cycleStartAt {\n\t\t\taddr := new(big.Int).Mod(new(big.Int).Sub(K, step), big.NewInt(int64(len(cycle))))\n\t\t\tfmt.Print(cycle[addr.Int64()])\n\t\t\treturn\n\t\t}\n\t\tcur = currentTown.next\n\t}\n}\n\ntype town struct {\n\tnext int\n\tcame bool\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "sample_input": "4 5\n3 2 4 1\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02684", "source_text": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1542, "cpu_time_ms": 1070, "memory_kb": 16640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s196720953", "group_id": "codeNet:p02684", "input_text": "package main\n \nimport \"fmt\"\n \nfunc main() {\n\tvar n, k int\n\tstart := 0\n\tfmt.Scan(&n, &k)\n\ta := make([]int, n)\n\tstate := make([]int, n)\n\ttmp := make([]int, 1000000)\n\ttmp[0] = 0\n\tloopLength := 0\n \n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n \n\tfor i := 0; i < k; i++ {\n\t\tstart = a[start] - 1\n\t\ttmp[i+1] = start\n\t\tif state[start] == 1 {\n\t\t\tfor j := 0; j < len(tmp); j++ {\n\t\t\t\tif tmp[j] == start {\n\t\t\t\t\ttmp = tmp[j : i+1]\n\t\t\t\t\tloopLength = len(tmp)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tfmt.Println(tmp[(k-i-1)%loopLength] + 1)\n\t\t\treturn\n\t\t} else {\n\t\t\tstate[start] = 1\n\t\t}\n\t}\n\tfmt.Println(start + 1)\n}", "language": "Go", "metadata": {"date": 1589166912, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02684.html", "problem_id": "p02684", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02684/input.txt", "sample_output_relpath": "derived/input_output/data/p02684/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02684/Go/s196720953.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s196720953", "user_id": "u541950811"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n \nimport \"fmt\"\n \nfunc main() {\n\tvar n, k int\n\tstart := 0\n\tfmt.Scan(&n, &k)\n\ta := make([]int, n)\n\tstate := make([]int, n)\n\ttmp := make([]int, 1000000)\n\ttmp[0] = 0\n\tloopLength := 0\n \n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n \n\tfor i := 0; i < k; i++ {\n\t\tstart = a[start] - 1\n\t\ttmp[i+1] = start\n\t\tif state[start] == 1 {\n\t\t\tfor j := 0; j < len(tmp); j++ {\n\t\t\t\tif tmp[j] == start {\n\t\t\t\t\ttmp = tmp[j : i+1]\n\t\t\t\t\tloopLength = len(tmp)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tfmt.Println(tmp[(k-i-1)%loopLength] + 1)\n\t\t\treturn\n\t\t} else {\n\t\t\tstate[start] = 1\n\t\t}\n\t}\n\tfmt.Println(start + 1)\n}", "problem_context": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "sample_input": "4 5\n3 2 4 1\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02684", "source_text": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1005, "memory_kb": 14092}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s355859765", "group_id": "codeNet:p02684", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\tstart := 1\n\tfmt.Scan(&n, &k)\n\ta := make([]int, n+1)\n\tstate := make([]int, n+1)\n\ttmp := make([]int, 5000000)\n\ttmp[0] = 1\n\tstate[1] = 1\n\tloopLength := 0\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i+1])\n\t}\n\n\tfor i := 0; i < k; i++ {\n\t\tstart = a[start]\n\t\ttmp[i+1] = start\n\t\tif state[start] == 1 {\n\t\t\tfor j := 0; j < i+1; j++ {\n\t\t\t\tif tmp[j] == start {\n\t\t\t\t\ttmp = tmp[j : i+1]\n\t\t\t\t\tloopLength = len(tmp)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\t// fmt.Println(tmp)\n\t\t\tfmt.Println(tmp[(k-i-1)%loopLength])\n\t\t\treturn\n\t\t} else {\n\t\t\tstate[start] = 1\n\t\t}\n\t}\n\tprintln(start)\n}\n", "language": "Go", "metadata": {"date": 1589166023, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02684.html", "problem_id": "p02684", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02684/input.txt", "sample_output_relpath": "derived/input_output/data/p02684/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02684/Go/s355859765.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s355859765", "user_id": "u541950811"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\tstart := 1\n\tfmt.Scan(&n, &k)\n\ta := make([]int, n+1)\n\tstate := make([]int, n+1)\n\ttmp := make([]int, 5000000)\n\ttmp[0] = 1\n\tstate[1] = 1\n\tloopLength := 0\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i+1])\n\t}\n\n\tfor i := 0; i < k; i++ {\n\t\tstart = a[start]\n\t\ttmp[i+1] = start\n\t\tif state[start] == 1 {\n\t\t\tfor j := 0; j < i+1; j++ {\n\t\t\t\tif tmp[j] == start {\n\t\t\t\t\ttmp = tmp[j : i+1]\n\t\t\t\t\tloopLength = len(tmp)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\t// fmt.Println(tmp)\n\t\t\tfmt.Println(tmp[(k-i-1)%loopLength])\n\t\t\treturn\n\t\t} else {\n\t\t\tstate[start] = 1\n\t\t}\n\t}\n\tprintln(start)\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "sample_input": "4 5\n3 2 4 1\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02684", "source_text": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 605, "cpu_time_ms": 986, "memory_kb": 18928}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s250067118", "group_id": "codeNet:p02684", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\tstart := 1\n\tfmt.Scan(&n, &k)\n\ta := make([]int, n+1)\n\tstate := make([]int, n+1)\n\ttmp := make([]int, 5000000)\n\ttmp[0] = 1\n\tstate[1] = 1\n\tloopLength := 0\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i+1])\n\t}\n\n\tfor i := 0; i < k; i++ {\n\t\tstart = a[start]\n\t\ttmp[i+1] = start\n\t\tif state[start] == 1 {\n\t\t\tfor j := 0; j < len(tmp); j++ {\n\t\t\t\tif tmp[j] == start {\n\t\t\t\t\ttmp = tmp[j : i+1]\n\t\t\t\t\tloopLength = len(tmp)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\t// fmt.Println(tmp)\n\t\t\tfmt.Println(tmp[(k-i-1)%loopLength])\n\t\t\treturn\n\t\t} else {\n\t\t\tstate[start] = 1\n\t\t}\n\t}\n\tprintln(start)\n}\n", "language": "Go", "metadata": {"date": 1589165860, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02684.html", "problem_id": "p02684", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02684/input.txt", "sample_output_relpath": "derived/input_output/data/p02684/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02684/Go/s250067118.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s250067118", "user_id": "u541950811"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\tstart := 1\n\tfmt.Scan(&n, &k)\n\ta := make([]int, n+1)\n\tstate := make([]int, n+1)\n\ttmp := make([]int, 5000000)\n\ttmp[0] = 1\n\tstate[1] = 1\n\tloopLength := 0\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i+1])\n\t}\n\n\tfor i := 0; i < k; i++ {\n\t\tstart = a[start]\n\t\ttmp[i+1] = start\n\t\tif state[start] == 1 {\n\t\t\tfor j := 0; j < len(tmp); j++ {\n\t\t\t\tif tmp[j] == start {\n\t\t\t\t\ttmp = tmp[j : i+1]\n\t\t\t\t\tloopLength = len(tmp)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\t// fmt.Println(tmp)\n\t\t\tfmt.Println(tmp[(k-i-1)%loopLength])\n\t\t\treturn\n\t\t} else {\n\t\t\tstate[start] = 1\n\t\t}\n\t}\n\tprintln(start)\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "sample_input": "4 5\n3 2 4 1\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02684", "source_text": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 610, "cpu_time_ms": 990, "memory_kb": 18928}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s179323164", "group_id": "codeNet:p02684", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc findCircuit(array []int) (int, int) {\n\tfor i := 0; i < len(array); i++ {\n\t\tvar target = array[i]\n\t\tfor j := i+1; j < len(array); j++ {\n\t\t\tif array[j] == target {\n\t\t\t\treturn i, j\n\t\t\t}\n\t\t}\n\t}\n\treturn -1, -1\n}\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scanf(\"%d %d\", &n, &k)\n\n\tfmt.Printf(\"%d %d\", n, k)\n\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\n\tb := make([]int, n + 2)\n\tb[0] = 1\n\tfor i := 0; i < n; i++ {\n\t\tb[i+1] = a[b[i] - 1]\n\t}\n\t// fmt.Printf(\"%d\", b)\n\tvar start, end = findCircuit(b)\n\tvar duration = end - start\n\t// fmt.Printf(\"%d %d %d\", start, end, duration)\n\n\tif start >= k {\n\t\tnow := 0\n\t\tfor i := 0; i < k; i++ {\n\t\t\tnow = a[now] - 1\n\t\t}\n\t\tfmt.Printf(\"%d\", now)\n\t} else {\n\t\tk = k - start\n\t\tk = k % duration\n\t\t// fmt.Printf(\"k=%d\", k)\n\t\tfmt.Printf(\"%d\", b[start + k])\n\t}\n}\n", "language": "Go", "metadata": {"date": 1589165777, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02684.html", "problem_id": "p02684", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02684/input.txt", "sample_output_relpath": "derived/input_output/data/p02684/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02684/Go/s179323164.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s179323164", "user_id": "u167600602"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc findCircuit(array []int) (int, int) {\n\tfor i := 0; i < len(array); i++ {\n\t\tvar target = array[i]\n\t\tfor j := i+1; j < len(array); j++ {\n\t\t\tif array[j] == target {\n\t\t\t\treturn i, j\n\t\t\t}\n\t\t}\n\t}\n\treturn -1, -1\n}\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scanf(\"%d %d\", &n, &k)\n\n\tfmt.Printf(\"%d %d\", n, k)\n\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\n\tb := make([]int, n + 2)\n\tb[0] = 1\n\tfor i := 0; i < n; i++ {\n\t\tb[i+1] = a[b[i] - 1]\n\t}\n\t// fmt.Printf(\"%d\", b)\n\tvar start, end = findCircuit(b)\n\tvar duration = end - start\n\t// fmt.Printf(\"%d %d %d\", start, end, duration)\n\n\tif start >= k {\n\t\tnow := 0\n\t\tfor i := 0; i < k; i++ {\n\t\t\tnow = a[now] - 1\n\t\t}\n\t\tfmt.Printf(\"%d\", now)\n\t} else {\n\t\tk = k - start\n\t\tk = k % duration\n\t\t// fmt.Printf(\"k=%d\", k)\n\t\tfmt.Printf(\"%d\", b[start + k])\n\t}\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "sample_input": "4 5\n3 2 4 1\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02684", "source_text": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 835, "cpu_time_ms": 2206, "memory_kb": 8120}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s310726770", "group_id": "codeNet:p02684", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tk, a := input()\n\tans := run(k, a)\n\toutput(ans)\n}\n\nfunc run(k int, a []int) int {\n\ttown := 0\n\t// trajectory := []int{}\n\ttrajectory := make(map[int]int)\n\tvar begin, end int\n\tvar ok bool\n\tvar i int\n\tfor i = 0; i < k; i++ {\n\t\tbegin, ok = trajectory[town]\n\t\t// begin = firstAppearance(town, trajectory)\n\t\tif ok {\n\t\t\tend = i\n\t\t\tbreak\n\t\t}\n\t\ttrajectory[town] = i\n\t\t// trajectory = append(trajectory, town)\n\t\ttown = a[town]\n\t}\n\tif i == k {\n\t\treturn town + 1\n\t}\n\tt := (k - begin) % (end - begin)\n\t// fmt.Println(begin, end)\n\t// fmt.Println(trajectory)\n\tarr := make([]int, end-begin, end-begin)\n\tfor i, v := range trajectory {\n\t\tif begin <= v && v < end {\n\t\t\tarr[v-begin] = i\n\t\t}\n\t}\n\t// fmt.Println(arr)\n\t// arr := trajectory[begin:end]\n\treturn arr[t] + 1\n\t// return -1\n}\n\nfunc firstAppearance(x int, t map[int]int) int {\n\tfor i, v := range t {\n\t\tif x == v {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn -1\n}\n\nfunc output(a int) {\n\tfmt.Println(a)\n}\n\nfunc input() (int, []int) {\n\tvar n, k int\n\tfmt.Scan(&n, &k)\n\ta := make([]int, n, n)\n\tvar t int\n\tfor i := range a {\n\t\tfmt.Scan(&t)\n\t\ta[i] = t - 1\n\t}\n\treturn k, a\n}\n", "language": "Go", "metadata": {"date": 1589165449, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02684.html", "problem_id": "p02684", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02684/input.txt", "sample_output_relpath": "derived/input_output/data/p02684/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02684/Go/s310726770.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s310726770", "user_id": "u037710225"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tk, a := input()\n\tans := run(k, a)\n\toutput(ans)\n}\n\nfunc run(k int, a []int) int {\n\ttown := 0\n\t// trajectory := []int{}\n\ttrajectory := make(map[int]int)\n\tvar begin, end int\n\tvar ok bool\n\tvar i int\n\tfor i = 0; i < k; i++ {\n\t\tbegin, ok = trajectory[town]\n\t\t// begin = firstAppearance(town, trajectory)\n\t\tif ok {\n\t\t\tend = i\n\t\t\tbreak\n\t\t}\n\t\ttrajectory[town] = i\n\t\t// trajectory = append(trajectory, town)\n\t\ttown = a[town]\n\t}\n\tif i == k {\n\t\treturn town + 1\n\t}\n\tt := (k - begin) % (end - begin)\n\t// fmt.Println(begin, end)\n\t// fmt.Println(trajectory)\n\tarr := make([]int, end-begin, end-begin)\n\tfor i, v := range trajectory {\n\t\tif begin <= v && v < end {\n\t\t\tarr[v-begin] = i\n\t\t}\n\t}\n\t// fmt.Println(arr)\n\t// arr := trajectory[begin:end]\n\treturn arr[t] + 1\n\t// return -1\n}\n\nfunc firstAppearance(x int, t map[int]int) int {\n\tfor i, v := range t {\n\t\tif x == v {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn -1\n}\n\nfunc output(a int) {\n\tfmt.Println(a)\n}\n\nfunc input() (int, []int) {\n\tvar n, k int\n\tfmt.Scan(&n, &k)\n\ta := make([]int, n, n)\n\tvar t int\n\tfor i := range a {\n\t\tfmt.Scan(&t)\n\t\ta[i] = t - 1\n\t}\n\treturn k, a\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "sample_input": "4 5\n3 2 4 1\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02684", "source_text": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1127, "cpu_time_ms": 1032, "memory_kb": 15984}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s887569490", "group_id": "codeNet:p02684", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\n\tfmt.Scanf(\"%d %d\", &n, &k)\n\n\ta := make([]int, n+1)\n\tfor i := 1; i <= n; i++ {\n\t\tfmt.Scanf(\"%d\", &a[i])\n\t}\n\n\tpos := 1\n\tprev := pos\n\tmemo := []int{1}\n\tvar i int\n\n\tfor i = 0; i < k; i++ {\n\t\tprev = pos\n\t\tpos = a[pos]\n\t\ta[prev] = -(i + 1)\n\t\tif pos < 0 {\n\t\t\tbreak\n\t\t}\n\t\tmemo = append(memo, pos)\n\t}\n\n\tif i == k {\n\t\tfmt.Println(pos)\n\t} else {\n\t\tj := -pos\n\t\tk1 := k - j\n\t\tl := len(memo) - j\n\t\tmod := k1 % l\n\t\tfmt.Println(memo[j+mod])\n\t}\n}\n", "language": "Go", "metadata": {"date": 1589164077, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02684.html", "problem_id": "p02684", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02684/input.txt", "sample_output_relpath": "derived/input_output/data/p02684/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02684/Go/s887569490.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s887569490", "user_id": "u143994115"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\n\tfmt.Scanf(\"%d %d\", &n, &k)\n\n\ta := make([]int, n+1)\n\tfor i := 1; i <= n; i++ {\n\t\tfmt.Scanf(\"%d\", &a[i])\n\t}\n\n\tpos := 1\n\tprev := pos\n\tmemo := []int{1}\n\tvar i int\n\n\tfor i = 0; i < k; i++ {\n\t\tprev = pos\n\t\tpos = a[pos]\n\t\ta[prev] = -(i + 1)\n\t\tif pos < 0 {\n\t\t\tbreak\n\t\t}\n\t\tmemo = append(memo, pos)\n\t}\n\n\tif i == k {\n\t\tfmt.Println(pos)\n\t} else {\n\t\tj := -pos\n\t\tk1 := k - j\n\t\tl := len(memo) - j\n\t\tmod := k1 % l\n\t\tfmt.Println(memo[j+mod])\n\t}\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "sample_input": "4 5\n3 2 4 1\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02684", "source_text": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 488, "cpu_time_ms": 990, "memory_kb": 10712}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s455406778", "group_id": "codeNet:p02684", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tsc.Scan()\n\tiv, _ := strconv.Atoi(sc.Text())\n\treturn iv\n}\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc main() {\n\tn, k := scanInt(), scanInt()\n\ta := make([]int, n+1)\n\tfor i := 1; i <= n; i++ {\n\t\ta[i] = scanInt()\n\t}\n\n\tp := 1\n\tans := make([]int, n+1)\n\tans[0] = p\n\tpassed := make([]int, n+1)\n\tfor i := range passed {\n\t\tpassed[i] = -1\n\t}\n\tpassed[1] = 0\n\tvar r int\n\tfor i := 1; i <= n; i++ {\n\t\tp = a[p]\n\t\tif passed[p] != -1 {\n\t\t\tk -= passed[p]\n\t\t\tr = i - passed[p] - 1\n\t\t\tbreak\n\t\t}\n\n\t\tpassed[p] = i\n\t\tans[i] = p\n\t\tif i == k {\n\t\t\tfmt.Println(p)\n\t\t\treturn\n\t\t}\n\t}\n\n\tk %= r\n\tfmt.Println(ans[k+1])\n}\n", "language": "Go", "metadata": {"date": 1589163386, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02684.html", "problem_id": "p02684", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02684/input.txt", "sample_output_relpath": "derived/input_output/data/p02684/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02684/Go/s455406778.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s455406778", "user_id": "u461993794"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tsc.Scan()\n\tiv, _ := strconv.Atoi(sc.Text())\n\treturn iv\n}\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc main() {\n\tn, k := scanInt(), scanInt()\n\ta := make([]int, n+1)\n\tfor i := 1; i <= n; i++ {\n\t\ta[i] = scanInt()\n\t}\n\n\tp := 1\n\tans := make([]int, n+1)\n\tans[0] = p\n\tpassed := make([]int, n+1)\n\tfor i := range passed {\n\t\tpassed[i] = -1\n\t}\n\tpassed[1] = 0\n\tvar r int\n\tfor i := 1; i <= n; i++ {\n\t\tp = a[p]\n\t\tif passed[p] != -1 {\n\t\t\tk -= passed[p]\n\t\t\tr = i - passed[p] - 1\n\t\t\tbreak\n\t\t}\n\n\t\tpassed[p] = i\n\t\tans[i] = p\n\t\tif i == k {\n\t\t\tfmt.Println(p)\n\t\t\treturn\n\t\t}\n\t}\n\n\tk %= r\n\tfmt.Println(ans[k+1])\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "sample_input": "4 5\n3 2 4 1\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02684", "source_text": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 711, "cpu_time_ms": 37, "memory_kb": 7720}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s012162583", "group_id": "codeNet:p02684", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tsc.Scan()\n\tiv, _ := strconv.Atoi(sc.Text())\n\treturn iv\n}\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc main() {\n\tn, k := scanInt(), scanInt()\n\ta := make([]int, n+1)\n\tfor i := 1; i <= n; i++ {\n\t\ta[i] = scanInt()\n\t}\n\n\tp := 1\n\tans := make([]int, n+1)\n\tans[0] = p\n\tpassed := make(map[int]int)\n\tpassed[p] = 0\n\tvar r int\n\tfor i := 1; i <= n; i++ {\n\t\tp = a[p]\n\t\tif _, ok := passed[p]; ok {\n\t\t\tk -= passed[p]\n\t\t\tr = i - passed[p] - 1\n\t\t\tbreak\n\t\t}\n\n\t\tpassed[p] = i\n\t\tans[i] = p\n\t\tif i == k {\n\t\t\tfmt.Println(p)\n\t\t\treturn\n\t\t}\n\t}\n\n\tk %= r\n\tfmt.Println(ans[k+1])\n}\n", "language": "Go", "metadata": {"date": 1589163188, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02684.html", "problem_id": "p02684", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02684/input.txt", "sample_output_relpath": "derived/input_output/data/p02684/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02684/Go/s012162583.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s012162583", "user_id": "u461993794"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tsc.Scan()\n\tiv, _ := strconv.Atoi(sc.Text())\n\treturn iv\n}\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc main() {\n\tn, k := scanInt(), scanInt()\n\ta := make([]int, n+1)\n\tfor i := 1; i <= n; i++ {\n\t\ta[i] = scanInt()\n\t}\n\n\tp := 1\n\tans := make([]int, n+1)\n\tans[0] = p\n\tpassed := make(map[int]int)\n\tpassed[p] = 0\n\tvar r int\n\tfor i := 1; i <= n; i++ {\n\t\tp = a[p]\n\t\tif _, ok := passed[p]; ok {\n\t\t\tk -= passed[p]\n\t\t\tr = i - passed[p] - 1\n\t\t\tbreak\n\t\t}\n\n\t\tpassed[p] = i\n\t\tans[i] = p\n\t\tif i == k {\n\t\t\tfmt.Println(p)\n\t\t\treturn\n\t\t}\n\t}\n\n\tk %= r\n\tfmt.Println(ans[k+1])\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "sample_input": "4 5\n3 2 4 1\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02684", "source_text": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 674, "cpu_time_ms": 59, "memory_kb": 15680}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s709758626", "group_id": "codeNet:p02684", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\tstart := 0\n\tfmt.Scan(&n, &k)\n\ta := make([]int, n)\n\tstate := make([]int, n)\n\ttmp := make([]int, 5000000)\n\ttmp[0] = 0\n\tloopLength := 0\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\n\tfor i := 0; i < k; i++ {\n\t\tstart = a[start] - 1\n\t\ttmp[i+1] = start\n\t\tif state[start] == 1 {\n\t\t\tfor j := 0; j < len(tmp); j++ {\n\t\t\t\tif tmp[j] == start {\n\t\t\t\t\ttmp = tmp[j : i+1]\n\t\t\t\t\tloopLength = len(tmp)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tfmt.Println(tmp[(k-i-1)%loopLength] + 1)\n\t\t\treturn\n\t\t} else {\n\t\t\tstate[start] = 1\n\t\t}\n\t}\n\tprintln(start + 1)\n}\n", "language": "Go", "metadata": {"date": 1589162963, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02684.html", "problem_id": "p02684", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02684/input.txt", "sample_output_relpath": "derived/input_output/data/p02684/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02684/Go/s709758626.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s709758626", "user_id": "u541950811"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\tstart := 0\n\tfmt.Scan(&n, &k)\n\ta := make([]int, n)\n\tstate := make([]int, n)\n\ttmp := make([]int, 5000000)\n\ttmp[0] = 0\n\tloopLength := 0\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\n\tfor i := 0; i < k; i++ {\n\t\tstart = a[start] - 1\n\t\ttmp[i+1] = start\n\t\tif state[start] == 1 {\n\t\t\tfor j := 0; j < len(tmp); j++ {\n\t\t\t\tif tmp[j] == start {\n\t\t\t\t\ttmp = tmp[j : i+1]\n\t\t\t\t\tloopLength = len(tmp)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tfmt.Println(tmp[(k-i-1)%loopLength] + 1)\n\t\t\treturn\n\t\t} else {\n\t\t\tstate[start] = 1\n\t\t}\n\t}\n\tprintln(start + 1)\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "sample_input": "4 5\n3 2 4 1\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02684", "source_text": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 579, "cpu_time_ms": 1009, "memory_kb": 18920}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s065336007", "group_id": "codeNet:p02684", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\n\t// PARSE HELPER SESSION\n\n\t// STR := io.Next()\n\t// Log(\"string\", STR)\n\n\t// F := io.NextFloat()\n\t// Log(\"float\", F)\n\n\t// parsing int array\n\tN := io.NextInt()\n\tLogf(\"%v\\n\", N)\n\tK := io.NextInt()\n\tLogf(\"%v\\n\", K)\n\tvar A [200000]int\n\tfor i := 0 ; i < N; i++ {\n\t\tA[i] = io.NextInt()-1\n\t}\n\tLogf(\"A %v\\n\", A[0:10])\n\t// sort.Sort(sort.Reverse(sort.IntSlice(A[:])))\n\t// sort.Sort(sort.IntSlice(A[:]))\n\n\t// find loop\n\tenterloop:=0\n\tloop:=0\n\tplace:=0\n\tvar visited [200000]int\n\tcache := []int{0}\n\tfor i:=0;i enterloop {\n\t\tfor i:=0;i< enterloop + ((K-enterloop) % loop) ;i++ {\n\t\t\tplace = A[place]\n\t\t}\n\t} else {\n\t\tLogf(\"a \\n\")\n\t\tfor i:=0;i< K ;i++ {\n\t\t\tplace = A[place]\n\t\t}\n\t}\n\tfmt.Printf(\"%v\\n\",place+1)\n\n\t// parsing string as byte array\n\t// var s [10000]byte\n\t// var si [10000]int\n\t// str := io.Next()\n\t// for i := 0; i < len(str); i++ {\n\t// \ts[i] = str[i]\n\t// // \"0\" = 48, \"A\" = 65, \"a\" = 97\n\t// si[i] = int(str[i]) - 48\n\t// }\n\t// Log(\"byte array\", s[0:10])\n\n\t// OUTPUT GENERATION PART\n\t// ans := 0\n\t// fmt.Printf(\"%v\\n\", ans)\n\n\t// if ans > 0 {\n\t// fmt.Printf(\"Yes\\n\")\n\t// } else {\n\t// fmt.Printf(\"No\\n\")\n\t// }\n\n\t// BFS/DFS PART\n\t// visited := []int{}\n\t// bfs/dfs(1, neighbor, func(node int) {\n\t// \tvisited = append(visited, node)\n\t// })\n\t// fmt.Println(visited)\n\n\t// DFS 2\n\t// var dp [2000000]int\n\t// nei := make(map[int][]int)\n\t// nei[0] = []int{1, 2}\n\t// nei[1] = []int{0}\n\t// nei[2] = []int{0, 3}\n\t// nei[3] = []int{2}\n\t// dfs2(0, nei, func(n, p int) {\n\t// \tLogf(\"%v -> %v\\n\", p, n)\n\t// \tdp[n] = p\n\t// }, func(n, p int) {\n\t// \tLogf(\"%v -> %v\\n\", n, p)\n\t// })\n\t// Logf(\"%v\\n\", dp[0:5])\n\n\t// COMBINATION\n\t// fmt.Printf(\"%d %d %d\\n\", N, M, intMax(N, M))\n\t// fmt.Printf(\"Lucas %d %d\\n\", combMod(N, M, 13), combination(N, M))\n}\n\n// Libraries\n\n// Io helps parsing inputs from standard input for programming contest.\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\n// NewIo generates Io instance.\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\n// Flush flushes buffer. Don't forget to do this when you call Io.Printf/Io.PrintLn for final output.\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\n// NextLine parses line as string.\nfunc (io *Io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\n// Next parse next word as string.\nfunc (io *Io) Next() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\n// NextInt parse next word as Int.\nfunc (io *Io) NextInt() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\n// NextFloat parses next word as float64.\nfunc (io *Io) NextFloat() float64 {\n\ti, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\n// PrintLn does buffer write with linefeed.\nfunc (io *Io) PrintLn(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\n// Printf does formatted buffer write.\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\n// PrintIntLn prints Int array in a single line.\nfunc (io *Io) PrintIntLn(a []int) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\n// PrintStringLn prints string array in a single line.\nfunc (io *Io) PrintStringLn(a []string) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\n// Log print single value to standard output (contest server ignores this so you don't have to remove when finishing)\nfunc Log(name string, value interface{}) {\n\tfmt.Fprintf(os.Stderr, \"%s=%+v\\n\", name, value)\n}\n\n// Logf print formatted output to standard output (contest server ignores this so you don't have to remove when finishing)\nfunc Logf(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\n}\n\nfunc intMin(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc intMax(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// direct calculation of combination\n// n, m should be \"small\"\nfunc combination(n, m int) int {\n\tif m > n {\n\t\treturn 0\n\t} else if m == n || m == 0 {\n\t\treturn 1\n\t} else {\n\t\tres := 1\n\t\tfor i := 0; i < m; i++ {\n\t\t\tres *= (n - i)\n\t\t}\n\t\tfor i := 1; i <= m; i++ {\n\t\t\tres /= i\n\t\t}\n\t\treturn res\n\t}\n}\n\n// caluclate combination modulo based on Lucas theorem\nfunc lucas(n, m, p int) int {\n\tntemp := n\n\tmtemp := m\n\tres := 1\n\tfor i := 0; i < 100; i++ {\n\t\t// fmt.Printf(\"ntemp: %d\\n\", ntemp)\n\t\tnreminder := ntemp % p\n\t\tntemp = ntemp / p\n\t\tmreminder := mtemp % p\n\t\tmtemp = mtemp / p\n\t\tres = res * (combination(nreminder, mreminder) % p)\n\t\tif ntemp == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn res % p\n}\n\nfunc combMod(n, m, p int) int {\n\treturn lucas(n, m, p)\n}\n\nfunc bfs(start int, nodes map[int][]int, fn func(int)) {\n\tfrontier := []int{start}\n\tvisited := map[int]bool{}\n\tnext := []int{}\n\n\tfor 0 < len(frontier) {\n\t\tnext = []int{}\n\t\tfor _, node := range frontier {\n\t\t\tvisited[node] = true\n\t\t\tfn(node)\n\t\t\tfor _, n := range bfsFrontier(node, nodes, visited) {\n\t\t\t\tnext = append(next, n)\n\t\t\t}\n\t\t}\n\t\tfrontier = next\n\t}\n}\n\nfunc bfsFrontier(node int, nodes map[int][]int, visited map[int]bool) []int {\n\tnext := []int{}\n\titer := func(n int) bool { _, ok := visited[n]; return !ok }\n\tfor _, n := range nodes[node] {\n\t\tif iter(n) {\n\t\t\tnext = append(next, n)\n\t\t}\n\t}\n\treturn next\n}\n\nfunc dfs(node int, nodes map[int][]int, fn func(int)) {\n\tdfsRecur(node, nodes, map[int]bool{}, fn)\n}\n\nfunc dfsRecur(node int, nodes map[int][]int, v map[int]bool, fn func(int)) {\n\tv[node] = true\n\tfn(node)\n\tfor _, n := range nodes[node] {\n\t\tif _, ok := v[n]; !ok {\n\t\t\tdfsRecur(n, nodes, v, fn)\n\t\t}\n\t}\n}\n\n// handles 2 function, one is before entering child tree, and another is\n// after entering child tree.\nfunc dfs2(node int, nodes map[int][]int, fn1, fn2 func(int, int)) {\n\tdfs2Recur(node, -1, nodes, map[int]bool{}, fn1, fn2)\n}\n\nfunc dfs2Recur(node, parent int, nodes map[int][]int, v map[int]bool, fn1, fn2 func(int, int)) {\n\tv[node] = true\n\tif fn1 != nil {\n\t\tfn1(node, parent)\n\t}\n\tfor _, n := range nodes[node] {\n\t\tif _, ok := v[n]; !ok {\n\t\t\tdfs2Recur(n, node, nodes, v, fn1, fn2)\n\t\t}\n\t}\n\tif fn2 != nil {\n\t\tfn2(node, parent)\n\t}\n}\n\n// Stack data structure\ntype Stack struct {\n\ttop *Element\n\tsize int\n}\n\n// Element is a struct for stack element\ntype Element struct {\n\tvalue interface{}\n\tnext *Element\n}\n\n// Len returns stack height\nfunc (s *Stack) Len() int {\n\treturn s.size\n}\n\n// Push put a element on the stack.\nfunc (s *Stack) Push(value interface{}) {\n\ts.top = &Element{value, s.top}\n\ts.size++\n}\n\n// Pop picks out the last element from the stack.\nfunc (s *Stack) Pop() (value interface{}) {\n\tif s.size > 0 {\n\t\tvalue, s.top = s.top.value, s.top.next\n\t\ts.size--\n\t\treturn\n\t}\n\treturn nil\n}\n\n// powerInt (use math.Pow() for float parameters)\nfunc powerInt(n, p int) int {\n\ttmp := 1\n\tfor i := 0; i < n; i++ {\n\t\ttmp *= p\n\t}\n\treturn tmp\n}\n\nfunc findDivisors(n int, a *[]int) {\n\tif n == 1 {\n\t\treturn\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n%i == 0 {\n\t\t\t*a = append(*a, i)\n\t\t\t*a = append(*a, n/i)\n\t\t}\n\t}\n\t*a = append(*a, n)\n}\n\nfunc removeDuplicate(a []int) []int {\n\tm := make(map[int]bool)\n\tfor i := 0; i < len(a); i++ {\n\t\tm[a[i]] = true\n\t}\n\tres := []int{}\n\tfor i := range m {\n\t\tres = append(res, i)\n\t}\n\treturn res\n}\n\n// var gcdmap map[int](map[int]int)\n// func gcd(a, b int) int {\n// \tina := a\n// \tinb := b\n// \tif _, ok := gcdmap[a]; !ok {\n// \t\tgcdmap[a] = make(map[int]int)\n// \t}\n// \tif _, ok := gcdmap[ina][inb]; ok {\n// \t\treturn gcdmap[ina][inb]\n// \t}\n// \tfor b != 0 {\n// \t\tt := b\n// \t\tb = a % b\n// \t\ta = t\n// \t}\n// \tgcdmap[ina][inb] = a\n// \treturn a\n// }\n", "language": "Go", "metadata": {"date": 1589162752, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02684.html", "problem_id": "p02684", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02684/input.txt", "sample_output_relpath": "derived/input_output/data/p02684/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02684/Go/s065336007.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s065336007", "user_id": "u678848631"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\n\t// PARSE HELPER SESSION\n\n\t// STR := io.Next()\n\t// Log(\"string\", STR)\n\n\t// F := io.NextFloat()\n\t// Log(\"float\", F)\n\n\t// parsing int array\n\tN := io.NextInt()\n\tLogf(\"%v\\n\", N)\n\tK := io.NextInt()\n\tLogf(\"%v\\n\", K)\n\tvar A [200000]int\n\tfor i := 0 ; i < N; i++ {\n\t\tA[i] = io.NextInt()-1\n\t}\n\tLogf(\"A %v\\n\", A[0:10])\n\t// sort.Sort(sort.Reverse(sort.IntSlice(A[:])))\n\t// sort.Sort(sort.IntSlice(A[:]))\n\n\t// find loop\n\tenterloop:=0\n\tloop:=0\n\tplace:=0\n\tvar visited [200000]int\n\tcache := []int{0}\n\tfor i:=0;i enterloop {\n\t\tfor i:=0;i< enterloop + ((K-enterloop) % loop) ;i++ {\n\t\t\tplace = A[place]\n\t\t}\n\t} else {\n\t\tLogf(\"a \\n\")\n\t\tfor i:=0;i< K ;i++ {\n\t\t\tplace = A[place]\n\t\t}\n\t}\n\tfmt.Printf(\"%v\\n\",place+1)\n\n\t// parsing string as byte array\n\t// var s [10000]byte\n\t// var si [10000]int\n\t// str := io.Next()\n\t// for i := 0; i < len(str); i++ {\n\t// \ts[i] = str[i]\n\t// // \"0\" = 48, \"A\" = 65, \"a\" = 97\n\t// si[i] = int(str[i]) - 48\n\t// }\n\t// Log(\"byte array\", s[0:10])\n\n\t// OUTPUT GENERATION PART\n\t// ans := 0\n\t// fmt.Printf(\"%v\\n\", ans)\n\n\t// if ans > 0 {\n\t// fmt.Printf(\"Yes\\n\")\n\t// } else {\n\t// fmt.Printf(\"No\\n\")\n\t// }\n\n\t// BFS/DFS PART\n\t// visited := []int{}\n\t// bfs/dfs(1, neighbor, func(node int) {\n\t// \tvisited = append(visited, node)\n\t// })\n\t// fmt.Println(visited)\n\n\t// DFS 2\n\t// var dp [2000000]int\n\t// nei := make(map[int][]int)\n\t// nei[0] = []int{1, 2}\n\t// nei[1] = []int{0}\n\t// nei[2] = []int{0, 3}\n\t// nei[3] = []int{2}\n\t// dfs2(0, nei, func(n, p int) {\n\t// \tLogf(\"%v -> %v\\n\", p, n)\n\t// \tdp[n] = p\n\t// }, func(n, p int) {\n\t// \tLogf(\"%v -> %v\\n\", n, p)\n\t// })\n\t// Logf(\"%v\\n\", dp[0:5])\n\n\t// COMBINATION\n\t// fmt.Printf(\"%d %d %d\\n\", N, M, intMax(N, M))\n\t// fmt.Printf(\"Lucas %d %d\\n\", combMod(N, M, 13), combination(N, M))\n}\n\n// Libraries\n\n// Io helps parsing inputs from standard input for programming contest.\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\n// NewIo generates Io instance.\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\n// Flush flushes buffer. Don't forget to do this when you call Io.Printf/Io.PrintLn for final output.\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\n// NextLine parses line as string.\nfunc (io *Io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\n// Next parse next word as string.\nfunc (io *Io) Next() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\n// NextInt parse next word as Int.\nfunc (io *Io) NextInt() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\n// NextFloat parses next word as float64.\nfunc (io *Io) NextFloat() float64 {\n\ti, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\n// PrintLn does buffer write with linefeed.\nfunc (io *Io) PrintLn(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\n// Printf does formatted buffer write.\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\n// PrintIntLn prints Int array in a single line.\nfunc (io *Io) PrintIntLn(a []int) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\n// PrintStringLn prints string array in a single line.\nfunc (io *Io) PrintStringLn(a []string) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\n// Log print single value to standard output (contest server ignores this so you don't have to remove when finishing)\nfunc Log(name string, value interface{}) {\n\tfmt.Fprintf(os.Stderr, \"%s=%+v\\n\", name, value)\n}\n\n// Logf print formatted output to standard output (contest server ignores this so you don't have to remove when finishing)\nfunc Logf(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\n}\n\nfunc intMin(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc intMax(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// direct calculation of combination\n// n, m should be \"small\"\nfunc combination(n, m int) int {\n\tif m > n {\n\t\treturn 0\n\t} else if m == n || m == 0 {\n\t\treturn 1\n\t} else {\n\t\tres := 1\n\t\tfor i := 0; i < m; i++ {\n\t\t\tres *= (n - i)\n\t\t}\n\t\tfor i := 1; i <= m; i++ {\n\t\t\tres /= i\n\t\t}\n\t\treturn res\n\t}\n}\n\n// caluclate combination modulo based on Lucas theorem\nfunc lucas(n, m, p int) int {\n\tntemp := n\n\tmtemp := m\n\tres := 1\n\tfor i := 0; i < 100; i++ {\n\t\t// fmt.Printf(\"ntemp: %d\\n\", ntemp)\n\t\tnreminder := ntemp % p\n\t\tntemp = ntemp / p\n\t\tmreminder := mtemp % p\n\t\tmtemp = mtemp / p\n\t\tres = res * (combination(nreminder, mreminder) % p)\n\t\tif ntemp == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn res % p\n}\n\nfunc combMod(n, m, p int) int {\n\treturn lucas(n, m, p)\n}\n\nfunc bfs(start int, nodes map[int][]int, fn func(int)) {\n\tfrontier := []int{start}\n\tvisited := map[int]bool{}\n\tnext := []int{}\n\n\tfor 0 < len(frontier) {\n\t\tnext = []int{}\n\t\tfor _, node := range frontier {\n\t\t\tvisited[node] = true\n\t\t\tfn(node)\n\t\t\tfor _, n := range bfsFrontier(node, nodes, visited) {\n\t\t\t\tnext = append(next, n)\n\t\t\t}\n\t\t}\n\t\tfrontier = next\n\t}\n}\n\nfunc bfsFrontier(node int, nodes map[int][]int, visited map[int]bool) []int {\n\tnext := []int{}\n\titer := func(n int) bool { _, ok := visited[n]; return !ok }\n\tfor _, n := range nodes[node] {\n\t\tif iter(n) {\n\t\t\tnext = append(next, n)\n\t\t}\n\t}\n\treturn next\n}\n\nfunc dfs(node int, nodes map[int][]int, fn func(int)) {\n\tdfsRecur(node, nodes, map[int]bool{}, fn)\n}\n\nfunc dfsRecur(node int, nodes map[int][]int, v map[int]bool, fn func(int)) {\n\tv[node] = true\n\tfn(node)\n\tfor _, n := range nodes[node] {\n\t\tif _, ok := v[n]; !ok {\n\t\t\tdfsRecur(n, nodes, v, fn)\n\t\t}\n\t}\n}\n\n// handles 2 function, one is before entering child tree, and another is\n// after entering child tree.\nfunc dfs2(node int, nodes map[int][]int, fn1, fn2 func(int, int)) {\n\tdfs2Recur(node, -1, nodes, map[int]bool{}, fn1, fn2)\n}\n\nfunc dfs2Recur(node, parent int, nodes map[int][]int, v map[int]bool, fn1, fn2 func(int, int)) {\n\tv[node] = true\n\tif fn1 != nil {\n\t\tfn1(node, parent)\n\t}\n\tfor _, n := range nodes[node] {\n\t\tif _, ok := v[n]; !ok {\n\t\t\tdfs2Recur(n, node, nodes, v, fn1, fn2)\n\t\t}\n\t}\n\tif fn2 != nil {\n\t\tfn2(node, parent)\n\t}\n}\n\n// Stack data structure\ntype Stack struct {\n\ttop *Element\n\tsize int\n}\n\n// Element is a struct for stack element\ntype Element struct {\n\tvalue interface{}\n\tnext *Element\n}\n\n// Len returns stack height\nfunc (s *Stack) Len() int {\n\treturn s.size\n}\n\n// Push put a element on the stack.\nfunc (s *Stack) Push(value interface{}) {\n\ts.top = &Element{value, s.top}\n\ts.size++\n}\n\n// Pop picks out the last element from the stack.\nfunc (s *Stack) Pop() (value interface{}) {\n\tif s.size > 0 {\n\t\tvalue, s.top = s.top.value, s.top.next\n\t\ts.size--\n\t\treturn\n\t}\n\treturn nil\n}\n\n// powerInt (use math.Pow() for float parameters)\nfunc powerInt(n, p int) int {\n\ttmp := 1\n\tfor i := 0; i < n; i++ {\n\t\ttmp *= p\n\t}\n\treturn tmp\n}\n\nfunc findDivisors(n int, a *[]int) {\n\tif n == 1 {\n\t\treturn\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n%i == 0 {\n\t\t\t*a = append(*a, i)\n\t\t\t*a = append(*a, n/i)\n\t\t}\n\t}\n\t*a = append(*a, n)\n}\n\nfunc removeDuplicate(a []int) []int {\n\tm := make(map[int]bool)\n\tfor i := 0; i < len(a); i++ {\n\t\tm[a[i]] = true\n\t}\n\tres := []int{}\n\tfor i := range m {\n\t\tres = append(res, i)\n\t}\n\treturn res\n}\n\n// var gcdmap map[int](map[int]int)\n// func gcd(a, b int) int {\n// \tina := a\n// \tinb := b\n// \tif _, ok := gcdmap[a]; !ok {\n// \t\tgcdmap[a] = make(map[int]int)\n// \t}\n// \tif _, ok := gcdmap[ina][inb]; ok {\n// \t\treturn gcdmap[ina][inb]\n// \t}\n// \tfor b != 0 {\n// \t\tt := b\n// \t\tb = a % b\n// \t\ta = t\n// \t}\n// \tgcdmap[ina][inb] = a\n// \treturn a\n// }\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "sample_input": "4 5\n3 2 4 1\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02684", "source_text": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 8553, "cpu_time_ms": 77, "memory_kb": 24272}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s374558255", "group_id": "codeNet:p02684", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tN := getInt()\n\tK := getInt()\n\n\tg := NewGraph(N)\n\n\tfor i := 0; i < N; i++ {\n\t\ta := getInt() - 1\n\t\tg.AddEdge(i, a)\n\t}\n\n\tvisited := make(map[int]struct{})\n\tvar route []int\n\n\tdfs(0, g.edges, visited, &route)\n\n\tloopStart := g.edges[route[len(route) - 1]][0]\n\n\tonceCnt := 0\n\tloopCnt := 0\n\tfor i, v := range route {\n\t\tif v == loopStart {\n\t\t\tonceCnt = i\n\t\t\tloopCnt = len(route) - i\n\t\t\tbreak\n\t\t}\n\t}\n\n\tresult := 0\n\n\tif onceCnt == len(route) - 1{\n\t\tresult = route[K] + 1\n\t} else {\n\t\tif K < onceCnt {\n\t\t\tresult = route[K] + 1\n\t\t} else {\n\t\t\trest := (K - onceCnt) % loopCnt\n\t\t\tresult = route[onceCnt + rest] + 1\n\t\t}\n\t}\n\n\tfmt.Println(result)\n}\n\ntype Graph struct {\n\tn int\n\tedges [][]int\n\tdistances []int\n}\n\nfunc NewGraph(n int) *Graph {\n\tg := &Graph{\n\t\tn: n,\n\t\tedges: make([][]int, n),\n\t\tdistances: make([]int, n),\n\t}\n\treturn g\n}\n\nfunc (g *Graph) AddEdge(u, v int) {\n\t//g.edges[v] = append(g.edges[v], u)\n\tg.edges[u] = append(g.edges[u], v)\n}\n\nfunc dfs(c int, edges [][]int, visited map[int]struct{}, route *[]int) {\n\tvisited[c] = struct{}{}\n\t*route = append(*route, c)\n\n\tfor _, v := range edges[c] {\n\t\t_, flag := visited[v]\n\t\tif flag {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(v, edges, visited, route)\n\t}\n}\n\nfunc bfs(c int, graph *Graph) {\n\tnext := make([]int, 0)\n\tnext = append(next, c)\n\tvisited := make(map[int]struct{})\n\n\tfor ; len(next) != 0; {\n\t\tu := next[0]\n\t\tnext = next[1:]\n\t\tvisited[u] = struct{}{}\n\n\t\tfor _, v := range graph.edges[u] {\n\t\t\t_, flag := visited[v]\n\t\t\tif flag {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tnext = append(next, v)\n\t\t}\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getIntArray(n int) []int {\n\tarray := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getInt()\n\t}\n\treturn array\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc getStringArray(n int) []string {\n\tarray := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getString()\n\t}\n\treturn array\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc powMod(n, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 0 {\n\t\tt := powMod(n, p/2)\n\t\treturn calcMod(t * t)\n\t} else {\n\t\treturn calcMod(n * powMod(n, p-1))\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n%2 == 0 {\n\t\treturn false\n\t}\n\n\tsqrtN := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sqrtN; i += 2 {\n\t\tif n%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}\n\nfunc powerset2(nums []int) [][]int {\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tindex := 0\n\tresult[index] = []int{}\n\tindex++\n\n\tfor _, n := range nums {\n\t\tmax := index\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[index] = copyAndAppend(result[i], n)\n\t\t\tindex++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc calcGcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t} else if x >= y {\n\t\treturn calcGcd(y, x%y)\n\t} else {\n\t\treturn calcGcd(x, y%x)\n\t}\n}\n\nfunc getDivisor(n int) []int {\n\tdivisor := make(map[int]struct{})\n\tdivisor[1] = struct{}{}\n\tif n != 1 {\n\t\tdivisor[n] = struct{}{}\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n%i == 0 {\n\t\t\tdivisor[i] = struct{}{}\n\t\t\tdivisor[n/i] = struct{}{}\n\t\t}\n\t}\n\n\tvar divisorArray []int\n\tfor d := range divisor {\n\t\tdivisorArray = append(divisorArray, d)\n\t}\n\treturn divisorArray\n}\n\ntype intHeap []int\n\nfunc (h intHeap) Len() int {\n\treturn len(h)\n}\n\nfunc (h intHeap) Less(i, j int) bool {\n\treturn h[i] > h[j]\n}\n\nfunc (h intHeap) Swap(i, j int) {\n\th[i], h[j] = h[j], h[i]\n}\n\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc initHeap() *intHeap {\n\tih := &intHeap{}\n\theap.Init(ih)\n\treturn ih\n}\n\nfunc (h *intHeap) pushHeap(n int) {\n\theap.Push(h, n)\n}\n\nfunc (h *intHeap) popHeap() int {\n\treturn heap.Pop(h).(int)\n}\n\nfunc factMod(n int) int {\n\tvalue := 1\n\tfor ; n > 1; n-- {\n\t\tvalue = calcMod(value * n)\n\t}\n\treturn value\n}\n\nfunc combinationMod(n, k int) int {\n\tfactN := factMod(n)\n\tfactK := factMod(k)\n\tfactNK := factMod(n - k)\n\tfactKR := powMod(factK, mod-2)\n\tfactNKR := powMod(factNK, mod-2)\n\treturn calcMod(factN * calcMod(factKR*factNKR))\n}\n\nfunc primeFactors(n int) []int {\n\tfactors := make([]int, 0)\n\ti := 2\n\tfor i*i <= n {\n\t\tr := n % i\n\t\tif r != 0 {\n\t\t\ti += 1\n\t\t} else if r == 0 {\n\t\t\tn /= i\n\t\t\tfactors = append(factors, i)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfactors = append(factors, n)\n\t}\n\treturn factors\n}\n", "language": "Go", "metadata": {"date": 1589162365, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02684.html", "problem_id": "p02684", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02684/input.txt", "sample_output_relpath": "derived/input_output/data/p02684/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02684/Go/s374558255.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s374558255", "user_id": "u964273035"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tN := getInt()\n\tK := getInt()\n\n\tg := NewGraph(N)\n\n\tfor i := 0; i < N; i++ {\n\t\ta := getInt() - 1\n\t\tg.AddEdge(i, a)\n\t}\n\n\tvisited := make(map[int]struct{})\n\tvar route []int\n\n\tdfs(0, g.edges, visited, &route)\n\n\tloopStart := g.edges[route[len(route) - 1]][0]\n\n\tonceCnt := 0\n\tloopCnt := 0\n\tfor i, v := range route {\n\t\tif v == loopStart {\n\t\t\tonceCnt = i\n\t\t\tloopCnt = len(route) - i\n\t\t\tbreak\n\t\t}\n\t}\n\n\tresult := 0\n\n\tif onceCnt == len(route) - 1{\n\t\tresult = route[K] + 1\n\t} else {\n\t\tif K < onceCnt {\n\t\t\tresult = route[K] + 1\n\t\t} else {\n\t\t\trest := (K - onceCnt) % loopCnt\n\t\t\tresult = route[onceCnt + rest] + 1\n\t\t}\n\t}\n\n\tfmt.Println(result)\n}\n\ntype Graph struct {\n\tn int\n\tedges [][]int\n\tdistances []int\n}\n\nfunc NewGraph(n int) *Graph {\n\tg := &Graph{\n\t\tn: n,\n\t\tedges: make([][]int, n),\n\t\tdistances: make([]int, n),\n\t}\n\treturn g\n}\n\nfunc (g *Graph) AddEdge(u, v int) {\n\t//g.edges[v] = append(g.edges[v], u)\n\tg.edges[u] = append(g.edges[u], v)\n}\n\nfunc dfs(c int, edges [][]int, visited map[int]struct{}, route *[]int) {\n\tvisited[c] = struct{}{}\n\t*route = append(*route, c)\n\n\tfor _, v := range edges[c] {\n\t\t_, flag := visited[v]\n\t\tif flag {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(v, edges, visited, route)\n\t}\n}\n\nfunc bfs(c int, graph *Graph) {\n\tnext := make([]int, 0)\n\tnext = append(next, c)\n\tvisited := make(map[int]struct{})\n\n\tfor ; len(next) != 0; {\n\t\tu := next[0]\n\t\tnext = next[1:]\n\t\tvisited[u] = struct{}{}\n\n\t\tfor _, v := range graph.edges[u] {\n\t\t\t_, flag := visited[v]\n\t\t\tif flag {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tnext = append(next, v)\n\t\t}\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getIntArray(n int) []int {\n\tarray := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getInt()\n\t}\n\treturn array\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc getStringArray(n int) []string {\n\tarray := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getString()\n\t}\n\treturn array\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc powMod(n, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 0 {\n\t\tt := powMod(n, p/2)\n\t\treturn calcMod(t * t)\n\t} else {\n\t\treturn calcMod(n * powMod(n, p-1))\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n%2 == 0 {\n\t\treturn false\n\t}\n\n\tsqrtN := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sqrtN; i += 2 {\n\t\tif n%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}\n\nfunc powerset2(nums []int) [][]int {\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tindex := 0\n\tresult[index] = []int{}\n\tindex++\n\n\tfor _, n := range nums {\n\t\tmax := index\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[index] = copyAndAppend(result[i], n)\n\t\t\tindex++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc calcGcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t} else if x >= y {\n\t\treturn calcGcd(y, x%y)\n\t} else {\n\t\treturn calcGcd(x, y%x)\n\t}\n}\n\nfunc getDivisor(n int) []int {\n\tdivisor := make(map[int]struct{})\n\tdivisor[1] = struct{}{}\n\tif n != 1 {\n\t\tdivisor[n] = struct{}{}\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n%i == 0 {\n\t\t\tdivisor[i] = struct{}{}\n\t\t\tdivisor[n/i] = struct{}{}\n\t\t}\n\t}\n\n\tvar divisorArray []int\n\tfor d := range divisor {\n\t\tdivisorArray = append(divisorArray, d)\n\t}\n\treturn divisorArray\n}\n\ntype intHeap []int\n\nfunc (h intHeap) Len() int {\n\treturn len(h)\n}\n\nfunc (h intHeap) Less(i, j int) bool {\n\treturn h[i] > h[j]\n}\n\nfunc (h intHeap) Swap(i, j int) {\n\th[i], h[j] = h[j], h[i]\n}\n\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc initHeap() *intHeap {\n\tih := &intHeap{}\n\theap.Init(ih)\n\treturn ih\n}\n\nfunc (h *intHeap) pushHeap(n int) {\n\theap.Push(h, n)\n}\n\nfunc (h *intHeap) popHeap() int {\n\treturn heap.Pop(h).(int)\n}\n\nfunc factMod(n int) int {\n\tvalue := 1\n\tfor ; n > 1; n-- {\n\t\tvalue = calcMod(value * n)\n\t}\n\treturn value\n}\n\nfunc combinationMod(n, k int) int {\n\tfactN := factMod(n)\n\tfactK := factMod(k)\n\tfactNK := factMod(n - k)\n\tfactKR := powMod(factK, mod-2)\n\tfactNKR := powMod(factNK, mod-2)\n\treturn calcMod(factN * calcMod(factKR*factNKR))\n}\n\nfunc primeFactors(n int) []int {\n\tfactors := make([]int, 0)\n\ti := 2\n\tfor i*i <= n {\n\t\tr := n % i\n\t\tif r != 0 {\n\t\t\ti += 1\n\t\t} else if r == 0 {\n\t\t\tn /= i\n\t\t\tfactors = append(factors, i)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfactors = append(factors, n)\n\t}\n\treturn factors\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "sample_input": "4 5\n3 2 4 1\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02684", "source_text": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6204, "cpu_time_ms": 167, "memory_kb": 66328}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s938601528", "group_id": "codeNet:p02684", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype town struct {\n\ta int\n\tb int\n}\n\nfunc main() {\n\tn := readi()\n\tk := readi()\n\taa := make([]town, n)\n\tfor i := range aa {\n\t\tfmt.Scan(&aa[i].a)\n\t}\n\tvar t, t2, t3, i int\n\tfor ; i < k; i++ {\n\t\tif t2 == 0 && aa[t].b == 2 {\n\t\t\tt2 = i\n\t\t}\n\t\tif aa[t].b == 3 {\n\t\t\tt3 = i\n\t\t\tm := (k - t2) % (t3-t2)\n\t\t\tfor i = 0; i < m; i++ {\n\t\t\t\tt = aa[t].a-1\n\t\t\t}\n\t\t\tfmt.Println(t+1)\n\t\t\treturn\n\t\t}\n\t\taa[t].b++\n\t\tt = aa[t].a-1\n\t}\n\tfmt.Println(t+1)\n}\n\n// IO---------------------------------------------------\n\nfunc readi() (n int) {\n\tfmt.Scan(&n)\n\treturn\n}\n\nfunc readf() (n float64) {\n\tfmt.Scan(&n)\n\treturn\n}\n\nfunc reads() (n string) {\n\tfmt.Scan(&n)\n\treturn\n}\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc readSlice() []string {\n\treturn strings.Split(readLine(), \" \")\n}\n\nfunc atoi(a []string) (b []int) {\n\tb = make([]int, len(a))\n\tfor i := range a {\n\t\tb[i], _ = strconv.Atoi(a[i])\n\t}\n\treturn\n}\n\nfunc atof(a []string) (b []float64) {\n\tb = make([]float64, len(a))\n\tfor i := range a {\n\t\tb[i], _ = strconv.ParseFloat(a[i], 64)\n\t}\n\treturn\n}\n\nfunc readSlice2(n int) (a []int, b []int) {\n\ta = make([]int, n)\n\tb = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i], &b[i])\n\t}\n\treturn\n}\n\nfunc readFloatSlice2(n int) (a []float64, b []float64) {\n\ta = make([]float64, n)\n\tb = make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i], &b[i])\n\t}\n\treturn\n}\n\nfunc yesOrNo(b bool) {\n\tif b {\n\t\tfmt.Println(\"Yes\")\n\t\treturn\n\t}\n\tfmt.Println(\"No\")\n}\n\nfunc yesorNO(b bool) {\n\tif b {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\tfmt.Println(\"NO\")\n}\n\nfunc yesorno(b bool) {\n\tif b {\n\t\tfmt.Println(\"yes\")\n\t\treturn\n\t}\n\tfmt.Println(\"no\")\n}\n\n// calc---------------------------------------------------\n\nfunc abs(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc ave(a []int) (ave int) {\n\tfor i := 0; i < len(a); i++ {\n\t\tave += a[i]\n\t}\n\tave /= len(a)\n\treturn\n}\n\nfunc eq(a []string, b []string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] != b[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc max(a ...int) int {\n\tmax := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tif max < a[i] {\n\t\t\tmax = a[i]\n\t\t}\n\t}\n\treturn max\n}\n\nfunc min(a ...int) int {\n\tmin := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tif min > a[i] {\n\t\t\tmin = a[i]\n\t\t}\n\t}\n\treturn min\n}\n\nfunc mid(a []int) int {\n\tsort.Ints(a)\n\treturn a[len(a)/2]\n}\n\nfunc sum(a []int) (ans int) {\n\tfor i := range a {\n\t\tans += a[i]\n\t}\n\treturn\n}\n", "language": "Go", "metadata": {"date": 1589162269, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02684.html", "problem_id": "p02684", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02684/input.txt", "sample_output_relpath": "derived/input_output/data/p02684/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02684/Go/s938601528.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s938601528", "user_id": "u963686413"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype town struct {\n\ta int\n\tb int\n}\n\nfunc main() {\n\tn := readi()\n\tk := readi()\n\taa := make([]town, n)\n\tfor i := range aa {\n\t\tfmt.Scan(&aa[i].a)\n\t}\n\tvar t, t2, t3, i int\n\tfor ; i < k; i++ {\n\t\tif t2 == 0 && aa[t].b == 2 {\n\t\t\tt2 = i\n\t\t}\n\t\tif aa[t].b == 3 {\n\t\t\tt3 = i\n\t\t\tm := (k - t2) % (t3-t2)\n\t\t\tfor i = 0; i < m; i++ {\n\t\t\t\tt = aa[t].a-1\n\t\t\t}\n\t\t\tfmt.Println(t+1)\n\t\t\treturn\n\t\t}\n\t\taa[t].b++\n\t\tt = aa[t].a-1\n\t}\n\tfmt.Println(t+1)\n}\n\n// IO---------------------------------------------------\n\nfunc readi() (n int) {\n\tfmt.Scan(&n)\n\treturn\n}\n\nfunc readf() (n float64) {\n\tfmt.Scan(&n)\n\treturn\n}\n\nfunc reads() (n string) {\n\tfmt.Scan(&n)\n\treturn\n}\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc readSlice() []string {\n\treturn strings.Split(readLine(), \" \")\n}\n\nfunc atoi(a []string) (b []int) {\n\tb = make([]int, len(a))\n\tfor i := range a {\n\t\tb[i], _ = strconv.Atoi(a[i])\n\t}\n\treturn\n}\n\nfunc atof(a []string) (b []float64) {\n\tb = make([]float64, len(a))\n\tfor i := range a {\n\t\tb[i], _ = strconv.ParseFloat(a[i], 64)\n\t}\n\treturn\n}\n\nfunc readSlice2(n int) (a []int, b []int) {\n\ta = make([]int, n)\n\tb = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i], &b[i])\n\t}\n\treturn\n}\n\nfunc readFloatSlice2(n int) (a []float64, b []float64) {\n\ta = make([]float64, n)\n\tb = make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i], &b[i])\n\t}\n\treturn\n}\n\nfunc yesOrNo(b bool) {\n\tif b {\n\t\tfmt.Println(\"Yes\")\n\t\treturn\n\t}\n\tfmt.Println(\"No\")\n}\n\nfunc yesorNO(b bool) {\n\tif b {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\tfmt.Println(\"NO\")\n}\n\nfunc yesorno(b bool) {\n\tif b {\n\t\tfmt.Println(\"yes\")\n\t\treturn\n\t}\n\tfmt.Println(\"no\")\n}\n\n// calc---------------------------------------------------\n\nfunc abs(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc ave(a []int) (ave int) {\n\tfor i := 0; i < len(a); i++ {\n\t\tave += a[i]\n\t}\n\tave /= len(a)\n\treturn\n}\n\nfunc eq(a []string, b []string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] != b[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc max(a ...int) int {\n\tmax := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tif max < a[i] {\n\t\t\tmax = a[i]\n\t\t}\n\t}\n\treturn max\n}\n\nfunc min(a ...int) int {\n\tmin := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tif min > a[i] {\n\t\t\tmin = a[i]\n\t\t}\n\t}\n\treturn min\n}\n\nfunc mid(a []int) int {\n\tsort.Ints(a)\n\treturn a[len(a)/2]\n}\n\nfunc sum(a []int) (ans int) {\n\tfor i := range a {\n\t\tans += a[i]\n\t}\n\treturn\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "sample_input": "4 5\n3 2 4 1\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02684", "source_text": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2690, "cpu_time_ms": 990, "memory_kb": 9668}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s412508020", "group_id": "codeNet:p02684", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scan(&n, &k)\n\n\tas := make([]int, n+1)\n\tfor i := 1; i <= n; i++ {\n\t\tfmt.Scan(&as[i])\n\t}\n\n\tds := make([]int, n+1)\n\n\tcur := 1\n\tfor i := 1; i <= k; i++ {\n\t\tcur = as[cur]\n\t\tif ds[cur] == 0 {\n\t\t\tds[cur] = i\n\t\t\tcontinue\n\t\t}\n\n\t\td := i - ds[cur]\n\t\tif d <= k-i {\n\t\t\ti += (k - i) / d * d\n\t\t}\n\t}\n\n\tfmt.Println(cur)\n}\n", "language": "Go", "metadata": {"date": 1589162015, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02684.html", "problem_id": "p02684", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02684/input.txt", "sample_output_relpath": "derived/input_output/data/p02684/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02684/Go/s412508020.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s412508020", "user_id": "u902409225"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scan(&n, &k)\n\n\tas := make([]int, n+1)\n\tfor i := 1; i <= n; i++ {\n\t\tfmt.Scan(&as[i])\n\t}\n\n\tds := make([]int, n+1)\n\n\tcur := 1\n\tfor i := 1; i <= k; i++ {\n\t\tcur = as[cur]\n\t\tif ds[cur] == 0 {\n\t\t\tds[cur] = i\n\t\t\tcontinue\n\t\t}\n\n\t\td := i - ds[cur]\n\t\tif d <= k-i {\n\t\t\ti += (k - i) / d * d\n\t\t}\n\t}\n\n\tfmt.Println(cur)\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "sample_input": "4 5\n3 2 4 1\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02684", "source_text": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 993, "memory_kb": 8100}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s882433417", "group_id": "codeNet:p02684", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\n\t// PARSE HELPER SESSION\n\n\t// STR := io.Next()\n\t// Log(\"string\", STR)\n\n\t// F := io.NextFloat()\n\t// Log(\"float\", F)\n\n\t// parsing int array\n\tN := io.NextInt()\n\tLogf(\"%v\\n\", N)\n\tK := io.NextInt()\n\tLogf(\"%v\\n\", K)\n\tvar A [200000]int\n\tfor i := 0 ; i < N; i++ {\n\t\tA[i] = io.NextInt()-1\n\t}\n\tLogf(\"A %v\\n\", A[0:10])\n\t// sort.Sort(sort.Reverse(sort.IntSlice(A[:])))\n\t// sort.Sort(sort.IntSlice(A[:]))\n\n\t// find loop\n\tenterloop:=0\n\tloop:=1\n\tplace:=0\n\tvar visited [200000]int\n\tfor i:=0;i 0 {\n\t// fmt.Printf(\"Yes\\n\")\n\t// } else {\n\t// fmt.Printf(\"No\\n\")\n\t// }\n\n\t// BFS/DFS PART\n\t// visited := []int{}\n\t// bfs/dfs(1, neighbor, func(node int) {\n\t// \tvisited = append(visited, node)\n\t// })\n\t// fmt.Println(visited)\n\n\t// DFS 2\n\t// var dp [2000000]int\n\t// nei := make(map[int][]int)\n\t// nei[0] = []int{1, 2}\n\t// nei[1] = []int{0}\n\t// nei[2] = []int{0, 3}\n\t// nei[3] = []int{2}\n\t// dfs2(0, nei, func(n, p int) {\n\t// \tLogf(\"%v -> %v\\n\", p, n)\n\t// \tdp[n] = p\n\t// }, func(n, p int) {\n\t// \tLogf(\"%v -> %v\\n\", n, p)\n\t// })\n\t// Logf(\"%v\\n\", dp[0:5])\n\n\t// COMBINATION\n\t// fmt.Printf(\"%d %d %d\\n\", N, M, intMax(N, M))\n\t// fmt.Printf(\"Lucas %d %d\\n\", combMod(N, M, 13), combination(N, M))\n}\n\n// Libraries\n\n// Io helps parsing inputs from standard input for programming contest.\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\n// NewIo generates Io instance.\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\n// Flush flushes buffer. Don't forget to do this when you call Io.Printf/Io.PrintLn for final output.\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\n// NextLine parses line as string.\nfunc (io *Io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\n// Next parse next word as string.\nfunc (io *Io) Next() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\n// NextInt parse next word as Int.\nfunc (io *Io) NextInt() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\n// NextFloat parses next word as float64.\nfunc (io *Io) NextFloat() float64 {\n\ti, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\n// PrintLn does buffer write with linefeed.\nfunc (io *Io) PrintLn(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\n// Printf does formatted buffer write.\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\n// PrintIntLn prints Int array in a single line.\nfunc (io *Io) PrintIntLn(a []int) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\n// PrintStringLn prints string array in a single line.\nfunc (io *Io) PrintStringLn(a []string) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\n// Log print single value to standard output (contest server ignores this so you don't have to remove when finishing)\nfunc Log(name string, value interface{}) {\n\tfmt.Fprintf(os.Stderr, \"%s=%+v\\n\", name, value)\n}\n\n// Logf print formatted output to standard output (contest server ignores this so you don't have to remove when finishing)\nfunc Logf(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\n}\n\nfunc intMin(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc intMax(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// direct calculation of combination\n// n, m should be \"small\"\nfunc combination(n, m int) int {\n\tif m > n {\n\t\treturn 0\n\t} else if m == n || m == 0 {\n\t\treturn 1\n\t} else {\n\t\tres := 1\n\t\tfor i := 0; i < m; i++ {\n\t\t\tres *= (n - i)\n\t\t}\n\t\tfor i := 1; i <= m; i++ {\n\t\t\tres /= i\n\t\t}\n\t\treturn res\n\t}\n}\n\n// caluclate combination modulo based on Lucas theorem\nfunc lucas(n, m, p int) int {\n\tntemp := n\n\tmtemp := m\n\tres := 1\n\tfor i := 0; i < 100; i++ {\n\t\t// fmt.Printf(\"ntemp: %d\\n\", ntemp)\n\t\tnreminder := ntemp % p\n\t\tntemp = ntemp / p\n\t\tmreminder := mtemp % p\n\t\tmtemp = mtemp / p\n\t\tres = res * (combination(nreminder, mreminder) % p)\n\t\tif ntemp == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn res % p\n}\n\nfunc combMod(n, m, p int) int {\n\treturn lucas(n, m, p)\n}\n\nfunc bfs(start int, nodes map[int][]int, fn func(int)) {\n\tfrontier := []int{start}\n\tvisited := map[int]bool{}\n\tnext := []int{}\n\n\tfor 0 < len(frontier) {\n\t\tnext = []int{}\n\t\tfor _, node := range frontier {\n\t\t\tvisited[node] = true\n\t\t\tfn(node)\n\t\t\tfor _, n := range bfsFrontier(node, nodes, visited) {\n\t\t\t\tnext = append(next, n)\n\t\t\t}\n\t\t}\n\t\tfrontier = next\n\t}\n}\n\nfunc bfsFrontier(node int, nodes map[int][]int, visited map[int]bool) []int {\n\tnext := []int{}\n\titer := func(n int) bool { _, ok := visited[n]; return !ok }\n\tfor _, n := range nodes[node] {\n\t\tif iter(n) {\n\t\t\tnext = append(next, n)\n\t\t}\n\t}\n\treturn next\n}\n\nfunc dfs(node int, nodes map[int][]int, fn func(int)) {\n\tdfsRecur(node, nodes, map[int]bool{}, fn)\n}\n\nfunc dfsRecur(node int, nodes map[int][]int, v map[int]bool, fn func(int)) {\n\tv[node] = true\n\tfn(node)\n\tfor _, n := range nodes[node] {\n\t\tif _, ok := v[n]; !ok {\n\t\t\tdfsRecur(n, nodes, v, fn)\n\t\t}\n\t}\n}\n\n// handles 2 function, one is before entering child tree, and another is\n// after entering child tree.\nfunc dfs2(node int, nodes map[int][]int, fn1, fn2 func(int, int)) {\n\tdfs2Recur(node, -1, nodes, map[int]bool{}, fn1, fn2)\n}\n\nfunc dfs2Recur(node, parent int, nodes map[int][]int, v map[int]bool, fn1, fn2 func(int, int)) {\n\tv[node] = true\n\tif fn1 != nil {\n\t\tfn1(node, parent)\n\t}\n\tfor _, n := range nodes[node] {\n\t\tif _, ok := v[n]; !ok {\n\t\t\tdfs2Recur(n, node, nodes, v, fn1, fn2)\n\t\t}\n\t}\n\tif fn2 != nil {\n\t\tfn2(node, parent)\n\t}\n}\n\n// Stack data structure\ntype Stack struct {\n\ttop *Element\n\tsize int\n}\n\n// Element is a struct for stack element\ntype Element struct {\n\tvalue interface{}\n\tnext *Element\n}\n\n// Len returns stack height\nfunc (s *Stack) Len() int {\n\treturn s.size\n}\n\n// Push put a element on the stack.\nfunc (s *Stack) Push(value interface{}) {\n\ts.top = &Element{value, s.top}\n\ts.size++\n}\n\n// Pop picks out the last element from the stack.\nfunc (s *Stack) Pop() (value interface{}) {\n\tif s.size > 0 {\n\t\tvalue, s.top = s.top.value, s.top.next\n\t\ts.size--\n\t\treturn\n\t}\n\treturn nil\n}\n\n// powerInt (use math.Pow() for float parameters)\nfunc powerInt(n, p int) int {\n\ttmp := 1\n\tfor i := 0; i < n; i++ {\n\t\ttmp *= p\n\t}\n\treturn tmp\n}\n\nfunc findDivisors(n int, a *[]int) {\n\tif n == 1 {\n\t\treturn\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n%i == 0 {\n\t\t\t*a = append(*a, i)\n\t\t\t*a = append(*a, n/i)\n\t\t}\n\t}\n\t*a = append(*a, n)\n}\n\nfunc removeDuplicate(a []int) []int {\n\tm := make(map[int]bool)\n\tfor i := 0; i < len(a); i++ {\n\t\tm[a[i]] = true\n\t}\n\tres := []int{}\n\tfor i := range m {\n\t\tres = append(res, i)\n\t}\n\treturn res\n}\n\n// var gcdmap map[int](map[int]int)\n// func gcd(a, b int) int {\n// \tina := a\n// \tinb := b\n// \tif _, ok := gcdmap[a]; !ok {\n// \t\tgcdmap[a] = make(map[int]int)\n// \t}\n// \tif _, ok := gcdmap[ina][inb]; ok {\n// \t\treturn gcdmap[ina][inb]\n// \t}\n// \tfor b != 0 {\n// \t\tt := b\n// \t\tb = a % b\n// \t\ta = t\n// \t}\n// \tgcdmap[ina][inb] = a\n// \treturn a\n// }\n", "language": "Go", "metadata": {"date": 1589161557, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02684.html", "problem_id": "p02684", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02684/input.txt", "sample_output_relpath": "derived/input_output/data/p02684/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02684/Go/s882433417.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s882433417", "user_id": "u678848631"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\n\t// PARSE HELPER SESSION\n\n\t// STR := io.Next()\n\t// Log(\"string\", STR)\n\n\t// F := io.NextFloat()\n\t// Log(\"float\", F)\n\n\t// parsing int array\n\tN := io.NextInt()\n\tLogf(\"%v\\n\", N)\n\tK := io.NextInt()\n\tLogf(\"%v\\n\", K)\n\tvar A [200000]int\n\tfor i := 0 ; i < N; i++ {\n\t\tA[i] = io.NextInt()-1\n\t}\n\tLogf(\"A %v\\n\", A[0:10])\n\t// sort.Sort(sort.Reverse(sort.IntSlice(A[:])))\n\t// sort.Sort(sort.IntSlice(A[:]))\n\n\t// find loop\n\tenterloop:=0\n\tloop:=1\n\tplace:=0\n\tvar visited [200000]int\n\tfor i:=0;i 0 {\n\t// fmt.Printf(\"Yes\\n\")\n\t// } else {\n\t// fmt.Printf(\"No\\n\")\n\t// }\n\n\t// BFS/DFS PART\n\t// visited := []int{}\n\t// bfs/dfs(1, neighbor, func(node int) {\n\t// \tvisited = append(visited, node)\n\t// })\n\t// fmt.Println(visited)\n\n\t// DFS 2\n\t// var dp [2000000]int\n\t// nei := make(map[int][]int)\n\t// nei[0] = []int{1, 2}\n\t// nei[1] = []int{0}\n\t// nei[2] = []int{0, 3}\n\t// nei[3] = []int{2}\n\t// dfs2(0, nei, func(n, p int) {\n\t// \tLogf(\"%v -> %v\\n\", p, n)\n\t// \tdp[n] = p\n\t// }, func(n, p int) {\n\t// \tLogf(\"%v -> %v\\n\", n, p)\n\t// })\n\t// Logf(\"%v\\n\", dp[0:5])\n\n\t// COMBINATION\n\t// fmt.Printf(\"%d %d %d\\n\", N, M, intMax(N, M))\n\t// fmt.Printf(\"Lucas %d %d\\n\", combMod(N, M, 13), combination(N, M))\n}\n\n// Libraries\n\n// Io helps parsing inputs from standard input for programming contest.\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\n// NewIo generates Io instance.\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\n// Flush flushes buffer. Don't forget to do this when you call Io.Printf/Io.PrintLn for final output.\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\n// NextLine parses line as string.\nfunc (io *Io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\n// Next parse next word as string.\nfunc (io *Io) Next() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\n// NextInt parse next word as Int.\nfunc (io *Io) NextInt() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\n// NextFloat parses next word as float64.\nfunc (io *Io) NextFloat() float64 {\n\ti, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\n// PrintLn does buffer write with linefeed.\nfunc (io *Io) PrintLn(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\n// Printf does formatted buffer write.\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\n// PrintIntLn prints Int array in a single line.\nfunc (io *Io) PrintIntLn(a []int) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\n// PrintStringLn prints string array in a single line.\nfunc (io *Io) PrintStringLn(a []string) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\n// Log print single value to standard output (contest server ignores this so you don't have to remove when finishing)\nfunc Log(name string, value interface{}) {\n\tfmt.Fprintf(os.Stderr, \"%s=%+v\\n\", name, value)\n}\n\n// Logf print formatted output to standard output (contest server ignores this so you don't have to remove when finishing)\nfunc Logf(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\n}\n\nfunc intMin(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc intMax(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// direct calculation of combination\n// n, m should be \"small\"\nfunc combination(n, m int) int {\n\tif m > n {\n\t\treturn 0\n\t} else if m == n || m == 0 {\n\t\treturn 1\n\t} else {\n\t\tres := 1\n\t\tfor i := 0; i < m; i++ {\n\t\t\tres *= (n - i)\n\t\t}\n\t\tfor i := 1; i <= m; i++ {\n\t\t\tres /= i\n\t\t}\n\t\treturn res\n\t}\n}\n\n// caluclate combination modulo based on Lucas theorem\nfunc lucas(n, m, p int) int {\n\tntemp := n\n\tmtemp := m\n\tres := 1\n\tfor i := 0; i < 100; i++ {\n\t\t// fmt.Printf(\"ntemp: %d\\n\", ntemp)\n\t\tnreminder := ntemp % p\n\t\tntemp = ntemp / p\n\t\tmreminder := mtemp % p\n\t\tmtemp = mtemp / p\n\t\tres = res * (combination(nreminder, mreminder) % p)\n\t\tif ntemp == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn res % p\n}\n\nfunc combMod(n, m, p int) int {\n\treturn lucas(n, m, p)\n}\n\nfunc bfs(start int, nodes map[int][]int, fn func(int)) {\n\tfrontier := []int{start}\n\tvisited := map[int]bool{}\n\tnext := []int{}\n\n\tfor 0 < len(frontier) {\n\t\tnext = []int{}\n\t\tfor _, node := range frontier {\n\t\t\tvisited[node] = true\n\t\t\tfn(node)\n\t\t\tfor _, n := range bfsFrontier(node, nodes, visited) {\n\t\t\t\tnext = append(next, n)\n\t\t\t}\n\t\t}\n\t\tfrontier = next\n\t}\n}\n\nfunc bfsFrontier(node int, nodes map[int][]int, visited map[int]bool) []int {\n\tnext := []int{}\n\titer := func(n int) bool { _, ok := visited[n]; return !ok }\n\tfor _, n := range nodes[node] {\n\t\tif iter(n) {\n\t\t\tnext = append(next, n)\n\t\t}\n\t}\n\treturn next\n}\n\nfunc dfs(node int, nodes map[int][]int, fn func(int)) {\n\tdfsRecur(node, nodes, map[int]bool{}, fn)\n}\n\nfunc dfsRecur(node int, nodes map[int][]int, v map[int]bool, fn func(int)) {\n\tv[node] = true\n\tfn(node)\n\tfor _, n := range nodes[node] {\n\t\tif _, ok := v[n]; !ok {\n\t\t\tdfsRecur(n, nodes, v, fn)\n\t\t}\n\t}\n}\n\n// handles 2 function, one is before entering child tree, and another is\n// after entering child tree.\nfunc dfs2(node int, nodes map[int][]int, fn1, fn2 func(int, int)) {\n\tdfs2Recur(node, -1, nodes, map[int]bool{}, fn1, fn2)\n}\n\nfunc dfs2Recur(node, parent int, nodes map[int][]int, v map[int]bool, fn1, fn2 func(int, int)) {\n\tv[node] = true\n\tif fn1 != nil {\n\t\tfn1(node, parent)\n\t}\n\tfor _, n := range nodes[node] {\n\t\tif _, ok := v[n]; !ok {\n\t\t\tdfs2Recur(n, node, nodes, v, fn1, fn2)\n\t\t}\n\t}\n\tif fn2 != nil {\n\t\tfn2(node, parent)\n\t}\n}\n\n// Stack data structure\ntype Stack struct {\n\ttop *Element\n\tsize int\n}\n\n// Element is a struct for stack element\ntype Element struct {\n\tvalue interface{}\n\tnext *Element\n}\n\n// Len returns stack height\nfunc (s *Stack) Len() int {\n\treturn s.size\n}\n\n// Push put a element on the stack.\nfunc (s *Stack) Push(value interface{}) {\n\ts.top = &Element{value, s.top}\n\ts.size++\n}\n\n// Pop picks out the last element from the stack.\nfunc (s *Stack) Pop() (value interface{}) {\n\tif s.size > 0 {\n\t\tvalue, s.top = s.top.value, s.top.next\n\t\ts.size--\n\t\treturn\n\t}\n\treturn nil\n}\n\n// powerInt (use math.Pow() for float parameters)\nfunc powerInt(n, p int) int {\n\ttmp := 1\n\tfor i := 0; i < n; i++ {\n\t\ttmp *= p\n\t}\n\treturn tmp\n}\n\nfunc findDivisors(n int, a *[]int) {\n\tif n == 1 {\n\t\treturn\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n%i == 0 {\n\t\t\t*a = append(*a, i)\n\t\t\t*a = append(*a, n/i)\n\t\t}\n\t}\n\t*a = append(*a, n)\n}\n\nfunc removeDuplicate(a []int) []int {\n\tm := make(map[int]bool)\n\tfor i := 0; i < len(a); i++ {\n\t\tm[a[i]] = true\n\t}\n\tres := []int{}\n\tfor i := range m {\n\t\tres = append(res, i)\n\t}\n\treturn res\n}\n\n// var gcdmap map[int](map[int]int)\n// func gcd(a, b int) int {\n// \tina := a\n// \tinb := b\n// \tif _, ok := gcdmap[a]; !ok {\n// \t\tgcdmap[a] = make(map[int]int)\n// \t}\n// \tif _, ok := gcdmap[ina][inb]; ok {\n// \t\treturn gcdmap[ina][inb]\n// \t}\n// \tfor b != 0 {\n// \t\tt := b\n// \t\tb = a % b\n// \t\ta = t\n// \t}\n// \tgcdmap[ina][inb] = a\n// \treturn a\n// }\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "sample_input": "4 5\n3 2 4 1\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02684", "source_text": "Score: 400 points\n\nProblem Statement\n\nThe Kingdom of Takahashi has N towns, numbered 1 through N.\n\nThere is one teleporter in each town. The teleporter in Town i (1 \\leq i \\leq N) sends you to Town A_i.\n\nTakahashi, the king, loves the positive integer K. The selfish king wonders what town he will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nHelp the king by writing a program that answers this question.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\n1 \\leq K \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the integer representing the town the king will be in if he starts at Town 1 and uses a teleporter exactly K times from there.\n\nSample Input 1\n\n4 5\n3 2 4 1\n\nSample Output 1\n\n4\n\nIf we start at Town 1 and use the teleporter 5 times, our travel will be as follows: 1 \\to 3 \\to 4 \\to 1 \\to 3 \\to 4.\n\nSample Input 2\n\n6 727202214173249351\n6 5 2 5 3 2\n\nSample Output 2\n\n2", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 8211, "cpu_time_ms": 40, "memory_kb": 14156}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s319813675", "group_id": "codeNet:p02700", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, c, d int\n\tfmt.Scan(&a, &b, &c, &d)\n\n\tfor {\n\t\tif c <= 0 {\n\t\t\tfmt.Println(\"Yes\")\n\t\t\tbreak\n\t\t} else {\n\t\t\tc -= b\n\t\t}\n\n\t\tif a <= 0 {\n\t\t\tfmt.Println(\"No\")\n\t\t\tbreak\n\t\t} else {\n\t\t\ta -= d\n\t\t}\n\t}\n}", "language": "Go", "metadata": {"date": 1591247622, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02700.html", "problem_id": "p02700", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02700/input.txt", "sample_output_relpath": "derived/input_output/data/p02700/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02700/Go/s319813675.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s319813675", "user_id": "u473974118"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, c, d int\n\tfmt.Scan(&a, &b, &c, &d)\n\n\tfor {\n\t\tif c <= 0 {\n\t\t\tfmt.Println(\"Yes\")\n\t\t\tbreak\n\t\t} else {\n\t\t\tc -= b\n\t\t}\n\n\t\tif a <= 0 {\n\t\t\tfmt.Println(\"No\")\n\t\t\tbreak\n\t\t} else {\n\t\t\ta -= d\n\t\t}\n\t}\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi and Aoki will have a battle using their monsters.\n\nThe health and strength of Takahashi's monster are A and B, respectively, and those of Aoki's monster are C and D, respectively.\n\nThe two monsters will take turns attacking, in the order Takahashi's, Aoki's, Takahashi's, Aoki's, ...\nHere, an attack decreases the opponent's health by the value equal to the attacker's strength.\nThe monsters keep attacking until the health of one monster becomes 0 or below. The person with the monster whose health becomes 0 or below loses, and the other person wins.\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nConstraints\n\n1 \\leq A,B,C,D \\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 C D\n\nOutput\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nSample Input 1\n\n10 9 10 10\n\nSample Output 1\n\nNo\n\nFirst, Takahashi's monster attacks Aoki's monster, whose health is now 10-9=1.\n\nNext, Aoki's monster attacks Takahashi's monster, whose health is now 10-10=0.\n\nTakahashi's monster is the first to have 0 or less health, so Takahashi loses.\n\nSample Input 2\n\n46 4 40 5\n\nSample Output 2\n\nYes", "sample_input": "10 9 10 10\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02700", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi and Aoki will have a battle using their monsters.\n\nThe health and strength of Takahashi's monster are A and B, respectively, and those of Aoki's monster are C and D, respectively.\n\nThe two monsters will take turns attacking, in the order Takahashi's, Aoki's, Takahashi's, Aoki's, ...\nHere, an attack decreases the opponent's health by the value equal to the attacker's strength.\nThe monsters keep attacking until the health of one monster becomes 0 or below. The person with the monster whose health becomes 0 or below loses, and the other person wins.\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nConstraints\n\n1 \\leq A,B,C,D \\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 C D\n\nOutput\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nSample Input 1\n\n10 9 10 10\n\nSample Output 1\n\nNo\n\nFirst, Takahashi's monster attacks Aoki's monster, whose health is now 10-9=1.\n\nNext, Aoki's monster attacks Takahashi's monster, whose health is now 10-10=0.\n\nTakahashi's monster is the first to have 0 or less health, so Takahashi loses.\n\nSample Input 2\n\n46 4 40 5\n\nSample Output 2\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 240, "cpu_time_ms": 2, "memory_kb": 1756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s539049379", "group_id": "codeNet:p02700", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar A, B int\n\tvar C, D int\n\tvar f = 0\n\n\tfmt.Scan(&A, &B);\n\tfmt.Scan(&C, &D);\n\n\tfor {\n\t\tC -= B \n\t\tif C <= 0 {\n\t\t\tf = 1;\n\t\t\tbreak;\n\t\t}\n\t\tA -= D\n\t\tif A <= 0 {\n\t\t\tf = 2;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif f == 1 {\n\t\tfmt.Println(\"Yes\");\n\t}else{\n\t\tfmt.Println(\"No\");\n\t}\n}", "language": "Go", "metadata": {"date": 1589640122, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02700.html", "problem_id": "p02700", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02700/input.txt", "sample_output_relpath": "derived/input_output/data/p02700/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02700/Go/s539049379.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s539049379", "user_id": "u283295031"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar A, B int\n\tvar C, D int\n\tvar f = 0\n\n\tfmt.Scan(&A, &B);\n\tfmt.Scan(&C, &D);\n\n\tfor {\n\t\tC -= B \n\t\tif C <= 0 {\n\t\t\tf = 1;\n\t\t\tbreak;\n\t\t}\n\t\tA -= D\n\t\tif A <= 0 {\n\t\t\tf = 2;\n\t\t\tbreak;\n\t\t}\n\t}\n\tif f == 1 {\n\t\tfmt.Println(\"Yes\");\n\t}else{\n\t\tfmt.Println(\"No\");\n\t}\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi and Aoki will have a battle using their monsters.\n\nThe health and strength of Takahashi's monster are A and B, respectively, and those of Aoki's monster are C and D, respectively.\n\nThe two monsters will take turns attacking, in the order Takahashi's, Aoki's, Takahashi's, Aoki's, ...\nHere, an attack decreases the opponent's health by the value equal to the attacker's strength.\nThe monsters keep attacking until the health of one monster becomes 0 or below. The person with the monster whose health becomes 0 or below loses, and the other person wins.\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nConstraints\n\n1 \\leq A,B,C,D \\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 C D\n\nOutput\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nSample Input 1\n\n10 9 10 10\n\nSample Output 1\n\nNo\n\nFirst, Takahashi's monster attacks Aoki's monster, whose health is now 10-9=1.\n\nNext, Aoki's monster attacks Takahashi's monster, whose health is now 10-10=0.\n\nTakahashi's monster is the first to have 0 or less health, so Takahashi loses.\n\nSample Input 2\n\n46 4 40 5\n\nSample Output 2\n\nYes", "sample_input": "10 9 10 10\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02700", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi and Aoki will have a battle using their monsters.\n\nThe health and strength of Takahashi's monster are A and B, respectively, and those of Aoki's monster are C and D, respectively.\n\nThe two monsters will take turns attacking, in the order Takahashi's, Aoki's, Takahashi's, Aoki's, ...\nHere, an attack decreases the opponent's health by the value equal to the attacker's strength.\nThe monsters keep attacking until the health of one monster becomes 0 or below. The person with the monster whose health becomes 0 or below loses, and the other person wins.\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nConstraints\n\n1 \\leq A,B,C,D \\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 C D\n\nOutput\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nSample Input 1\n\n10 9 10 10\n\nSample Output 1\n\nNo\n\nFirst, Takahashi's monster attacks Aoki's monster, whose health is now 10-9=1.\n\nNext, Aoki's monster attacks Takahashi's monster, whose health is now 10-10=0.\n\nTakahashi's monster is the first to have 0 or less health, so Takahashi loses.\n\nSample Input 2\n\n46 4 40 5\n\nSample Output 2\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 293, "cpu_time_ms": 3, "memory_kb": 1752}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s889205507", "group_id": "codeNet:p02700", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tvar A, B, C, D int\n\tnextInt(&A, &B, &C, &D)\n\tvar step int\n\tfor A > 0 && C > 0 {\n\t\tif step % 2 == 0 {\n\t\t\tC-=B\n\t\t} else {\n\t\t\tA-=D\n\t\t}\n\t\tstep++\n\t}\n\tif A <= 0 {\n\t\tfmt.Printf(\"No\")\n\t} else {\n\t\tfmt.Printf(\"Yes\")\n\t}\n}\n\nconst MAX_INT int = 1_000_000_000\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nvar reader = bufio.NewReaderSize(os.Stdin, 1000000)\nvar writer = bufio.NewWriter(os.Stdout)\n\nfunc nextLine() string {\n\tbuffer := make([]byte, 0)\n\tfor true {\n\t\tline, isPrefix, err := reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\nfunc nextInt(A ...*int) {\n\tL := strings.Split(nextLine(), \" \")\n\tfor i, a := range A {\n\t\t*a, _ = strconv.Atoi(L[i])\n\t}\n}\nfunc nextInts(A *[]int) {\n\tL := strings.Split(nextLine(), \" \")\n\t(*A) = make([]int, len(L))\n\tfor i, l := range L {\n\t\t(*A)[i], _ = strconv.Atoi(l)\n\t}\n}\n\nfunc nextInt64(A ...*int64) {\n\tL := strings.Split(nextLine(), \" \")\n\tfor i, a := range A {\n\t\t*a, _ = strconv.ParseInt(L[i], 0, 64)\n\t}\n}\n\nfunc max(a int, b int) int {\n\tif a >= b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n", "language": "Go", "metadata": {"date": 1588718737, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02700.html", "problem_id": "p02700", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02700/input.txt", "sample_output_relpath": "derived/input_output/data/p02700/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02700/Go/s889205507.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s889205507", "user_id": "u024821820"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tvar A, B, C, D int\n\tnextInt(&A, &B, &C, &D)\n\tvar step int\n\tfor A > 0 && C > 0 {\n\t\tif step % 2 == 0 {\n\t\t\tC-=B\n\t\t} else {\n\t\t\tA-=D\n\t\t}\n\t\tstep++\n\t}\n\tif A <= 0 {\n\t\tfmt.Printf(\"No\")\n\t} else {\n\t\tfmt.Printf(\"Yes\")\n\t}\n}\n\nconst MAX_INT int = 1_000_000_000\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nvar reader = bufio.NewReaderSize(os.Stdin, 1000000)\nvar writer = bufio.NewWriter(os.Stdout)\n\nfunc nextLine() string {\n\tbuffer := make([]byte, 0)\n\tfor true {\n\t\tline, isPrefix, err := reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\nfunc nextInt(A ...*int) {\n\tL := strings.Split(nextLine(), \" \")\n\tfor i, a := range A {\n\t\t*a, _ = strconv.Atoi(L[i])\n\t}\n}\nfunc nextInts(A *[]int) {\n\tL := strings.Split(nextLine(), \" \")\n\t(*A) = make([]int, len(L))\n\tfor i, l := range L {\n\t\t(*A)[i], _ = strconv.Atoi(l)\n\t}\n}\n\nfunc nextInt64(A ...*int64) {\n\tL := strings.Split(nextLine(), \" \")\n\tfor i, a := range A {\n\t\t*a, _ = strconv.ParseInt(L[i], 0, 64)\n\t}\n}\n\nfunc max(a int, b int) int {\n\tif a >= b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi and Aoki will have a battle using their monsters.\n\nThe health and strength of Takahashi's monster are A and B, respectively, and those of Aoki's monster are C and D, respectively.\n\nThe two monsters will take turns attacking, in the order Takahashi's, Aoki's, Takahashi's, Aoki's, ...\nHere, an attack decreases the opponent's health by the value equal to the attacker's strength.\nThe monsters keep attacking until the health of one monster becomes 0 or below. The person with the monster whose health becomes 0 or below loses, and the other person wins.\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nConstraints\n\n1 \\leq A,B,C,D \\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 C D\n\nOutput\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nSample Input 1\n\n10 9 10 10\n\nSample Output 1\n\nNo\n\nFirst, Takahashi's monster attacks Aoki's monster, whose health is now 10-9=1.\n\nNext, Aoki's monster attacks Takahashi's monster, whose health is now 10-10=0.\n\nTakahashi's monster is the first to have 0 or less health, so Takahashi loses.\n\nSample Input 2\n\n46 4 40 5\n\nSample Output 2\n\nYes", "sample_input": "10 9 10 10\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02700", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi and Aoki will have a battle using their monsters.\n\nThe health and strength of Takahashi's monster are A and B, respectively, and those of Aoki's monster are C and D, respectively.\n\nThe two monsters will take turns attacking, in the order Takahashi's, Aoki's, Takahashi's, Aoki's, ...\nHere, an attack decreases the opponent's health by the value equal to the attacker's strength.\nThe monsters keep attacking until the health of one monster becomes 0 or below. The person with the monster whose health becomes 0 or below loses, and the other person wins.\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nConstraints\n\n1 \\leq A,B,C,D \\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 C D\n\nOutput\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nSample Input 1\n\n10 9 10 10\n\nSample Output 1\n\nNo\n\nFirst, Takahashi's monster attacks Aoki's monster, whose health is now 10-9=1.\n\nNext, Aoki's monster attacks Takahashi's monster, whose health is now 10-10=0.\n\nTakahashi's monster is the first to have 0 or less health, so Takahashi loses.\n\nSample Input 2\n\n46 4 40 5\n\nSample Output 2\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1202, "cpu_time_ms": 2, "memory_kb": 1768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s134324376", "group_id": "codeNet:p02700", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar A, B, C, D int\n\n\tfmt.Scan(&A, &B, &C, &D)\n\n\tHT := A / D\n\tCheckHT := A % D\n\tHA := C / B\n\n\tif HT > HA {\n\t\tfmt.Println(\"Yes\")\n\t} else if HT == HA {\n\t\tif CheckHT == 0 {\n\t\t\tfmt.Println(\"No\")\n\t\t} else {\n\t\t\tfmt.Println(\"Yes\")\n\t\t}\n\t} else {\n\t\tif (HA - HT) == 1 {\n\t\t\tfmt.Println(\"Yes\")\n\t\t} else {\n\t\t\tfmt.Println(\"No\")\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1588439126, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02700.html", "problem_id": "p02700", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02700/input.txt", "sample_output_relpath": "derived/input_output/data/p02700/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02700/Go/s134324376.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s134324376", "user_id": "u979699056"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar A, B, C, D int\n\n\tfmt.Scan(&A, &B, &C, &D)\n\n\tHT := A / D\n\tCheckHT := A % D\n\tHA := C / B\n\n\tif HT > HA {\n\t\tfmt.Println(\"Yes\")\n\t} else if HT == HA {\n\t\tif CheckHT == 0 {\n\t\t\tfmt.Println(\"No\")\n\t\t} else {\n\t\t\tfmt.Println(\"Yes\")\n\t\t}\n\t} else {\n\t\tif (HA - HT) == 1 {\n\t\t\tfmt.Println(\"Yes\")\n\t\t} else {\n\t\t\tfmt.Println(\"No\")\n\t\t}\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi and Aoki will have a battle using their monsters.\n\nThe health and strength of Takahashi's monster are A and B, respectively, and those of Aoki's monster are C and D, respectively.\n\nThe two monsters will take turns attacking, in the order Takahashi's, Aoki's, Takahashi's, Aoki's, ...\nHere, an attack decreases the opponent's health by the value equal to the attacker's strength.\nThe monsters keep attacking until the health of one monster becomes 0 or below. The person with the monster whose health becomes 0 or below loses, and the other person wins.\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nConstraints\n\n1 \\leq A,B,C,D \\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 C D\n\nOutput\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nSample Input 1\n\n10 9 10 10\n\nSample Output 1\n\nNo\n\nFirst, Takahashi's monster attacks Aoki's monster, whose health is now 10-9=1.\n\nNext, Aoki's monster attacks Takahashi's monster, whose health is now 10-10=0.\n\nTakahashi's monster is the first to have 0 or less health, so Takahashi loses.\n\nSample Input 2\n\n46 4 40 5\n\nSample Output 2\n\nYes", "sample_input": "10 9 10 10\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02700", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi and Aoki will have a battle using their monsters.\n\nThe health and strength of Takahashi's monster are A and B, respectively, and those of Aoki's monster are C and D, respectively.\n\nThe two monsters will take turns attacking, in the order Takahashi's, Aoki's, Takahashi's, Aoki's, ...\nHere, an attack decreases the opponent's health by the value equal to the attacker's strength.\nThe monsters keep attacking until the health of one monster becomes 0 or below. The person with the monster whose health becomes 0 or below loses, and the other person wins.\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nConstraints\n\n1 \\leq A,B,C,D \\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 C D\n\nOutput\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nSample Input 1\n\n10 9 10 10\n\nSample Output 1\n\nNo\n\nFirst, Takahashi's monster attacks Aoki's monster, whose health is now 10-9=1.\n\nNext, Aoki's monster attacks Takahashi's monster, whose health is now 10-10=0.\n\nTakahashi's monster is the first to have 0 or less health, so Takahashi loses.\n\nSample Input 2\n\n46 4 40 5\n\nSample Output 2\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 9, "memory_kb": 1816}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s044446737", "group_id": "codeNet:p02700", "input_text": "package main\n\nimport (\n \"fmt\"\n \"math\"\n)\n\nfunc main() {\n var a, b, c, d float64\n fmt.Scanf(\"%f %f %f %f\", &a, &b, &c, &d)\n if math.Ceil(c / b) > math.Ceil(a / d) {\n fmt.Println(\"No\")\n } else {\n fmt.Println(\"Yes\")\n }\n}", "language": "Go", "metadata": {"date": 1587968031, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02700.html", "problem_id": "p02700", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02700/input.txt", "sample_output_relpath": "derived/input_output/data/p02700/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02700/Go/s044446737.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s044446737", "user_id": "u975039852"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"math\"\n)\n\nfunc main() {\n var a, b, c, d float64\n fmt.Scanf(\"%f %f %f %f\", &a, &b, &c, &d)\n if math.Ceil(c / b) > math.Ceil(a / d) {\n fmt.Println(\"No\")\n } else {\n fmt.Println(\"Yes\")\n }\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi and Aoki will have a battle using their monsters.\n\nThe health and strength of Takahashi's monster are A and B, respectively, and those of Aoki's monster are C and D, respectively.\n\nThe two monsters will take turns attacking, in the order Takahashi's, Aoki's, Takahashi's, Aoki's, ...\nHere, an attack decreases the opponent's health by the value equal to the attacker's strength.\nThe monsters keep attacking until the health of one monster becomes 0 or below. The person with the monster whose health becomes 0 or below loses, and the other person wins.\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nConstraints\n\n1 \\leq A,B,C,D \\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 C D\n\nOutput\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nSample Input 1\n\n10 9 10 10\n\nSample Output 1\n\nNo\n\nFirst, Takahashi's monster attacks Aoki's monster, whose health is now 10-9=1.\n\nNext, Aoki's monster attacks Takahashi's monster, whose health is now 10-10=0.\n\nTakahashi's monster is the first to have 0 or less health, so Takahashi loses.\n\nSample Input 2\n\n46 4 40 5\n\nSample Output 2\n\nYes", "sample_input": "10 9 10 10\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02700", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi and Aoki will have a battle using their monsters.\n\nThe health and strength of Takahashi's monster are A and B, respectively, and those of Aoki's monster are C and D, respectively.\n\nThe two monsters will take turns attacking, in the order Takahashi's, Aoki's, Takahashi's, Aoki's, ...\nHere, an attack decreases the opponent's health by the value equal to the attacker's strength.\nThe monsters keep attacking until the health of one monster becomes 0 or below. The person with the monster whose health becomes 0 or below loses, and the other person wins.\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nConstraints\n\n1 \\leq A,B,C,D \\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 C D\n\nOutput\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nSample Input 1\n\n10 9 10 10\n\nSample Output 1\n\nNo\n\nFirst, Takahashi's monster attacks Aoki's monster, whose health is now 10-9=1.\n\nNext, Aoki's monster attacks Takahashi's monster, whose health is now 10-10=0.\n\nTakahashi's monster is the first to have 0 or less health, so Takahashi loses.\n\nSample Input 2\n\n46 4 40 5\n\nSample Output 2\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 229, "cpu_time_ms": 3, "memory_kb": 1820}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s907123278", "group_id": "codeNet:p02700", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\ntype Monster struct {\n Hp int\n Atk int\n}\n\nfunc battle(o, d *Monster) {\n d.Hp -= o.Atk\n}\n\nfunc main() {\n t := new(Monster)\n a := new(Monster)\n fmt.Scanf(\"%d %d %d %d\", &t.Hp, &t.Atk, &a.Hp, &a.Atk)\n //fmt.Printf(\"t(%d:%d), a(%d:%d)\", t.Hp, t.Atk, a.Hp, a.Atk)\n\n for {\n battle(t, a)\n if t.Hp < 1 {\n fmt.Print(\"NO\\n\")\n return\n }\n\n battle(a, t)\n if a.Hp < 1 {\n fmt.Print(\"YES\\n\")\n return\n }\n }\n}\n", "language": "Go", "metadata": {"date": 1587952209, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02700.html", "problem_id": "p02700", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02700/input.txt", "sample_output_relpath": "derived/input_output/data/p02700/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02700/Go/s907123278.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s907123278", "user_id": "u472560729"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\ntype Monster struct {\n Hp int\n Atk int\n}\n\nfunc battle(o, d *Monster) {\n d.Hp -= o.Atk\n}\n\nfunc main() {\n t := new(Monster)\n a := new(Monster)\n fmt.Scanf(\"%d %d %d %d\", &t.Hp, &t.Atk, &a.Hp, &a.Atk)\n //fmt.Printf(\"t(%d:%d), a(%d:%d)\", t.Hp, t.Atk, a.Hp, a.Atk)\n\n for {\n battle(t, a)\n if t.Hp < 1 {\n fmt.Print(\"NO\\n\")\n return\n }\n\n battle(a, t)\n if a.Hp < 1 {\n fmt.Print(\"YES\\n\")\n return\n }\n }\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi and Aoki will have a battle using their monsters.\n\nThe health and strength of Takahashi's monster are A and B, respectively, and those of Aoki's monster are C and D, respectively.\n\nThe two monsters will take turns attacking, in the order Takahashi's, Aoki's, Takahashi's, Aoki's, ...\nHere, an attack decreases the opponent's health by the value equal to the attacker's strength.\nThe monsters keep attacking until the health of one monster becomes 0 or below. The person with the monster whose health becomes 0 or below loses, and the other person wins.\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nConstraints\n\n1 \\leq A,B,C,D \\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 C D\n\nOutput\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nSample Input 1\n\n10 9 10 10\n\nSample Output 1\n\nNo\n\nFirst, Takahashi's monster attacks Aoki's monster, whose health is now 10-9=1.\n\nNext, Aoki's monster attacks Takahashi's monster, whose health is now 10-10=0.\n\nTakahashi's monster is the first to have 0 or less health, so Takahashi loses.\n\nSample Input 2\n\n46 4 40 5\n\nSample Output 2\n\nYes", "sample_input": "10 9 10 10\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02700", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi and Aoki will have a battle using their monsters.\n\nThe health and strength of Takahashi's monster are A and B, respectively, and those of Aoki's monster are C and D, respectively.\n\nThe two monsters will take turns attacking, in the order Takahashi's, Aoki's, Takahashi's, Aoki's, ...\nHere, an attack decreases the opponent's health by the value equal to the attacker's strength.\nThe monsters keep attacking until the health of one monster becomes 0 or below. The person with the monster whose health becomes 0 or below loses, and the other person wins.\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nConstraints\n\n1 \\leq A,B,C,D \\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 C D\n\nOutput\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nSample Input 1\n\n10 9 10 10\n\nSample Output 1\n\nNo\n\nFirst, Takahashi's monster attacks Aoki's monster, whose health is now 10-9=1.\n\nNext, Aoki's monster attacks Takahashi's monster, whose health is now 10-10=0.\n\nTakahashi's monster is the first to have 0 or less health, so Takahashi loses.\n\nSample Input 2\n\n46 4 40 5\n\nSample Output 2\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 542, "cpu_time_ms": 2, "memory_kb": 1812}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s387013444", "group_id": "codeNet:p02700", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\ntype Monster struct {\n Hp int\n Atk int\n}\n\nfunc battle(o, d *Monster) {\n d.Hp -= o.Atk\n}\n\nfunc main() {\n t := new(Monster)\n a := new(Monster)\n fmt.Scanf(\"%d %d %d %d\", &t.Hp, &t.Atk, &a.Hp, &a.Atk)\n //fmt.Printf(\"t(%d:%d), a(%d:%d)\", t.Hp, t.Atk, a.Hp, a.Atk)\n\n for {\n battle(t, a)\n if t.Hp < 1 {\n fmt.Print(\"NO\")\n return\n }\n\n battle(a, t)\n if a.Hp < 1 {\n fmt.Print(\"YES\")\n return\n }\n }\n}\n", "language": "Go", "metadata": {"date": 1587952128, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02700.html", "problem_id": "p02700", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02700/input.txt", "sample_output_relpath": "derived/input_output/data/p02700/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02700/Go/s387013444.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s387013444", "user_id": "u472560729"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\ntype Monster struct {\n Hp int\n Atk int\n}\n\nfunc battle(o, d *Monster) {\n d.Hp -= o.Atk\n}\n\nfunc main() {\n t := new(Monster)\n a := new(Monster)\n fmt.Scanf(\"%d %d %d %d\", &t.Hp, &t.Atk, &a.Hp, &a.Atk)\n //fmt.Printf(\"t(%d:%d), a(%d:%d)\", t.Hp, t.Atk, a.Hp, a.Atk)\n\n for {\n battle(t, a)\n if t.Hp < 1 {\n fmt.Print(\"NO\")\n return\n }\n\n battle(a, t)\n if a.Hp < 1 {\n fmt.Print(\"YES\")\n return\n }\n }\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi and Aoki will have a battle using their monsters.\n\nThe health and strength of Takahashi's monster are A and B, respectively, and those of Aoki's monster are C and D, respectively.\n\nThe two monsters will take turns attacking, in the order Takahashi's, Aoki's, Takahashi's, Aoki's, ...\nHere, an attack decreases the opponent's health by the value equal to the attacker's strength.\nThe monsters keep attacking until the health of one monster becomes 0 or below. The person with the monster whose health becomes 0 or below loses, and the other person wins.\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nConstraints\n\n1 \\leq A,B,C,D \\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 C D\n\nOutput\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nSample Input 1\n\n10 9 10 10\n\nSample Output 1\n\nNo\n\nFirst, Takahashi's monster attacks Aoki's monster, whose health is now 10-9=1.\n\nNext, Aoki's monster attacks Takahashi's monster, whose health is now 10-10=0.\n\nTakahashi's monster is the first to have 0 or less health, so Takahashi loses.\n\nSample Input 2\n\n46 4 40 5\n\nSample Output 2\n\nYes", "sample_input": "10 9 10 10\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02700", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi and Aoki will have a battle using their monsters.\n\nThe health and strength of Takahashi's monster are A and B, respectively, and those of Aoki's monster are C and D, respectively.\n\nThe two monsters will take turns attacking, in the order Takahashi's, Aoki's, Takahashi's, Aoki's, ...\nHere, an attack decreases the opponent's health by the value equal to the attacker's strength.\nThe monsters keep attacking until the health of one monster becomes 0 or below. The person with the monster whose health becomes 0 or below loses, and the other person wins.\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nConstraints\n\n1 \\leq A,B,C,D \\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 C D\n\nOutput\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nSample Input 1\n\n10 9 10 10\n\nSample Output 1\n\nNo\n\nFirst, Takahashi's monster attacks Aoki's monster, whose health is now 10-9=1.\n\nNext, Aoki's monster attacks Takahashi's monster, whose health is now 10-10=0.\n\nTakahashi's monster is the first to have 0 or less health, so Takahashi loses.\n\nSample Input 2\n\n46 4 40 5\n\nSample Output 2\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 538, "cpu_time_ms": 11, "memory_kb": 1816}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s695732369", "group_id": "codeNet:p02700", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar TakahashiHp, TakahashiForce, AokiHp, AokiForce int\n\tfmt.Scan(&TakahashiHp, &TakahashiForce, &AokiHp, &AokiForce)\n\n\tfor {\n\t\tAokiHp = AokiHp - TakahashiForce\n\n\t\tif AokiHp <= 0 {\n\t\t\tfmt.Println(\"Yes\")\n\t\t\treturn\n\t\t}\n\n\t\tTakahashiHp = TakahashiHp - AokiForce\n\n\t\tif TakahashiHp <= 0 {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n}", "language": "Go", "metadata": {"date": 1587949833, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02700.html", "problem_id": "p02700", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02700/input.txt", "sample_output_relpath": "derived/input_output/data/p02700/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02700/Go/s695732369.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s695732369", "user_id": "u942427847"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar TakahashiHp, TakahashiForce, AokiHp, AokiForce int\n\tfmt.Scan(&TakahashiHp, &TakahashiForce, &AokiHp, &AokiForce)\n\n\tfor {\n\t\tAokiHp = AokiHp - TakahashiForce\n\n\t\tif AokiHp <= 0 {\n\t\t\tfmt.Println(\"Yes\")\n\t\t\treturn\n\t\t}\n\n\t\tTakahashiHp = TakahashiHp - AokiForce\n\n\t\tif TakahashiHp <= 0 {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi and Aoki will have a battle using their monsters.\n\nThe health and strength of Takahashi's monster are A and B, respectively, and those of Aoki's monster are C and D, respectively.\n\nThe two monsters will take turns attacking, in the order Takahashi's, Aoki's, Takahashi's, Aoki's, ...\nHere, an attack decreases the opponent's health by the value equal to the attacker's strength.\nThe monsters keep attacking until the health of one monster becomes 0 or below. The person with the monster whose health becomes 0 or below loses, and the other person wins.\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nConstraints\n\n1 \\leq A,B,C,D \\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 C D\n\nOutput\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nSample Input 1\n\n10 9 10 10\n\nSample Output 1\n\nNo\n\nFirst, Takahashi's monster attacks Aoki's monster, whose health is now 10-9=1.\n\nNext, Aoki's monster attacks Takahashi's monster, whose health is now 10-10=0.\n\nTakahashi's monster is the first to have 0 or less health, so Takahashi loses.\n\nSample Input 2\n\n46 4 40 5\n\nSample Output 2\n\nYes", "sample_input": "10 9 10 10\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02700", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi and Aoki will have a battle using their monsters.\n\nThe health and strength of Takahashi's monster are A and B, respectively, and those of Aoki's monster are C and D, respectively.\n\nThe two monsters will take turns attacking, in the order Takahashi's, Aoki's, Takahashi's, Aoki's, ...\nHere, an attack decreases the opponent's health by the value equal to the attacker's strength.\nThe monsters keep attacking until the health of one monster becomes 0 or below. The person with the monster whose health becomes 0 or below loses, and the other person wins.\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nConstraints\n\n1 \\leq A,B,C,D \\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 C D\n\nOutput\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nSample Input 1\n\n10 9 10 10\n\nSample Output 1\n\nNo\n\nFirst, Takahashi's monster attacks Aoki's monster, whose health is now 10-9=1.\n\nNext, Aoki's monster attacks Takahashi's monster, whose health is now 10-10=0.\n\nTakahashi's monster is the first to have 0 or less health, so Takahashi loses.\n\nSample Input 2\n\n46 4 40 5\n\nSample Output 2\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 1756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s427579852", "group_id": "codeNet:p02700", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, c, d int\n\tfmt.Scan(&a)\n\tfmt.Scan(&b)\n\tfmt.Scan(&c)\n\tfmt.Scan(&d)\n\n\tfor {\n\t\tc -= b\n\t\tif c <= 0 {\n\t\t\tfmt.Println(\"Yes\")\n\t\t\tbreak\n\t\t}\n\n\t\ta -= d\n\t\tif a <= 0 {\n\t\t\tfmt.Println(\"No\")\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1587949695, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02700.html", "problem_id": "p02700", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02700/input.txt", "sample_output_relpath": "derived/input_output/data/p02700/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02700/Go/s427579852.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s427579852", "user_id": "u715605488"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, c, d int\n\tfmt.Scan(&a)\n\tfmt.Scan(&b)\n\tfmt.Scan(&c)\n\tfmt.Scan(&d)\n\n\tfor {\n\t\tc -= b\n\t\tif c <= 0 {\n\t\t\tfmt.Println(\"Yes\")\n\t\t\tbreak\n\t\t}\n\n\t\ta -= d\n\t\tif a <= 0 {\n\t\t\tfmt.Println(\"No\")\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi and Aoki will have a battle using their monsters.\n\nThe health and strength of Takahashi's monster are A and B, respectively, and those of Aoki's monster are C and D, respectively.\n\nThe two monsters will take turns attacking, in the order Takahashi's, Aoki's, Takahashi's, Aoki's, ...\nHere, an attack decreases the opponent's health by the value equal to the attacker's strength.\nThe monsters keep attacking until the health of one monster becomes 0 or below. The person with the monster whose health becomes 0 or below loses, and the other person wins.\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nConstraints\n\n1 \\leq A,B,C,D \\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 C D\n\nOutput\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nSample Input 1\n\n10 9 10 10\n\nSample Output 1\n\nNo\n\nFirst, Takahashi's monster attacks Aoki's monster, whose health is now 10-9=1.\n\nNext, Aoki's monster attacks Takahashi's monster, whose health is now 10-10=0.\n\nTakahashi's monster is the first to have 0 or less health, so Takahashi loses.\n\nSample Input 2\n\n46 4 40 5\n\nSample Output 2\n\nYes", "sample_input": "10 9 10 10\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02700", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi and Aoki will have a battle using their monsters.\n\nThe health and strength of Takahashi's monster are A and B, respectively, and those of Aoki's monster are C and D, respectively.\n\nThe two monsters will take turns attacking, in the order Takahashi's, Aoki's, Takahashi's, Aoki's, ...\nHere, an attack decreases the opponent's health by the value equal to the attacker's strength.\nThe monsters keep attacking until the health of one monster becomes 0 or below. The person with the monster whose health becomes 0 or below loses, and the other person wins.\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nConstraints\n\n1 \\leq A,B,C,D \\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 C D\n\nOutput\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nSample Input 1\n\n10 9 10 10\n\nSample Output 1\n\nNo\n\nFirst, Takahashi's monster attacks Aoki's monster, whose health is now 10-9=1.\n\nNext, Aoki's monster attacks Takahashi's monster, whose health is now 10-10=0.\n\nTakahashi's monster is the first to have 0 or less health, so Takahashi loses.\n\nSample Input 2\n\n46 4 40 5\n\nSample Output 2\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 9, "memory_kb": 1752}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s510931492", "group_id": "codeNet:p02700", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tA, B, C, D := getInt(), getInt(), getInt(), getInt()\n\n\tfor {\n\t\tC -= B\n\t\tif C <= 0 {\n\t\t\tout(\"Yes\")\n\t\t\treturn\n\t\t}\n\t\tA -= D\n\t\tif A <= 0 {\n\t\t\tout(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1587949650, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02700.html", "problem_id": "p02700", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02700/input.txt", "sample_output_relpath": "derived/input_output/data/p02700/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02700/Go/s510931492.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s510931492", "user_id": "u814575783"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tA, B, C, D := getInt(), getInt(), getInt(), getInt()\n\n\tfor {\n\t\tC -= B\n\t\tif C <= 0 {\n\t\t\tout(\"Yes\")\n\t\t\treturn\n\t\t}\n\t\tA -= D\n\t\tif A <= 0 {\n\t\t\tout(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi and Aoki will have a battle using their monsters.\n\nThe health and strength of Takahashi's monster are A and B, respectively, and those of Aoki's monster are C and D, respectively.\n\nThe two monsters will take turns attacking, in the order Takahashi's, Aoki's, Takahashi's, Aoki's, ...\nHere, an attack decreases the opponent's health by the value equal to the attacker's strength.\nThe monsters keep attacking until the health of one monster becomes 0 or below. The person with the monster whose health becomes 0 or below loses, and the other person wins.\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nConstraints\n\n1 \\leq A,B,C,D \\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 C D\n\nOutput\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nSample Input 1\n\n10 9 10 10\n\nSample Output 1\n\nNo\n\nFirst, Takahashi's monster attacks Aoki's monster, whose health is now 10-9=1.\n\nNext, Aoki's monster attacks Takahashi's monster, whose health is now 10-10=0.\n\nTakahashi's monster is the first to have 0 or less health, so Takahashi loses.\n\nSample Input 2\n\n46 4 40 5\n\nSample Output 2\n\nYes", "sample_input": "10 9 10 10\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02700", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi and Aoki will have a battle using their monsters.\n\nThe health and strength of Takahashi's monster are A and B, respectively, and those of Aoki's monster are C and D, respectively.\n\nThe two monsters will take turns attacking, in the order Takahashi's, Aoki's, Takahashi's, Aoki's, ...\nHere, an attack decreases the opponent's health by the value equal to the attacker's strength.\nThe monsters keep attacking until the health of one monster becomes 0 or below. The person with the monster whose health becomes 0 or below loses, and the other person wins.\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nConstraints\n\n1 \\leq A,B,C,D \\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 C D\n\nOutput\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nSample Input 1\n\n10 9 10 10\n\nSample Output 1\n\nNo\n\nFirst, Takahashi's monster attacks Aoki's monster, whose health is now 10-9=1.\n\nNext, Aoki's monster attacks Takahashi's monster, whose health is now 10-10=0.\n\nTakahashi's monster is the first to have 0 or less health, so Takahashi loses.\n\nSample Input 2\n\n46 4 40 5\n\nSample Output 2\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 826, "cpu_time_ms": 2, "memory_kb": 1756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s499315374", "group_id": "codeNet:p02700", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar a, b, c, d float64\n\tfmt.Scan(&a, &b, &c, &d)\n\n\tn := math.Ceil(a / d)\n\tm := math.Ceil(c / b)\n\tif n == m {\n\t\tfmt.Println(\"Yes\")\n\t} else if n > m {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1587949599, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02700.html", "problem_id": "p02700", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02700/input.txt", "sample_output_relpath": "derived/input_output/data/p02700/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02700/Go/s499315374.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s499315374", "user_id": "u620351704"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar a, b, c, d float64\n\tfmt.Scan(&a, &b, &c, &d)\n\n\tn := math.Ceil(a / d)\n\tm := math.Ceil(c / b)\n\tif n == m {\n\t\tfmt.Println(\"Yes\")\n\t} else if n > m {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi and Aoki will have a battle using their monsters.\n\nThe health and strength of Takahashi's monster are A and B, respectively, and those of Aoki's monster are C and D, respectively.\n\nThe two monsters will take turns attacking, in the order Takahashi's, Aoki's, Takahashi's, Aoki's, ...\nHere, an attack decreases the opponent's health by the value equal to the attacker's strength.\nThe monsters keep attacking until the health of one monster becomes 0 or below. The person with the monster whose health becomes 0 or below loses, and the other person wins.\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nConstraints\n\n1 \\leq A,B,C,D \\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 C D\n\nOutput\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nSample Input 1\n\n10 9 10 10\n\nSample Output 1\n\nNo\n\nFirst, Takahashi's monster attacks Aoki's monster, whose health is now 10-9=1.\n\nNext, Aoki's monster attacks Takahashi's monster, whose health is now 10-10=0.\n\nTakahashi's monster is the first to have 0 or less health, so Takahashi loses.\n\nSample Input 2\n\n46 4 40 5\n\nSample Output 2\n\nYes", "sample_input": "10 9 10 10\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02700", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi and Aoki will have a battle using their monsters.\n\nThe health and strength of Takahashi's monster are A and B, respectively, and those of Aoki's monster are C and D, respectively.\n\nThe two monsters will take turns attacking, in the order Takahashi's, Aoki's, Takahashi's, Aoki's, ...\nHere, an attack decreases the opponent's health by the value equal to the attacker's strength.\nThe monsters keep attacking until the health of one monster becomes 0 or below. The person with the monster whose health becomes 0 or below loses, and the other person wins.\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nConstraints\n\n1 \\leq A,B,C,D \\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 C D\n\nOutput\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nSample Input 1\n\n10 9 10 10\n\nSample Output 1\n\nNo\n\nFirst, Takahashi's monster attacks Aoki's monster, whose health is now 10-9=1.\n\nNext, Aoki's monster attacks Takahashi's monster, whose health is now 10-10=0.\n\nTakahashi's monster is the first to have 0 or less health, so Takahashi loses.\n\nSample Input 2\n\n46 4 40 5\n\nSample Output 2\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 6, "memory_kb": 1820}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s651235857", "group_id": "codeNet:p02700", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 1024\n\tmaxBufSize = 1e6\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\t// writer = bufio.NewWriterSize(os.Stdout, 1000000)\n)\n\nfunc main() {\n\tscanner.Split(bufio.ScanWords)\n\t// scanner.Buffer(make([]byte, initialBufSize), maxBufSize)\n\t// defer writer.Flush()\n\ta, b, c, d := scanInt(), scanInt(), scanInt(), scanInt()\n\n\tta := true\n\tfor {\n\t\tif ta {\n\t\t\tc = c - b\n\t\t\tif c <= 0 {\n\t\t\t\tfmt.Println(\"Yes\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tta = !ta\n\t\t} else {\n\t\t\ta = a - d\n\t\t\tif a <= 0 {\n\t\t\t\tfmt.Println(\"No\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tta = !ta\n\t\t}\n\t}\n\n}\n\nfunc scanInt() int {\n\ti, _ := strconv.Atoi(scanString())\n\treturn i\n}\n\nfunc scanInts(size int) []int {\n\tints := make([]int, size)\n\tfor i := 0; i < size; i++ {\n\t\tints[i] = scanInt()\n\t}\n\treturn ints\n}\n\nfunc scanFloat64() float64 {\n\tf, _ := strconv.ParseFloat(scanString(), 64)\n\treturn f\n}\n\nfunc scanFloat64s(size int) []float64 {\n\tf := make([]float64, size)\n\tfor i := 0; i < size; i++ {\n\t\tf[i] = scanFloat64()\n\t}\n\treturn f\n}\n\nfunc scanString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc scanStrings(size int) []string {\n\ts := make([]string, size)\n\tfor i := 0; i < size; i++ {\n\t\ts[i] = scanString()\n\t}\n\treturn s\n}\n", "language": "Go", "metadata": {"date": 1587949570, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02700.html", "problem_id": "p02700", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02700/input.txt", "sample_output_relpath": "derived/input_output/data/p02700/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02700/Go/s651235857.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s651235857", "user_id": "u550884590"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 1024\n\tmaxBufSize = 1e6\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\t// writer = bufio.NewWriterSize(os.Stdout, 1000000)\n)\n\nfunc main() {\n\tscanner.Split(bufio.ScanWords)\n\t// scanner.Buffer(make([]byte, initialBufSize), maxBufSize)\n\t// defer writer.Flush()\n\ta, b, c, d := scanInt(), scanInt(), scanInt(), scanInt()\n\n\tta := true\n\tfor {\n\t\tif ta {\n\t\t\tc = c - b\n\t\t\tif c <= 0 {\n\t\t\t\tfmt.Println(\"Yes\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tta = !ta\n\t\t} else {\n\t\t\ta = a - d\n\t\t\tif a <= 0 {\n\t\t\t\tfmt.Println(\"No\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tta = !ta\n\t\t}\n\t}\n\n}\n\nfunc scanInt() int {\n\ti, _ := strconv.Atoi(scanString())\n\treturn i\n}\n\nfunc scanInts(size int) []int {\n\tints := make([]int, size)\n\tfor i := 0; i < size; i++ {\n\t\tints[i] = scanInt()\n\t}\n\treturn ints\n}\n\nfunc scanFloat64() float64 {\n\tf, _ := strconv.ParseFloat(scanString(), 64)\n\treturn f\n}\n\nfunc scanFloat64s(size int) []float64 {\n\tf := make([]float64, size)\n\tfor i := 0; i < size; i++ {\n\t\tf[i] = scanFloat64()\n\t}\n\treturn f\n}\n\nfunc scanString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc scanStrings(size int) []string {\n\ts := make([]string, size)\n\tfor i := 0; i < size; i++ {\n\t\ts[i] = scanString()\n\t}\n\treturn s\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi and Aoki will have a battle using their monsters.\n\nThe health and strength of Takahashi's monster are A and B, respectively, and those of Aoki's monster are C and D, respectively.\n\nThe two monsters will take turns attacking, in the order Takahashi's, Aoki's, Takahashi's, Aoki's, ...\nHere, an attack decreases the opponent's health by the value equal to the attacker's strength.\nThe monsters keep attacking until the health of one monster becomes 0 or below. The person with the monster whose health becomes 0 or below loses, and the other person wins.\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nConstraints\n\n1 \\leq A,B,C,D \\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 C D\n\nOutput\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nSample Input 1\n\n10 9 10 10\n\nSample Output 1\n\nNo\n\nFirst, Takahashi's monster attacks Aoki's monster, whose health is now 10-9=1.\n\nNext, Aoki's monster attacks Takahashi's monster, whose health is now 10-10=0.\n\nTakahashi's monster is the first to have 0 or less health, so Takahashi loses.\n\nSample Input 2\n\n46 4 40 5\n\nSample Output 2\n\nYes", "sample_input": "10 9 10 10\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02700", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi and Aoki will have a battle using their monsters.\n\nThe health and strength of Takahashi's monster are A and B, respectively, and those of Aoki's monster are C and D, respectively.\n\nThe two monsters will take turns attacking, in the order Takahashi's, Aoki's, Takahashi's, Aoki's, ...\nHere, an attack decreases the opponent's health by the value equal to the attacker's strength.\nThe monsters keep attacking until the health of one monster becomes 0 or below. The person with the monster whose health becomes 0 or below loses, and the other person wins.\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nConstraints\n\n1 \\leq A,B,C,D \\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 C D\n\nOutput\n\nIf Takahashi will win, print Yes; if he will lose, print No.\n\nSample Input 1\n\n10 9 10 10\n\nSample Output 1\n\nNo\n\nFirst, Takahashi's monster attacks Aoki's monster, whose health is now 10-9=1.\n\nNext, Aoki's monster attacks Takahashi's monster, whose health is now 10-10=0.\n\nTakahashi's monster is the first to have 0 or less health, so Takahashi loses.\n\nSample Input 2\n\n46 4 40 5\n\nSample Output 2\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1238, "cpu_time_ms": 6, "memory_kb": 1756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s615259594", "group_id": "codeNet:p02702", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc dfs(s string) int {\n\tans := 0\n\tfor i := 0; i < len(s); i++ {\n\t\tfor j := i + 3; j <= len(s); j++ {\n\t\t\t// fmt.Println(s[i:j])\n\t\t\tnum, _ := strconv.Atoi(s[i:j])\n\t\t\tif num%2019 == 0 {\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tss := nextString()\n\n\tfmt.Println(dfs(ss))\n}\n", "language": "Go", "metadata": {"date": 1599397268, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02702.html", "problem_id": "p02702", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02702/input.txt", "sample_output_relpath": "derived/input_output/data/p02702/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02702/Go/s615259594.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s615259594", "user_id": "u998286277"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc dfs(s string) int {\n\tans := 0\n\tfor i := 0; i < len(s); i++ {\n\t\tfor j := i + 3; j <= len(s); j++ {\n\t\t\t// fmt.Println(s[i:j])\n\t\t\tnum, _ := strconv.Atoi(s[i:j])\n\t\t\tif num%2019 == 0 {\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tss := nextString()\n\n\tfmt.Println(dfs(ss))\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "sample_input": "1817181712114\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02702", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 570, "cpu_time_ms": 2205, "memory_kb": 6340}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s332129700", "group_id": "codeNet:p02702", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tscanInit()\n\ts := scan()\n\t// 1817181712114\n\tn := len(s)\n\tSplit := strings.Split(s,\"\")\n\tm := 2019\n\tcnt := map[int]int{}\n\ttotal := 0\n\tx := 1\n\tans := 0\n\tfor i:= n-1; i>=0; i-- {\n\t\tif _,ok := cnt[total]; !ok {\n\t\t\tcnt[total] = 0\n\t\t}\n\t\tcnt[total] += 1 //S_r ≡ S_l (r,lは任意)なら+1なのでこうなってる a_0も入ってないもの(s_0)が0なので最初に0に+1\n\t\t// 理解が普通にクソムズ 数学的な素養と簡単な累積和的知識が必要\n\t\tval,_ := strconv.Atoi(Split[i])\n\t\ttotal += val*x //累積和\n\t\ttotal %= m\n\t\tans += cnt[total]\n\t\tx *= 10\n\t}\n\tfmt.Println(ans)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\nfunc scanInit () {\n\tsc.Split(bufio.ScanWords)\n}\n// func scanInt () int{\n// sc.Scan()\n//\ti,_ := strconv.Atoi(sc.Text())\n//\treturn i\n//}\nfunc scan () string{\n sc.Scan()\n\treturn sc.Text()\n}\n", "language": "Go", "metadata": {"date": 1592311769, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02702.html", "problem_id": "p02702", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02702/input.txt", "sample_output_relpath": "derived/input_output/data/p02702/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02702/Go/s332129700.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s332129700", "user_id": "u184577857"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tscanInit()\n\ts := scan()\n\t// 1817181712114\n\tn := len(s)\n\tSplit := strings.Split(s,\"\")\n\tm := 2019\n\tcnt := map[int]int{}\n\ttotal := 0\n\tx := 1\n\tans := 0\n\tfor i:= n-1; i>=0; i-- {\n\t\tif _,ok := cnt[total]; !ok {\n\t\t\tcnt[total] = 0\n\t\t}\n\t\tcnt[total] += 1 //S_r ≡ S_l (r,lは任意)なら+1なのでこうなってる a_0も入ってないもの(s_0)が0なので最初に0に+1\n\t\t// 理解が普通にクソムズ 数学的な素養と簡単な累積和的知識が必要\n\t\tval,_ := strconv.Atoi(Split[i])\n\t\ttotal += val*x //累積和\n\t\ttotal %= m\n\t\tans += cnt[total]\n\t\tx *= 10\n\t}\n\tfmt.Println(ans)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\nfunc scanInit () {\n\tsc.Split(bufio.ScanWords)\n}\n// func scanInt () int{\n// sc.Scan()\n//\ti,_ := strconv.Atoi(sc.Text())\n//\treturn i\n//}\nfunc scan () string{\n sc.Scan()\n\treturn sc.Text()\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "sample_input": "1817181712114\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02702", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 908, "cpu_time_ms": 7, "memory_kb": 2448}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s958622776", "group_id": "codeNet:p02702", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc scanText() string {\n\tsc.Buffer([]byte{}, math.MaxInt64)\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tN := 2019\n\ts := reverse(scanText())\n\tm := map[int]int{}\n\ttotal := 0\n\td := 1\n\tm[0] = 1\n\tfor _, c := range s {\n\t\tn, _ := strconv.Atoi(string(c))\n\t\ttotal += n * d\n\t\ttotal %= 2019\n\t\td = (d * 10) % N\n\t\tm[total]++\n\t}\n\tsum := 0\n\tfor _, v := range m {\n\t\tsum += v * (v - 1) / 2\n\t}\n\tfmt.Println(sum)\n}\n", "language": "Go", "metadata": {"date": 1591897433, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02702.html", "problem_id": "p02702", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02702/input.txt", "sample_output_relpath": "derived/input_output/data/p02702/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02702/Go/s958622776.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s958622776", "user_id": "u475329018"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc scanText() string {\n\tsc.Buffer([]byte{}, math.MaxInt64)\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tN := 2019\n\ts := reverse(scanText())\n\tm := map[int]int{}\n\ttotal := 0\n\td := 1\n\tm[0] = 1\n\tfor _, c := range s {\n\t\tn, _ := strconv.Atoi(string(c))\n\t\ttotal += n * d\n\t\ttotal %= 2019\n\t\td = (d * 10) % N\n\t\tm[total]++\n\t}\n\tsum := 0\n\tfor _, v := range m {\n\t\tsum += v * (v - 1) / 2\n\t}\n\tfmt.Println(sum)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "sample_input": "1817181712114\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02702", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 681, "cpu_time_ms": 19, "memory_kb": 3636}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s063476977", "group_id": "codeNet:p02702", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc scanText() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc reverse(s string) (result string) {\n\tfor _, v := range s {\n\t\tresult = string(v) + result\n\t}\n\treturn\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\ts := reverse(scanText())\n\tcnts := map[int]int{}\n\tsum := 0\n\td := 1\n\n\tfor _, c := range s {\n\t\tcn, _ := strconv.Atoi(string(c))\n\t\tsum += (cn * d) % 2019\n\t\td = (10 * d) % 2019\n\t\tcnts[sum%2019]++\n\t}\n\n\tans := cnts[0]\n\tfor _, cnt := range cnts {\n\t\tans += cnt * (cnt - 1) / 2\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1591886499, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02702.html", "problem_id": "p02702", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02702/input.txt", "sample_output_relpath": "derived/input_output/data/p02702/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02702/Go/s063476977.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s063476977", "user_id": "u475329018"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc scanText() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc reverse(s string) (result string) {\n\tfor _, v := range s {\n\t\tresult = string(v) + result\n\t}\n\treturn\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\ts := reverse(scanText())\n\tcnts := map[int]int{}\n\tsum := 0\n\td := 1\n\n\tfor _, c := range s {\n\t\tcn, _ := strconv.Atoi(string(c))\n\t\tsum += (cn * d) % 2019\n\t\td = (10 * d) % 2019\n\t\tcnts[sum%2019]++\n\t}\n\n\tans := cnts[0]\n\tfor _, cnt := range cnts {\n\t\tans += cnt * (cnt - 1) / 2\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "sample_input": "1817181712114\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02702", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 594, "cpu_time_ms": 69, "memory_kb": 7424}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s993759180", "group_id": "codeNet:p02702", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc scanText() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc reverse(s string) (result string) {\n\tfor _, v := range s {\n\t\tresult = string(v) + result\n\t}\n\treturn\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\ts := reverse(scanText())\n\tcnts := map[int]int{}\n\tsum := 0\n\td := 1\n\n\tcnts[0] = 1\n\tfor _, c := range s {\n\t\tcn, _ := strconv.Atoi(string(c))\n\t\tcn *= d\n\t\tsum += cn\n\t\tsum %= 2019\n\t\td *= 10\n\t\td %= 2019\n\t\tcnts[sum]++\n\t}\n\n\tans := 0\n\tfor _, cnt := range cnts {\n\t\tans += cnt * (cnt - 1) / 2\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1591885123, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02702.html", "problem_id": "p02702", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02702/input.txt", "sample_output_relpath": "derived/input_output/data/p02702/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02702/Go/s993759180.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s993759180", "user_id": "u475329018"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc scanText() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc reverse(s string) (result string) {\n\tfor _, v := range s {\n\t\tresult = string(v) + result\n\t}\n\treturn\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\ts := reverse(scanText())\n\tcnts := map[int]int{}\n\tsum := 0\n\td := 1\n\n\tcnts[0] = 1\n\tfor _, c := range s {\n\t\tcn, _ := strconv.Atoi(string(c))\n\t\tcn *= d\n\t\tsum += cn\n\t\tsum %= 2019\n\t\td *= 10\n\t\td %= 2019\n\t\tcnts[sum]++\n\t}\n\n\tans := 0\n\tfor _, cnt := range cnts {\n\t\tans += cnt * (cnt - 1) / 2\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "sample_input": "1817181712114\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02702", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 580, "cpu_time_ms": 71, "memory_kb": 7780}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s783126373", "group_id": "codeNet:p02702", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n\nfunc scanInt64() int64 {\n\tsc.Scan()\n\ti, _ := strconv.ParseInt(sc.Text(), 10, 64)\n\treturn i\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t}\n\treturn res\n}\n\nfunc scanInts64(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := range res {\n\t\tres[i] = scanInt64()\n\t}\n\treturn res\n}\n\nfunc scanText() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tvar ans int\n\ts := []rune(scanText())\n\tfor i := 0; i < len(s)-3; i++ {\n\t\tfor j := i + 4; j < len(s)+1; j++ {\n\t\t\tnum, _ := strconv.Atoi(string(s[i:j]))\n\t\t\tif num%2019 == 0 {\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1591846751, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02702.html", "problem_id": "p02702", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02702/input.txt", "sample_output_relpath": "derived/input_output/data/p02702/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02702/Go/s783126373.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s783126373", "user_id": "u475329018"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n\nfunc scanInt64() int64 {\n\tsc.Scan()\n\ti, _ := strconv.ParseInt(sc.Text(), 10, 64)\n\treturn i\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t}\n\treturn res\n}\n\nfunc scanInts64(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := range res {\n\t\tres[i] = scanInt64()\n\t}\n\treturn res\n}\n\nfunc scanText() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tvar ans int\n\ts := []rune(scanText())\n\tfor i := 0; i < len(s)-3; i++ {\n\t\tfor j := i + 4; j < len(s)+1; j++ {\n\t\t\tnum, _ := strconv.Atoi(string(s[i:j]))\n\t\t\tif num%2019 == 0 {\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "sample_input": "1817181712114\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02702", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 819, "cpu_time_ms": 2206, "memory_kb": 7420}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s190760810", "group_id": "codeNet:p02702", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextString() string {\n\tvar s string\n\tif sc.Scan() {\n\t\ts = sc.Text()\n\t}\n\treturn s\n}\n\nfunc isMultipleOf2019(i int) bool {\n\tif i%2019 == 0 {\n\t\treturn true\n\t} else {\n\t\treturn false\n\t}\n}\n\nfunc dfs(s string, start int) {\n\tif (len(s) - start) <= 0 {\n\t\treturn\n\t}\n\tlastIndex := start + 4\n\tfor ; lastIndex <= len(s); lastIndex++ {\n\t\tv := s[start:lastIndex]\n\t\tnum, _ := strconv.Atoi(v)\n\t\tif isMultipleOf2019(num) {\n\t\t\tmultipleOf2019++\n\t\t}\n\t}\n\tdfs(s, start+1)\n}\n\nvar multipleOf2019 int\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\ts := nextString()\n\tif len(s) < 4 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tdfs(s, 0)\n\tfmt.Println(multipleOf2019)\n}\n", "language": "Go", "metadata": {"date": 1590717407, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02702.html", "problem_id": "p02702", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02702/input.txt", "sample_output_relpath": "derived/input_output/data/p02702/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02702/Go/s190760810.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s190760810", "user_id": "u405747908"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextString() string {\n\tvar s string\n\tif sc.Scan() {\n\t\ts = sc.Text()\n\t}\n\treturn s\n}\n\nfunc isMultipleOf2019(i int) bool {\n\tif i%2019 == 0 {\n\t\treturn true\n\t} else {\n\t\treturn false\n\t}\n}\n\nfunc dfs(s string, start int) {\n\tif (len(s) - start) <= 0 {\n\t\treturn\n\t}\n\tlastIndex := start + 4\n\tfor ; lastIndex <= len(s); lastIndex++ {\n\t\tv := s[start:lastIndex]\n\t\tnum, _ := strconv.Atoi(v)\n\t\tif isMultipleOf2019(num) {\n\t\t\tmultipleOf2019++\n\t\t}\n\t}\n\tdfs(s, start+1)\n}\n\nvar multipleOf2019 int\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\ts := nextString()\n\tif len(s) < 4 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tdfs(s, 0)\n\tfmt.Println(multipleOf2019)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "sample_input": "1817181712114\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02702", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2206, "memory_kb": 6528}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s363694262", "group_id": "codeNet:p02702", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tscanner := makeScanner(20000000)\n\tstr := String(eGetLine(scanner))\n\ts := str.revese()\n\tn := 0\n\td := 1\n\tvar counts [2019]int\n\tcounts[0] = 1\n\tfor i := 0; i < len(s); i++ {\n\t\tc := eAtoi(string(s[i]))\n\t\tn = n + c*d\n\t\tcounts[n%2019]++\n\t\td *= 10\n\t}\n\tsum := 0\n\tfor _, v := range counts {\n\t\tif v != 0 {\n\t\t\tsum += v * (v - 1) / 2\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n\n////////////////////////////////////////////////////////////////////////////////\n// ライブラリ\n////////////////////////////////////////////////////////////////////////////////\nconst (\n\tTooLarge = math.MaxInt64\n\tTooSmall = math.MinInt64\n)\n\nfunc makeScanner(maxByte int) *bufio.Scanner {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Buffer(make([]uint8, 0, 8192), maxByte)\n\treturn scanner\n}\nfunc makeCharScanner() *bufio.Scanner {\n\tscanner := makeScanner(8192)\n\tscanner.Split(bufio.ScanRunes)\n\treturn scanner\n}\nfunc makeWordScanner() *bufio.Scanner {\n\tscanner := makeScanner(8192)\n\tscanner.Split(bufio.ScanWords)\n\treturn scanner\n}\nfunc eGetLine(r *bufio.Scanner) string {\n\tif r.Scan() {\n\t\treturn r.Text()\n\t}\n\terr := r.Err()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\t// EOF\n\treturn \"\"\n}\nfunc eGetInt(r *bufio.Scanner) int {\n\tline := eGetLine(r)\n\treturn eAtoi(line)\n}\nfunc eGetInt64(r *bufio.Scanner) int64 {\n\tline := eGetLine(r)\n\treturn eAtoInt64(line)\n}\nfunc eGetFields(r *bufio.Scanner) []string {\n\tline := eGetLine(r)\n\treturn strings.Fields(line)\n}\nfunc eGetInts(r *bufio.Scanner) []int {\n\tfields := eGetFields(r)\n\tints := make([]int, len(fields))\n\tfor i := 0; i < len(ints); i++ {\n\t\tints[i] = eAtoi(fields[i])\n\t}\n\treturn ints\n}\nfunc eGetInt64s(r *bufio.Scanner) []int64 {\n\tfields := eGetFields(r)\n\tints := make([]int64, len(fields))\n\tfor i := 0; i < len(ints); i++ {\n\t\tints[i] = eAtoInt64(fields[i])\n\t}\n\treturn ints\n}\nfunc eGetChars(r *bufio.Scanner) []string {\n\tline := eGetLine(r)\n\treturn strings.Split(line, \"\")\n}\nfunc eAtoi(s string) int {\n\tn, err := strconv.Atoi(s)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn n\n}\nfunc eAtoInt64(s string) int64 {\n\tn, err := strconv.ParseInt(s, 10, 64)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn n\n}\nfunc pow(a, n int) int {\n\tif n == 0 {\n\t\treturn 1\n\t}\n\tif n == 1 {\n\t\treturn a\n\t}\n\tif n%2 == 1 {\n\t\treturn pow((a*a), n/2) * a\n\t}\n\treturn pow((a * a), n/2)\n}\nfunc powMod(a, n, mod int) int {\n\tif n == 0 {\n\t\treturn 1 % mod\n\t}\n\tif n == 1 {\n\t\treturn a % mod\n\t}\n\tif n%2 == 1 {\n\t\treturn powMod((a*a)%mod, n/2, mod) * a % mod\n\t}\n\treturn powMod((a*a)%mod, n/2, mod)\n}\n\nfunc factoricalMod(n, count, mod int) int {\n\tif count == 1 {\n\t\treturn n % mod\n\t}\n\treturn (n % mod) * (factoricalMod(n-1, count-1, mod)) % mod\n}\n\nfunc combinationMod(n, a, mod int) int {\n\tx := factoricalMod(n, a, mod)\n\ty := factoricalMod(a, a, mod)\n\ty = powMod(y, mod-2, mod)\n\treturn ((x % mod) * (y % mod)) % mod\n}\nfunc countBitOfOn(i, numbits int) int {\n\tcount := 0\n\tvar bit uint64\n\tfor bit = 0; bit < uint64(numbits); bit++ {\n\t\tt := 1 << bit\n\t\tif i&t > 0 {\n\t\t\tcount++\n\t\t}\n\t}\n\treturn count\n}\n\ntype ints []int\n\nfunc ToString(slice []int) string {\n\tformat := fmt.Sprint(slice)\n\treturn fmt.Sprint(format[1 : len(format)-1])\n}\n\ntype String string\n\nfunc (s String) revese() string {\n\tb := []byte(s)\n\tfor i := 0; i < len(b)/2; i++ {\n\t\tb[i], b[len(b)-1-i] = b[len(b)-1-i], b[i]\n\t}\n\treturn string(b)\n}\n", "language": "Go", "metadata": {"date": 1588535552, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02702.html", "problem_id": "p02702", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02702/input.txt", "sample_output_relpath": "derived/input_output/data/p02702/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02702/Go/s363694262.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s363694262", "user_id": "u663116078"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tscanner := makeScanner(20000000)\n\tstr := String(eGetLine(scanner))\n\ts := str.revese()\n\tn := 0\n\td := 1\n\tvar counts [2019]int\n\tcounts[0] = 1\n\tfor i := 0; i < len(s); i++ {\n\t\tc := eAtoi(string(s[i]))\n\t\tn = n + c*d\n\t\tcounts[n%2019]++\n\t\td *= 10\n\t}\n\tsum := 0\n\tfor _, v := range counts {\n\t\tif v != 0 {\n\t\t\tsum += v * (v - 1) / 2\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n\n////////////////////////////////////////////////////////////////////////////////\n// ライブラリ\n////////////////////////////////////////////////////////////////////////////////\nconst (\n\tTooLarge = math.MaxInt64\n\tTooSmall = math.MinInt64\n)\n\nfunc makeScanner(maxByte int) *bufio.Scanner {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Buffer(make([]uint8, 0, 8192), maxByte)\n\treturn scanner\n}\nfunc makeCharScanner() *bufio.Scanner {\n\tscanner := makeScanner(8192)\n\tscanner.Split(bufio.ScanRunes)\n\treturn scanner\n}\nfunc makeWordScanner() *bufio.Scanner {\n\tscanner := makeScanner(8192)\n\tscanner.Split(bufio.ScanWords)\n\treturn scanner\n}\nfunc eGetLine(r *bufio.Scanner) string {\n\tif r.Scan() {\n\t\treturn r.Text()\n\t}\n\terr := r.Err()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\t// EOF\n\treturn \"\"\n}\nfunc eGetInt(r *bufio.Scanner) int {\n\tline := eGetLine(r)\n\treturn eAtoi(line)\n}\nfunc eGetInt64(r *bufio.Scanner) int64 {\n\tline := eGetLine(r)\n\treturn eAtoInt64(line)\n}\nfunc eGetFields(r *bufio.Scanner) []string {\n\tline := eGetLine(r)\n\treturn strings.Fields(line)\n}\nfunc eGetInts(r *bufio.Scanner) []int {\n\tfields := eGetFields(r)\n\tints := make([]int, len(fields))\n\tfor i := 0; i < len(ints); i++ {\n\t\tints[i] = eAtoi(fields[i])\n\t}\n\treturn ints\n}\nfunc eGetInt64s(r *bufio.Scanner) []int64 {\n\tfields := eGetFields(r)\n\tints := make([]int64, len(fields))\n\tfor i := 0; i < len(ints); i++ {\n\t\tints[i] = eAtoInt64(fields[i])\n\t}\n\treturn ints\n}\nfunc eGetChars(r *bufio.Scanner) []string {\n\tline := eGetLine(r)\n\treturn strings.Split(line, \"\")\n}\nfunc eAtoi(s string) int {\n\tn, err := strconv.Atoi(s)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn n\n}\nfunc eAtoInt64(s string) int64 {\n\tn, err := strconv.ParseInt(s, 10, 64)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn n\n}\nfunc pow(a, n int) int {\n\tif n == 0 {\n\t\treturn 1\n\t}\n\tif n == 1 {\n\t\treturn a\n\t}\n\tif n%2 == 1 {\n\t\treturn pow((a*a), n/2) * a\n\t}\n\treturn pow((a * a), n/2)\n}\nfunc powMod(a, n, mod int) int {\n\tif n == 0 {\n\t\treturn 1 % mod\n\t}\n\tif n == 1 {\n\t\treturn a % mod\n\t}\n\tif n%2 == 1 {\n\t\treturn powMod((a*a)%mod, n/2, mod) * a % mod\n\t}\n\treturn powMod((a*a)%mod, n/2, mod)\n}\n\nfunc factoricalMod(n, count, mod int) int {\n\tif count == 1 {\n\t\treturn n % mod\n\t}\n\treturn (n % mod) * (factoricalMod(n-1, count-1, mod)) % mod\n}\n\nfunc combinationMod(n, a, mod int) int {\n\tx := factoricalMod(n, a, mod)\n\ty := factoricalMod(a, a, mod)\n\ty = powMod(y, mod-2, mod)\n\treturn ((x % mod) * (y % mod)) % mod\n}\nfunc countBitOfOn(i, numbits int) int {\n\tcount := 0\n\tvar bit uint64\n\tfor bit = 0; bit < uint64(numbits); bit++ {\n\t\tt := 1 << bit\n\t\tif i&t > 0 {\n\t\t\tcount++\n\t\t}\n\t}\n\treturn count\n}\n\ntype ints []int\n\nfunc ToString(slice []int) string {\n\tformat := fmt.Sprint(slice)\n\treturn fmt.Sprint(format[1 : len(format)-1])\n}\n\ntype String string\n\nfunc (s String) revese() string {\n\tb := []byte(s)\n\tfor i := 0; i < len(b)/2; i++ {\n\t\tb[i], b[len(b)-1-i] = b[len(b)-1-i], b[i]\n\t}\n\treturn string(b)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "sample_input": "1817181712114\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02702", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3347, "cpu_time_ms": 5, "memory_kb": 2952}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s500080019", "group_id": "codeNet:p02702", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tscanner := makeScanner(2000000)\n\tstr := String(eGetLine(scanner))\n\ts := str.revese()\n\tn := 0\n\td := 1\n\tvar counts [2019]int\n\tcounts[0] = 1\n\tfor i := 0; i < len(s); i++ {\n\t\tc := eAtoi(string(s[i]))\n\t\tn = n + c*d\n\t\tcounts[n%2019]++\n\t\td *= 10\n\t}\n\tsum := 0\n\tfor _, v := range counts {\n\t\tif v != 0 {\n\t\t\tsum += v * (v - 1) / 2\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n\n////////////////////////////////////////////////////////////////////////////////\n// ライブラリ\n////////////////////////////////////////////////////////////////////////////////\nconst (\n\tTooLarge = math.MaxInt64\n\tTooSmall = math.MinInt64\n)\n\nfunc makeScanner(maxByte int) *bufio.Scanner {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Buffer(make([]uint8, 0, 8192), maxByte)\n\treturn scanner\n}\nfunc makeCharScanner() *bufio.Scanner {\n\tscanner := makeScanner(8192)\n\tscanner.Split(bufio.ScanRunes)\n\treturn scanner\n}\nfunc makeWordScanner() *bufio.Scanner {\n\tscanner := makeScanner(8192)\n\tscanner.Split(bufio.ScanWords)\n\treturn scanner\n}\nfunc eGetLine(r *bufio.Scanner) string {\n\tif r.Scan() {\n\t\treturn r.Text()\n\t}\n\terr := r.Err()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\t// EOF\n\treturn \"\"\n}\nfunc eGetInt(r *bufio.Scanner) int {\n\tline := eGetLine(r)\n\treturn eAtoi(line)\n}\nfunc eGetInt64(r *bufio.Scanner) int64 {\n\tline := eGetLine(r)\n\treturn eAtoInt64(line)\n}\nfunc eGetFields(r *bufio.Scanner) []string {\n\tline := eGetLine(r)\n\treturn strings.Fields(line)\n}\nfunc eGetInts(r *bufio.Scanner) []int {\n\tfields := eGetFields(r)\n\tints := make([]int, len(fields))\n\tfor i := 0; i < len(ints); i++ {\n\t\tints[i] = eAtoi(fields[i])\n\t}\n\treturn ints\n}\nfunc eGetInt64s(r *bufio.Scanner) []int64 {\n\tfields := eGetFields(r)\n\tints := make([]int64, len(fields))\n\tfor i := 0; i < len(ints); i++ {\n\t\tints[i] = eAtoInt64(fields[i])\n\t}\n\treturn ints\n}\nfunc eGetChars(r *bufio.Scanner) []string {\n\tline := eGetLine(r)\n\treturn strings.Split(line, \"\")\n}\nfunc eAtoi(s string) int {\n\tn, err := strconv.Atoi(s)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn n\n}\nfunc eAtoInt64(s string) int64 {\n\tn, err := strconv.ParseInt(s, 10, 64)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn n\n}\nfunc pow(a, n int) int {\n\tif n == 0 {\n\t\treturn 1\n\t}\n\tif n == 1 {\n\t\treturn a\n\t}\n\tif n%2 == 1 {\n\t\treturn pow((a*a), n/2) * a\n\t}\n\treturn pow((a * a), n/2)\n}\nfunc powMod(a, n, mod int) int {\n\tif n == 0 {\n\t\treturn 1 % mod\n\t}\n\tif n == 1 {\n\t\treturn a % mod\n\t}\n\tif n%2 == 1 {\n\t\treturn powMod((a*a)%mod, n/2, mod) * a % mod\n\t}\n\treturn powMod((a*a)%mod, n/2, mod)\n}\n\nfunc factoricalMod(n, count, mod int) int {\n\tif count == 1 {\n\t\treturn n % mod\n\t}\n\treturn (n % mod) * (factoricalMod(n-1, count-1, mod)) % mod\n}\n\nfunc combinationMod(n, a, mod int) int {\n\tx := factoricalMod(n, a, mod)\n\ty := factoricalMod(a, a, mod)\n\ty = powMod(y, mod-2, mod)\n\treturn ((x % mod) * (y % mod)) % mod\n}\nfunc countBitOfOn(i, numbits int) int {\n\tcount := 0\n\tvar bit uint64\n\tfor bit = 0; bit < uint64(numbits); bit++ {\n\t\tt := 1 << bit\n\t\tif i&t > 0 {\n\t\t\tcount++\n\t\t}\n\t}\n\treturn count\n}\n\ntype ints []int\n\nfunc ToString(slice []int) string {\n\tformat := fmt.Sprint(slice)\n\treturn fmt.Sprint(format[1 : len(format)-1])\n}\n\ntype String string\n\nfunc (s String) revese() string {\n\tb := []byte(s)\n\tfor i := 0; i < len(b)/2; i++ {\n\t\tb[i], b[len(b)-1-i] = b[len(b)-1-i], b[i]\n\t}\n\treturn string(b)\n}\n", "language": "Go", "metadata": {"date": 1588535504, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02702.html", "problem_id": "p02702", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02702/input.txt", "sample_output_relpath": "derived/input_output/data/p02702/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02702/Go/s500080019.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s500080019", "user_id": "u663116078"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tscanner := makeScanner(2000000)\n\tstr := String(eGetLine(scanner))\n\ts := str.revese()\n\tn := 0\n\td := 1\n\tvar counts [2019]int\n\tcounts[0] = 1\n\tfor i := 0; i < len(s); i++ {\n\t\tc := eAtoi(string(s[i]))\n\t\tn = n + c*d\n\t\tcounts[n%2019]++\n\t\td *= 10\n\t}\n\tsum := 0\n\tfor _, v := range counts {\n\t\tif v != 0 {\n\t\t\tsum += v * (v - 1) / 2\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n\n////////////////////////////////////////////////////////////////////////////////\n// ライブラリ\n////////////////////////////////////////////////////////////////////////////////\nconst (\n\tTooLarge = math.MaxInt64\n\tTooSmall = math.MinInt64\n)\n\nfunc makeScanner(maxByte int) *bufio.Scanner {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Buffer(make([]uint8, 0, 8192), maxByte)\n\treturn scanner\n}\nfunc makeCharScanner() *bufio.Scanner {\n\tscanner := makeScanner(8192)\n\tscanner.Split(bufio.ScanRunes)\n\treturn scanner\n}\nfunc makeWordScanner() *bufio.Scanner {\n\tscanner := makeScanner(8192)\n\tscanner.Split(bufio.ScanWords)\n\treturn scanner\n}\nfunc eGetLine(r *bufio.Scanner) string {\n\tif r.Scan() {\n\t\treturn r.Text()\n\t}\n\terr := r.Err()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\t// EOF\n\treturn \"\"\n}\nfunc eGetInt(r *bufio.Scanner) int {\n\tline := eGetLine(r)\n\treturn eAtoi(line)\n}\nfunc eGetInt64(r *bufio.Scanner) int64 {\n\tline := eGetLine(r)\n\treturn eAtoInt64(line)\n}\nfunc eGetFields(r *bufio.Scanner) []string {\n\tline := eGetLine(r)\n\treturn strings.Fields(line)\n}\nfunc eGetInts(r *bufio.Scanner) []int {\n\tfields := eGetFields(r)\n\tints := make([]int, len(fields))\n\tfor i := 0; i < len(ints); i++ {\n\t\tints[i] = eAtoi(fields[i])\n\t}\n\treturn ints\n}\nfunc eGetInt64s(r *bufio.Scanner) []int64 {\n\tfields := eGetFields(r)\n\tints := make([]int64, len(fields))\n\tfor i := 0; i < len(ints); i++ {\n\t\tints[i] = eAtoInt64(fields[i])\n\t}\n\treturn ints\n}\nfunc eGetChars(r *bufio.Scanner) []string {\n\tline := eGetLine(r)\n\treturn strings.Split(line, \"\")\n}\nfunc eAtoi(s string) int {\n\tn, err := strconv.Atoi(s)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn n\n}\nfunc eAtoInt64(s string) int64 {\n\tn, err := strconv.ParseInt(s, 10, 64)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn n\n}\nfunc pow(a, n int) int {\n\tif n == 0 {\n\t\treturn 1\n\t}\n\tif n == 1 {\n\t\treturn a\n\t}\n\tif n%2 == 1 {\n\t\treturn pow((a*a), n/2) * a\n\t}\n\treturn pow((a * a), n/2)\n}\nfunc powMod(a, n, mod int) int {\n\tif n == 0 {\n\t\treturn 1 % mod\n\t}\n\tif n == 1 {\n\t\treturn a % mod\n\t}\n\tif n%2 == 1 {\n\t\treturn powMod((a*a)%mod, n/2, mod) * a % mod\n\t}\n\treturn powMod((a*a)%mod, n/2, mod)\n}\n\nfunc factoricalMod(n, count, mod int) int {\n\tif count == 1 {\n\t\treturn n % mod\n\t}\n\treturn (n % mod) * (factoricalMod(n-1, count-1, mod)) % mod\n}\n\nfunc combinationMod(n, a, mod int) int {\n\tx := factoricalMod(n, a, mod)\n\ty := factoricalMod(a, a, mod)\n\ty = powMod(y, mod-2, mod)\n\treturn ((x % mod) * (y % mod)) % mod\n}\nfunc countBitOfOn(i, numbits int) int {\n\tcount := 0\n\tvar bit uint64\n\tfor bit = 0; bit < uint64(numbits); bit++ {\n\t\tt := 1 << bit\n\t\tif i&t > 0 {\n\t\t\tcount++\n\t\t}\n\t}\n\treturn count\n}\n\ntype ints []int\n\nfunc ToString(slice []int) string {\n\tformat := fmt.Sprint(slice)\n\treturn fmt.Sprint(format[1 : len(format)-1])\n}\n\ntype String string\n\nfunc (s String) revese() string {\n\tb := []byte(s)\n\tfor i := 0; i < len(b)/2; i++ {\n\t\tb[i], b[len(b)-1-i] = b[len(b)-1-i], b[i]\n\t}\n\treturn string(b)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "sample_input": "1817181712114\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02702", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3346, "cpu_time_ms": 8, "memory_kb": 2952}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s781954812", "group_id": "codeNet:p02702", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc main() {\n\tvar sc = bufio.NewScanner(os.Stdin)\n\tsc.Buffer([]byte{}, math.MaxInt64)\n\tsc.Scan()\n\tS := sc.Text()\n\tS = reverse(S)\n\tN := 2019\n\tvar m = make([]int, N)\n\t// 10と2019は「互いに素」なので、累積和同士の剰余が等しいとき定数倍した累積和同士の剰余も等しい\n\t// x===y (mod 2019) <=> 10x===10y (mod 2019)\n\tm[0]++ // s0=0 (何も累積していない)\n\ttotal := 0\n\tten := 1\n\tfor x := 0; x < len(S); x++ {\n\t\ttmp, _ := strconv.Atoi(S[x : x+1])\n\t\ttotal += (tmp * ten) % N\n\t\t// 10^x (xが十分大きい) を剰余するとオーバーフローするのでNで剰余取りながら累積和をとる\n\t\tten = (ten * 10) % N\n\t\tm[total%N]++\n\t}\n\tcnt := 0\n\tfor _, v := range m {\n\t\t// 剰余の計算結果から2組ずつ選ぶパターン数を足す\n\t\t// ex) 2C2=1, 3C2=3\n\t\tcnt += v * (v - 1) / 2\n\t}\n\tfmt.Println(cnt)\n}\n", "language": "Go", "metadata": {"date": 1588447272, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02702.html", "problem_id": "p02702", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02702/input.txt", "sample_output_relpath": "derived/input_output/data/p02702/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02702/Go/s781954812.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s781954812", "user_id": "u884847580"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc main() {\n\tvar sc = bufio.NewScanner(os.Stdin)\n\tsc.Buffer([]byte{}, math.MaxInt64)\n\tsc.Scan()\n\tS := sc.Text()\n\tS = reverse(S)\n\tN := 2019\n\tvar m = make([]int, N)\n\t// 10と2019は「互いに素」なので、累積和同士の剰余が等しいとき定数倍した累積和同士の剰余も等しい\n\t// x===y (mod 2019) <=> 10x===10y (mod 2019)\n\tm[0]++ // s0=0 (何も累積していない)\n\ttotal := 0\n\tten := 1\n\tfor x := 0; x < len(S); x++ {\n\t\ttmp, _ := strconv.Atoi(S[x : x+1])\n\t\ttotal += (tmp * ten) % N\n\t\t// 10^x (xが十分大きい) を剰余するとオーバーフローするのでNで剰余取りながら累積和をとる\n\t\tten = (ten * 10) % N\n\t\tm[total%N]++\n\t}\n\tcnt := 0\n\tfor _, v := range m {\n\t\t// 剰余の計算結果から2組ずつ選ぶパターン数を足す\n\t\t// ex) 2C2=1, 3C2=3\n\t\tcnt += v * (v - 1) / 2\n\t}\n\tfmt.Println(cnt)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "sample_input": "1817181712114\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02702", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1102, "cpu_time_ms": 15, "memory_kb": 3448}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s756135238", "group_id": "codeNet:p02702", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar scanner = bufio.NewScanner(os.Stdin)\n\tvar p string\n\tif scanner.Scan() {\n\t\tp = scanner.Text()\n\t}\n\tslice := strings.Split(p, \"\")\n\ts := 0\n\ts2 := 1\n\tm := map[int]int{}\n\tm[0]++\n\tfor i := len(slice) - 1; i >= 0; i-- {\n\t\tq, _ := strconv.Atoi(slice[i])\n\t\ts += s2 * q\n\t\tm[s%2019]++\n\t\ts2 *= 10\n\t\ts2 %= 2019\n\t}\n\tans := 0\n\tfor _, v := range m {\n\t\tans += v * (v - 1) / 2\n\t}\n\tfmt.Println(ans)\n\n}\n", "language": "Go", "metadata": {"date": 1588394275, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02702.html", "problem_id": "p02702", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02702/input.txt", "sample_output_relpath": "derived/input_output/data/p02702/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02702/Go/s756135238.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s756135238", "user_id": "u002831011"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar scanner = bufio.NewScanner(os.Stdin)\n\tvar p string\n\tif scanner.Scan() {\n\t\tp = scanner.Text()\n\t}\n\tslice := strings.Split(p, \"\")\n\ts := 0\n\ts2 := 1\n\tm := map[int]int{}\n\tm[0]++\n\tfor i := len(slice) - 1; i >= 0; i-- {\n\t\tq, _ := strconv.Atoi(slice[i])\n\t\ts += s2 * q\n\t\tm[s%2019]++\n\t\ts2 *= 10\n\t\ts2 %= 2019\n\t}\n\tans := 0\n\tfor _, v := range m {\n\t\tans += v * (v - 1) / 2\n\t}\n\tfmt.Println(ans)\n\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "sample_input": "1817181712114\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02702", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 471, "cpu_time_ms": 4, "memory_kb": 2620}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s122934112", "group_id": "codeNet:p02702", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar scanner = bufio.NewScanner(os.Stdin)\n\tvar p string\n\tif scanner.Scan() {\n\t\tp = scanner.Text()\n\t}\n\tslice := strings.Split(p, \"\")\n\ts := 0\n\ts2 := 1\n\tm := map[int]int{}\n\tm[0]++\n\tfor i := len(slice) - 1; i >= 0; i-- {\n\t\tq, _ := strconv.Atoi(slice[i])\n\t\ts += s2 * q\n\t\tm[s%2019]++\n\t\ts2 *= 10\n\t}\n\tans := 0\n\tfor _, v := range m {\n\t\tans += v * (v - 1) / 2\n\t}\n\tfmt.Println(ans)\n\n}\n", "language": "Go", "metadata": {"date": 1588394030, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02702.html", "problem_id": "p02702", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02702/input.txt", "sample_output_relpath": "derived/input_output/data/p02702/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02702/Go/s122934112.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s122934112", "user_id": "u002831011"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar scanner = bufio.NewScanner(os.Stdin)\n\tvar p string\n\tif scanner.Scan() {\n\t\tp = scanner.Text()\n\t}\n\tslice := strings.Split(p, \"\")\n\ts := 0\n\ts2 := 1\n\tm := map[int]int{}\n\tm[0]++\n\tfor i := len(slice) - 1; i >= 0; i-- {\n\t\tq, _ := strconv.Atoi(slice[i])\n\t\ts += s2 * q\n\t\tm[s%2019]++\n\t\ts2 *= 10\n\t}\n\tans := 0\n\tfor _, v := range m {\n\t\tans += v * (v - 1) / 2\n\t}\n\tfmt.Println(ans)\n\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "sample_input": "1817181712114\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02702", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 458, "cpu_time_ms": 6, "memory_kb": 2444}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s100814734", "group_id": "codeNet:p02702", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc countMod(str string) map[int]int {\n\tconst div = 2019\n\tprev := 0\n\tl := len(str)\n\tdigit := 1\n\tcount := make(map[int]int)\n\tcount[0] = 1\n\tfor i := l - 1; i >= 0; i-- {\n\t\tn := int(rune(str[i]) - '0')\n\t\tmod := (n*digit + prev) % div\n\t\tcount[mod]++\n\t\tprev = mod\n\t\tdigit *= 10\n\t}\n\treturn count\n}\n\nfunc solve(str string) int {\n\tcount := countMod(str)\n\tans := 0\n\tfor _, v := range count {\n\t\tans += v * (v - 1) / 2\n\t}\n\treturn ans\n}\n\nfunc main() {\n\tvar str string\n\tfmt.Scan(&str)\n\n\tans := solve(str)\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1588366732, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02702.html", "problem_id": "p02702", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02702/input.txt", "sample_output_relpath": "derived/input_output/data/p02702/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02702/Go/s100814734.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s100814734", "user_id": "u275316733"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc countMod(str string) map[int]int {\n\tconst div = 2019\n\tprev := 0\n\tl := len(str)\n\tdigit := 1\n\tcount := make(map[int]int)\n\tcount[0] = 1\n\tfor i := l - 1; i >= 0; i-- {\n\t\tn := int(rune(str[i]) - '0')\n\t\tmod := (n*digit + prev) % div\n\t\tcount[mod]++\n\t\tprev = mod\n\t\tdigit *= 10\n\t}\n\treturn count\n}\n\nfunc solve(str string) int {\n\tcount := countMod(str)\n\tans := 0\n\tfor _, v := range count {\n\t\tans += v * (v - 1) / 2\n\t}\n\treturn ans\n}\n\nfunc main() {\n\tvar str string\n\tfmt.Scan(&str)\n\n\tans := solve(str)\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "sample_input": "1817181712114\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02702", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 546, "cpu_time_ms": 153, "memory_kb": 3276}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s064953866", "group_id": "codeNet:p02702", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tn := len(s)\n\tm := make([]int, 2019)\n\tc := 0\n\tm[0] = 1\n\tfor i := n - 1; i >= 0; i-- {\n\t\tt, _ := strconv.Atoi((s[i:]))\n\t\tm[t%2019]++\n\t}\n\tfor i := 0; i < 2019; i++ {\n\t\tc += m[i] * (m[i] - 1) / 2\n\t}\n\tfmt.Println(c)\n}\n", "language": "Go", "metadata": {"date": 1587964599, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02702.html", "problem_id": "p02702", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02702/input.txt", "sample_output_relpath": "derived/input_output/data/p02702/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02702/Go/s064953866.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s064953866", "user_id": "u037710225"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tn := len(s)\n\tm := make([]int, 2019)\n\tc := 0\n\tm[0] = 1\n\tfor i := n - 1; i >= 0; i-- {\n\t\tt, _ := strconv.Atoi((s[i:]))\n\t\tm[t%2019]++\n\t}\n\tfor i := 0; i < 2019; i++ {\n\t\tc += m[i] * (m[i] - 1) / 2\n\t}\n\tfmt.Println(c)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "sample_input": "1817181712114\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02702", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 300, "cpu_time_ms": 188, "memory_kb": 6440}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s414275887", "group_id": "codeNet:p02702", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 100000\n\tmaxBufSize = 10000000\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twt = bufio.NewWriter(os.Stdout)\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(next())\n\treturn i\n}\n\nfunc nextInts(n int) []int {\n\tslice := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tslice[i] = nextInt()\n\t}\n\treturn slice\n}\n\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(next(), 64)\n\treturn f\n}\n\nfunc nextFloat64s(n int) []float64 {\n\tslice := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tslice[i] = nextFloat64()\n\t}\n\treturn slice\n}\n\nfunc putf(format string, a ...interface{}) {\n\tfmt.Fprintf(wt, format, a...)\n}\n\nfunc puts(a ...interface{}) {\n\tfmt.Fprintln(wt, a...)\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer wt.Flush()\n\n\ts := next()\n\tn := len(s)\n\n\tdp := make([]int, n+1)\n\tdp[n] = 0\n\tfor i, tens := n-1, 1; i >= 0; i-- {\n\t\tdp[i] = (dp[i+1] + int(s[i]-'0')*tens) % 2019\n\t\ttens = (tens * 10) % 2019\n\t}\n\t// puts(dp)\n\n\tmod := map[int]int{}\n\tfor i := range dp {\n\t\tmod[dp[i]]++\n\t}\n\t// puts(mod)\n\n\tans := 0\n\tfor _, v := range mod {\n\t\tans += v - 1\n\t}\n\tputs(ans)\n}\n", "language": "Go", "metadata": {"date": 1587962707, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02702.html", "problem_id": "p02702", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02702/input.txt", "sample_output_relpath": "derived/input_output/data/p02702/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02702/Go/s414275887.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s414275887", "user_id": "u502813058"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 100000\n\tmaxBufSize = 10000000\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twt = bufio.NewWriter(os.Stdout)\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(next())\n\treturn i\n}\n\nfunc nextInts(n int) []int {\n\tslice := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tslice[i] = nextInt()\n\t}\n\treturn slice\n}\n\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(next(), 64)\n\treturn f\n}\n\nfunc nextFloat64s(n int) []float64 {\n\tslice := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tslice[i] = nextFloat64()\n\t}\n\treturn slice\n}\n\nfunc putf(format string, a ...interface{}) {\n\tfmt.Fprintf(wt, format, a...)\n}\n\nfunc puts(a ...interface{}) {\n\tfmt.Fprintln(wt, a...)\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer wt.Flush()\n\n\ts := next()\n\tn := len(s)\n\n\tdp := make([]int, n+1)\n\tdp[n] = 0\n\tfor i, tens := n-1, 1; i >= 0; i-- {\n\t\tdp[i] = (dp[i+1] + int(s[i]-'0')*tens) % 2019\n\t\ttens = (tens * 10) % 2019\n\t}\n\t// puts(dp)\n\n\tmod := map[int]int{}\n\tfor i := range dp {\n\t\tmod[dp[i]]++\n\t}\n\t// puts(mod)\n\n\tans := 0\n\tfor _, v := range mod {\n\t\tans += v - 1\n\t}\n\tputs(ans)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "sample_input": "1817181712114\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02702", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1242, "cpu_time_ms": 19, "memory_kb": 4304}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s360633104", "group_id": "codeNet:p02702", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nvar S string\n\nfunc main() {\n\tfmt.Scan(&S)\n\ta := make([]int, len(S))\n\tfor i, v := range S {\n\t\ta[i], _ = strconv.Atoi(string(v))\n\t}\n\tb := map[int]int{\n\t\tlen(S): 0,\n\t}\n\tc := 1\n\td := map[int]int{}\n\tres := 0\n\tfor i := len(S) - 1; i >= 0; i-- {\n\t\tb[i] = (a[i]*c + b[i+1]) % 2019\n\t\tc *= 10\n\t\tif d[b[i]] >= 1 {\n\t\t\tres += d[b[i]]\n\t\t}\n\t\td[b[i]]++\n\t}\n\n\tfmt.Println(res + d[0])\n}\n", "language": "Go", "metadata": {"date": 1587962563, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02702.html", "problem_id": "p02702", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02702/input.txt", "sample_output_relpath": "derived/input_output/data/p02702/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02702/Go/s360633104.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s360633104", "user_id": "u686302771"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nvar S string\n\nfunc main() {\n\tfmt.Scan(&S)\n\ta := make([]int, len(S))\n\tfor i, v := range S {\n\t\ta[i], _ = strconv.Atoi(string(v))\n\t}\n\tb := map[int]int{\n\t\tlen(S): 0,\n\t}\n\tc := 1\n\td := map[int]int{}\n\tres := 0\n\tfor i := len(S) - 1; i >= 0; i-- {\n\t\tb[i] = (a[i]*c + b[i+1]) % 2019\n\t\tc *= 10\n\t\tif d[b[i]] >= 1 {\n\t\t\tres += d[b[i]]\n\t\t}\n\t\td[b[i]]++\n\t}\n\n\tfmt.Println(res + d[0])\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "sample_input": "1817181712114\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02702", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 412, "cpu_time_ms": 197, "memory_kb": 15192}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s678514519", "group_id": "codeNet:p02702", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nvar S string\n\nfunc main() {\n\tfmt.Scan(&S)\n\ta := make([]int, len(S))\n\tfor i, v := range S {\n\t\ta[i], _ = strconv.Atoi(string(v))\n\t}\n\tb := map[int]int{\n\t\tlen(S): 0,\n\t}\n\tc := 1\n\td := map[int]bool{\n\t\t0: true,\n\t}\n\tres := 0\n\tfor i := len(S) - 1; i >= 0; i-- {\n\t\tb[i] = (a[i]*c + b[i+1]) % 2019\n\t\tc *= 10\n\t\tif d[b[i]] {\n\t\t\tres++\n\t\t\tcontinue\n\t\t}\n\t\td[b[i]] = true\n\t}\n\n\tfmt.Printf(\"%d\",res)\n}\n", "language": "Go", "metadata": {"date": 1587960903, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02702.html", "problem_id": "p02702", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02702/input.txt", "sample_output_relpath": "derived/input_output/data/p02702/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02702/Go/s678514519.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s678514519", "user_id": "u686302771"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nvar S string\n\nfunc main() {\n\tfmt.Scan(&S)\n\ta := make([]int, len(S))\n\tfor i, v := range S {\n\t\ta[i], _ = strconv.Atoi(string(v))\n\t}\n\tb := map[int]int{\n\t\tlen(S): 0,\n\t}\n\tc := 1\n\td := map[int]bool{\n\t\t0: true,\n\t}\n\tres := 0\n\tfor i := len(S) - 1; i >= 0; i-- {\n\t\tb[i] = (a[i]*c + b[i+1]) % 2019\n\t\tc *= 10\n\t\tif d[b[i]] {\n\t\t\tres++\n\t\t\tcontinue\n\t\t}\n\t\td[b[i]] = true\n\t}\n\n\tfmt.Printf(\"%d\",res)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "sample_input": "1817181712114\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02702", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 426, "cpu_time_ms": 182, "memory_kb": 15188}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s441276592", "group_id": "codeNet:p02702", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"index/suffixarray\"\n\t\"strconv\"\n)\n\nfunc main() {\n\t// Code for D - Multiple of 2019\n\tvar s string\n\tfmt.Scanf(\"%s\", &s)\n\tindex := suffixarray.New([]byte(s))\n\n\tedges := map[int]int{}\n\tfor i := 1; i <= 9999; i++ {\n\t\tb := strconv.Itoa(i * 2019)\n\t\tlookup := index.Lookup([]byte(b), -1)\n\t\tif len(lookup) > 0 {\n\t\t\tfor _, start := range lookup {\n\t\t\t\tedges[start] = start + len(b)\n\t\t\t}\n\t\t}\n\t}\n\n\ttotal := 0\n\tfor i := 0; i < len(s); i++ {\n\t\tvar ok bool\n\t\tend := i\n\t\tfor {\n\t\t\tend, ok = edges[end]\n\t\t\tif !ok {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\ttotal += 1\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\", total)\n}", "language": "Go", "metadata": {"date": 1587952792, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02702.html", "problem_id": "p02702", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02702/input.txt", "sample_output_relpath": "derived/input_output/data/p02702/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02702/Go/s441276592.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s441276592", "user_id": "u638629468"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"index/suffixarray\"\n\t\"strconv\"\n)\n\nfunc main() {\n\t// Code for D - Multiple of 2019\n\tvar s string\n\tfmt.Scanf(\"%s\", &s)\n\tindex := suffixarray.New([]byte(s))\n\n\tedges := map[int]int{}\n\tfor i := 1; i <= 9999; i++ {\n\t\tb := strconv.Itoa(i * 2019)\n\t\tlookup := index.Lookup([]byte(b), -1)\n\t\tif len(lookup) > 0 {\n\t\t\tfor _, start := range lookup {\n\t\t\t\tedges[start] = start + len(b)\n\t\t\t}\n\t\t}\n\t}\n\n\ttotal := 0\n\tfor i := 0; i < len(s); i++ {\n\t\tvar ok bool\n\t\tend := i\n\t\tfor {\n\t\t\tend, ok = edges[end]\n\t\t\tif !ok {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\ttotal += 1\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\", total)\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "sample_input": "1817181712114\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02702", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 589, "cpu_time_ms": 2205, "memory_kb": 7244}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s971104115", "group_id": "codeNet:p02702", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 10000000)\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 10000000)\n\tfor {\n\t\tl, p, err := rdr.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc main() {\n\tstr := readLine()\n\tcount := 0\n\ttargetLen := 5\n\tif len(str) > 4 {\n\t\tfor targetLen <= len(str) {\n\t\t\tfor i := 0; i < len(str)-targetLen+1; i++ {\n\t\t\t\tslice := str[i : i+targetLen]\n\t\t\t\tnum, _ := strconv.Atoi(slice)\n\t\t\t\tif num%2019 == 0 {\n\t\t\t\t\tcount++\n\t\t\t\t}\n\t\t\t}\n\t\t\ttargetLen++\n\t\t}\n\t}\n\n\tfmt.Println(count)\n}\n", "language": "Go", "metadata": {"date": 1587952552, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02702.html", "problem_id": "p02702", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02702/input.txt", "sample_output_relpath": "derived/input_output/data/p02702/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02702/Go/s971104115.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s971104115", "user_id": "u481836184"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 10000000)\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 10000000)\n\tfor {\n\t\tl, p, err := rdr.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc main() {\n\tstr := readLine()\n\tcount := 0\n\ttargetLen := 5\n\tif len(str) > 4 {\n\t\tfor targetLen <= len(str) {\n\t\t\tfor i := 0; i < len(str)-targetLen+1; i++ {\n\t\t\t\tslice := str[i : i+targetLen]\n\t\t\t\tnum, _ := strconv.Atoi(slice)\n\t\t\t\tif num%2019 == 0 {\n\t\t\t\t\tcount++\n\t\t\t\t}\n\t\t\t}\n\t\t\ttargetLen++\n\t\t}\n\t}\n\n\tfmt.Println(count)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "sample_input": "1817181712114\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02702", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 634, "cpu_time_ms": 2206, "memory_kb": 21376}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s178487301", "group_id": "codeNet:p02702", "input_text": "package main\n\nimport (\n\t\"fmt\"\n \t\"strconv\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\t\n\tsnum := make([]int, len(s))\n\t\n\tfor i := 0; i < len(s); i++ {\n snum[i],_ = strconv.Atoi(string(s[i]))\n\t}\n\t\n\tcnt := 0;\n\tfor i := 0; i < len(s)-1; i++ {\n\t\tfor j := i+3; j < len(s); j++ {\n if digits(snum[i:j+1]) % 2019 == 0 {\n \tcnt++\n }\n\t\t}\n\t}\n\tfmt.Println(cnt)\n}\n\nfunc digits(num []int) int {\n\tans := 0\n\tfor i := 0; i < len(num); i++ {\n ans += int(math.Pow(10,float64(len(num)-1-i))) * num[i]\n\t}\n\treturn ans\n}", "language": "Go", "metadata": {"date": 1587952334, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02702.html", "problem_id": "p02702", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02702/input.txt", "sample_output_relpath": "derived/input_output/data/p02702/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02702/Go/s178487301.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s178487301", "user_id": "u689167014"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n \t\"strconv\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\t\n\tsnum := make([]int, len(s))\n\t\n\tfor i := 0; i < len(s); i++ {\n snum[i],_ = strconv.Atoi(string(s[i]))\n\t}\n\t\n\tcnt := 0;\n\tfor i := 0; i < len(s)-1; i++ {\n\t\tfor j := i+3; j < len(s); j++ {\n if digits(snum[i:j+1]) % 2019 == 0 {\n \tcnt++\n }\n\t\t}\n\t}\n\tfmt.Println(cnt)\n}\n\nfunc digits(num []int) int {\n\tans := 0\n\tfor i := 0; i < len(num); i++ {\n ans += int(math.Pow(10,float64(len(num)-1-i))) * num[i]\n\t}\n\treturn ans\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "sample_input": "1817181712114\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02702", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 541, "cpu_time_ms": 2205, "memory_kb": 4884}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s133747999", "group_id": "codeNet:p02702", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scanf(\"%s\", &s)\n\tanswer := countPairs(s)\n\tfmt.Println(answer)\n}\n\nfunc countPairs(s string) int {\n\tif len(s) < 5 {\n\t\treturn 0\n\t}\n\tcount := 0\n\tcountMap := make(map[string]int)\n\tfor i := 0; i < len(s)-4; i++ {\n\t\tfor j := i + 5; j <= len(s); j++ {\n\t\t\trawStr := s[i:j]\n\t\t\tif countMap[rawStr] != 0 {\n\t\t\t\tcount += countMap[rawStr]\n\t\t\t} else {\n\t\t\t\tnum, _ := strconv.Atoi(rawStr)\n\t\t\t\tif num%2019 == 0 {\n\t\t\t\t\tcount++\n\t\t\t\t\tcountMap[rawStr] = 1\n\t\t\t\t} else {\n\t\t\t\t\tcountMap[rawStr] = -1\n\t\t\t\t}\n\t\t\t}\n\t\t\tif countMap[rawStr] == 1 {\n\t\t\t\tbreak // go to next loop of i\n\t\t\t}\n\t\t}\n\t}\n\treturn count\n}\n", "language": "Go", "metadata": {"date": 1587951825, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02702.html", "problem_id": "p02702", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02702/input.txt", "sample_output_relpath": "derived/input_output/data/p02702/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02702/Go/s133747999.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s133747999", "user_id": "u238461782"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scanf(\"%s\", &s)\n\tanswer := countPairs(s)\n\tfmt.Println(answer)\n}\n\nfunc countPairs(s string) int {\n\tif len(s) < 5 {\n\t\treturn 0\n\t}\n\tcount := 0\n\tcountMap := make(map[string]int)\n\tfor i := 0; i < len(s)-4; i++ {\n\t\tfor j := i + 5; j <= len(s); j++ {\n\t\t\trawStr := s[i:j]\n\t\t\tif countMap[rawStr] != 0 {\n\t\t\t\tcount += countMap[rawStr]\n\t\t\t} else {\n\t\t\t\tnum, _ := strconv.Atoi(rawStr)\n\t\t\t\tif num%2019 == 0 {\n\t\t\t\t\tcount++\n\t\t\t\t\tcountMap[rawStr] = 1\n\t\t\t\t} else {\n\t\t\t\t\tcountMap[rawStr] = -1\n\t\t\t\t}\n\t\t\t}\n\t\t\tif countMap[rawStr] == 1 {\n\t\t\t\tbreak // go to next loop of i\n\t\t\t}\n\t\t}\n\t}\n\treturn count\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "sample_input": "1817181712114\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02702", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 653, "cpu_time_ms": 2208, "memory_kb": 77944}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s307231892", "group_id": "codeNet:p02702", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tans := 0\n\tfor i := 1; i <= 100; i++ {\n\t\tt := strconv.Itoa(2019 * i)\n\t\tlt := len(t)\n\t\tfor j := 0; j+lt <= len(s); j++ {\n\t\t\tif t == s[j:j+lt] {\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1587951532, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02702.html", "problem_id": "p02702", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02702/input.txt", "sample_output_relpath": "derived/input_output/data/p02702/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02702/Go/s307231892.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s307231892", "user_id": "u461993794"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tans := 0\n\tfor i := 1; i <= 100; i++ {\n\t\tt := strconv.Itoa(2019 * i)\n\t\tlt := len(t)\n\t\tfor j := 0; j+lt <= len(s); j++ {\n\t\t\tif t == s[j:j+lt] {\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "sample_input": "1817181712114\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02702", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 261, "memory_kb": 3192}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s922144393", "group_id": "codeNet:p02702", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tvar s string\n\tfmt.Fscan(r, &s)\n\tnums := make([]int, len(s))\n\tfor i := 0; i < len(s); i++ {\n\t\tnum, _ := strconv.Atoi(string(s[i]))\n\t\tnums[i] = num\n\t}\n\n\t// 2019 = 3 * 673\n\tc := make([]int, len(s)+2)\n\tc[1] = nums[0]\n\tfor i := 1; i < len(s); i++ {\n\t\tc[i+1] = c[i] + nums[i]\n\t}\n\n\tans := 0\n\tfor i := 0; i < len(s)-4; i++ {\n\t\tfor j := i + 4; j < len(s); j++ {\n\t\t\ttmp := c[j+1] - c[i]\n\t\t\tif tmp%3 == 0 {\n\t\t\t\tmul := 1\n\t\t\t\tnum := 0\n\t\t\t\tfor k := j; k >= i; k-- {\n\t\t\t\t\tnum += nums[k] * mul\n\t\t\t\t\tmul *= 10\n\t\t\t\t}\n\t\t\t\tif num%673 == 0 {\n\t\t\t\t\tans++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\n// mod combination\nfunc modpow(a, n, mod int) int {\n\tres := 1\n\tfor n > 0 {\n\t\tif n%2 != 0 {\n\t\t\tres = res * a % mod\n\t\t}\n\t\ta = a * a % mod\n\t\tn = n / 2\n\t}\n\treturn res\n}\n\nfunc modcomb(n, a, mod int) int {\n\tx := 1\n\ty := 1\n\tfor i := 0; i < a; i++ {\n\t\tx = x * (n - i)\n\t\tx %= mod\n\t\ty = y * (i + 1)\n\t\ty %= mod\n\t}\n\treturn x * modpow(y, mod-2, mod) % mod\n}\n\nfunc modfactorial(n, mod int) int {\n\tresult := 1\n\tfor i := 1; i <= n; i++ {\n\t\tresult = (result * i) % mod\n\t}\n\treturn result\n}\n\n// Utility\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc primeFactor(x int) map[int]int {\n\tres := make(map[int]int)\n\tfor i := 2; i*i <= x; i++ {\n\t\tfor x%i == 0 {\n\t\t\tres[i]++\n\t\t\tx = x / i\n\t\t}\n\t}\n\tif x != 1 {\n\t\tres[x] = 1\n\t}\n\treturn res\n}\n\nfunc divisor(x int) []int {\n\tres := make([]int, 0)\n\tfor i := 1; i*i <= x; i++ {\n\t\tif x%i == 0 {\n\t\t\tres = append(res, i)\n\t\t\tif i != x/i {\n\t\t\t\tres = append(res, x/i)\n\t\t\t}\n\t\t}\n\t}\n\treturn res\n}\n\nfunc gcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t}\n\treturn gcd(y, x%y)\n}\n\nfunc lcm(x, y int) int {\n\treturn x / gcd(x, y) * y\n}\n\nfunc reverseString(s string) string {\n\tr := []rune(s)\n\tfor i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {\n\t\tr[i], r[j] = r[j], r[i]\n\t}\n\treturn string(r)\n}\n\n// Queue ...\ntype Queue []int\n\n// pop ...\nfunc (q *Queue) empty() bool {\n\treturn len(*q) == 0\n}\n\n// push ...\nfunc (q *Queue) push(i int) {\n\t*q = append(*q, i)\n}\n\n// pop ...\nfunc (q *Queue) pop() (int, bool) {\n\tif q.empty() {\n\t\treturn 0, false\n\t} else {\n\t\tres := (*q)[0]\n\t\t*q = (*q)[1:]\n\t\treturn res, true\n\t}\n}\n\n// Stack ...\ntype Stack []int\n\n// pop ...\nfunc (s *Stack) empty() bool {\n\treturn len(*s) == 0\n}\n\n// push ...\nfunc (s *Stack) push(i int) {\n\t*s = append(*s, i)\n}\n\n// pop ...\nfunc (s *Stack) pop() (int, bool) {\n\tif s.empty() {\n\t\treturn 0, false\n\t} else {\n\t\tindex := len(*s) - 1\n\t\tres := (*s)[index]\n\t\t*s = (*s)[:index]\n\t\treturn res, true\n\t}\n}\n", "language": "Go", "metadata": {"date": 1587951464, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02702.html", "problem_id": "p02702", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02702/input.txt", "sample_output_relpath": "derived/input_output/data/p02702/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02702/Go/s922144393.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s922144393", "user_id": "u433254839"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tvar s string\n\tfmt.Fscan(r, &s)\n\tnums := make([]int, len(s))\n\tfor i := 0; i < len(s); i++ {\n\t\tnum, _ := strconv.Atoi(string(s[i]))\n\t\tnums[i] = num\n\t}\n\n\t// 2019 = 3 * 673\n\tc := make([]int, len(s)+2)\n\tc[1] = nums[0]\n\tfor i := 1; i < len(s); i++ {\n\t\tc[i+1] = c[i] + nums[i]\n\t}\n\n\tans := 0\n\tfor i := 0; i < len(s)-4; i++ {\n\t\tfor j := i + 4; j < len(s); j++ {\n\t\t\ttmp := c[j+1] - c[i]\n\t\t\tif tmp%3 == 0 {\n\t\t\t\tmul := 1\n\t\t\t\tnum := 0\n\t\t\t\tfor k := j; k >= i; k-- {\n\t\t\t\t\tnum += nums[k] * mul\n\t\t\t\t\tmul *= 10\n\t\t\t\t}\n\t\t\t\tif num%673 == 0 {\n\t\t\t\t\tans++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\n// mod combination\nfunc modpow(a, n, mod int) int {\n\tres := 1\n\tfor n > 0 {\n\t\tif n%2 != 0 {\n\t\t\tres = res * a % mod\n\t\t}\n\t\ta = a * a % mod\n\t\tn = n / 2\n\t}\n\treturn res\n}\n\nfunc modcomb(n, a, mod int) int {\n\tx := 1\n\ty := 1\n\tfor i := 0; i < a; i++ {\n\t\tx = x * (n - i)\n\t\tx %= mod\n\t\ty = y * (i + 1)\n\t\ty %= mod\n\t}\n\treturn x * modpow(y, mod-2, mod) % mod\n}\n\nfunc modfactorial(n, mod int) int {\n\tresult := 1\n\tfor i := 1; i <= n; i++ {\n\t\tresult = (result * i) % mod\n\t}\n\treturn result\n}\n\n// Utility\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc primeFactor(x int) map[int]int {\n\tres := make(map[int]int)\n\tfor i := 2; i*i <= x; i++ {\n\t\tfor x%i == 0 {\n\t\t\tres[i]++\n\t\t\tx = x / i\n\t\t}\n\t}\n\tif x != 1 {\n\t\tres[x] = 1\n\t}\n\treturn res\n}\n\nfunc divisor(x int) []int {\n\tres := make([]int, 0)\n\tfor i := 1; i*i <= x; i++ {\n\t\tif x%i == 0 {\n\t\t\tres = append(res, i)\n\t\t\tif i != x/i {\n\t\t\t\tres = append(res, x/i)\n\t\t\t}\n\t\t}\n\t}\n\treturn res\n}\n\nfunc gcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t}\n\treturn gcd(y, x%y)\n}\n\nfunc lcm(x, y int) int {\n\treturn x / gcd(x, y) * y\n}\n\nfunc reverseString(s string) string {\n\tr := []rune(s)\n\tfor i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {\n\t\tr[i], r[j] = r[j], r[i]\n\t}\n\treturn string(r)\n}\n\n// Queue ...\ntype Queue []int\n\n// pop ...\nfunc (q *Queue) empty() bool {\n\treturn len(*q) == 0\n}\n\n// push ...\nfunc (q *Queue) push(i int) {\n\t*q = append(*q, i)\n}\n\n// pop ...\nfunc (q *Queue) pop() (int, bool) {\n\tif q.empty() {\n\t\treturn 0, false\n\t} else {\n\t\tres := (*q)[0]\n\t\t*q = (*q)[1:]\n\t\treturn res, true\n\t}\n}\n\n// Stack ...\ntype Stack []int\n\n// pop ...\nfunc (s *Stack) empty() bool {\n\treturn len(*s) == 0\n}\n\n// push ...\nfunc (s *Stack) push(i int) {\n\t*s = append(*s, i)\n}\n\n// pop ...\nfunc (s *Stack) pop() (int, bool) {\n\tif s.empty() {\n\t\treturn 0, false\n\t} else {\n\t\tindex := len(*s) - 1\n\t\tres := (*s)[index]\n\t\t*s = (*s)[:index]\n\t\treturn res, true\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "sample_input": "1817181712114\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02702", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of digits from 1 through 9.\n\nFind the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the following condition:\n\nCondition: In base ten, the i-th through j-th characters of S form an integer that is a multiple of 2019.\n\nConstraints\n\n1 ≤ |S| ≤ 200000\n\nS is a string consisting of digits from 1 through 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of pairs of integers (i,j) (1 ≤ i ≤ j ≤ |S|) that satisfy the condition.\n\nSample Input 1\n\n1817181712114\n\nSample Output 1\n\n3\n\nThree pairs - (1,5), (5,9), and (9,13) - satisfy the condition.\n\nSample Input 2\n\n14282668646\n\nSample Output 2\n\n2\n\nSample Input 3\n\n2119\n\nSample Output 3\n\n0\n\nNo pairs satisfy the condition.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2673, "cpu_time_ms": 2206, "memory_kb": 6476}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s670297024", "group_id": "codeNet:p02703", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\ntype item struct {\n\tpriority, value, index int\n}\n\ntype pQ []*item\n\nfunc (pq pQ) Len() int {\n\treturn len(pq)\n}\n\nfunc (pq pQ) Less(i, j int) bool {\n\treturn pq[i].priority < pq[j].priority\n}\n\nfunc (pq pQ) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n\tpq[i].index = i\n\tpq[j].index = j\n}\n\nfunc (pq *pQ) Push(x interface{}) {\n\tn := len(*pq)\n\tit := x.(*item)\n\tit.index = n\n\t*pq = append(*pq, it)\n}\n\nfunc (pq *pQ) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\tit := old[n-1]\n\tit.index = -1\n\t*pq = old[0 : n-1]\n\treturn it\n}\n\n// End Priority Queue\ntype link struct {\n\tu, v, a, b int\n}\n\ntype edge struct {\n\tto, cost int\n}\n\ntype node struct {\n\te []edge\n}\n\nconst inf = 1001001001001001\n\nfunc dijkstra(s, N int, n []node) []int {\n\tpq := make(pQ, 0)\n\theap.Init(&pq)\n\tdist := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tdist[i] = inf\n\t}\n\tdist[s] = 0\n\theap.Push(&pq, &item{0, s, 0})\n\tfor pq.Len() > 0 {\n\t\tit := heap.Pop(&pq).(*item)\n\t\tv := it.value\n\t\tif dist[v] < it.priority {\n\t\t\tcontinue\n\t\t}\n\t\tfor _, e := range n[v].e {\n\t\t\tif dist[e.to] > dist[v]+e.cost {\n\t\t\t\t// out(v, e)\n\t\t\t\tdist[e.to] = dist[v] + e.cost\n\t\t\t\theap.Push(&pq, &item{dist[e.to], e.to, 0})\n\t\t\t}\n\t\t}\n\t}\n\treturn dist\n}\n\nfunc pos(n, c, m int) int {\n\treturn n*m + c\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tN, M, S := getInt(), getInt(), getInt()\n\tma := 0\n\tl := make([]link, M*2)\n\tfor i := 0; i < M; i++ {\n\t\tu, v, a, b := getInt()-1, getInt()-1, getInt(), getInt()\n\t\tl[i*2] = link{u, v, a, b}\n\t\tl[i*2+1] = link{v, u, a, b}\n\t\tma = max(ma, a)\n\t}\n\n\tc := make([]int, N)\n\td := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tc[i], d[i] = getInt(), getInt()\n\t}\n\n\t// make nodes\n\tma *= N\n\tn := make([]node, ma*N)\n\tfor i := 0; i < N; i++ {\n\t\t// out(\"---\", ma)\n\t\tfor j := 0; j <= ma; j++ {\n\t\t\tto := j + c[i]\n\t\t\tcost := d[i]\n\t\t\tif to >= ma {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tf := pos(i, j, ma)\n\t\t\tt := pos(i, to, ma)\n\t\t\t// out(f, \"->\", t, cost)\n\t\t\tn[f].e = append(n[f].e, edge{t, cost})\n\t\t}\n\t}\n\tfor i := 0; i < M*2; i++ {\n\t\tfrom := l[i].u\n\t\tto := l[i].v\n\t\tcoin := l[i].a\n\t\tcost := l[i].b\n\t\tfor j := 0; j < ma; j++ {\n\t\t\tif j-coin < 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tf := pos(from, j, ma)\n\t\t\tt := pos(to, j-coin, ma)\n\t\t\t// out(from, to, \"f,t\", f, t, cost, len(n))\n\t\t\tn[f].e = append(n[f].e, edge{t, cost})\n\t\t}\n\t}\n\n\tS = min(S, ma-1)\n\tdist := dijkstra(S, ma*N, n)\n\n\tfor i := 1; i < N; i++ {\n\t\tm := inf\n\t\tfor j := 0; j < ma; j++ {\n\t\t\tm = min(m, dist[i*ma+j])\n\t\t}\n\t\t// out(dist[i*ma : (i+1)*ma])\n\t\tout(m)\n\t}\n\t//out(\"dist=\", dist)\n}\n", "language": "Go", "metadata": {"date": 1588036551, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02703.html", "problem_id": "p02703", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02703/input.txt", "sample_output_relpath": "derived/input_output/data/p02703/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02703/Go/s670297024.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s670297024", "user_id": "u814575783"}, "prompt_components": {"gold_output": "2\n14\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\ntype item struct {\n\tpriority, value, index int\n}\n\ntype pQ []*item\n\nfunc (pq pQ) Len() int {\n\treturn len(pq)\n}\n\nfunc (pq pQ) Less(i, j int) bool {\n\treturn pq[i].priority < pq[j].priority\n}\n\nfunc (pq pQ) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n\tpq[i].index = i\n\tpq[j].index = j\n}\n\nfunc (pq *pQ) Push(x interface{}) {\n\tn := len(*pq)\n\tit := x.(*item)\n\tit.index = n\n\t*pq = append(*pq, it)\n}\n\nfunc (pq *pQ) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\tit := old[n-1]\n\tit.index = -1\n\t*pq = old[0 : n-1]\n\treturn it\n}\n\n// End Priority Queue\ntype link struct {\n\tu, v, a, b int\n}\n\ntype edge struct {\n\tto, cost int\n}\n\ntype node struct {\n\te []edge\n}\n\nconst inf = 1001001001001001\n\nfunc dijkstra(s, N int, n []node) []int {\n\tpq := make(pQ, 0)\n\theap.Init(&pq)\n\tdist := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tdist[i] = inf\n\t}\n\tdist[s] = 0\n\theap.Push(&pq, &item{0, s, 0})\n\tfor pq.Len() > 0 {\n\t\tit := heap.Pop(&pq).(*item)\n\t\tv := it.value\n\t\tif dist[v] < it.priority {\n\t\t\tcontinue\n\t\t}\n\t\tfor _, e := range n[v].e {\n\t\t\tif dist[e.to] > dist[v]+e.cost {\n\t\t\t\t// out(v, e)\n\t\t\t\tdist[e.to] = dist[v] + e.cost\n\t\t\t\theap.Push(&pq, &item{dist[e.to], e.to, 0})\n\t\t\t}\n\t\t}\n\t}\n\treturn dist\n}\n\nfunc pos(n, c, m int) int {\n\treturn n*m + c\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tN, M, S := getInt(), getInt(), getInt()\n\tma := 0\n\tl := make([]link, M*2)\n\tfor i := 0; i < M; i++ {\n\t\tu, v, a, b := getInt()-1, getInt()-1, getInt(), getInt()\n\t\tl[i*2] = link{u, v, a, b}\n\t\tl[i*2+1] = link{v, u, a, b}\n\t\tma = max(ma, a)\n\t}\n\n\tc := make([]int, N)\n\td := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tc[i], d[i] = getInt(), getInt()\n\t}\n\n\t// make nodes\n\tma *= N\n\tn := make([]node, ma*N)\n\tfor i := 0; i < N; i++ {\n\t\t// out(\"---\", ma)\n\t\tfor j := 0; j <= ma; j++ {\n\t\t\tto := j + c[i]\n\t\t\tcost := d[i]\n\t\t\tif to >= ma {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tf := pos(i, j, ma)\n\t\t\tt := pos(i, to, ma)\n\t\t\t// out(f, \"->\", t, cost)\n\t\t\tn[f].e = append(n[f].e, edge{t, cost})\n\t\t}\n\t}\n\tfor i := 0; i < M*2; i++ {\n\t\tfrom := l[i].u\n\t\tto := l[i].v\n\t\tcoin := l[i].a\n\t\tcost := l[i].b\n\t\tfor j := 0; j < ma; j++ {\n\t\t\tif j-coin < 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tf := pos(from, j, ma)\n\t\t\tt := pos(to, j-coin, ma)\n\t\t\t// out(from, to, \"f,t\", f, t, cost, len(n))\n\t\t\tn[f].e = append(n[f].e, edge{t, cost})\n\t\t}\n\t}\n\n\tS = min(S, ma-1)\n\tdist := dijkstra(S, ma*N, n)\n\n\tfor i := 1; i < N; i++ {\n\t\tm := inf\n\t\tfor j := 0; j < ma; j++ {\n\t\t\tm = min(m, dist[i*ma+j])\n\t\t}\n\t\t// out(dist[i*ma : (i+1)*ma])\n\t\tout(m)\n\t}\n\t//out(\"dist=\", dist)\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nThere are N cities numbered 1 to N, connected by M railroads.\n\nYou are now at City 1, with 10^{100} gold coins and S silver coins in your pocket.\n\nThe i-th railroad connects City U_i and City V_i bidirectionally, and a one-way trip costs A_i silver coins and takes B_i minutes.\nYou cannot use gold coins to pay the fare.\n\nThere is an exchange counter in each city. At the exchange counter in City i, you can get C_i silver coins for 1 gold coin.\nThe transaction takes D_i minutes for each gold coin you give.\nYou can exchange any number of gold coins at each exchange counter.\n\nFor each t=2, ..., N, find the minimum time needed to travel from City 1 to City t. You can ignore the time spent waiting for trains.\n\nConstraints\n\n2 \\leq N \\leq 50\n\nN-1 \\leq M \\leq 100\n\n0 \\leq S \\leq 10^9\n\n1 \\leq A_i \\leq 50\n\n1 \\leq B_i,C_i,D_i \\leq 10^9\n\n1 \\leq U_i < V_i \\leq N\n\nThere is no pair i, j(i \\neq j) such that (U_i,V_i)=(U_j,V_j).\n\nEach city t=2,...,N can be reached from City 1 with some number of railroads.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M S\nU_1 V_1 A_1 B_1\n:\nU_M V_M A_M B_M\nC_1 D_1\n:\nC_N D_N\n\nOutput\n\nFor each t=2, ..., N in this order, print a line containing the minimum time needed to travel from City 1 to City t.\n\nSample Input 1\n\n3 2 1\n1 2 1 2\n1 3 2 4\n1 11\n1 2\n2 5\n\nSample Output 1\n\n2\n14\n\nThe railway network in this input is shown in the figure below.\n\nIn this figure, each city is labeled as follows:\n\nThe first line: the ID number i of the city (i for City i)\n\nThe second line: C_i / D_i\n\nSimilarly, each railroad is labeled as follows:\n\nThe first line: the ID number i of the railroad (i for the i-th railroad in input)\n\nThe second line: A_i / B_i\n\nYou can travel from City 1 to City 2 in 2 minutes, as follows:\n\nUse the 1-st railroad to move from City 1 to City 2 in 2 minutes.\n\nYou can travel from City 1 to City 3 in 14 minutes, as follows:\n\nUse the 1-st railroad to move from City 1 to City 2 in 2 minutes.\n\nAt the exchange counter in City 2, exchange 3 gold coins for 3 silver coins in 6 minutes.\n\nUse the 1-st railroad to move from City 2 to City 1 in 2 minutes.\n\nUse the 2-nd railroad to move from City 1 to City 3 in 4 minutes.\n\nSample Input 2\n\n4 4 1\n1 2 1 5\n1 3 4 4\n2 4 2 2\n3 4 1 1\n3 1\n3 1\n5 2\n6 4\n\nSample Output 2\n\n5\n5\n7\n\nThe railway network in this input is shown in the figure below:\n\nYou can travel from City 1 to City 4 in 7 minutes, as follows:\n\nAt the exchange counter in City 1, exchange 2 gold coins for 6 silver coins in 2 minutes.\n\nUse the 2-nd railroad to move from City 1 to City 3 in 4 minutes.\n\nUse the 4-th railroad to move from City 3 to City 4 in 1 minutes.\n\nSample Input 3\n\n6 5 1\n1 2 1 1\n1 3 2 1\n2 4 5 1\n3 5 11 1\n1 6 50 1\n1 10000\n1 3000\n1 700\n1 100\n1 1\n100 1\n\nSample Output 3\n\n1\n9003\n14606\n16510\n16576\n\nThe railway network in this input is shown in the figure below:\n\nYou can travel from City 1 to City 6 in 16576 minutes, as follows:\n\nUse the 1-st railroad to move from City 1 to City 2 in 1 minute.\n\nAt the exchange counter in City 2, exchange 3 gold coins for 3 silver coins in 9000 minutes.\n\nUse the 1-st railroad to move from City 2 to City 1 in 1 minute.\n\nUse the 2-nd railroad to move from City 1 to City 3 in 1 minute.\n\nAt the exchange counter in City 3, exchange 8 gold coins for 8 silver coins in 5600 minutes.\n\nUse the 2-nd railroad to move from City 3 to City 1 in 1 minute.\n\nUse the 1-st railroad to move from City 1 to City 2 in 1 minute.\n\nUse the 3-rd railroad to move from City 2 to City 4 in 1 minute.\n\nAt the exchange counter in City 4, exchange 19 gold coins for 19 silver coins in 1900 minutes.\n\nUse the 3-rd railroad to move from City 4 to City 2 in 1 minute.\n\nUse the 1-st railroad to move from City 2 to City 1 in 1 minute.\n\nUse the 2-nd railroad to move from City 1 to City 3 in 1 minute.\n\nUse the 4-th railroad to move from City 3 to City 5 in 1 minute.\n\nAt the exchange counter in City 5, exchange 63 gold coins for 63 silver coins in 63 minutes.\n\nUse the 4-th railroad to move from City 5 to City 3 in 1 minute.\n\nUse the 2-nd railroad to move from City 3 to City 1 in 1 minute.\n\nUse the 5-th railroad to move from City 1 to City 6 in 1 minute.\n\nSample Input 4\n\n4 6 1000000000\n1 2 50 1\n1 3 50 5\n1 4 50 7\n2 3 50 2\n2 4 50 4\n3 4 50 3\n10 2\n4 4\n5 5\n7 7\n\nSample Output 4\n\n1\n3\n5\n\nThe railway network in this input is shown in the figure below:\n\nSample Input 5\n\n2 1 0\n1 2 1 1\n1 1000000000\n1 1\n\nSample Output 5\n\n1000000001\n\nThe railway network in this input is shown in the figure below:\n\nYou can travel from City 1 to City 2 in 1000000001 minutes, as follows:\n\nAt the exchange counter in City 1, exchange 1 gold coin for 1 silver coin in 1000000000 minutes.\n\nUse the 1-st railroad to move from City 1 to City 2 in 1 minute.", "sample_input": "3 2 1\n1 2 1 2\n1 3 2 4\n1 11\n1 2\n2 5\n"}, "reference_outputs": ["2\n14\n"], "source_document_id": "p02703", "source_text": "Score : 500 points\n\nProblem Statement\n\nThere are N cities numbered 1 to N, connected by M railroads.\n\nYou are now at City 1, with 10^{100} gold coins and S silver coins in your pocket.\n\nThe i-th railroad connects City U_i and City V_i bidirectionally, and a one-way trip costs A_i silver coins and takes B_i minutes.\nYou cannot use gold coins to pay the fare.\n\nThere is an exchange counter in each city. At the exchange counter in City i, you can get C_i silver coins for 1 gold coin.\nThe transaction takes D_i minutes for each gold coin you give.\nYou can exchange any number of gold coins at each exchange counter.\n\nFor each t=2, ..., N, find the minimum time needed to travel from City 1 to City t. You can ignore the time spent waiting for trains.\n\nConstraints\n\n2 \\leq N \\leq 50\n\nN-1 \\leq M \\leq 100\n\n0 \\leq S \\leq 10^9\n\n1 \\leq A_i \\leq 50\n\n1 \\leq B_i,C_i,D_i \\leq 10^9\n\n1 \\leq U_i < V_i \\leq N\n\nThere is no pair i, j(i \\neq j) such that (U_i,V_i)=(U_j,V_j).\n\nEach city t=2,...,N can be reached from City 1 with some number of railroads.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M S\nU_1 V_1 A_1 B_1\n:\nU_M V_M A_M B_M\nC_1 D_1\n:\nC_N D_N\n\nOutput\n\nFor each t=2, ..., N in this order, print a line containing the minimum time needed to travel from City 1 to City t.\n\nSample Input 1\n\n3 2 1\n1 2 1 2\n1 3 2 4\n1 11\n1 2\n2 5\n\nSample Output 1\n\n2\n14\n\nThe railway network in this input is shown in the figure below.\n\nIn this figure, each city is labeled as follows:\n\nThe first line: the ID number i of the city (i for City i)\n\nThe second line: C_i / D_i\n\nSimilarly, each railroad is labeled as follows:\n\nThe first line: the ID number i of the railroad (i for the i-th railroad in input)\n\nThe second line: A_i / B_i\n\nYou can travel from City 1 to City 2 in 2 minutes, as follows:\n\nUse the 1-st railroad to move from City 1 to City 2 in 2 minutes.\n\nYou can travel from City 1 to City 3 in 14 minutes, as follows:\n\nUse the 1-st railroad to move from City 1 to City 2 in 2 minutes.\n\nAt the exchange counter in City 2, exchange 3 gold coins for 3 silver coins in 6 minutes.\n\nUse the 1-st railroad to move from City 2 to City 1 in 2 minutes.\n\nUse the 2-nd railroad to move from City 1 to City 3 in 4 minutes.\n\nSample Input 2\n\n4 4 1\n1 2 1 5\n1 3 4 4\n2 4 2 2\n3 4 1 1\n3 1\n3 1\n5 2\n6 4\n\nSample Output 2\n\n5\n5\n7\n\nThe railway network in this input is shown in the figure below:\n\nYou can travel from City 1 to City 4 in 7 minutes, as follows:\n\nAt the exchange counter in City 1, exchange 2 gold coins for 6 silver coins in 2 minutes.\n\nUse the 2-nd railroad to move from City 1 to City 3 in 4 minutes.\n\nUse the 4-th railroad to move from City 3 to City 4 in 1 minutes.\n\nSample Input 3\n\n6 5 1\n1 2 1 1\n1 3 2 1\n2 4 5 1\n3 5 11 1\n1 6 50 1\n1 10000\n1 3000\n1 700\n1 100\n1 1\n100 1\n\nSample Output 3\n\n1\n9003\n14606\n16510\n16576\n\nThe railway network in this input is shown in the figure below:\n\nYou can travel from City 1 to City 6 in 16576 minutes, as follows:\n\nUse the 1-st railroad to move from City 1 to City 2 in 1 minute.\n\nAt the exchange counter in City 2, exchange 3 gold coins for 3 silver coins in 9000 minutes.\n\nUse the 1-st railroad to move from City 2 to City 1 in 1 minute.\n\nUse the 2-nd railroad to move from City 1 to City 3 in 1 minute.\n\nAt the exchange counter in City 3, exchange 8 gold coins for 8 silver coins in 5600 minutes.\n\nUse the 2-nd railroad to move from City 3 to City 1 in 1 minute.\n\nUse the 1-st railroad to move from City 1 to City 2 in 1 minute.\n\nUse the 3-rd railroad to move from City 2 to City 4 in 1 minute.\n\nAt the exchange counter in City 4, exchange 19 gold coins for 19 silver coins in 1900 minutes.\n\nUse the 3-rd railroad to move from City 4 to City 2 in 1 minute.\n\nUse the 1-st railroad to move from City 2 to City 1 in 1 minute.\n\nUse the 2-nd railroad to move from City 1 to City 3 in 1 minute.\n\nUse the 4-th railroad to move from City 3 to City 5 in 1 minute.\n\nAt the exchange counter in City 5, exchange 63 gold coins for 63 silver coins in 63 minutes.\n\nUse the 4-th railroad to move from City 5 to City 3 in 1 minute.\n\nUse the 2-nd railroad to move from City 3 to City 1 in 1 minute.\n\nUse the 5-th railroad to move from City 1 to City 6 in 1 minute.\n\nSample Input 4\n\n4 6 1000000000\n1 2 50 1\n1 3 50 5\n1 4 50 7\n2 3 50 2\n2 4 50 4\n3 4 50 3\n10 2\n4 4\n5 5\n7 7\n\nSample Output 4\n\n1\n3\n5\n\nThe railway network in this input is shown in the figure below:\n\nSample Input 5\n\n2 1 0\n1 2 1 1\n1 1000000000\n1 1\n\nSample Output 5\n\n1000000001\n\nThe railway network in this input is shown in the figure below:\n\nYou can travel from City 1 to City 2 in 1000000001 minutes, as follows:\n\nAt the exchange counter in City 1, exchange 1 gold coin for 1 silver coin in 1000000000 minutes.\n\nUse the 1-st railroad to move from City 1 to City 2 in 1 minute.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3073, "cpu_time_ms": 184, "memory_kb": 31864}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s000209093", "group_id": "codeNet:p02705", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar r float64\n\tfmt.Scan(&r)\n\tfmt.Println(math.Pi * (2 * r))\n}", "language": "Go", "metadata": {"date": 1590641499, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02705.html", "problem_id": "p02705", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02705/input.txt", "sample_output_relpath": "derived/input_output/data/p02705/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02705/Go/s000209093.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s000209093", "user_id": "u473974118"}, "prompt_components": {"gold_output": "6.28318530717958623200\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar r float64\n\tfmt.Scan(&r)\n\tfmt.Println(math.Pi * (2 * r))\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nPrint the circumference of a circle of radius R.\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 circumference of the circle.\nYour output is considered correct if and only if its absolute or relative error from our answer is at most 10^{-2}.\n\nSample Input 1\n\n1\n\nSample Output 1\n\n6.28318530717958623200\n\nSince we accept an absolute or relative error of at most 10^{-2}, 6.28 is also an acceptable output, but 6 is not.\n\nSample Input 2\n\n73\n\nSample Output 2\n\n458.67252742410977361942", "sample_input": "1\n"}, "reference_outputs": ["6.28318530717958623200\n"], "source_document_id": "p02705", "source_text": "Score : 100 points\n\nProblem Statement\n\nPrint the circumference of a circle of radius R.\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 circumference of the circle.\nYour output is considered correct if and only if its absolute or relative error from our answer is at most 10^{-2}.\n\nSample Input 1\n\n1\n\nSample Output 1\n\n6.28318530717958623200\n\nSince we accept an absolute or relative error of at most 10^{-2}, 6.28 is also an acceptable output, but 6 is not.\n\nSample Input 2\n\n73\n\nSample Output 2\n\n458.67252742410977361942", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s963110788", "group_id": "codeNet:p02705", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar r float64\n\tfmt.Scan(&r)\n\tfmt.Println(2*r*math.Pi)\n\n}", "language": "Go", "metadata": {"date": 1588399813, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02705.html", "problem_id": "p02705", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02705/input.txt", "sample_output_relpath": "derived/input_output/data/p02705/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02705/Go/s963110788.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s963110788", "user_id": "u239375815"}, "prompt_components": {"gold_output": "6.28318530717958623200\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar r float64\n\tfmt.Scan(&r)\n\tfmt.Println(2*r*math.Pi)\n\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nPrint the circumference of a circle of radius R.\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 circumference of the circle.\nYour output is considered correct if and only if its absolute or relative error from our answer is at most 10^{-2}.\n\nSample Input 1\n\n1\n\nSample Output 1\n\n6.28318530717958623200\n\nSince we accept an absolute or relative error of at most 10^{-2}, 6.28 is also an acceptable output, but 6 is not.\n\nSample Input 2\n\n73\n\nSample Output 2\n\n458.67252742410977361942", "sample_input": "1\n"}, "reference_outputs": ["6.28318530717958623200\n"], "source_document_id": "p02705", "source_text": "Score : 100 points\n\nProblem Statement\n\nPrint the circumference of a circle of radius R.\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 circumference of the circle.\nYour output is considered correct if and only if its absolute or relative error from our answer is at most 10^{-2}.\n\nSample Input 1\n\n1\n\nSample Output 1\n\n6.28318530717958623200\n\nSince we accept an absolute or relative error of at most 10^{-2}, 6.28 is also an acceptable output, but 6 is not.\n\nSample Input 2\n\n73\n\nSample Output 2\n\n458.67252742410977361942", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 1756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s067171571", "group_id": "codeNet:p02705", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tlog.Fatal(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tr := getInt()\n\tout(math.Pi * 2 * float64(r))\n}\n", "language": "Go", "metadata": {"date": 1588200658, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02705.html", "problem_id": "p02705", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02705/input.txt", "sample_output_relpath": "derived/input_output/data/p02705/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02705/Go/s067171571.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s067171571", "user_id": "u663830728"}, "prompt_components": {"gold_output": "6.28318530717958623200\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tlog.Fatal(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tr := getInt()\n\tout(math.Pi * 2 * float64(r))\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nPrint the circumference of a circle of radius R.\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 circumference of the circle.\nYour output is considered correct if and only if its absolute or relative error from our answer is at most 10^{-2}.\n\nSample Input 1\n\n1\n\nSample Output 1\n\n6.28318530717958623200\n\nSince we accept an absolute or relative error of at most 10^{-2}, 6.28 is also an acceptable output, but 6 is not.\n\nSample Input 2\n\n73\n\nSample Output 2\n\n458.67252742410977361942", "sample_input": "1\n"}, "reference_outputs": ["6.28318530717958623200\n"], "source_document_id": "p02705", "source_text": "Score : 100 points\n\nProblem Statement\n\nPrint the circumference of a circle of radius R.\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 circumference of the circle.\nYour output is considered correct if and only if its absolute or relative error from our answer is at most 10^{-2}.\n\nSample Input 1\n\n1\n\nSample Output 1\n\n6.28318530717958623200\n\nSince we accept an absolute or relative error of at most 10^{-2}, 6.28 is also an acceptable output, but 6 is not.\n\nSample Input 2\n\n73\n\nSample Output 2\n\n458.67252742410977361942", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 493, "cpu_time_ms": 3, "memory_kb": 1816}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s584268636", "group_id": "codeNet:p02705", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tif scanner.Scan() {\n\t\ta, _ := strconv.Atoi(scanner.Text())\n\t\tb := float64(a)\n\t\tc := b * float64(2) * 3.1415\n\t\tfmt.Println(c)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1587347279, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02705.html", "problem_id": "p02705", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02705/input.txt", "sample_output_relpath": "derived/input_output/data/p02705/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02705/Go/s584268636.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s584268636", "user_id": "u628805995"}, "prompt_components": {"gold_output": "6.28318530717958623200\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tif scanner.Scan() {\n\t\ta, _ := strconv.Atoi(scanner.Text())\n\t\tb := float64(a)\n\t\tc := b * float64(2) * 3.1415\n\t\tfmt.Println(c)\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nPrint the circumference of a circle of radius R.\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 circumference of the circle.\nYour output is considered correct if and only if its absolute or relative error from our answer is at most 10^{-2}.\n\nSample Input 1\n\n1\n\nSample Output 1\n\n6.28318530717958623200\n\nSince we accept an absolute or relative error of at most 10^{-2}, 6.28 is also an acceptable output, but 6 is not.\n\nSample Input 2\n\n73\n\nSample Output 2\n\n458.67252742410977361942", "sample_input": "1\n"}, "reference_outputs": ["6.28318530717958623200\n"], "source_document_id": "p02705", "source_text": "Score : 100 points\n\nProblem Statement\n\nPrint the circumference of a circle of radius R.\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 circumference of the circle.\nYour output is considered correct if and only if its absolute or relative error from our answer is at most 10^{-2}.\n\nSample Input 1\n\n1\n\nSample Output 1\n\n6.28318530717958623200\n\nSince we accept an absolute or relative error of at most 10^{-2}, 6.28 is also an acceptable output, but 6 is not.\n\nSample Input 2\n\n73\n\nSample Output 2\n\n458.67252742410977361942", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 6, "memory_kb": 1756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s811827759", "group_id": "codeNet:p02705", "input_text": "package main\n\nimport \"fmt\"\nimport \"math\"\n\nfunc main(){\n\tvar R float64\n\n\tfmt.Scan(&R)\n\tans := R * 2. * math.Pi\n\tfmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1587345253, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02705.html", "problem_id": "p02705", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02705/input.txt", "sample_output_relpath": "derived/input_output/data/p02705/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02705/Go/s811827759.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s811827759", "user_id": "u283295031"}, "prompt_components": {"gold_output": "6.28318530717958623200\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\nimport \"math\"\n\nfunc main(){\n\tvar R float64\n\n\tfmt.Scan(&R)\n\tans := R * 2. * math.Pi\n\tfmt.Println(ans)\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nPrint the circumference of a circle of radius R.\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 circumference of the circle.\nYour output is considered correct if and only if its absolute or relative error from our answer is at most 10^{-2}.\n\nSample Input 1\n\n1\n\nSample Output 1\n\n6.28318530717958623200\n\nSince we accept an absolute or relative error of at most 10^{-2}, 6.28 is also an acceptable output, but 6 is not.\n\nSample Input 2\n\n73\n\nSample Output 2\n\n458.67252742410977361942", "sample_input": "1\n"}, "reference_outputs": ["6.28318530717958623200\n"], "source_document_id": "p02705", "source_text": "Score : 100 points\n\nProblem Statement\n\nPrint the circumference of a circle of radius R.\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 circumference of the circle.\nYour output is considered correct if and only if its absolute or relative error from our answer is at most 10^{-2}.\n\nSample Input 1\n\n1\n\nSample Output 1\n\n6.28318530717958623200\n\nSince we accept an absolute or relative error of at most 10^{-2}, 6.28 is also an acceptable output, but 6 is not.\n\nSample Input 2\n\n73\n\nSample Output 2\n\n458.67252742410977361942", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 1756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s369848483", "group_id": "codeNet:p02705", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar R float64\n\tfmt.Scan(&R)\n\n\tres := R * 2 * 3.14\n\n\tfmt.Println(res)\n\n}", "language": "Go", "metadata": {"date": 1587345249, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02705.html", "problem_id": "p02705", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02705/input.txt", "sample_output_relpath": "derived/input_output/data/p02705/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02705/Go/s369848483.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s369848483", "user_id": "u252854929"}, "prompt_components": {"gold_output": "6.28318530717958623200\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar R float64\n\tfmt.Scan(&R)\n\n\tres := R * 2 * 3.14\n\n\tfmt.Println(res)\n\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nPrint the circumference of a circle of radius R.\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 circumference of the circle.\nYour output is considered correct if and only if its absolute or relative error from our answer is at most 10^{-2}.\n\nSample Input 1\n\n1\n\nSample Output 1\n\n6.28318530717958623200\n\nSince we accept an absolute or relative error of at most 10^{-2}, 6.28 is also an acceptable output, but 6 is not.\n\nSample Input 2\n\n73\n\nSample Output 2\n\n458.67252742410977361942", "sample_input": "1\n"}, "reference_outputs": ["6.28318530717958623200\n"], "source_document_id": "p02705", "source_text": "Score : 100 points\n\nProblem Statement\n\nPrint the circumference of a circle of radius R.\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 circumference of the circle.\nYour output is considered correct if and only if its absolute or relative error from our answer is at most 10^{-2}.\n\nSample Input 1\n\n1\n\nSample Output 1\n\n6.28318530717958623200\n\nSince we accept an absolute or relative error of at most 10^{-2}, 6.28 is also an acceptable output, but 6 is not.\n\nSample Input 2\n\n73\n\nSample Output 2\n\n458.67252742410977361942", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 8, "memory_kb": 1752}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s043751034", "group_id": "codeNet:p02705", "input_text": "package main\n\nimport \"fmt\"\nimport \"math\"\n\nfunc main(){\n\tvar R float64\n\n\tfmt.Scan(&R)\n\n\tfmt.Println(R * 2. * math.Pi)\n}", "language": "Go", "metadata": {"date": 1587345189, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02705.html", "problem_id": "p02705", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02705/input.txt", "sample_output_relpath": "derived/input_output/data/p02705/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02705/Go/s043751034.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s043751034", "user_id": "u283295031"}, "prompt_components": {"gold_output": "6.28318530717958623200\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\nimport \"math\"\n\nfunc main(){\n\tvar R float64\n\n\tfmt.Scan(&R)\n\n\tfmt.Println(R * 2. * math.Pi)\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nPrint the circumference of a circle of radius R.\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 circumference of the circle.\nYour output is considered correct if and only if its absolute or relative error from our answer is at most 10^{-2}.\n\nSample Input 1\n\n1\n\nSample Output 1\n\n6.28318530717958623200\n\nSince we accept an absolute or relative error of at most 10^{-2}, 6.28 is also an acceptable output, but 6 is not.\n\nSample Input 2\n\n73\n\nSample Output 2\n\n458.67252742410977361942", "sample_input": "1\n"}, "reference_outputs": ["6.28318530717958623200\n"], "source_document_id": "p02705", "source_text": "Score : 100 points\n\nProblem Statement\n\nPrint the circumference of a circle of radius R.\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 circumference of the circle.\nYour output is considered correct if and only if its absolute or relative error from our answer is at most 10^{-2}.\n\nSample Input 1\n\n1\n\nSample Output 1\n\n6.28318530717958623200\n\nSince we accept an absolute or relative error of at most 10^{-2}, 6.28 is also an acceptable output, but 6 is not.\n\nSample Input 2\n\n73\n\nSample Output 2\n\n458.67252742410977361942", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s066354336", "group_id": "codeNet:p02705", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar r int\n\tfmt.Scan(&r)\n\tfmt.Println(float64(2) * float64(r) * math.Pi)\n}\n", "language": "Go", "metadata": {"date": 1587345020, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02705.html", "problem_id": "p02705", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02705/input.txt", "sample_output_relpath": "derived/input_output/data/p02705/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02705/Go/s066354336.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s066354336", "user_id": "u620351704"}, "prompt_components": {"gold_output": "6.28318530717958623200\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar r int\n\tfmt.Scan(&r)\n\tfmt.Println(float64(2) * float64(r) * math.Pi)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nPrint the circumference of a circle of radius R.\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 circumference of the circle.\nYour output is considered correct if and only if its absolute or relative error from our answer is at most 10^{-2}.\n\nSample Input 1\n\n1\n\nSample Output 1\n\n6.28318530717958623200\n\nSince we accept an absolute or relative error of at most 10^{-2}, 6.28 is also an acceptable output, but 6 is not.\n\nSample Input 2\n\n73\n\nSample Output 2\n\n458.67252742410977361942", "sample_input": "1\n"}, "reference_outputs": ["6.28318530717958623200\n"], "source_document_id": "p02705", "source_text": "Score : 100 points\n\nProblem Statement\n\nPrint the circumference of a circle of radius R.\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 circumference of the circle.\nYour output is considered correct if and only if its absolute or relative error from our answer is at most 10^{-2}.\n\nSample Input 1\n\n1\n\nSample Output 1\n\n6.28318530717958623200\n\nSince we accept an absolute or relative error of at most 10^{-2}, 6.28 is also an acceptable output, but 6 is not.\n\nSample Input 2\n\n73\n\nSample Output 2\n\n458.67252742410977361942", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 1756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s725476626", "group_id": "codeNet:p02711", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst mod = 998244353\nconst facNum = 300001\n\nfunc main() {\n\tsc := newScanner(os.Stdin)\n\tN := sc.s()\n\tfor _, r := range N {\n\t\tif r == '7' {\n\t\t\tfmt.Println(\"Yes\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"No\")\n}\n\n// fmt.Println(\"Yes\")\n// fmt.Println(\"No\")\n\n// I/O\ntype scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc newScanner(input io.Reader) *scanner {\n\tsc := bufio.NewScanner(input)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &scanner{sc}\n}\n\nfunc (s *scanner) s() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *scanner) i() int {\n\ti, e := strconv.Atoi(s.s())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *scanner) f() float64 {\n\tf, e := strconv.ParseFloat(s.s(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *scanner) bs() []byte {\n\treturn []byte(s.s())\n}\n\nfunc (s *scanner) is(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.i()\n\t}\n\treturn res\n}\n\nfunc (s *scanner) fs(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.f()\n\t}\n\treturn res\n}\n\n//const factorial = new\nfunc Pow(a, n int) int {\n\tans := 1\n\tfor n > 0 {\n\t\tif (n & 1) == 1 {\n\t\t\tans = ans * a % mod\n\t\t}\n\t\ta = a * a % mod\n\t\tn = n >> 1\n\t}\n\treturn ans\n}\n\nfunc Gcd(a, b int) int {\n\tif a < b {\n\t\treturn Gcd(b, a)\n\t}\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc combination(n, k int, fac, ifac []int) int {\n\tif n < k || n < 0 {\n\t\treturn 0\n\t}\n\tif k == 0 {\n\t\treturn 1\n\t}\n\t//while n != 0\n\tans := ifac[k] * ifac[n-k] % mod\n\treturn ans * fac[n] % mod\n}\n\n// 階乗: factorial\n// コンビネーションを計算する際に前もって計算しておく\n// fac[k] => k! (mod M)\n// ifac[k] => k!^(M-2) (mod M)\n// n: ex. 2 * 10^5 => 200001\n// fac, ifac := factorial()\nfunc factorial() (fac []int, ifac []int) {\n\tfac = make([]int, facNum)\n\tfac[0] = 1\n\tifac = make([]int, facNum)\n\tifac[0] = 1\n\tfor i := 1; i < facNum; i++ {\n\t\tfac[i] = fac[i-1] * i % mod\n\t\tifac[i] = ifac[i-1] * Pow(i, mod-2) % mod\n\t}\n\treturn\n}\n\n// vs: sorted slice int value\nfunc lowerBound(vs []int, v int) (index int) {\n\tn := len(vs) / 2\n\tm := len(vs)\n\tfor m != n {\n\t\tif vs[n] < v {\n\t\t\tn = (m-n+1)/2 + n\n\t\t\t//m = m\n\t\t} else {\n\t\t\tm = n\n\t\t\tn = n / 2\n\t\t}\n\t}\n\treturn n\n}\n\nfunc IntSlice(n, init int) []int {\n\tr := make([]int, n)\n\tfor i := range r {\n\t\tr[i] = init\n\t}\n\treturn r\n}\n", "language": "Go", "metadata": {"date": 1592174101, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02711.html", "problem_id": "p02711", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02711/input.txt", "sample_output_relpath": "derived/input_output/data/p02711/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02711/Go/s725476626.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s725476626", "user_id": "u130295323"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst mod = 998244353\nconst facNum = 300001\n\nfunc main() {\n\tsc := newScanner(os.Stdin)\n\tN := sc.s()\n\tfor _, r := range N {\n\t\tif r == '7' {\n\t\t\tfmt.Println(\"Yes\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"No\")\n}\n\n// fmt.Println(\"Yes\")\n// fmt.Println(\"No\")\n\n// I/O\ntype scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc newScanner(input io.Reader) *scanner {\n\tsc := bufio.NewScanner(input)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &scanner{sc}\n}\n\nfunc (s *scanner) s() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *scanner) i() int {\n\ti, e := strconv.Atoi(s.s())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *scanner) f() float64 {\n\tf, e := strconv.ParseFloat(s.s(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *scanner) bs() []byte {\n\treturn []byte(s.s())\n}\n\nfunc (s *scanner) is(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.i()\n\t}\n\treturn res\n}\n\nfunc (s *scanner) fs(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.f()\n\t}\n\treturn res\n}\n\n//const factorial = new\nfunc Pow(a, n int) int {\n\tans := 1\n\tfor n > 0 {\n\t\tif (n & 1) == 1 {\n\t\t\tans = ans * a % mod\n\t\t}\n\t\ta = a * a % mod\n\t\tn = n >> 1\n\t}\n\treturn ans\n}\n\nfunc Gcd(a, b int) int {\n\tif a < b {\n\t\treturn Gcd(b, a)\n\t}\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc combination(n, k int, fac, ifac []int) int {\n\tif n < k || n < 0 {\n\t\treturn 0\n\t}\n\tif k == 0 {\n\t\treturn 1\n\t}\n\t//while n != 0\n\tans := ifac[k] * ifac[n-k] % mod\n\treturn ans * fac[n] % mod\n}\n\n// 階乗: factorial\n// コンビネーションを計算する際に前もって計算しておく\n// fac[k] => k! (mod M)\n// ifac[k] => k!^(M-2) (mod M)\n// n: ex. 2 * 10^5 => 200001\n// fac, ifac := factorial()\nfunc factorial() (fac []int, ifac []int) {\n\tfac = make([]int, facNum)\n\tfac[0] = 1\n\tifac = make([]int, facNum)\n\tifac[0] = 1\n\tfor i := 1; i < facNum; i++ {\n\t\tfac[i] = fac[i-1] * i % mod\n\t\tifac[i] = ifac[i-1] * Pow(i, mod-2) % mod\n\t}\n\treturn\n}\n\n// vs: sorted slice int value\nfunc lowerBound(vs []int, v int) (index int) {\n\tn := len(vs) / 2\n\tm := len(vs)\n\tfor m != n {\n\t\tif vs[n] < v {\n\t\t\tn = (m-n+1)/2 + n\n\t\t\t//m = m\n\t\t} else {\n\t\t\tm = n\n\t\t\tn = n / 2\n\t\t}\n\t}\n\treturn n\n}\n\nfunc IntSlice(n, init int) []int {\n\tr := make([]int, n)\n\tfor i := range r {\n\t\tr[i] = init\n\t}\n\treturn r\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven is a three-digit integer N. Does N contain the digit 7?\n\nIf so, print Yes; otherwise, print No.\n\nConstraints\n\n100 \\leq N \\leq 999\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N contains the digit 7, print Yes; otherwise, print No.\n\nSample Input 1\n\n117\n\nSample Output 1\n\nYes\n\n117 contains 7 as its last digit.\n\nSample Input 2\n\n123\n\nSample Output 2\n\nNo\n\n123 does not contain the digit 7.\n\nSample Input 3\n\n777\n\nSample Output 3\n\nYes", "sample_input": "117\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02711", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven is a three-digit integer N. Does N contain the digit 7?\n\nIf so, print Yes; otherwise, print No.\n\nConstraints\n\n100 \\leq N \\leq 999\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N contains the digit 7, print Yes; otherwise, print No.\n\nSample Input 1\n\n117\n\nSample Output 1\n\nYes\n\n117 contains 7 as its last digit.\n\nSample Input 2\n\n123\n\nSample Output 2\n\nNo\n\n123 does not contain the digit 7.\n\nSample Input 3\n\n777\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2425, "cpu_time_ms": 7, "memory_kb": 1760}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s369942930", "group_id": "codeNet:p02711", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n\nfunc scanInt64() int64 {\n\tsc.Scan()\n\ti, _ := strconv.ParseInt(sc.Text(), 10, 64)\n\treturn i\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t}\n\treturn res\n}\n\nfunc scanInts64(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := range res {\n\t\tres[i] = scanInt64()\n\t}\n\treturn res\n}\n\nfunc scanText() string {\n\tsc.Buffer([]byte{}, math.MaxInt64)\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := scanText()\n\tfor _, c := range n {\n\t\tif c == '7'\t {\n\t\t\tfmt.Println(\"Yes\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"No\")\n}\n", "language": "Go", "metadata": {"date": 1592003093, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02711.html", "problem_id": "p02711", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02711/input.txt", "sample_output_relpath": "derived/input_output/data/p02711/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02711/Go/s369942930.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s369942930", "user_id": "u475329018"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n\nfunc scanInt64() int64 {\n\tsc.Scan()\n\ti, _ := strconv.ParseInt(sc.Text(), 10, 64)\n\treturn i\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t}\n\treturn res\n}\n\nfunc scanInts64(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := range res {\n\t\tres[i] = scanInt64()\n\t}\n\treturn res\n}\n\nfunc scanText() string {\n\tsc.Buffer([]byte{}, math.MaxInt64)\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := scanText()\n\tfor _, c := range n {\n\t\tif c == '7'\t {\n\t\t\tfmt.Println(\"Yes\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"No\")\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven is a three-digit integer N. Does N contain the digit 7?\n\nIf so, print Yes; otherwise, print No.\n\nConstraints\n\n100 \\leq N \\leq 999\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N contains the digit 7, print Yes; otherwise, print No.\n\nSample Input 1\n\n117\n\nSample Output 1\n\nYes\n\n117 contains 7 as its last digit.\n\nSample Input 2\n\n123\n\nSample Output 2\n\nNo\n\n123 does not contain the digit 7.\n\nSample Input 3\n\n777\n\nSample Output 3\n\nYes", "sample_input": "117\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02711", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven is a three-digit integer N. Does N contain the digit 7?\n\nIf so, print Yes; otherwise, print No.\n\nConstraints\n\n100 \\leq N \\leq 999\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N contains the digit 7, print Yes; otherwise, print No.\n\nSample Input 1\n\n117\n\nSample Output 1\n\nYes\n\n117 contains 7 as its last digit.\n\nSample Input 2\n\n123\n\nSample Output 2\n\nNo\n\n123 does not contain the digit 7.\n\nSample Input 3\n\n777\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 765, "cpu_time_ms": 5, "memory_kb": 1756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s140099172", "group_id": "codeNet:p02711", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar str string\n\n\t_, _ = fmt.Scan(&str)\n\n\tif IsSevenExistingIn(str) {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\nfunc IsSevenExistingIn(str string) bool{\n\tfor i := 0; i < len(str); i++{\n\t\tif str[i] == '7'{\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n", "language": "Go", "metadata": {"date": 1587845802, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02711.html", "problem_id": "p02711", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02711/input.txt", "sample_output_relpath": "derived/input_output/data/p02711/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02711/Go/s140099172.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s140099172", "user_id": "u942427847"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar str string\n\n\t_, _ = fmt.Scan(&str)\n\n\tif IsSevenExistingIn(str) {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\nfunc IsSevenExistingIn(str string) bool{\n\tfor i := 0; i < len(str); i++{\n\t\tif str[i] == '7'{\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven is a three-digit integer N. Does N contain the digit 7?\n\nIf so, print Yes; otherwise, print No.\n\nConstraints\n\n100 \\leq N \\leq 999\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N contains the digit 7, print Yes; otherwise, print No.\n\nSample Input 1\n\n117\n\nSample Output 1\n\nYes\n\n117 contains 7 as its last digit.\n\nSample Input 2\n\n123\n\nSample Output 2\n\nNo\n\n123 does not contain the digit 7.\n\nSample Input 3\n\n777\n\nSample Output 3\n\nYes", "sample_input": "117\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02711", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven is a three-digit integer N. Does N contain the digit 7?\n\nIf so, print Yes; otherwise, print No.\n\nConstraints\n\n100 \\leq N \\leq 999\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N contains the digit 7, print Yes; otherwise, print No.\n\nSample Input 1\n\n117\n\nSample Output 1\n\nYes\n\n117 contains 7 as its last digit.\n\nSample Input 2\n\n123\n\nSample Output 2\n\nNo\n\n123 does not contain the digit 7.\n\nSample Input 3\n\n777\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 306, "cpu_time_ms": 11, "memory_kb": 1752}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s972616938", "group_id": "codeNet:p02711", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\tvar n string\n\tfmt.Scan(&n)\n\n\tresult := \"No\"\n\tif n[0] == '7' || n[1] == '7' || n[2] == '7' {\n\t\tresult = \"Yes\"\n\t}\n\tfmt.Println(result)\n}\n", "language": "Go", "metadata": {"date": 1587240301, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02711.html", "problem_id": "p02711", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02711/input.txt", "sample_output_relpath": "derived/input_output/data/p02711/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02711/Go/s972616938.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s972616938", "user_id": "u346986631"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\tvar n string\n\tfmt.Scan(&n)\n\n\tresult := \"No\"\n\tif n[0] == '7' || n[1] == '7' || n[2] == '7' {\n\t\tresult = \"Yes\"\n\t}\n\tfmt.Println(result)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven is a three-digit integer N. Does N contain the digit 7?\n\nIf so, print Yes; otherwise, print No.\n\nConstraints\n\n100 \\leq N \\leq 999\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N contains the digit 7, print Yes; otherwise, print No.\n\nSample Input 1\n\n117\n\nSample Output 1\n\nYes\n\n117 contains 7 as its last digit.\n\nSample Input 2\n\n123\n\nSample Output 2\n\nNo\n\n123 does not contain the digit 7.\n\nSample Input 3\n\n777\n\nSample Output 3\n\nYes", "sample_input": "117\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02711", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven is a three-digit integer N. Does N contain the digit 7?\n\nIf so, print Yes; otherwise, print No.\n\nConstraints\n\n100 \\leq N \\leq 999\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N contains the digit 7, print Yes; otherwise, print No.\n\nSample Input 1\n\n117\n\nSample Output 1\n\nYes\n\n117 contains 7 as its last digit.\n\nSample Input 2\n\n123\n\nSample Output 2\n\nNo\n\n123 does not contain the digit 7.\n\nSample Input 3\n\n777\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s841997506", "group_id": "codeNet:p02711", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, c int\n\tvar ans int = 0\n\tfmt.Scan(&a)\n\tfor i := 0; i < 3; i++ {\n\t\tc = a % 10\n\t\tif c == 7 {\n\t\t\tans++\n\t\t}\n\t\ta = a / 10\n\t}\n\n\tif ans > 0 {\n\t\tfmt.Printf(\"Yes\\n\")\n\t} else {\n\t\tfmt.Printf(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1586826678, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02711.html", "problem_id": "p02711", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02711/input.txt", "sample_output_relpath": "derived/input_output/data/p02711/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02711/Go/s841997506.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s841997506", "user_id": "u302074323"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, c int\n\tvar ans int = 0\n\tfmt.Scan(&a)\n\tfor i := 0; i < 3; i++ {\n\t\tc = a % 10\n\t\tif c == 7 {\n\t\t\tans++\n\t\t}\n\t\ta = a / 10\n\t}\n\n\tif ans > 0 {\n\t\tfmt.Printf(\"Yes\\n\")\n\t} else {\n\t\tfmt.Printf(\"No\")\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven is a three-digit integer N. Does N contain the digit 7?\n\nIf so, print Yes; otherwise, print No.\n\nConstraints\n\n100 \\leq N \\leq 999\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N contains the digit 7, print Yes; otherwise, print No.\n\nSample Input 1\n\n117\n\nSample Output 1\n\nYes\n\n117 contains 7 as its last digit.\n\nSample Input 2\n\n123\n\nSample Output 2\n\nNo\n\n123 does not contain the digit 7.\n\nSample Input 3\n\n777\n\nSample Output 3\n\nYes", "sample_input": "117\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02711", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven is a three-digit integer N. Does N contain the digit 7?\n\nIf so, print Yes; otherwise, print No.\n\nConstraints\n\n100 \\leq N \\leq 999\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N contains the digit 7, print Yes; otherwise, print No.\n\nSample Input 1\n\n117\n\nSample Output 1\n\nYes\n\n117 contains 7 as its last digit.\n\nSample Input 2\n\n123\n\nSample Output 2\n\nNo\n\n123 does not contain the digit 7.\n\nSample Input 3\n\n777\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 240, "cpu_time_ms": 4, "memory_kb": 1820}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s533117279", "group_id": "codeNet:p02711", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\n/*\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tstr := strconv.Itoa(n)\n\tarr := strings.Split(str, \"\")\n\tfor i := 0; i < len(arr); i++ {\n\t\tif arr[i] == \"7\" {\n\t\t\tfmt.Println(\"Yes\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"No\")\n}\n*/\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tstr := strconv.Itoa(n)\n\tif strings.Index(str, \"7\") != -1 {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1586802560, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02711.html", "problem_id": "p02711", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02711/input.txt", "sample_output_relpath": "derived/input_output/data/p02711/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02711/Go/s533117279.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s533117279", "user_id": "u150749188"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\n/*\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tstr := strconv.Itoa(n)\n\tarr := strings.Split(str, \"\")\n\tfor i := 0; i < len(arr); i++ {\n\t\tif arr[i] == \"7\" {\n\t\t\tfmt.Println(\"Yes\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"No\")\n}\n*/\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tstr := strconv.Itoa(n)\n\tif strings.Index(str, \"7\") != -1 {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven is a three-digit integer N. Does N contain the digit 7?\n\nIf so, print Yes; otherwise, print No.\n\nConstraints\n\n100 \\leq N \\leq 999\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N contains the digit 7, print Yes; otherwise, print No.\n\nSample Input 1\n\n117\n\nSample Output 1\n\nYes\n\n117 contains 7 as its last digit.\n\nSample Input 2\n\n123\n\nSample Output 2\n\nNo\n\n123 does not contain the digit 7.\n\nSample Input 3\n\n777\n\nSample Output 3\n\nYes", "sample_input": "117\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02711", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven is a three-digit integer N. Does N contain the digit 7?\n\nIf so, print Yes; otherwise, print No.\n\nConstraints\n\n100 \\leq N \\leq 999\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N contains the digit 7, print Yes; otherwise, print No.\n\nSample Input 1\n\n117\n\nSample Output 1\n\nYes\n\n117 contains 7 as its last digit.\n\nSample Input 2\n\n123\n\nSample Output 2\n\nNo\n\n123 does not contain the digit 7.\n\nSample Input 3\n\n777\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 676, "cpu_time_ms": 4, "memory_kb": 1760}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s693951613", "group_id": "codeNet:p02711", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar S int\n\tfmt.Scan(&S)\n\n\tx := 100\n\tcounter := 0\n\tfor i:=0; i<3; i++ {\n\t\tres := S / x\n\t\tif res == 7 {\n\t\t\tcounter = 1\n\t\t\tfmt.Println(\"Yes\")\n\t\t\tbreak\n\t\t}\n\t\ty := res * x\n\t\tS -= y\n\t\tx /= 10\n\t}\n\tif counter == 0 {\n\t\tfmt.Println(\"No\")\n\t}\n\n}", "language": "Go", "metadata": {"date": 1586741112, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02711.html", "problem_id": "p02711", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02711/input.txt", "sample_output_relpath": "derived/input_output/data/p02711/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02711/Go/s693951613.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s693951613", "user_id": "u269243552"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar S int\n\tfmt.Scan(&S)\n\n\tx := 100\n\tcounter := 0\n\tfor i:=0; i<3; i++ {\n\t\tres := S / x\n\t\tif res == 7 {\n\t\t\tcounter = 1\n\t\t\tfmt.Println(\"Yes\")\n\t\t\tbreak\n\t\t}\n\t\ty := res * x\n\t\tS -= y\n\t\tx /= 10\n\t}\n\tif counter == 0 {\n\t\tfmt.Println(\"No\")\n\t}\n\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven is a three-digit integer N. Does N contain the digit 7?\n\nIf so, print Yes; otherwise, print No.\n\nConstraints\n\n100 \\leq N \\leq 999\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N contains the digit 7, print Yes; otherwise, print No.\n\nSample Input 1\n\n117\n\nSample Output 1\n\nYes\n\n117 contains 7 as its last digit.\n\nSample Input 2\n\n123\n\nSample Output 2\n\nNo\n\n123 does not contain the digit 7.\n\nSample Input 3\n\n777\n\nSample Output 3\n\nYes", "sample_input": "117\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02711", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven is a three-digit integer N. Does N contain the digit 7?\n\nIf so, print Yes; otherwise, print No.\n\nConstraints\n\n100 \\leq N \\leq 999\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N contains the digit 7, print Yes; otherwise, print No.\n\nSample Input 1\n\n117\n\nSample Output 1\n\nYes\n\n117 contains 7 as its last digit.\n\nSample Input 2\n\n123\n\nSample Output 2\n\nNo\n\n123 does not contain the digit 7.\n\nSample Input 3\n\n777\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 281, "cpu_time_ms": 1, "memory_kb": 1752}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s063079319", "group_id": "codeNet:p02711", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush() // !!!!coution!!!! you must use Fprint(out, ) not Print()\n\t/* --- code --- */\n\ta := next()\n\n\tif strings.Contains(a, \"7\") {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\n// -*-*-*-*-*-*-*-*-\n// * I/O utilities *\n// -*-*-*-*-*-*-*-*-\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextFloat64() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\nfunc nextFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextFloat64()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\nfunc split(s string) []string {\n\tret := make([]string, len([]rune(s)))\n\tfor i, v := range []rune(s) {\n\t\tret[i] = string(v)\n\t}\n\treturn ret\n}\n\nfunc PrintOut(src interface{}, joinner string) {\n\tswitch reflect.TypeOf(src).Kind() {\n\tcase reflect.Slice:\n\t\ts := reflect.ValueOf(src)\n\t\tfor idx := 0; idx < s.Len(); idx++ {\n\t\t\tfmt.Fprintf(out, \"%v\", s.Index(idx))\n\t\t\tif idx < s.Len()-1 {\n\t\t\t\tfmt.Fprintf(out, \"%s\", joinner)\n\t\t\t} else {\n\t\t\t\tfmt.Fprintln(out)\n\t\t\t}\n\t\t}\n\tdefault:\n\t\tfmt.Fprintln(out, \"fuck\")\n\t}\n}\n\n// -*-*-*-*-*-*-*-*-\n// * tool snippets *\n// -*-*-*-*-*-*-*-*-\nfunc duplicate2Int(base [][]int) (ret [][]int) {\n\tret = make([][]int, len(base))\n\tfor i, v := range base {\n\t\tret[i] = append([]int{}, v...)\n\t}\n\treturn\n}\n\n// -*-*-*-*-*-*-*-*-*-*-*-*-*-\n// * Algorithms Utility Zone *\n// -*-*-*-*-*-*-*-*-*-*-*-*-*-\n\n// -*-*-*-*-*-*-*-\n// * 1. nibutan *\n// -*-*-*-*-*-*-*-\nfunc lower_bound(arr []int, target int) int {\n\tl, r := 0, len(arr)\n\tfor l < r {\n\t\tmid := (l + r) / 2\n\t\tif arr[mid] < target {\n\t\t\tl = mid + 1\n\t\t} else {\n\t\t\tr = mid\n\t\t}\n\t}\n\treturn l\n}\n\nfunc upper_bound(arr []int, target int) int {\n\tl, r := 0, len(arr)\n\tfor l < r {\n\t\tmid := (l + r) / 2\n\t\tif target < arr[mid] {\n\t\t\tr = mid\n\t\t} else {\n\t\t\tl = mid + 1\n\t\t}\n\t}\n\treturn l\n}\n\n// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-\n// * math flavor typical theories *\n// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-\nfunc gcd(a, b int) int {\n\tif a > b {\n\t\treturn gcd(b, a)\n\t}\n\tfor a != 0 {\n\t\ta, b = b%a, a\n\t}\n\treturn b\n}\n\nfunc pow(a, b int) (ret int) {\n\tret = a\n\t// 10^2 = 100ってことは10に10を1回掛けることだね\n\t// なので初期値を含めると上限b-1未満\n\tfor i := 0; i < b-1; i++ {\n\t\tret *= a\n\t}\n\treturn\n}\n\nfunc powMod(n, m, mod int) (ret int) {\n\tret = 1\n\tfor m > 0 {\n\t\tif m&1 == 1 {\n\t\t\tret *= n\n\t\t\tret %= mod\n\t\t}\n\t\tn *= n\n\t\tn %= mod\n\t\tm >>= 1\n\t}\n\treturn ret\n}\n", "language": "Go", "metadata": {"date": 1586739872, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02711.html", "problem_id": "p02711", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02711/input.txt", "sample_output_relpath": "derived/input_output/data/p02711/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02711/Go/s063079319.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s063079319", "user_id": "u532762536"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"reflect\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush() // !!!!coution!!!! you must use Fprint(out, ) not Print()\n\t/* --- code --- */\n\ta := next()\n\n\tif strings.Contains(a, \"7\") {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\n// -*-*-*-*-*-*-*-*-\n// * I/O utilities *\n// -*-*-*-*-*-*-*-*-\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextFloat64() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\nfunc nextFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextFloat64()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\nfunc split(s string) []string {\n\tret := make([]string, len([]rune(s)))\n\tfor i, v := range []rune(s) {\n\t\tret[i] = string(v)\n\t}\n\treturn ret\n}\n\nfunc PrintOut(src interface{}, joinner string) {\n\tswitch reflect.TypeOf(src).Kind() {\n\tcase reflect.Slice:\n\t\ts := reflect.ValueOf(src)\n\t\tfor idx := 0; idx < s.Len(); idx++ {\n\t\t\tfmt.Fprintf(out, \"%v\", s.Index(idx))\n\t\t\tif idx < s.Len()-1 {\n\t\t\t\tfmt.Fprintf(out, \"%s\", joinner)\n\t\t\t} else {\n\t\t\t\tfmt.Fprintln(out)\n\t\t\t}\n\t\t}\n\tdefault:\n\t\tfmt.Fprintln(out, \"fuck\")\n\t}\n}\n\n// -*-*-*-*-*-*-*-*-\n// * tool snippets *\n// -*-*-*-*-*-*-*-*-\nfunc duplicate2Int(base [][]int) (ret [][]int) {\n\tret = make([][]int, len(base))\n\tfor i, v := range base {\n\t\tret[i] = append([]int{}, v...)\n\t}\n\treturn\n}\n\n// -*-*-*-*-*-*-*-*-*-*-*-*-*-\n// * Algorithms Utility Zone *\n// -*-*-*-*-*-*-*-*-*-*-*-*-*-\n\n// -*-*-*-*-*-*-*-\n// * 1. nibutan *\n// -*-*-*-*-*-*-*-\nfunc lower_bound(arr []int, target int) int {\n\tl, r := 0, len(arr)\n\tfor l < r {\n\t\tmid := (l + r) / 2\n\t\tif arr[mid] < target {\n\t\t\tl = mid + 1\n\t\t} else {\n\t\t\tr = mid\n\t\t}\n\t}\n\treturn l\n}\n\nfunc upper_bound(arr []int, target int) int {\n\tl, r := 0, len(arr)\n\tfor l < r {\n\t\tmid := (l + r) / 2\n\t\tif target < arr[mid] {\n\t\t\tr = mid\n\t\t} else {\n\t\t\tl = mid + 1\n\t\t}\n\t}\n\treturn l\n}\n\n// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-\n// * math flavor typical theories *\n// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-\nfunc gcd(a, b int) int {\n\tif a > b {\n\t\treturn gcd(b, a)\n\t}\n\tfor a != 0 {\n\t\ta, b = b%a, a\n\t}\n\treturn b\n}\n\nfunc pow(a, b int) (ret int) {\n\tret = a\n\t// 10^2 = 100ってことは10に10を1回掛けることだね\n\t// なので初期値を含めると上限b-1未満\n\tfor i := 0; i < b-1; i++ {\n\t\tret *= a\n\t}\n\treturn\n}\n\nfunc powMod(n, m, mod int) (ret int) {\n\tret = 1\n\tfor m > 0 {\n\t\tif m&1 == 1 {\n\t\t\tret *= n\n\t\t\tret %= mod\n\t\t}\n\t\tn *= n\n\t\tn %= mod\n\t\tm >>= 1\n\t}\n\treturn ret\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven is a three-digit integer N. Does N contain the digit 7?\n\nIf so, print Yes; otherwise, print No.\n\nConstraints\n\n100 \\leq N \\leq 999\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N contains the digit 7, print Yes; otherwise, print No.\n\nSample Input 1\n\n117\n\nSample Output 1\n\nYes\n\n117 contains 7 as its last digit.\n\nSample Input 2\n\n123\n\nSample Output 2\n\nNo\n\n123 does not contain the digit 7.\n\nSample Input 3\n\n777\n\nSample Output 3\n\nYes", "sample_input": "117\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02711", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven is a three-digit integer N. Does N contain the digit 7?\n\nIf so, print Yes; otherwise, print No.\n\nConstraints\n\n100 \\leq N \\leq 999\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N contains the digit 7, print Yes; otherwise, print No.\n\nSample Input 1\n\n117\n\nSample Output 1\n\nYes\n\n117 contains 7 as its last digit.\n\nSample Input 2\n\n123\n\nSample Output 2\n\nNo\n\n123 does not contain the digit 7.\n\nSample Input 3\n\n777\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2841, "cpu_time_ms": 5, "memory_kb": 1756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s446568063", "group_id": "codeNet:p02711", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tfor i := 0; i < 3; i++ {\n\t\tif n%10 == 7 {\n\t\t\tfmt.Println(\"Yes\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"No\")\n}", "language": "Go", "metadata": {"date": 1586739756, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02711.html", "problem_id": "p02711", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02711/input.txt", "sample_output_relpath": "derived/input_output/data/p02711/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02711/Go/s446568063.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s446568063", "user_id": "u448258717"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tfor i := 0; i < 3; i++ {\n\t\tif n%10 == 7 {\n\t\t\tfmt.Println(\"Yes\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"No\")\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven is a three-digit integer N. Does N contain the digit 7?\n\nIf so, print Yes; otherwise, print No.\n\nConstraints\n\n100 \\leq N \\leq 999\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N contains the digit 7, print Yes; otherwise, print No.\n\nSample Input 1\n\n117\n\nSample Output 1\n\nYes\n\n117 contains 7 as its last digit.\n\nSample Input 2\n\n123\n\nSample Output 2\n\nNo\n\n123 does not contain the digit 7.\n\nSample Input 3\n\n777\n\nSample Output 3\n\nYes", "sample_input": "117\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02711", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven is a three-digit integer N. Does N contain the digit 7?\n\nIf so, print Yes; otherwise, print No.\n\nConstraints\n\n100 \\leq N \\leq 999\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N contains the digit 7, print Yes; otherwise, print No.\n\nSample Input 1\n\n117\n\nSample Output 1\n\nYes\n\n117 contains 7 as its last digit.\n\nSample Input 2\n\n123\n\nSample Output 2\n\nNo\n\n123 does not contain the digit 7.\n\nSample Input 3\n\n777\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 5, "memory_kb": 1752}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s593198734", "group_id": "codeNet:p02711", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tsolve(os.Stdin, os.Stdout)\n}\n\nfunc solve(in io.Reader, out io.Writer) {\n\tbs := NewBufScanner(in)\n\tbw := NewBufWriter(out)\n\tdefer bw.w.Flush()\n\tans := \"No\"\n\tif strings.Index(bs.Scan(), \"7\") > 0 {\n\t\tans = \"Yes\"\n\t}\n\tbw.Printf(ans)\n}\n\n// BufScanner original scanner\ntype BufScanner struct {\n\ts *bufio.Scanner\n}\n\n// NewBufScanner constructer\nfunc NewBufScanner(in io.Reader) *BufScanner {\n\ts := bufio.NewScanner(in)\n\ts.Buffer(make([]byte, 1024), 1e+9)\n\ts.Split(bufio.ScanWords)\n\treturn &BufScanner{\n\t\ts: s,\n\t}\n}\n\n// Scan Scan Data\nfunc (b *BufScanner) Scan() string {\n\tb.s.Scan()\n\treturn b.s.Text()\n}\n\n// IntScan Scan Data\nfunc (b *BufScanner) IntScan() int {\n\tv, err := strconv.Atoi(b.Scan())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\n// BufWriter original writer\ntype BufWriter struct {\n\tw *bufio.Writer\n}\n\n// NewBufWriter constructer\nfunc NewBufWriter(out io.Writer) *BufWriter {\n\tw := bufio.NewWriter(out)\n\treturn &BufWriter{\n\t\tw: w,\n\t}\n}\n\n// Printf Output file\nfunc (b *BufWriter) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(b.w, format, a...)\n}", "language": "Go", "metadata": {"date": 1586739750, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02711.html", "problem_id": "p02711", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02711/input.txt", "sample_output_relpath": "derived/input_output/data/p02711/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02711/Go/s593198734.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s593198734", "user_id": "u647304231"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tsolve(os.Stdin, os.Stdout)\n}\n\nfunc solve(in io.Reader, out io.Writer) {\n\tbs := NewBufScanner(in)\n\tbw := NewBufWriter(out)\n\tdefer bw.w.Flush()\n\tans := \"No\"\n\tif strings.Index(bs.Scan(), \"7\") > 0 {\n\t\tans = \"Yes\"\n\t}\n\tbw.Printf(ans)\n}\n\n// BufScanner original scanner\ntype BufScanner struct {\n\ts *bufio.Scanner\n}\n\n// NewBufScanner constructer\nfunc NewBufScanner(in io.Reader) *BufScanner {\n\ts := bufio.NewScanner(in)\n\ts.Buffer(make([]byte, 1024), 1e+9)\n\ts.Split(bufio.ScanWords)\n\treturn &BufScanner{\n\t\ts: s,\n\t}\n}\n\n// Scan Scan Data\nfunc (b *BufScanner) Scan() string {\n\tb.s.Scan()\n\treturn b.s.Text()\n}\n\n// IntScan Scan Data\nfunc (b *BufScanner) IntScan() int {\n\tv, err := strconv.Atoi(b.Scan())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\n// BufWriter original writer\ntype BufWriter struct {\n\tw *bufio.Writer\n}\n\n// NewBufWriter constructer\nfunc NewBufWriter(out io.Writer) *BufWriter {\n\tw := bufio.NewWriter(out)\n\treturn &BufWriter{\n\t\tw: w,\n\t}\n}\n\n// Printf Output file\nfunc (b *BufWriter) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(b.w, format, a...)\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven is a three-digit integer N. Does N contain the digit 7?\n\nIf so, print Yes; otherwise, print No.\n\nConstraints\n\n100 \\leq N \\leq 999\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N contains the digit 7, print Yes; otherwise, print No.\n\nSample Input 1\n\n117\n\nSample Output 1\n\nYes\n\n117 contains 7 as its last digit.\n\nSample Input 2\n\n123\n\nSample Output 2\n\nNo\n\n123 does not contain the digit 7.\n\nSample Input 3\n\n777\n\nSample Output 3\n\nYes", "sample_input": "117\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02711", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven is a three-digit integer N. Does N contain the digit 7?\n\nIf so, print Yes; otherwise, print No.\n\nConstraints\n\n100 \\leq N \\leq 999\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N contains the digit 7, print Yes; otherwise, print No.\n\nSample Input 1\n\n117\n\nSample Output 1\n\nYes\n\n117 contains 7 as its last digit.\n\nSample Input 2\n\n123\n\nSample Output 2\n\nNo\n\n123 does not contain the digit 7.\n\nSample Input 3\n\n777\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1151, "cpu_time_ms": 4, "memory_kb": 1760}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s854365495", "group_id": "codeNet:p02711", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t_ \"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t_ \"sort\"\n\t\"strconv\"\n)\n\n// I/O\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextFloat() float64 {\n\tf, e := strconv.ParseFloat(s.nextStr(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc (s *Scanner) nextFloatSlice(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextFloat()\n\t}\n\treturn res\n}\n\n// Arithmetic\nfunc max(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m < i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m > i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc pow(x, y int) int {\n\tres := 1\n\tfor i := 0; i < y; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\nfunc ceil(a, b int) int {\n\tif a%b == 0 {\n\t\treturn a / b\n\t} else {\n\t\treturn a/b + 1\n\t}\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\treturn a / gcd(a, b) * b\n}\n\n// Sort\ntype RuneSlice []rune\n\nfunc (a RuneSlice) Len() int { return len(a) }\nfunc (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }\nfunc (a RuneSlice) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\n\n// Main\nconst MOD = int(1e+9) + 7\nconst INF = 1 << 60\n\nfunc main() {\n\tsc := NewScanner()\n\twtr := bufio.NewWriter(os.Stdout)\n\tdefer wtr.Flush()\n\tN := sc.nextStr()\n\tif N[0] == '7' || N[1] == '7' || N[2] == '7' {\n\t\tfmt.Fprintln(wtr, \"Yes\")\n\t} else {\n\t\tfmt.Fprintln(wtr, \"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1586739696, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02711.html", "problem_id": "p02711", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02711/input.txt", "sample_output_relpath": "derived/input_output/data/p02711/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02711/Go/s854365495.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s854365495", "user_id": "u924691798"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t_ \"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t_ \"sort\"\n\t\"strconv\"\n)\n\n// I/O\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextFloat() float64 {\n\tf, e := strconv.ParseFloat(s.nextStr(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc (s *Scanner) nextFloatSlice(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextFloat()\n\t}\n\treturn res\n}\n\n// Arithmetic\nfunc max(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m < i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m > i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc pow(x, y int) int {\n\tres := 1\n\tfor i := 0; i < y; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\nfunc ceil(a, b int) int {\n\tif a%b == 0 {\n\t\treturn a / b\n\t} else {\n\t\treturn a/b + 1\n\t}\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\treturn a / gcd(a, b) * b\n}\n\n// Sort\ntype RuneSlice []rune\n\nfunc (a RuneSlice) Len() int { return len(a) }\nfunc (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }\nfunc (a RuneSlice) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\n\n// Main\nconst MOD = int(1e+9) + 7\nconst INF = 1 << 60\n\nfunc main() {\n\tsc := NewScanner()\n\twtr := bufio.NewWriter(os.Stdout)\n\tdefer wtr.Flush()\n\tN := sc.nextStr()\n\tif N[0] == '7' || N[1] == '7' || N[2] == '7' {\n\t\tfmt.Fprintln(wtr, \"Yes\")\n\t} else {\n\t\tfmt.Fprintln(wtr, \"No\")\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven is a three-digit integer N. Does N contain the digit 7?\n\nIf so, print Yes; otherwise, print No.\n\nConstraints\n\n100 \\leq N \\leq 999\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N contains the digit 7, print Yes; otherwise, print No.\n\nSample Input 1\n\n117\n\nSample Output 1\n\nYes\n\n117 contains 7 as its last digit.\n\nSample Input 2\n\n123\n\nSample Output 2\n\nNo\n\n123 does not contain the digit 7.\n\nSample Input 3\n\n777\n\nSample Output 3\n\nYes", "sample_input": "117\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02711", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven is a three-digit integer N. Does N contain the digit 7?\n\nIf so, print Yes; otherwise, print No.\n\nConstraints\n\n100 \\leq N \\leq 999\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N contains the digit 7, print Yes; otherwise, print No.\n\nSample Input 1\n\n117\n\nSample Output 1\n\nYes\n\n117 contains 7 as its last digit.\n\nSample Input 2\n\n123\n\nSample Output 2\n\nNo\n\n123 does not contain the digit 7.\n\nSample Input 3\n\n777\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2065, "cpu_time_ms": 7, "memory_kb": 1760}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s476547839", "group_id": "codeNet:p02711", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\tS := sc.Next()\n\t\n\tif strings.Contains(S,\"7\"){\n\t\tfmt.Println(\"Yes\")\n\t}else{\n\t\tfmt.Println(\"No\")\n\t}\n\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *Scanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *Scanner) NextFloat() float64 {\n\tv, _ := strconv.ParseFloat(s.Next(), 64)\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)\n\t\t\tresult = append(result, int(v))\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\n\treturn result\n}\nfunc (s *Scanner) NextInt64Array() []int64 {\n\ts.pre()\n\tstart := s.p\n\tresult := []int64{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1586739665, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02711.html", "problem_id": "p02711", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02711/input.txt", "sample_output_relpath": "derived/input_output/data/p02711/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02711/Go/s476547839.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s476547839", "user_id": "u504669764"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\tS := sc.Next()\n\t\n\tif strings.Contains(S,\"7\"){\n\t\tfmt.Println(\"Yes\")\n\t}else{\n\t\tfmt.Println(\"No\")\n\t}\n\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *Scanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *Scanner) NextFloat() float64 {\n\tv, _ := strconv.ParseFloat(s.Next(), 64)\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)\n\t\t\tresult = append(result, int(v))\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\n\treturn result\n}\nfunc (s *Scanner) NextInt64Array() []int64 {\n\ts.pre()\n\tstart := s.p\n\tresult := []int64{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven is a three-digit integer N. Does N contain the digit 7?\n\nIf so, print Yes; otherwise, print No.\n\nConstraints\n\n100 \\leq N \\leq 999\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N contains the digit 7, print Yes; otherwise, print No.\n\nSample Input 1\n\n117\n\nSample Output 1\n\nYes\n\n117 contains 7 as its last digit.\n\nSample Input 2\n\n123\n\nSample Output 2\n\nNo\n\n123 does not contain the digit 7.\n\nSample Input 3\n\n777\n\nSample Output 3\n\nYes", "sample_input": "117\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02711", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven is a three-digit integer N. Does N contain the digit 7?\n\nIf so, print Yes; otherwise, print No.\n\nConstraints\n\n100 \\leq N \\leq 999\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N contains the digit 7, print Yes; otherwise, print No.\n\nSample Input 1\n\n117\n\nSample Output 1\n\nYes\n\n117 contains 7 as its last digit.\n\nSample Input 2\n\n123\n\nSample Output 2\n\nNo\n\n123 does not contain the digit 7.\n\nSample Input 3\n\n777\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2128, "cpu_time_ms": 6, "memory_kb": 1756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s772125691", "group_id": "codeNet:p02713", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\t// gcd(a, b, c) = gcd(gcd(a, b), c)\n\tvar K int\n\tfmt.Scanf(\"%d\", &K)\n\n\tsum := 0\n\tfor i := 1; i <= K; i++ {\n\t\tfor j := 1; j <= K; j++ {\n\t\t\tfor k := 1; k <= K; k++ {\n\t\t\t\tsum += gcd(gcd(i, j), k)\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n\nfunc gcd(a, b int) int {\n\tif a > b {\n\t\tb, a = a, b\n\t} else if a == b {\n\t\treturn a\n\t}\n\t// b > a\n\tfor a != 0 {\n\t\ta, b = b%a, a\n\t}\n\treturn b\n}\n", "language": "Go", "metadata": {"date": 1591502283, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02713.html", "problem_id": "p02713", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02713/input.txt", "sample_output_relpath": "derived/input_output/data/p02713/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02713/Go/s772125691.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s772125691", "user_id": "u162326103"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\t// gcd(a, b, c) = gcd(gcd(a, b), c)\n\tvar K int\n\tfmt.Scanf(\"%d\", &K)\n\n\tsum := 0\n\tfor i := 1; i <= K; i++ {\n\t\tfor j := 1; j <= K; j++ {\n\t\t\tfor k := 1; k <= K; k++ {\n\t\t\t\tsum += gcd(gcd(i, j), k)\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n\nfunc gcd(a, b int) int {\n\tif a > b {\n\t\tb, a = a, b\n\t} else if a == b {\n\t\treturn a\n\t}\n\t// b > a\n\tfor a != 0 {\n\t\ta, b = b%a, a\n\t}\n\treturn b\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nFind \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nHere \\gcd(a,b,c) denotes the greatest common divisor of a, b, and c.\n\nConstraints\n\n1 \\leq K \\leq 200\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the value of \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n9\n\n\\gcd(1,1,1)+\\gcd(1,1,2)+\\gcd(1,2,1)+\\gcd(1,2,2)\n+\\gcd(2,1,1)+\\gcd(2,1,2)+\\gcd(2,2,1)+\\gcd(2,2,2)\n=1+1+1+1+1+1+1+2=9\n\nThus, the answer is 9.\n\nSample Input 2\n\n200\n\nSample Output 2\n\n10813692", "sample_input": "2\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02713", "source_text": "Score : 300 points\n\nProblem Statement\n\nFind \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nHere \\gcd(a,b,c) denotes the greatest common divisor of a, b, and c.\n\nConstraints\n\n1 \\leq K \\leq 200\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the value of \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n9\n\n\\gcd(1,1,1)+\\gcd(1,1,2)+\\gcd(1,2,1)+\\gcd(1,2,2)\n+\\gcd(2,1,1)+\\gcd(2,1,2)+\\gcd(2,2,1)+\\gcd(2,2,2)\n=1+1+1+1+1+1+1+2=9\n\nThus, the answer is 9.\n\nSample Input 2\n\n200\n\nSample Output 2\n\n10813692", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 413, "cpu_time_ms": 500, "memory_kb": 1844}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s614989320", "group_id": "codeNet:p02713", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\n// go run ./main.go < in\nvar num int\n\nfunc main() {\n\tfmt.Scan(&num)\n\n\tsum := 0\n\tfor i := 1; i <= num; i++ {\n\t\tfor j := 1; j <= num; j++ {\n\t\t\tinit := gcd(i, j)\n\t\t\tfor k := 1; k <= num; k++ {\n\t\t\t\tsum += gcd(init, k)\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}", "language": "Go", "metadata": {"date": 1591412567, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02713.html", "problem_id": "p02713", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02713/input.txt", "sample_output_relpath": "derived/input_output/data/p02713/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02713/Go/s614989320.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s614989320", "user_id": "u046160726"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\n// go run ./main.go < in\nvar num int\n\nfunc main() {\n\tfmt.Scan(&num)\n\n\tsum := 0\n\tfor i := 1; i <= num; i++ {\n\t\tfor j := 1; j <= num; j++ {\n\t\t\tinit := gcd(i, j)\n\t\t\tfor k := 1; k <= num; k++ {\n\t\t\t\tsum += gcd(init, k)\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nFind \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nHere \\gcd(a,b,c) denotes the greatest common divisor of a, b, and c.\n\nConstraints\n\n1 \\leq K \\leq 200\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the value of \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n9\n\n\\gcd(1,1,1)+\\gcd(1,1,2)+\\gcd(1,2,1)+\\gcd(1,2,2)\n+\\gcd(2,1,1)+\\gcd(2,1,2)+\\gcd(2,2,1)+\\gcd(2,2,2)\n=1+1+1+1+1+1+1+2=9\n\nThus, the answer is 9.\n\nSample Input 2\n\n200\n\nSample Output 2\n\n10813692", "sample_input": "2\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02713", "source_text": "Score : 300 points\n\nProblem Statement\n\nFind \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nHere \\gcd(a,b,c) denotes the greatest common divisor of a, b, and c.\n\nConstraints\n\n1 \\leq K \\leq 200\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the value of \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n9\n\n\\gcd(1,1,1)+\\gcd(1,1,2)+\\gcd(1,2,1)+\\gcd(1,2,2)\n+\\gcd(2,1,1)+\\gcd(2,1,2)+\\gcd(2,2,1)+\\gcd(2,2,2)\n=1+1+1+1+1+1+1+2=9\n\nThus, the answer is 9.\n\nSample Input 2\n\n200\n\nSample Output 2\n\n10813692", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 242, "memory_kb": 1780}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s074995943", "group_id": "codeNet:p02713", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tnextReader = newScanner()\n\tk := nextInt()\n\tans := 0\n\tfor a := 1; a <= k; a++ {\n\t\tfor b := 1; b <= k; b++ {\n\t\t\tfor c := 1; c <= k; c++ {\n\t\t\t\tans += gcd(a, gcd(b, c))\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc gcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t}\n\treturn gcd(y, x%y)\n}\n\n// ---------------------------------------------------------------\n// I/O\n// ---------------------------------------------------------------\nvar nextReader func() string\n\nfunc newScanner() func() string {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Buffer(make([]byte, 1024), int(1e11))\n\tsc.Split(bufio.ScanWords)\n\treturn func() string {\n\t\tsc.Scan()\n\t\treturn sc.Text()\n\t}\n}\n\nfunc nextString() string { return nextReader() }\n\nfunc nextInt() int { n, _ := strconv.Atoi(nextReader()); return n }\n\nfunc nextInts(size int) []int {\n\tns := make([]int, size)\n\tfor i := 0; i < size; i++ {\n\t\tns[i] = nextInt()\n\t}\n\treturn ns\n}\n", "language": "Go", "metadata": {"date": 1590029659, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02713.html", "problem_id": "p02713", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02713/input.txt", "sample_output_relpath": "derived/input_output/data/p02713/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02713/Go/s074995943.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s074995943", "user_id": "u150922405"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tnextReader = newScanner()\n\tk := nextInt()\n\tans := 0\n\tfor a := 1; a <= k; a++ {\n\t\tfor b := 1; b <= k; b++ {\n\t\t\tfor c := 1; c <= k; c++ {\n\t\t\t\tans += gcd(a, gcd(b, c))\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc gcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t}\n\treturn gcd(y, x%y)\n}\n\n// ---------------------------------------------------------------\n// I/O\n// ---------------------------------------------------------------\nvar nextReader func() string\n\nfunc newScanner() func() string {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Buffer(make([]byte, 1024), int(1e11))\n\tsc.Split(bufio.ScanWords)\n\treturn func() string {\n\t\tsc.Scan()\n\t\treturn sc.Text()\n\t}\n}\n\nfunc nextString() string { return nextReader() }\n\nfunc nextInt() int { n, _ := strconv.Atoi(nextReader()); return n }\n\nfunc nextInts(size int) []int {\n\tns := make([]int, size)\n\tfor i := 0; i < size; i++ {\n\t\tns[i] = nextInt()\n\t}\n\treturn ns\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nFind \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nHere \\gcd(a,b,c) denotes the greatest common divisor of a, b, and c.\n\nConstraints\n\n1 \\leq K \\leq 200\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the value of \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n9\n\n\\gcd(1,1,1)+\\gcd(1,1,2)+\\gcd(1,2,1)+\\gcd(1,2,2)\n+\\gcd(2,1,1)+\\gcd(2,1,2)+\\gcd(2,2,1)+\\gcd(2,2,2)\n=1+1+1+1+1+1+1+2=9\n\nThus, the answer is 9.\n\nSample Input 2\n\n200\n\nSample Output 2\n\n10813692", "sample_input": "2\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02713", "source_text": "Score : 300 points\n\nProblem Statement\n\nFind \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nHere \\gcd(a,b,c) denotes the greatest common divisor of a, b, and c.\n\nConstraints\n\n1 \\leq K \\leq 200\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the value of \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n9\n\n\\gcd(1,1,1)+\\gcd(1,1,2)+\\gcd(1,2,1)+\\gcd(1,2,2)\n+\\gcd(2,1,1)+\\gcd(2,1,2)+\\gcd(2,2,1)+\\gcd(2,2,2)\n=1+1+1+1+1+1+1+2=9\n\nThus, the answer is 9.\n\nSample Input 2\n\n200\n\nSample Output 2\n\n10813692", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 957, "cpu_time_ms": 745, "memory_kb": 1780}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s519642253", "group_id": "codeNet:p02713", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main(){\n var N, ans int\n fmt.Scan(&N)\n \n for i := 1; i<=N; i++ {\n for j := 1; j<=N; j++ {\n for k := 1; k<=N; k++ {\n ans += gcd(i,gcd(j,k))\n }\n }\n }\n fmt.Println(ans) \n}\n\nfunc gcd(a,b int) int {\n if b==0 {\n return a\n }\n return gcd(b,a%b)\n}\n", "language": "Go", "metadata": {"date": 1587240524, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02713.html", "problem_id": "p02713", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02713/input.txt", "sample_output_relpath": "derived/input_output/data/p02713/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02713/Go/s519642253.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s519642253", "user_id": "u742729271"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main(){\n var N, ans int\n fmt.Scan(&N)\n \n for i := 1; i<=N; i++ {\n for j := 1; j<=N; j++ {\n for k := 1; k<=N; k++ {\n ans += gcd(i,gcd(j,k))\n }\n }\n }\n fmt.Println(ans) \n}\n\nfunc gcd(a,b int) int {\n if b==0 {\n return a\n }\n return gcd(b,a%b)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nFind \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nHere \\gcd(a,b,c) denotes the greatest common divisor of a, b, and c.\n\nConstraints\n\n1 \\leq K \\leq 200\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the value of \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n9\n\n\\gcd(1,1,1)+\\gcd(1,1,2)+\\gcd(1,2,1)+\\gcd(1,2,2)\n+\\gcd(2,1,1)+\\gcd(2,1,2)+\\gcd(2,2,1)+\\gcd(2,2,2)\n=1+1+1+1+1+1+1+2=9\n\nThus, the answer is 9.\n\nSample Input 2\n\n200\n\nSample Output 2\n\n10813692", "sample_input": "2\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02713", "source_text": "Score : 300 points\n\nProblem Statement\n\nFind \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nHere \\gcd(a,b,c) denotes the greatest common divisor of a, b, and c.\n\nConstraints\n\n1 \\leq K \\leq 200\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the value of \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n9\n\n\\gcd(1,1,1)+\\gcd(1,1,2)+\\gcd(1,2,1)+\\gcd(1,2,2)\n+\\gcd(2,1,1)+\\gcd(2,1,2)+\\gcd(2,2,1)+\\gcd(2,2,2)\n=1+1+1+1+1+1+1+2=9\n\nThus, the answer is 9.\n\nSample Input 2\n\n200\n\nSample Output 2\n\n10813692", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 740, "memory_kb": 1776}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s426570566", "group_id": "codeNet:p02713", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar K, sum int\n\tfmt.Scan(&K)\n\tw := make([][]int, K+1)\n\tfor i := 0; i < len(w); i++ {\n\t\tw[i] = make([]int, K+1)\n\t\tfor j := 0; j < len(w[i]); j++ {\n\t\t\tw[i][j] = gcd(i, j)\n\t\t}\n\t}\n\tfor a := 1; a <= K; a++ {\n\t\tfor b := 1; b <= K; b++ {\n\t\t\tfor c := 1; c <= K; c++ {\n\t\t\t\tsum += gcd(w[a][b], c)\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n", "language": "Go", "metadata": {"date": 1586921087, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02713.html", "problem_id": "p02713", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02713/input.txt", "sample_output_relpath": "derived/input_output/data/p02713/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02713/Go/s426570566.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s426570566", "user_id": "u298152049"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar K, sum int\n\tfmt.Scan(&K)\n\tw := make([][]int, K+1)\n\tfor i := 0; i < len(w); i++ {\n\t\tw[i] = make([]int, K+1)\n\t\tfor j := 0; j < len(w[i]); j++ {\n\t\t\tw[i][j] = gcd(i, j)\n\t\t}\n\t}\n\tfor a := 1; a <= K; a++ {\n\t\tfor b := 1; b <= K; b++ {\n\t\t\tfor c := 1; c <= K; c++ {\n\t\t\t\tsum += gcd(w[a][b], c)\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nFind \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nHere \\gcd(a,b,c) denotes the greatest common divisor of a, b, and c.\n\nConstraints\n\n1 \\leq K \\leq 200\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the value of \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n9\n\n\\gcd(1,1,1)+\\gcd(1,1,2)+\\gcd(1,2,1)+\\gcd(1,2,2)\n+\\gcd(2,1,1)+\\gcd(2,1,2)+\\gcd(2,2,1)+\\gcd(2,2,2)\n=1+1+1+1+1+1+1+2=9\n\nThus, the answer is 9.\n\nSample Input 2\n\n200\n\nSample Output 2\n\n10813692", "sample_input": "2\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02713", "source_text": "Score : 300 points\n\nProblem Statement\n\nFind \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nHere \\gcd(a,b,c) denotes the greatest common divisor of a, b, and c.\n\nConstraints\n\n1 \\leq K \\leq 200\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the value of \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n9\n\n\\gcd(1,1,1)+\\gcd(1,1,2)+\\gcd(1,2,1)+\\gcd(1,2,2)\n+\\gcd(2,1,1)+\\gcd(2,1,2)+\\gcd(2,2,1)+\\gcd(2,2,2)\n=1+1+1+1+1+1+1+2=9\n\nThus, the answer is 9.\n\nSample Input 2\n\n200\n\nSample Output 2\n\n10813692", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 436, "cpu_time_ms": 254, "memory_kb": 2144}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s587201646", "group_id": "codeNet:p02713", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tsum := 0\n\tfor i := 1; i <= n; i++ {\n\t\tfor j := 1; j <= n; j++ {\n\t\t\tfor k := 1; k <= n; k++ {\n\t\t\t\tsum += gcd(gcd(i, j), k)\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n", "language": "Go", "metadata": {"date": 1586742260, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02713.html", "problem_id": "p02713", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02713/input.txt", "sample_output_relpath": "derived/input_output/data/p02713/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02713/Go/s587201646.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s587201646", "user_id": "u651597583"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tsum := 0\n\tfor i := 1; i <= n; i++ {\n\t\tfor j := 1; j <= n; j++ {\n\t\t\tfor k := 1; k <= n; k++ {\n\t\t\t\tsum += gcd(gcd(i, j), k)\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nFind \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nHere \\gcd(a,b,c) denotes the greatest common divisor of a, b, and c.\n\nConstraints\n\n1 \\leq K \\leq 200\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the value of \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n9\n\n\\gcd(1,1,1)+\\gcd(1,1,2)+\\gcd(1,2,1)+\\gcd(1,2,2)\n+\\gcd(2,1,1)+\\gcd(2,1,2)+\\gcd(2,2,1)+\\gcd(2,2,2)\n=1+1+1+1+1+1+1+2=9\n\nThus, the answer is 9.\n\nSample Input 2\n\n200\n\nSample Output 2\n\n10813692", "sample_input": "2\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02713", "source_text": "Score : 300 points\n\nProblem Statement\n\nFind \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nHere \\gcd(a,b,c) denotes the greatest common divisor of a, b, and c.\n\nConstraints\n\n1 \\leq K \\leq 200\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the value of \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n9\n\n\\gcd(1,1,1)+\\gcd(1,1,2)+\\gcd(1,2,1)+\\gcd(1,2,2)\n+\\gcd(2,1,1)+\\gcd(2,1,2)+\\gcd(2,2,1)+\\gcd(2,2,2)\n=1+1+1+1+1+1+1+2=9\n\nThus, the answer is 9.\n\nSample Input 2\n\n200\n\nSample Output 2\n\n10813692", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 490, "cpu_time_ms": 717, "memory_kb": 1776}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s986514121", "group_id": "codeNet:p02713", "input_text": "package main\nimport \"fmt\"\nfunc main(){\n // Your code here!\n var k int64\n fmt.Scan(&k)\n \n\n var x,y,z,sum int64\n sum = 0\n for x = 1; x <= k; x++{\n for y = 1; y <= k; y++{\n for z = 1; z <= k; z++{\n sum = sum + gcd(gcd(z,y),x)\n }\n }\n }\n fmt.Println(sum)\n}\n\nfunc gcd(a int64, b int64) int64{\n var t int64\n if a < b{\n t = b\n b = a\n a = t\n }\n for ;;{\n if a % b == 0{\n return b\n }else{\n t = a\n a = b\n b = t % b\n }\n }\n}", "language": "Go", "metadata": {"date": 1586741891, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02713.html", "problem_id": "p02713", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02713/input.txt", "sample_output_relpath": "derived/input_output/data/p02713/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02713/Go/s986514121.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s986514121", "user_id": "u167020125"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\nimport \"fmt\"\nfunc main(){\n // Your code here!\n var k int64\n fmt.Scan(&k)\n \n\n var x,y,z,sum int64\n sum = 0\n for x = 1; x <= k; x++{\n for y = 1; y <= k; y++{\n for z = 1; z <= k; z++{\n sum = sum + gcd(gcd(z,y),x)\n }\n }\n }\n fmt.Println(sum)\n}\n\nfunc gcd(a int64, b int64) int64{\n var t int64\n if a < b{\n t = b\n b = a\n a = t\n }\n for ;;{\n if a % b == 0{\n return b\n }else{\n t = a\n a = b\n b = t % b\n }\n }\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nFind \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nHere \\gcd(a,b,c) denotes the greatest common divisor of a, b, and c.\n\nConstraints\n\n1 \\leq K \\leq 200\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the value of \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n9\n\n\\gcd(1,1,1)+\\gcd(1,1,2)+\\gcd(1,2,1)+\\gcd(1,2,2)\n+\\gcd(2,1,1)+\\gcd(2,1,2)+\\gcd(2,2,1)+\\gcd(2,2,2)\n=1+1+1+1+1+1+1+2=9\n\nThus, the answer is 9.\n\nSample Input 2\n\n200\n\nSample Output 2\n\n10813692", "sample_input": "2\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02713", "source_text": "Score : 300 points\n\nProblem Statement\n\nFind \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nHere \\gcd(a,b,c) denotes the greatest common divisor of a, b, and c.\n\nConstraints\n\n1 \\leq K \\leq 200\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the value of \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n9\n\n\\gcd(1,1,1)+\\gcd(1,1,2)+\\gcd(1,2,1)+\\gcd(1,2,2)\n+\\gcd(2,1,1)+\\gcd(2,1,2)+\\gcd(2,2,1)+\\gcd(2,2,2)\n=1+1+1+1+1+1+1+2=9\n\nThus, the answer is 9.\n\nSample Input 2\n\n200\n\nSample Output 2\n\n10813692", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 589, "cpu_time_ms": 617, "memory_kb": 1776}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s282120938", "group_id": "codeNet:p02713", "input_text": "package main\n\nimport \"fmt\"\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc main() {\n\tvar K int\n\tfmt.Scan(&K)\n\tsum := 0\n\tfor i := 1; i <= K; i++ {\n\t\tfor j := 1; j <= K; j++ {\n\t\t\tfor l := 1; l <= K; l++ {\n\t\t\t\tsum += gcd(gcd(i, j), l)\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(sum)\n}", "language": "Go", "metadata": {"date": 1586741424, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02713.html", "problem_id": "p02713", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02713/input.txt", "sample_output_relpath": "derived/input_output/data/p02713/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02713/Go/s282120938.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s282120938", "user_id": "u163829702"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc main() {\n\tvar K int\n\tfmt.Scan(&K)\n\tsum := 0\n\tfor i := 1; i <= K; i++ {\n\t\tfor j := 1; j <= K; j++ {\n\t\t\tfor l := 1; l <= K; l++ {\n\t\t\t\tsum += gcd(gcd(i, j), l)\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(sum)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nFind \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nHere \\gcd(a,b,c) denotes the greatest common divisor of a, b, and c.\n\nConstraints\n\n1 \\leq K \\leq 200\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the value of \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n9\n\n\\gcd(1,1,1)+\\gcd(1,1,2)+\\gcd(1,2,1)+\\gcd(1,2,2)\n+\\gcd(2,1,1)+\\gcd(2,1,2)+\\gcd(2,2,1)+\\gcd(2,2,2)\n=1+1+1+1+1+1+1+2=9\n\nThus, the answer is 9.\n\nSample Input 2\n\n200\n\nSample Output 2\n\n10813692", "sample_input": "2\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02713", "source_text": "Score : 300 points\n\nProblem Statement\n\nFind \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nHere \\gcd(a,b,c) denotes the greatest common divisor of a, b, and c.\n\nConstraints\n\n1 \\leq K \\leq 200\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the value of \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n9\n\n\\gcd(1,1,1)+\\gcd(1,1,2)+\\gcd(1,2,1)+\\gcd(1,2,2)\n+\\gcd(2,1,1)+\\gcd(2,1,2)+\\gcd(2,2,1)+\\gcd(2,2,2)\n=1+1+1+1+1+1+1+2=9\n\nThus, the answer is 9.\n\nSample Input 2\n\n200\n\nSample Output 2\n\n10813692", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 716, "memory_kb": 1776}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s684158824", "group_id": "codeNet:p02713", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e6 + 7\n)\n\nvar buf []byte = make([]byte, maxBufSize)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBufSize)\n}\n\nfunc main() {\n\tK := nextInt()\n\tans := 0\n\tfor a := 1; a <= K; a++ {\n\t\tfor b := 1; b <= K; b++ {\n\t\t\tfor c := 1; c <= K; c++ {\n\t\t\t\tans += gcdof2numbers(a, gcdof2numbers(b, c))\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc gcdof2numbers(a int, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcdof2numbers(b, a%b)\n}\n", "language": "Go", "metadata": {"date": 1586740865, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02713.html", "problem_id": "p02713", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02713/input.txt", "sample_output_relpath": "derived/input_output/data/p02713/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02713/Go/s684158824.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s684158824", "user_id": "u605443479"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e6 + 7\n)\n\nvar buf []byte = make([]byte, maxBufSize)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBufSize)\n}\n\nfunc main() {\n\tK := nextInt()\n\tans := 0\n\tfor a := 1; a <= K; a++ {\n\t\tfor b := 1; b <= K; b++ {\n\t\t\tfor c := 1; c <= K; c++ {\n\t\t\t\tans += gcdof2numbers(a, gcdof2numbers(b, c))\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc gcdof2numbers(a int, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcdof2numbers(b, a%b)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nFind \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nHere \\gcd(a,b,c) denotes the greatest common divisor of a, b, and c.\n\nConstraints\n\n1 \\leq K \\leq 200\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the value of \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n9\n\n\\gcd(1,1,1)+\\gcd(1,1,2)+\\gcd(1,2,1)+\\gcd(1,2,2)\n+\\gcd(2,1,1)+\\gcd(2,1,2)+\\gcd(2,2,1)+\\gcd(2,2,2)\n=1+1+1+1+1+1+1+2=9\n\nThus, the answer is 9.\n\nSample Input 2\n\n200\n\nSample Output 2\n\n10813692", "sample_input": "2\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02713", "source_text": "Score : 300 points\n\nProblem Statement\n\nFind \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nHere \\gcd(a,b,c) denotes the greatest common divisor of a, b, and c.\n\nConstraints\n\n1 \\leq K \\leq 200\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the value of \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n9\n\n\\gcd(1,1,1)+\\gcd(1,1,2)+\\gcd(1,2,1)+\\gcd(1,2,2)\n+\\gcd(2,1,1)+\\gcd(2,1,2)+\\gcd(2,2,1)+\\gcd(2,2,2)\n=1+1+1+1+1+1+1+2=9\n\nThus, the answer is 9.\n\nSample Input 2\n\n200\n\nSample Output 2\n\n10813692", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 692, "memory_kb": 1812}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s440459659", "group_id": "codeNet:p02713", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst INFINITY = math.MaxInt64/2 - 1\n\nfunc exec(stdin *Stdin, stdout *Stdout) {\n\tk := stdin.ReadInt()\n\tsum := 0\n\tfor a := 1; a <= k; a++ {\n\t\tfor b := 1; b <= k; b++ {\n\t\t\tfor c := 1; c <= k; c++ {\n\t\t\t\tsum += Gcd(a, Gcd(b, c))\n\t\t\t}\n\t\t}\n\t}\n\tstdout.Println(sum)\n}\n\nfunc Gcd(x, y int) int {\n\tif x < y {\n\t\tx, y = y, x\n\t}\n\n\tfor y > 0 {\n\t\tx, y = y, x%y\n\t}\n\n\treturn x\n}\n\nfunc main() {\n\tstdout := NewStdout()\n\tdefer stdout.Flush()\n\texec(NewStdin(bufio.ScanWords), stdout)\n}\n\ntype Stdin struct {\n\tstdin *bufio.Scanner\n}\n\nfunc NewStdin(split bufio.SplitFunc) *Stdin {\n\ts := Stdin{bufio.NewScanner(os.Stdin)}\n\ts.stdin.Split(split)\n\ts.stdin.Buffer(make([]byte, bufio.MaxScanTokenSize), INFINITY)\n\treturn &s\n}\n\nfunc (s *Stdin) Read() string {\n\ts.stdin.Scan()\n\treturn s.stdin.Text()\n}\n\nfunc (s *Stdin) ReadInt() int {\n\tn, _ := strconv.Atoi(s.Read())\n\treturn n\n}\n\nfunc (s *Stdin) ReadFloat64() float64 {\n\tn, _ := strconv.ParseFloat(s.Read(), 64)\n\treturn n\n}\n\ntype Stdout struct {\n\tstdout *bufio.Writer\n}\n\nfunc NewStdout() *Stdout {\n\treturn &Stdout{bufio.NewWriter(os.Stdout)}\n}\n\nfunc (s *Stdout) Flush() {\n\ts.stdout.Flush()\n}\n\nfunc (s *Stdout) Println(a ...interface{}) {\n\tfmt.Fprintln(s.stdout, a...)\n}\n\nfunc Min(a int, b ...int) int {\n\tfor _, v := range b {\n\t\tif v < a {\n\t\t\ta = v\n\t\t}\n\t}\n\treturn a\n}\n\nfunc Max(a int, b ...int) int {\n\tfor _, v := range b {\n\t\tif a < v {\n\t\t\ta = v\n\t\t}\n\t}\n\treturn a\n}\n\nfunc Abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t} else {\n\t\treturn x * -1\n\t}\n}\n\nfunc Pow(x, y int) int {\n\tz := 1\n\tfor y > 0 {\n\t\tif y%2 == 0 {\n\t\t\tx *= x\n\t\t\ty /= 2\n\t\t} else {\n\t\t\tz *= x\n\t\t\ty -= 1\n\t\t}\n\t}\n\treturn z\n}\n\nfunc CreateMatrix(x, y int) [][]int {\n\tmatrix := make([][]int, x)\n\tfor i := 0; i < x; i++ {\n\t\tmatrix[i] = make([]int, y)\n\t}\n\treturn matrix\n}\n", "language": "Go", "metadata": {"date": 1586740514, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02713.html", "problem_id": "p02713", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02713/input.txt", "sample_output_relpath": "derived/input_output/data/p02713/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02713/Go/s440459659.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s440459659", "user_id": "u794250528"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst INFINITY = math.MaxInt64/2 - 1\n\nfunc exec(stdin *Stdin, stdout *Stdout) {\n\tk := stdin.ReadInt()\n\tsum := 0\n\tfor a := 1; a <= k; a++ {\n\t\tfor b := 1; b <= k; b++ {\n\t\t\tfor c := 1; c <= k; c++ {\n\t\t\t\tsum += Gcd(a, Gcd(b, c))\n\t\t\t}\n\t\t}\n\t}\n\tstdout.Println(sum)\n}\n\nfunc Gcd(x, y int) int {\n\tif x < y {\n\t\tx, y = y, x\n\t}\n\n\tfor y > 0 {\n\t\tx, y = y, x%y\n\t}\n\n\treturn x\n}\n\nfunc main() {\n\tstdout := NewStdout()\n\tdefer stdout.Flush()\n\texec(NewStdin(bufio.ScanWords), stdout)\n}\n\ntype Stdin struct {\n\tstdin *bufio.Scanner\n}\n\nfunc NewStdin(split bufio.SplitFunc) *Stdin {\n\ts := Stdin{bufio.NewScanner(os.Stdin)}\n\ts.stdin.Split(split)\n\ts.stdin.Buffer(make([]byte, bufio.MaxScanTokenSize), INFINITY)\n\treturn &s\n}\n\nfunc (s *Stdin) Read() string {\n\ts.stdin.Scan()\n\treturn s.stdin.Text()\n}\n\nfunc (s *Stdin) ReadInt() int {\n\tn, _ := strconv.Atoi(s.Read())\n\treturn n\n}\n\nfunc (s *Stdin) ReadFloat64() float64 {\n\tn, _ := strconv.ParseFloat(s.Read(), 64)\n\treturn n\n}\n\ntype Stdout struct {\n\tstdout *bufio.Writer\n}\n\nfunc NewStdout() *Stdout {\n\treturn &Stdout{bufio.NewWriter(os.Stdout)}\n}\n\nfunc (s *Stdout) Flush() {\n\ts.stdout.Flush()\n}\n\nfunc (s *Stdout) Println(a ...interface{}) {\n\tfmt.Fprintln(s.stdout, a...)\n}\n\nfunc Min(a int, b ...int) int {\n\tfor _, v := range b {\n\t\tif v < a {\n\t\t\ta = v\n\t\t}\n\t}\n\treturn a\n}\n\nfunc Max(a int, b ...int) int {\n\tfor _, v := range b {\n\t\tif a < v {\n\t\t\ta = v\n\t\t}\n\t}\n\treturn a\n}\n\nfunc Abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t} else {\n\t\treturn x * -1\n\t}\n}\n\nfunc Pow(x, y int) int {\n\tz := 1\n\tfor y > 0 {\n\t\tif y%2 == 0 {\n\t\t\tx *= x\n\t\t\ty /= 2\n\t\t} else {\n\t\t\tz *= x\n\t\t\ty -= 1\n\t\t}\n\t}\n\treturn z\n}\n\nfunc CreateMatrix(x, y int) [][]int {\n\tmatrix := make([][]int, x)\n\tfor i := 0; i < x; i++ {\n\t\tmatrix[i] = make([]int, y)\n\t}\n\treturn matrix\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nFind \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nHere \\gcd(a,b,c) denotes the greatest common divisor of a, b, and c.\n\nConstraints\n\n1 \\leq K \\leq 200\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the value of \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n9\n\n\\gcd(1,1,1)+\\gcd(1,1,2)+\\gcd(1,2,1)+\\gcd(1,2,2)\n+\\gcd(2,1,1)+\\gcd(2,1,2)+\\gcd(2,2,1)+\\gcd(2,2,2)\n=1+1+1+1+1+1+1+2=9\n\nThus, the answer is 9.\n\nSample Input 2\n\n200\n\nSample Output 2\n\n10813692", "sample_input": "2\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02713", "source_text": "Score : 300 points\n\nProblem Statement\n\nFind \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nHere \\gcd(a,b,c) denotes the greatest common divisor of a, b, and c.\n\nConstraints\n\n1 \\leq K \\leq 200\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the value of \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n9\n\n\\gcd(1,1,1)+\\gcd(1,1,2)+\\gcd(1,2,1)+\\gcd(1,2,2)\n+\\gcd(2,1,1)+\\gcd(2,1,2)+\\gcd(2,2,1)+\\gcd(2,2,2)\n=1+1+1+1+1+1+1+2=9\n\nThus, the answer is 9.\n\nSample Input 2\n\n200\n\nSample Output 2\n\n10813692", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1800, "cpu_time_ms": 574, "memory_kb": 1792}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s299558760", "group_id": "codeNet:p02713", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc GCD(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn GCD(b, a%b)\n}\nfunc main() {\n\tvar N int\n\tfmt.Scanf(\"%d\\n\", &N)\n\n\tsum := 0\n\tfor i := 1; i <= N; i++ {\n\t\tfor j := 1; j <= N; j++ {\n\t\t\tfor k := 1; k <= N; k++ {\n\t\t\t\tsum += GCD(GCD(i, j), k)\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(sum)\n\n}\n", "language": "Go", "metadata": {"date": 1586740191, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02713.html", "problem_id": "p02713", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02713/input.txt", "sample_output_relpath": "derived/input_output/data/p02713/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02713/Go/s299558760.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s299558760", "user_id": "u534481484"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc GCD(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn GCD(b, a%b)\n}\nfunc main() {\n\tvar N int\n\tfmt.Scanf(\"%d\\n\", &N)\n\n\tsum := 0\n\tfor i := 1; i <= N; i++ {\n\t\tfor j := 1; j <= N; j++ {\n\t\t\tfor k := 1; k <= N; k++ {\n\t\t\t\tsum += GCD(GCD(i, j), k)\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(sum)\n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nFind \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nHere \\gcd(a,b,c) denotes the greatest common divisor of a, b, and c.\n\nConstraints\n\n1 \\leq K \\leq 200\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the value of \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n9\n\n\\gcd(1,1,1)+\\gcd(1,1,2)+\\gcd(1,2,1)+\\gcd(1,2,2)\n+\\gcd(2,1,1)+\\gcd(2,1,2)+\\gcd(2,2,1)+\\gcd(2,2,2)\n=1+1+1+1+1+1+1+2=9\n\nThus, the answer is 9.\n\nSample Input 2\n\n200\n\nSample Output 2\n\n10813692", "sample_input": "2\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02713", "source_text": "Score : 300 points\n\nProblem Statement\n\nFind \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nHere \\gcd(a,b,c) denotes the greatest common divisor of a, b, and c.\n\nConstraints\n\n1 \\leq K \\leq 200\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the value of \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n9\n\n\\gcd(1,1,1)+\\gcd(1,1,2)+\\gcd(1,2,1)+\\gcd(1,2,2)\n+\\gcd(2,1,1)+\\gcd(2,1,2)+\\gcd(2,2,1)+\\gcd(2,2,2)\n=1+1+1+1+1+1+1+2=9\n\nThus, the answer is 9.\n\nSample Input 2\n\n200\n\nSample Output 2\n\n10813692", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 312, "cpu_time_ms": 716, "memory_kb": 1844}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s140189377", "group_id": "codeNet:p02713", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar k int\n\tfmt.Scan(&k)\n\tvar sum int\n\tfor a := 1; a <= k; a++ {\n\t\tfor b := 1; b <= k; b++ {\n\t\t\tfor c := 1; c <= k; c++ {\n\t\t\t\tsum += gcd(gcd(a, b), c)\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tr := a % b\n\tfor r != 0 {\n\t\ta = b\n\t\tb = r\n\t\tr = a % b\n\t}\n\treturn b\n}\n", "language": "Go", "metadata": {"date": 1586740092, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02713.html", "problem_id": "p02713", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02713/input.txt", "sample_output_relpath": "derived/input_output/data/p02713/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02713/Go/s140189377.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s140189377", "user_id": "u282164747"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar k int\n\tfmt.Scan(&k)\n\tvar sum int\n\tfor a := 1; a <= k; a++ {\n\t\tfor b := 1; b <= k; b++ {\n\t\t\tfor c := 1; c <= k; c++ {\n\t\t\t\tsum += gcd(gcd(a, b), c)\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tr := a % b\n\tfor r != 0 {\n\t\ta = b\n\t\tb = r\n\t\tr = a % b\n\t}\n\treturn b\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nFind \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nHere \\gcd(a,b,c) denotes the greatest common divisor of a, b, and c.\n\nConstraints\n\n1 \\leq K \\leq 200\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the value of \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n9\n\n\\gcd(1,1,1)+\\gcd(1,1,2)+\\gcd(1,2,1)+\\gcd(1,2,2)\n+\\gcd(2,1,1)+\\gcd(2,1,2)+\\gcd(2,2,1)+\\gcd(2,2,2)\n=1+1+1+1+1+1+1+2=9\n\nThus, the answer is 9.\n\nSample Input 2\n\n200\n\nSample Output 2\n\n10813692", "sample_input": "2\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02713", "source_text": "Score : 300 points\n\nProblem Statement\n\nFind \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nHere \\gcd(a,b,c) denotes the greatest common divisor of a, b, and c.\n\nConstraints\n\n1 \\leq K \\leq 200\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the value of \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n9\n\n\\gcd(1,1,1)+\\gcd(1,1,2)+\\gcd(1,2,1)+\\gcd(1,2,2)\n+\\gcd(2,1,1)+\\gcd(2,1,2)+\\gcd(2,2,1)+\\gcd(2,2,2)\n=1+1+1+1+1+1+1+2=9\n\nThus, the answer is 9.\n\nSample Input 2\n\n200\n\nSample Output 2\n\n10813692", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 500, "memory_kb": 1776}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s044620100", "group_id": "codeNet:p02713", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar DEBUG = true\n\nfunc main() {\n\tdefer Flush()\n\tK := readi()\n\n\tvar ans int\n\tfor a := 1; a <= K; a++ {\n\t\tfor b := 1; b <= K; b++ {\n\t\t\tfor c := 1; c <= K; c++ {\n\t\t\t\tans += gcd(a, gcd(b, c))\n\t\t\t}\n\t\t}\n\t}\n\tprintln(ans)\n\n}\n\n// -----------------------------------------------------------------------------\n\n// IO helper functions\n\n// Returns next token from input. It must be initialized by SetInput()\n// before the first call.\nvar nextToken func() ([]byte, error)\nvar nextLine func() ([]byte, error)\n\n// Holds a buffer for output. It must be initialized by SetOutput().\n// All IO fucntions (read*() and [e]print*()) should write to OutputWriter\n// instead of this.\nvar OutputBuffer *bufio.Writer\n\n// Holds an io.Writer. It must be initialized by SetOutput()\nvar OutputWriter io.Writer\n\n// Set IO functions for interactive input/output.\nfunc SetInteractive(w io.Writer, r io.Reader) {\n\tSetUnbefferedInput(r)\n\tOutputBuffer = nil\n\tOutputWriter = w\n}\n\n// Setup OutputBuffer and OutputWriter.\nfunc SetOutput(w io.Writer) {\n\tOutputBuffer = bufio.NewWriter(w)\n\tOutputWriter = OutputBuffer\n}\n\n// Flushes OutputBuffer\nfunc Flush() {\n\tif OutputBuffer != nil {\n\t\tOutputBuffer.Flush()\n\t}\n}\n\n// Returns true if c is a white space\nfunc IsSpace(c byte) bool {\n\tswitch c {\n\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc IsNewLine(c byte) bool {\n\tswitch c {\n\tcase '\\n', '\\r':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Setup nextToken with input buffer.\nfunc SetInput(r io.Reader) {\n\tbuf := new(bytes.Buffer)\n\tvar b []byte\n\n\tvar i int\n\trest := func() ([]byte, error) {\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\tinitial := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextToken = rest\n\t\treturn rest()\n\t}\n\tnextToken = initial\n\n\trestLn := func() ([]byte, error) {\n\t\tfor i < len(b) && IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\n\tinitialLn := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextLine = restLn\n\t\treturn restLn()\n\t}\n\tnextLine = initialLn\n}\n\n// Setup nextToken without input buffer.\nfunc SetUnbefferedInput(r io.Reader) {\n\tbuf := bufio.NewReader(r)\n\tvar b []byte\n\n\tvar i int\n\tnextToken = func() ([]byte, error) {\n\t\tvar err error\n\t\tif i == len(b) {\n\t\t\tb, err = buf.ReadBytes('\\n')\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ti = 0\n\t\t\tj := len(b) - 1\n\t\t\tfor 0 <= j && IsSpace(b[j]) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tb = b[0 : j+1]\n\t\t}\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n}\n\n// -----------------------------------------------------------------------------\n\n// IO functions\n\n// Reads next token and return it as []byte\nfunc readb() []byte {\n\tb, err := nextToken()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\n// Reads next token and return it as string\nfunc reads() string {\n\treturn string(readb())\n}\n\n// Read next line as []byte. Trailing '\\n' will not be included.\n// See also comments on readb()\nfunc readbln() []byte {\n\tb, err := nextLine()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\n// Read next line as string\nfunc readsln() string {\n\treturn string(readbln())\n}\n\n// Reads next token and return it as int64\nfunc readll() int64 {\n\ti, err := strconv.ParseInt(reads(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// Reads next token and return it as int\nfunc readi() int {\n\treturn int(readll())\n}\n\n// Reads next token and return it as float64\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(reads(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// Write args to OutputWriter with the format f\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(OutputWriter, f, args...)\n}\n\n// Write args to OutputWriter without format\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(OutputWriter, args...)\n}\n\n// Write args to stderr with the format f\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// Write args to stderr without format\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\nfunc dbgf(f string, args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintf(os.Stderr, f, args...)\n}\n\nfunc dbg(args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintln(os.Stderr, args...)\n}\n\n// -----------------------------------------------------------------------------\n\n// Utilities\n\nfunc sumSlice(a []int) int {\n\tvar res int\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc sumSlicell(a []int64) int64 {\n\tvar res int64\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc readInts(N int) (int, []int) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int, N)\n\tfor i := range a {\n\t\ta[i] = readi()\n\t}\n\treturn N, a\n}\n\nfunc readIntsll(N int) (int, []int64) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int64, N)\n\tfor i := range a {\n\t\ta[i] = readll()\n\t}\n\treturn N, a\n}\n\n// -----------------------------------------------------------------------------\n\n// Simple math functions\n\nconst (\n\t// big prime\n\tINF = 1000000007\n\tINF2 = 1000000009\n\tINF3 = 998244353\n)\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minll(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minf(a, b float64) float64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxll(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxf(a, b float64) float64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absll(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absf(a float64) float64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// egcd(a, b) returns d, x, y:\n// d is gcd(a,b)\n// x, y are integers that satisfy ax + by = d\nfunc egcd(a, b int) (int, int, int) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcd(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc egcdll(a, b int64) (int64, int64, int64) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcdll(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc gcd(a, b int) int {\n\td, _, _ := egcd(a, b)\n\treturn d\n}\n\nfunc gcdll(a, b int64) int64 {\n\td, _, _ := egcdll(a, b)\n\treturn d\n}\n\n// set up IO functions\nfunc init() {\n\t// for non-interactive\n\tSetInput(os.Stdin)\n\tSetOutput(os.Stdout)\n\n\t// Enable below when interactive. Its ok to leave above intact.\n\t// SetInteractive(os.Stdout, os.Stdin)\n}\n", "language": "Go", "metadata": {"date": 1586739903, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02713.html", "problem_id": "p02713", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02713/input.txt", "sample_output_relpath": "derived/input_output/data/p02713/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02713/Go/s044620100.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s044620100", "user_id": "u705974985"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar DEBUG = true\n\nfunc main() {\n\tdefer Flush()\n\tK := readi()\n\n\tvar ans int\n\tfor a := 1; a <= K; a++ {\n\t\tfor b := 1; b <= K; b++ {\n\t\t\tfor c := 1; c <= K; c++ {\n\t\t\t\tans += gcd(a, gcd(b, c))\n\t\t\t}\n\t\t}\n\t}\n\tprintln(ans)\n\n}\n\n// -----------------------------------------------------------------------------\n\n// IO helper functions\n\n// Returns next token from input. It must be initialized by SetInput()\n// before the first call.\nvar nextToken func() ([]byte, error)\nvar nextLine func() ([]byte, error)\n\n// Holds a buffer for output. It must be initialized by SetOutput().\n// All IO fucntions (read*() and [e]print*()) should write to OutputWriter\n// instead of this.\nvar OutputBuffer *bufio.Writer\n\n// Holds an io.Writer. It must be initialized by SetOutput()\nvar OutputWriter io.Writer\n\n// Set IO functions for interactive input/output.\nfunc SetInteractive(w io.Writer, r io.Reader) {\n\tSetUnbefferedInput(r)\n\tOutputBuffer = nil\n\tOutputWriter = w\n}\n\n// Setup OutputBuffer and OutputWriter.\nfunc SetOutput(w io.Writer) {\n\tOutputBuffer = bufio.NewWriter(w)\n\tOutputWriter = OutputBuffer\n}\n\n// Flushes OutputBuffer\nfunc Flush() {\n\tif OutputBuffer != nil {\n\t\tOutputBuffer.Flush()\n\t}\n}\n\n// Returns true if c is a white space\nfunc IsSpace(c byte) bool {\n\tswitch c {\n\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc IsNewLine(c byte) bool {\n\tswitch c {\n\tcase '\\n', '\\r':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Setup nextToken with input buffer.\nfunc SetInput(r io.Reader) {\n\tbuf := new(bytes.Buffer)\n\tvar b []byte\n\n\tvar i int\n\trest := func() ([]byte, error) {\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\tinitial := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextToken = rest\n\t\treturn rest()\n\t}\n\tnextToken = initial\n\n\trestLn := func() ([]byte, error) {\n\t\tfor i < len(b) && IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\n\tinitialLn := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextLine = restLn\n\t\treturn restLn()\n\t}\n\tnextLine = initialLn\n}\n\n// Setup nextToken without input buffer.\nfunc SetUnbefferedInput(r io.Reader) {\n\tbuf := bufio.NewReader(r)\n\tvar b []byte\n\n\tvar i int\n\tnextToken = func() ([]byte, error) {\n\t\tvar err error\n\t\tif i == len(b) {\n\t\t\tb, err = buf.ReadBytes('\\n')\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ti = 0\n\t\t\tj := len(b) - 1\n\t\t\tfor 0 <= j && IsSpace(b[j]) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tb = b[0 : j+1]\n\t\t}\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n}\n\n// -----------------------------------------------------------------------------\n\n// IO functions\n\n// Reads next token and return it as []byte\nfunc readb() []byte {\n\tb, err := nextToken()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\n// Reads next token and return it as string\nfunc reads() string {\n\treturn string(readb())\n}\n\n// Read next line as []byte. Trailing '\\n' will not be included.\n// See also comments on readb()\nfunc readbln() []byte {\n\tb, err := nextLine()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\n// Read next line as string\nfunc readsln() string {\n\treturn string(readbln())\n}\n\n// Reads next token and return it as int64\nfunc readll() int64 {\n\ti, err := strconv.ParseInt(reads(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// Reads next token and return it as int\nfunc readi() int {\n\treturn int(readll())\n}\n\n// Reads next token and return it as float64\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(reads(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// Write args to OutputWriter with the format f\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(OutputWriter, f, args...)\n}\n\n// Write args to OutputWriter without format\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(OutputWriter, args...)\n}\n\n// Write args to stderr with the format f\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// Write args to stderr without format\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\nfunc dbgf(f string, args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintf(os.Stderr, f, args...)\n}\n\nfunc dbg(args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintln(os.Stderr, args...)\n}\n\n// -----------------------------------------------------------------------------\n\n// Utilities\n\nfunc sumSlice(a []int) int {\n\tvar res int\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc sumSlicell(a []int64) int64 {\n\tvar res int64\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc readInts(N int) (int, []int) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int, N)\n\tfor i := range a {\n\t\ta[i] = readi()\n\t}\n\treturn N, a\n}\n\nfunc readIntsll(N int) (int, []int64) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int64, N)\n\tfor i := range a {\n\t\ta[i] = readll()\n\t}\n\treturn N, a\n}\n\n// -----------------------------------------------------------------------------\n\n// Simple math functions\n\nconst (\n\t// big prime\n\tINF = 1000000007\n\tINF2 = 1000000009\n\tINF3 = 998244353\n)\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minll(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minf(a, b float64) float64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxll(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxf(a, b float64) float64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absll(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absf(a float64) float64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// egcd(a, b) returns d, x, y:\n// d is gcd(a,b)\n// x, y are integers that satisfy ax + by = d\nfunc egcd(a, b int) (int, int, int) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcd(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc egcdll(a, b int64) (int64, int64, int64) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcdll(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc gcd(a, b int) int {\n\td, _, _ := egcd(a, b)\n\treturn d\n}\n\nfunc gcdll(a, b int64) int64 {\n\td, _, _ := egcdll(a, b)\n\treturn d\n}\n\n// set up IO functions\nfunc init() {\n\t// for non-interactive\n\tSetInput(os.Stdin)\n\tSetOutput(os.Stdout)\n\n\t// Enable below when interactive. Its ok to leave above intact.\n\t// SetInteractive(os.Stdout, os.Stdin)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nFind \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nHere \\gcd(a,b,c) denotes the greatest common divisor of a, b, and c.\n\nConstraints\n\n1 \\leq K \\leq 200\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the value of \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n9\n\n\\gcd(1,1,1)+\\gcd(1,1,2)+\\gcd(1,2,1)+\\gcd(1,2,2)\n+\\gcd(2,1,1)+\\gcd(2,1,2)+\\gcd(2,2,1)+\\gcd(2,2,2)\n=1+1+1+1+1+1+1+2=9\n\nThus, the answer is 9.\n\nSample Input 2\n\n200\n\nSample Output 2\n\n10813692", "sample_input": "2\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02713", "source_text": "Score : 300 points\n\nProblem Statement\n\nFind \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nHere \\gcd(a,b,c) denotes the greatest common divisor of a, b, and c.\n\nConstraints\n\n1 \\leq K \\leq 200\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the value of \\displaystyle{\\sum_{a=1}^{K}\\sum_{b=1}^{K}\\sum_{c=1}^{K} \\gcd(a,b,c)}.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n9\n\n\\gcd(1,1,1)+\\gcd(1,1,2)+\\gcd(1,2,1)+\\gcd(1,2,2)\n+\\gcd(2,1,1)+\\gcd(2,1,2)+\\gcd(2,2,1)+\\gcd(2,2,2)\n=1+1+1+1+1+1+1+2=9\n\nThus, the answer is 9.\n\nSample Input 2\n\n200\n\nSample Output 2\n\n10813692", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6808, "cpu_time_ms": 763, "memory_kb": 1804}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s099191085", "group_id": "codeNet:p02714", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tvar N int\n\tvar S string\n\n\tfmt.Scanf(\"%d\", &N)\n\tfmt.Scanf(\"%v\", &S)\n\n\tnum := 0\n\tfor a := 0; a < len(S); a++ {\n\t\tA := S[a]\n\t\tfor b := a+1; b < len(S); b++ {\n\t\t\tB := S[b]\n\t\t\tif A == B {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor c := b+1; c < len(S); c++ {\n\t\t\t\tC := S[c]\n\t\t\t\tif C == A || C == B {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif c - b == b - a {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tnum++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Printf(\"%v\\n\", num)\n}", "language": "Go", "metadata": {"date": 1590527942, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02714.html", "problem_id": "p02714", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02714/input.txt", "sample_output_relpath": "derived/input_output/data/p02714/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02714/Go/s099191085.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s099191085", "user_id": "u004477916"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tvar N int\n\tvar S string\n\n\tfmt.Scanf(\"%d\", &N)\n\tfmt.Scanf(\"%v\", &S)\n\n\tnum := 0\n\tfor a := 0; a < len(S); a++ {\n\t\tA := S[a]\n\t\tfor b := a+1; b < len(S); b++ {\n\t\t\tB := S[b]\n\t\t\tif A == B {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor c := b+1; c < len(S); c++ {\n\t\t\t\tC := S[c]\n\t\t\t\tif C == A || C == B {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif c - b == b - a {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tnum++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Printf(\"%v\\n\", num)\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a string S of length N consisting of R, G, and B.\n\nFind the number of triples (i,~j,~k)~(1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nS_i \\neq S_j, S_i \\neq S_k, and S_j \\neq S_k.\n\nj - i \\neq k - j.\n\nConstraints\n\n1 \\leq N \\leq 4000\n\nS is a string of length N consisting of R, G, and B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of triplets in question.\n\nSample Input 1\n\n4\nRRGB\n\nSample Output 1\n\n1\n\nOnly the triplet (1,~3,~4) satisfies both conditions. The triplet (2,~3,~4) satisfies the first condition but not the second, so it does not count.\n\nSample Input 2\n\n39\nRBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB\n\nSample Output 2\n\n1800", "sample_input": "4\nRRGB\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02714", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a string S of length N consisting of R, G, and B.\n\nFind the number of triples (i,~j,~k)~(1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nS_i \\neq S_j, S_i \\neq S_k, and S_j \\neq S_k.\n\nj - i \\neq k - j.\n\nConstraints\n\n1 \\leq N \\leq 4000\n\nS is a string of length N consisting of R, G, and B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of triplets in question.\n\nSample Input 1\n\n4\nRRGB\n\nSample Output 1\n\n1\n\nOnly the triplet (1,~3,~4) satisfies both conditions. The triplet (2,~3,~4) satisfies the first condition but not the second, so it does not count.\n\nSample Input 2\n\n39\nRBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB\n\nSample Output 2\n\n1800", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 432, "cpu_time_ms": 2205, "memory_kb": 1896}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s225983310", "group_id": "codeNet:p02714", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tnextReader = newScanner()\n\t_ = nextInt()\n\ts := nextString()\n\n\tm := make(map[rune][]int)\n\tfor i, c := range s {\n\t\tm[c] = append(m[c], i)\n\t}\n\tans := 0\n\tfor i, c := range s {\n\t\tif c == 'R' {\n\t\t\tans += solve('G', 'B', m, i)\n\t\t}\n\t\tif c == 'G' {\n\t\t\tans += solve('B', 'R', m, i)\n\t\t}\n\t\tif c == 'B' {\n\t\t\tans += solve('R', 'G', m, i)\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc solve(r1, r2 rune, m map[rune][]int, i int) int {\n\tans := 0\n\tfor _, j := range m[r1] {\n\t\tif i > j {\n\t\t\tcontinue\n\t\t}\n\t\tfor _, k := range m[r2] {\n\t\t\tif j > k {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif j-i != k-j {\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t}\n\tfor _, j := range m[r2] {\n\t\tif i > j {\n\t\t\tcontinue\n\t\t}\n\t\tfor _, k := range m[r1] {\n\t\t\tif j > k {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif j-i != k-j {\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t}\n\treturn ans\n}\n\n// ---------------------------------------------------------------\n// I/O\n// ---------------------------------------------------------------\nvar nextReader func() string\n\nfunc newScanner() func() string {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Buffer(make([]byte, 1024), int(1e11))\n\tsc.Split(bufio.ScanWords)\n\treturn func() string {\n\t\tsc.Scan()\n\t\treturn sc.Text()\n\t}\n}\n\nfunc nextString() string { return nextReader() }\n\nfunc nextInt() int { n, _ := strconv.Atoi(nextReader()); return n }\n\nfunc nextInts(size int) []int {\n\tns := make([]int, size)\n\tfor i := 0; i < size; i++ {\n\t\tns[i] = nextInt()\n\t}\n\treturn ns\n}\n", "language": "Go", "metadata": {"date": 1590272774, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02714.html", "problem_id": "p02714", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02714/input.txt", "sample_output_relpath": "derived/input_output/data/p02714/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02714/Go/s225983310.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s225983310", "user_id": "u150922405"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tnextReader = newScanner()\n\t_ = nextInt()\n\ts := nextString()\n\n\tm := make(map[rune][]int)\n\tfor i, c := range s {\n\t\tm[c] = append(m[c], i)\n\t}\n\tans := 0\n\tfor i, c := range s {\n\t\tif c == 'R' {\n\t\t\tans += solve('G', 'B', m, i)\n\t\t}\n\t\tif c == 'G' {\n\t\t\tans += solve('B', 'R', m, i)\n\t\t}\n\t\tif c == 'B' {\n\t\t\tans += solve('R', 'G', m, i)\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc solve(r1, r2 rune, m map[rune][]int, i int) int {\n\tans := 0\n\tfor _, j := range m[r1] {\n\t\tif i > j {\n\t\t\tcontinue\n\t\t}\n\t\tfor _, k := range m[r2] {\n\t\t\tif j > k {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif j-i != k-j {\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t}\n\tfor _, j := range m[r2] {\n\t\tif i > j {\n\t\t\tcontinue\n\t\t}\n\t\tfor _, k := range m[r1] {\n\t\t\tif j > k {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif j-i != k-j {\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t}\n\treturn ans\n}\n\n// ---------------------------------------------------------------\n// I/O\n// ---------------------------------------------------------------\nvar nextReader func() string\n\nfunc newScanner() func() string {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Buffer(make([]byte, 1024), int(1e11))\n\tsc.Split(bufio.ScanWords)\n\treturn func() string {\n\t\tsc.Scan()\n\t\treturn sc.Text()\n\t}\n}\n\nfunc nextString() string { return nextReader() }\n\nfunc nextInt() int { n, _ := strconv.Atoi(nextReader()); return n }\n\nfunc nextInts(size int) []int {\n\tns := make([]int, size)\n\tfor i := 0; i < size; i++ {\n\t\tns[i] = nextInt()\n\t}\n\treturn ns\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a string S of length N consisting of R, G, and B.\n\nFind the number of triples (i,~j,~k)~(1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nS_i \\neq S_j, S_i \\neq S_k, and S_j \\neq S_k.\n\nj - i \\neq k - j.\n\nConstraints\n\n1 \\leq N \\leq 4000\n\nS is a string of length N consisting of R, G, and B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of triplets in question.\n\nSample Input 1\n\n4\nRRGB\n\nSample Output 1\n\n1\n\nOnly the triplet (1,~3,~4) satisfies both conditions. The triplet (2,~3,~4) satisfies the first condition but not the second, so it does not count.\n\nSample Input 2\n\n39\nRBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB\n\nSample Output 2\n\n1800", "sample_input": "4\nRRGB\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02714", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a string S of length N consisting of R, G, and B.\n\nFind the number of triples (i,~j,~k)~(1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nS_i \\neq S_j, S_i \\neq S_k, and S_j \\neq S_k.\n\nj - i \\neq k - j.\n\nConstraints\n\n1 \\leq N \\leq 4000\n\nS is a string of length N consisting of R, G, and B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of triplets in question.\n\nSample Input 1\n\n4\nRRGB\n\nSample Output 1\n\n1\n\nOnly the triplet (1,~3,~4) satisfies both conditions. The triplet (2,~3,~4) satisfies the first condition but not the second, so it does not count.\n\nSample Input 2\n\n39\nRBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB\n\nSample Output 2\n\n1800", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1430, "cpu_time_ms": 2205, "memory_kb": 1916}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s858901377", "group_id": "codeNet:p02714", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\n\tvar n int\n\tvar s string\n\n\tif sc.Scan() {\n\t\tn, _ = strconv.Atoi(sc.Text())\n\t}\n\n\tif sc.Scan() {\n\t\ts = sc.Text()\n\t}\n\n\tvar rgb, r, g, b int\n\tfor i := 0; i < n; i++ {\n\t\tswitch s[i] {\n\t\tcase 'R':\n\t\t\tr++\n\t\tcase 'G':\n\t\t\tg++\n\t\tcase 'B':\n\t\t\tb++\n\t\t}\n\t}\n\trgb = r * g * b\n\n\tfor j := 0; j < n; j++ {\n\t\tfor i := 0; i < j; i++ {\n\t\t\tk := j + (j - i)\n\t\t\tif k < n {\n\t\t\t\tif s[i] == s[j] {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif s[i] == s[k] {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif s[j] == s[k] {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\trgb--\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Print(rgb)\n}\n", "language": "Go", "metadata": {"date": 1587245216, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02714.html", "problem_id": "p02714", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02714/input.txt", "sample_output_relpath": "derived/input_output/data/p02714/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02714/Go/s858901377.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s858901377", "user_id": "u044788022"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\n\tvar n int\n\tvar s string\n\n\tif sc.Scan() {\n\t\tn, _ = strconv.Atoi(sc.Text())\n\t}\n\n\tif sc.Scan() {\n\t\ts = sc.Text()\n\t}\n\n\tvar rgb, r, g, b int\n\tfor i := 0; i < n; i++ {\n\t\tswitch s[i] {\n\t\tcase 'R':\n\t\t\tr++\n\t\tcase 'G':\n\t\t\tg++\n\t\tcase 'B':\n\t\t\tb++\n\t\t}\n\t}\n\trgb = r * g * b\n\n\tfor j := 0; j < n; j++ {\n\t\tfor i := 0; i < j; i++ {\n\t\t\tk := j + (j - i)\n\t\t\tif k < n {\n\t\t\t\tif s[i] == s[j] {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif s[i] == s[k] {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif s[j] == s[k] {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\trgb--\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Print(rgb)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a string S of length N consisting of R, G, and B.\n\nFind the number of triples (i,~j,~k)~(1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nS_i \\neq S_j, S_i \\neq S_k, and S_j \\neq S_k.\n\nj - i \\neq k - j.\n\nConstraints\n\n1 \\leq N \\leq 4000\n\nS is a string of length N consisting of R, G, and B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of triplets in question.\n\nSample Input 1\n\n4\nRRGB\n\nSample Output 1\n\n1\n\nOnly the triplet (1,~3,~4) satisfies both conditions. The triplet (2,~3,~4) satisfies the first condition but not the second, so it does not count.\n\nSample Input 2\n\n39\nRBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB\n\nSample Output 2\n\n1800", "sample_input": "4\nRRGB\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02714", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a string S of length N consisting of R, G, and B.\n\nFind the number of triples (i,~j,~k)~(1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nS_i \\neq S_j, S_i \\neq S_k, and S_j \\neq S_k.\n\nj - i \\neq k - j.\n\nConstraints\n\n1 \\leq N \\leq 4000\n\nS is a string of length N consisting of R, G, and B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of triplets in question.\n\nSample Input 1\n\n4\nRRGB\n\nSample Output 1\n\n1\n\nOnly the triplet (1,~3,~4) satisfies both conditions. The triplet (2,~3,~4) satisfies the first condition but not the second, so it does not count.\n\nSample Input 2\n\n39\nRBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB\n\nSample Output 2\n\n1800", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 626, "cpu_time_ms": 45, "memory_kb": 1780}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s836003451", "group_id": "codeNet:p02714", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tvar s string\n\tfmt.Scan(&n, &s)\n\tvar r, g, b int\n\tfor i := 0; i < n; i++ {\n\t\tif s[i] == 'R' {\n\t\t\tr++\n\t\t} else if s[i] == 'G' {\n\t\t\tg++\n\t\t} else {\n\t\t\tb++\n\t\t}\n\t}\n\n\tans := r * g * b\n\tfor i := 0; i < n; i++ {\n\t\tfor j := i+1; j < n; j++ {\n\t\t\tk := 2*j - i\n\t\t\tif k == j || k >= n {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif s[i] != s[j] && s[j] != s[k] && s[k] != s[i] {\n\t\t\t\tans--\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1587023106, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02714.html", "problem_id": "p02714", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02714/input.txt", "sample_output_relpath": "derived/input_output/data/p02714/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02714/Go/s836003451.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s836003451", "user_id": "u448258717"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tvar s string\n\tfmt.Scan(&n, &s)\n\tvar r, g, b int\n\tfor i := 0; i < n; i++ {\n\t\tif s[i] == 'R' {\n\t\t\tr++\n\t\t} else if s[i] == 'G' {\n\t\t\tg++\n\t\t} else {\n\t\t\tb++\n\t\t}\n\t}\n\n\tans := r * g * b\n\tfor i := 0; i < n; i++ {\n\t\tfor j := i+1; j < n; j++ {\n\t\t\tk := 2*j - i\n\t\t\tif k == j || k >= n {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif s[i] != s[j] && s[j] != s[k] && s[k] != s[i] {\n\t\t\t\tans--\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a string S of length N consisting of R, G, and B.\n\nFind the number of triples (i,~j,~k)~(1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nS_i \\neq S_j, S_i \\neq S_k, and S_j \\neq S_k.\n\nj - i \\neq k - j.\n\nConstraints\n\n1 \\leq N \\leq 4000\n\nS is a string of length N consisting of R, G, and B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of triplets in question.\n\nSample Input 1\n\n4\nRRGB\n\nSample Output 1\n\n1\n\nOnly the triplet (1,~3,~4) satisfies both conditions. The triplet (2,~3,~4) satisfies the first condition but not the second, so it does not count.\n\nSample Input 2\n\n39\nRBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB\n\nSample Output 2\n\n1800", "sample_input": "4\nRRGB\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02714", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a string S of length N consisting of R, G, and B.\n\nFind the number of triples (i,~j,~k)~(1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nS_i \\neq S_j, S_i \\neq S_k, and S_j \\neq S_k.\n\nj - i \\neq k - j.\n\nConstraints\n\n1 \\leq N \\leq 4000\n\nS is a string of length N consisting of R, G, and B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of triplets in question.\n\nSample Input 1\n\n4\nRRGB\n\nSample Output 1\n\n1\n\nOnly the triplet (1,~3,~4) satisfies both conditions. The triplet (2,~3,~4) satisfies the first condition but not the second, so it does not count.\n\nSample Input 2\n\n39\nRBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB\n\nSample Output 2\n\n1800", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 444, "cpu_time_ms": 53, "memory_kb": 1812}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s710605356", "group_id": "codeNet:p02714", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"unicode/utf8\"\n)\n\nfunc main() {\n\tvar n int\n\tvar s string\n\n\tfmt.Scan(&n, &s)\n\n\tr := strings.Count(s, \"R\")\n\tg := strings.Count(s, \"G\")\n\tb := strings.Count(s, \"B\")\n\tlenS := utf8.RuneCountInString(s)\n\n\tvar exclude int\n\tfor i := 0; i < n; i++ {\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\tk := j + j - i\n\t\t\tif k >= lenS {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif s[i] != s[j] && s[i] != s[k] && s[j] != s[k] {\n\t\t\t\texclude++\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(r*g*b - exclude)\n}\n", "language": "Go", "metadata": {"date": 1586786307, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02714.html", "problem_id": "p02714", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02714/input.txt", "sample_output_relpath": "derived/input_output/data/p02714/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02714/Go/s710605356.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s710605356", "user_id": "u620351704"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"unicode/utf8\"\n)\n\nfunc main() {\n\tvar n int\n\tvar s string\n\n\tfmt.Scan(&n, &s)\n\n\tr := strings.Count(s, \"R\")\n\tg := strings.Count(s, \"G\")\n\tb := strings.Count(s, \"B\")\n\tlenS := utf8.RuneCountInString(s)\n\n\tvar exclude int\n\tfor i := 0; i < n; i++ {\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\tk := j + j - i\n\t\t\tif k >= lenS {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif s[i] != s[j] && s[i] != s[k] && s[j] != s[k] {\n\t\t\t\texclude++\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(r*g*b - exclude)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a string S of length N consisting of R, G, and B.\n\nFind the number of triples (i,~j,~k)~(1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nS_i \\neq S_j, S_i \\neq S_k, and S_j \\neq S_k.\n\nj - i \\neq k - j.\n\nConstraints\n\n1 \\leq N \\leq 4000\n\nS is a string of length N consisting of R, G, and B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of triplets in question.\n\nSample Input 1\n\n4\nRRGB\n\nSample Output 1\n\n1\n\nOnly the triplet (1,~3,~4) satisfies both conditions. The triplet (2,~3,~4) satisfies the first condition but not the second, so it does not count.\n\nSample Input 2\n\n39\nRBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB\n\nSample Output 2\n\n1800", "sample_input": "4\nRRGB\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02714", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a string S of length N consisting of R, G, and B.\n\nFind the number of triples (i,~j,~k)~(1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nS_i \\neq S_j, S_i \\neq S_k, and S_j \\neq S_k.\n\nj - i \\neq k - j.\n\nConstraints\n\n1 \\leq N \\leq 4000\n\nS is a string of length N consisting of R, G, and B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of triplets in question.\n\nSample Input 1\n\n4\nRRGB\n\nSample Output 1\n\n1\n\nOnly the triplet (1,~3,~4) satisfies both conditions. The triplet (2,~3,~4) satisfies the first condition but not the second, so it does not count.\n\nSample Input 2\n\n39\nRBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB\n\nSample Output 2\n\n1800", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 479, "cpu_time_ms": 50, "memory_kb": 1884}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s206662509", "group_id": "codeNet:p02714", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar DEBUG = true\n\nfunc main() {\n\tdefer Flush()\n\n\tN := readi()\n\tS := readb()\n\n\tvar R, G, B int\n\n\tfor _, c := range S {\n\t\tif c == 'R' {\n\t\t\tR++\n\t\t} else if c == 'G' {\n\t\t\tG++\n\t\t} else {\n\t\t\tB++\n\t\t}\n\t}\n\n\tans := R * G * B\n\tfor j := 1; j < N-1; j++ {\n\t\tfor i := j - 1; 0 <= i; i-- {\n\t\t\tk := j + j - i\n\t\t\tif N <= k {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif S[i] != S[j] && S[j] != S[k] && S[k] != S[i] && j-i == k-j {\n\t\t\t\tans--\n\t\t\t}\n\t\t}\n\t}\n\tprintln(ans)\n}\n\n// -----------------------------------------------------------------------------\n\n// IO helper functions\n\n// Returns next token from input. It must be initialized by SetInput()\n// before the first call.\nvar nextToken func() ([]byte, error)\nvar nextLine func() ([]byte, error)\n\n// Holds a buffer for output. It must be initialized by SetOutput().\n// All IO fucntions (read*() and [e]print*()) should write to OutputWriter\n// instead of this.\nvar OutputBuffer *bufio.Writer\n\n// Holds an io.Writer. It must be initialized by SetOutput()\nvar OutputWriter io.Writer\n\n// Set IO functions for interactive input/output.\nfunc SetInteractive(w io.Writer, r io.Reader) {\n\tSetUnbefferedInput(r)\n\tOutputBuffer = nil\n\tOutputWriter = w\n}\n\n// Setup OutputBuffer and OutputWriter.\nfunc SetOutput(w io.Writer) {\n\tOutputBuffer = bufio.NewWriter(w)\n\tOutputWriter = OutputBuffer\n}\n\n// Flushes OutputBuffer\nfunc Flush() {\n\tif OutputBuffer != nil {\n\t\tOutputBuffer.Flush()\n\t}\n}\n\n// Returns true if c is a white space\nfunc IsSpace(c byte) bool {\n\tswitch c {\n\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc IsNewLine(c byte) bool {\n\tswitch c {\n\tcase '\\n', '\\r':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Setup nextToken with input buffer.\nfunc SetInput(r io.Reader) {\n\tbuf := new(bytes.Buffer)\n\tvar b []byte\n\n\tvar i int\n\trest := func() ([]byte, error) {\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\tinitial := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextToken = rest\n\t\treturn rest()\n\t}\n\tnextToken = initial\n\n\trestLn := func() ([]byte, error) {\n\t\tfor i < len(b) && IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\n\tinitialLn := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextLine = restLn\n\t\treturn restLn()\n\t}\n\tnextLine = initialLn\n}\n\n// Setup nextToken without input buffer.\nfunc SetUnbefferedInput(r io.Reader) {\n\tbuf := bufio.NewReader(r)\n\tvar b []byte\n\n\tvar i int\n\tnextToken = func() ([]byte, error) {\n\t\tvar err error\n\t\tif i == len(b) {\n\t\t\tb, err = buf.ReadBytes('\\n')\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ti = 0\n\t\t\tj := len(b) - 1\n\t\t\tfor 0 <= j && IsSpace(b[j]) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tb = b[0 : j+1]\n\t\t}\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n}\n\n// -----------------------------------------------------------------------------\n\n// IO functions\n\n// Reads next token and return it as []byte\nfunc readb() []byte {\n\tb, err := nextToken()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\n// Reads next token and return it as string\nfunc reads() string {\n\treturn string(readb())\n}\n\n// Read next line as []byte. Trailing '\\n' will not be included.\n// See also comments on readb()\nfunc readbln() []byte {\n\tb, err := nextLine()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\n// Read next line as string\nfunc readsln() string {\n\treturn string(readbln())\n}\n\n// Reads next token and return it as int64\nfunc readll() int64 {\n\ti, err := strconv.ParseInt(reads(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// Reads next token and return it as int\nfunc readi() int {\n\treturn int(readll())\n}\n\n// Reads next token and return it as float64\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(reads(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// Write args to OutputWriter with the format f\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(OutputWriter, f, args...)\n}\n\n// Write args to OutputWriter without format\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(OutputWriter, args...)\n}\n\n// Write args to stderr with the format f\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// Write args to stderr without format\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\nfunc dbgf(f string, args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintf(os.Stderr, f, args...)\n}\n\nfunc dbg(args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintln(os.Stderr, args...)\n}\n\n// -----------------------------------------------------------------------------\n\n// Utilities\n\nfunc sumSlice(a []int) int {\n\tvar res int\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc sumSlicell(a []int64) int64 {\n\tvar res int64\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc readInts(N int) (int, []int) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int, N)\n\tfor i := range a {\n\t\ta[i] = readi()\n\t}\n\treturn N, a\n}\n\nfunc readIntsll(N int) (int, []int64) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int64, N)\n\tfor i := range a {\n\t\ta[i] = readll()\n\t}\n\treturn N, a\n}\n\n// -----------------------------------------------------------------------------\n\n// Simple math functions\n\nconst (\n\t// big prime\n\tINF = 1000000007\n\tINF2 = 1000000009\n\tINF3 = 998244353\n)\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minll(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minf(a, b float64) float64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxll(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxf(a, b float64) float64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absll(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absf(a float64) float64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// egcd(a, b) returns d, x, y:\n// d is gcd(a,b)\n// x, y are integers that satisfy ax + by = d\nfunc egcd(a, b int) (int, int, int) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcd(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc egcdll(a, b int64) (int64, int64, int64) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcdll(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc gcd(a, b int) int {\n\td, _, _ := egcd(a, b)\n\treturn d\n}\n\nfunc gcdll(a, b int64) int64 {\n\td, _, _ := egcdll(a, b)\n\treturn d\n}\n\n// set up IO functions\nfunc init() {\n\t// for non-interactive\n\tSetInput(os.Stdin)\n\tSetOutput(os.Stdout)\n\n\t// Enable below when interactive. Its ok to leave above intact.\n\t// SetInteractive(os.Stdout, os.Stdin)\n}\n", "language": "Go", "metadata": {"date": 1586747989, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02714.html", "problem_id": "p02714", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02714/input.txt", "sample_output_relpath": "derived/input_output/data/p02714/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02714/Go/s206662509.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s206662509", "user_id": "u705974985"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar DEBUG = true\n\nfunc main() {\n\tdefer Flush()\n\n\tN := readi()\n\tS := readb()\n\n\tvar R, G, B int\n\n\tfor _, c := range S {\n\t\tif c == 'R' {\n\t\t\tR++\n\t\t} else if c == 'G' {\n\t\t\tG++\n\t\t} else {\n\t\t\tB++\n\t\t}\n\t}\n\n\tans := R * G * B\n\tfor j := 1; j < N-1; j++ {\n\t\tfor i := j - 1; 0 <= i; i-- {\n\t\t\tk := j + j - i\n\t\t\tif N <= k {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif S[i] != S[j] && S[j] != S[k] && S[k] != S[i] && j-i == k-j {\n\t\t\t\tans--\n\t\t\t}\n\t\t}\n\t}\n\tprintln(ans)\n}\n\n// -----------------------------------------------------------------------------\n\n// IO helper functions\n\n// Returns next token from input. It must be initialized by SetInput()\n// before the first call.\nvar nextToken func() ([]byte, error)\nvar nextLine func() ([]byte, error)\n\n// Holds a buffer for output. It must be initialized by SetOutput().\n// All IO fucntions (read*() and [e]print*()) should write to OutputWriter\n// instead of this.\nvar OutputBuffer *bufio.Writer\n\n// Holds an io.Writer. It must be initialized by SetOutput()\nvar OutputWriter io.Writer\n\n// Set IO functions for interactive input/output.\nfunc SetInteractive(w io.Writer, r io.Reader) {\n\tSetUnbefferedInput(r)\n\tOutputBuffer = nil\n\tOutputWriter = w\n}\n\n// Setup OutputBuffer and OutputWriter.\nfunc SetOutput(w io.Writer) {\n\tOutputBuffer = bufio.NewWriter(w)\n\tOutputWriter = OutputBuffer\n}\n\n// Flushes OutputBuffer\nfunc Flush() {\n\tif OutputBuffer != nil {\n\t\tOutputBuffer.Flush()\n\t}\n}\n\n// Returns true if c is a white space\nfunc IsSpace(c byte) bool {\n\tswitch c {\n\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc IsNewLine(c byte) bool {\n\tswitch c {\n\tcase '\\n', '\\r':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Setup nextToken with input buffer.\nfunc SetInput(r io.Reader) {\n\tbuf := new(bytes.Buffer)\n\tvar b []byte\n\n\tvar i int\n\trest := func() ([]byte, error) {\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\tinitial := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextToken = rest\n\t\treturn rest()\n\t}\n\tnextToken = initial\n\n\trestLn := func() ([]byte, error) {\n\t\tfor i < len(b) && IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\n\tinitialLn := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextLine = restLn\n\t\treturn restLn()\n\t}\n\tnextLine = initialLn\n}\n\n// Setup nextToken without input buffer.\nfunc SetUnbefferedInput(r io.Reader) {\n\tbuf := bufio.NewReader(r)\n\tvar b []byte\n\n\tvar i int\n\tnextToken = func() ([]byte, error) {\n\t\tvar err error\n\t\tif i == len(b) {\n\t\t\tb, err = buf.ReadBytes('\\n')\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ti = 0\n\t\t\tj := len(b) - 1\n\t\t\tfor 0 <= j && IsSpace(b[j]) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tb = b[0 : j+1]\n\t\t}\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n}\n\n// -----------------------------------------------------------------------------\n\n// IO functions\n\n// Reads next token and return it as []byte\nfunc readb() []byte {\n\tb, err := nextToken()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\n// Reads next token and return it as string\nfunc reads() string {\n\treturn string(readb())\n}\n\n// Read next line as []byte. Trailing '\\n' will not be included.\n// See also comments on readb()\nfunc readbln() []byte {\n\tb, err := nextLine()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b[:len(b):len(b)]\n}\n\n// Read next line as string\nfunc readsln() string {\n\treturn string(readbln())\n}\n\n// Reads next token and return it as int64\nfunc readll() int64 {\n\ti, err := strconv.ParseInt(reads(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// Reads next token and return it as int\nfunc readi() int {\n\treturn int(readll())\n}\n\n// Reads next token and return it as float64\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(reads(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// Write args to OutputWriter with the format f\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(OutputWriter, f, args...)\n}\n\n// Write args to OutputWriter without format\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(OutputWriter, args...)\n}\n\n// Write args to stderr with the format f\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// Write args to stderr without format\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\nfunc dbgf(f string, args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintf(os.Stderr, f, args...)\n}\n\nfunc dbg(args ...interface{}) {\n\tif !DEBUG {\n\t\treturn\n\t}\n\tfmt.Fprintln(os.Stderr, args...)\n}\n\n// -----------------------------------------------------------------------------\n\n// Utilities\n\nfunc sumSlice(a []int) int {\n\tvar res int\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc sumSlicell(a []int64) int64 {\n\tvar res int64\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\n\nfunc readInts(N int) (int, []int) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int, N)\n\tfor i := range a {\n\t\ta[i] = readi()\n\t}\n\treturn N, a\n}\n\nfunc readIntsll(N int) (int, []int64) {\n\tif N == 0 {\n\t\tN = readi()\n\t}\n\ta := make([]int64, N)\n\tfor i := range a {\n\t\ta[i] = readll()\n\t}\n\treturn N, a\n}\n\n// -----------------------------------------------------------------------------\n\n// Simple math functions\n\nconst (\n\t// big prime\n\tINF = 1000000007\n\tINF2 = 1000000009\n\tINF3 = 998244353\n)\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minll(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minf(a, b float64) float64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxll(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxf(a, b float64) float64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absll(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absf(a float64) float64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// egcd(a, b) returns d, x, y:\n// d is gcd(a,b)\n// x, y are integers that satisfy ax + by = d\nfunc egcd(a, b int) (int, int, int) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcd(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc egcdll(a, b int64) (int64, int64, int64) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcdll(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc gcd(a, b int) int {\n\td, _, _ := egcd(a, b)\n\treturn d\n}\n\nfunc gcdll(a, b int64) int64 {\n\td, _, _ := egcdll(a, b)\n\treturn d\n}\n\n// set up IO functions\nfunc init() {\n\t// for non-interactive\n\tSetInput(os.Stdin)\n\tSetOutput(os.Stdout)\n\n\t// Enable below when interactive. Its ok to leave above intact.\n\t// SetInteractive(os.Stdout, os.Stdin)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a string S of length N consisting of R, G, and B.\n\nFind the number of triples (i,~j,~k)~(1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nS_i \\neq S_j, S_i \\neq S_k, and S_j \\neq S_k.\n\nj - i \\neq k - j.\n\nConstraints\n\n1 \\leq N \\leq 4000\n\nS is a string of length N consisting of R, G, and B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of triplets in question.\n\nSample Input 1\n\n4\nRRGB\n\nSample Output 1\n\n1\n\nOnly the triplet (1,~3,~4) satisfies both conditions. The triplet (2,~3,~4) satisfies the first condition but not the second, so it does not count.\n\nSample Input 2\n\n39\nRBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB\n\nSample Output 2\n\n1800", "sample_input": "4\nRRGB\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02714", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a string S of length N consisting of R, G, and B.\n\nFind the number of triples (i,~j,~k)~(1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nS_i \\neq S_j, S_i \\neq S_k, and S_j \\neq S_k.\n\nj - i \\neq k - j.\n\nConstraints\n\n1 \\leq N \\leq 4000\n\nS is a string of length N consisting of R, G, and B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of triplets in question.\n\nSample Input 1\n\n4\nRRGB\n\nSample Output 1\n\n1\n\nOnly the triplet (1,~3,~4) satisfies both conditions. The triplet (2,~3,~4) satisfies the first condition but not the second, so it does not count.\n\nSample Input 2\n\n39\nRBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB\n\nSample Output 2\n\n1800", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 7019, "cpu_time_ms": 43, "memory_kb": 1808}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s618122231", "group_id": "codeNet:p02714", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar s string\n\tfmt.Scan(&s)\n\trgb := strings.Split(s, \"\")\n\tvar r, g, b []int\n\tans := 0\n\tvar max, min, div int\n\n\tfor i := 0; i < n; i++ {\n\t\tif rgb[i] == \"R\" {\n\t\t\tr = append(r, i)\n\t\t} else if rgb[i] == \"G\" {\n\t\t\tg = append(g, i)\n\t\t} else {\n\t\t\tb = append(b, i)\n\t\t}\n\t}\n\tfor i := range r {\n\t\tfor j := range g {\n\t\t\tans = ans + len(b)\n\t\t\tif r[i]-g[j] < 0 {\n\t\t\t\tmax = g[j]\n\t\t\t\tmin = r[i]\n\t\t\t} else {\n\t\t\t\tmax = r[i]\n\t\t\t\tmin = g[j]\n\t\t\t}\n\t\t\tdiv = max - min\n\t\t\t//\t\t\tfmt.Println(max, min, div)\n\t\t\tif div%2 == 0 {\n\t\t\t\tif rgb[min+div/2] == \"B\" {\n\t\t\t\t\tans--\n\t\t\t\t}\n\t\t\t}\n\t\t\tif min-div >= 0 {\n\t\t\t\tif rgb[min-div] == \"B\" {\n\t\t\t\t\tans--\n\t\t\t\t}\n\t\t\t}\n\t\t\tif max+div <= n-1 {\n\t\t\t\tif rgb[max+div] == \"B\" {\n\t\t\t\t\tans--\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t//\tfor i := range r {\n\t//\t\tfor j := range g {\n\t//\t\t\tfor k := range b {\n\t//\t\t\t\ttmp := []int{r[i], g[j], b[k]}\n\t//\t\t\t\tsort.Sort(sort.IntSlice(tmp))\n\t//\t\t\t\tif tmp[1]-tmp[0] != tmp[2]-tmp[1] {\n\t//\t\t\t\t\tans++\n\t//\t\t\t\t}\n\t//\t\t\t}\n\t//\t\t}\n\t//\t}\n\t//\tfmt.Println(\"r\", r)\n\t//\tfmt.Println(\"g\", g)\n\t//\tfmt.Println(\"b\", b)\n\t//\tfmt.Println(\"rgb\", rgb)\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1586746599, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02714.html", "problem_id": "p02714", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02714/input.txt", "sample_output_relpath": "derived/input_output/data/p02714/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02714/Go/s618122231.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s618122231", "user_id": "u715605488"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar s string\n\tfmt.Scan(&s)\n\trgb := strings.Split(s, \"\")\n\tvar r, g, b []int\n\tans := 0\n\tvar max, min, div int\n\n\tfor i := 0; i < n; i++ {\n\t\tif rgb[i] == \"R\" {\n\t\t\tr = append(r, i)\n\t\t} else if rgb[i] == \"G\" {\n\t\t\tg = append(g, i)\n\t\t} else {\n\t\t\tb = append(b, i)\n\t\t}\n\t}\n\tfor i := range r {\n\t\tfor j := range g {\n\t\t\tans = ans + len(b)\n\t\t\tif r[i]-g[j] < 0 {\n\t\t\t\tmax = g[j]\n\t\t\t\tmin = r[i]\n\t\t\t} else {\n\t\t\t\tmax = r[i]\n\t\t\t\tmin = g[j]\n\t\t\t}\n\t\t\tdiv = max - min\n\t\t\t//\t\t\tfmt.Println(max, min, div)\n\t\t\tif div%2 == 0 {\n\t\t\t\tif rgb[min+div/2] == \"B\" {\n\t\t\t\t\tans--\n\t\t\t\t}\n\t\t\t}\n\t\t\tif min-div >= 0 {\n\t\t\t\tif rgb[min-div] == \"B\" {\n\t\t\t\t\tans--\n\t\t\t\t}\n\t\t\t}\n\t\t\tif max+div <= n-1 {\n\t\t\t\tif rgb[max+div] == \"B\" {\n\t\t\t\t\tans--\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t//\tfor i := range r {\n\t//\t\tfor j := range g {\n\t//\t\t\tfor k := range b {\n\t//\t\t\t\ttmp := []int{r[i], g[j], b[k]}\n\t//\t\t\t\tsort.Sort(sort.IntSlice(tmp))\n\t//\t\t\t\tif tmp[1]-tmp[0] != tmp[2]-tmp[1] {\n\t//\t\t\t\t\tans++\n\t//\t\t\t\t}\n\t//\t\t\t}\n\t//\t\t}\n\t//\t}\n\t//\tfmt.Println(\"r\", r)\n\t//\tfmt.Println(\"g\", g)\n\t//\tfmt.Println(\"b\", b)\n\t//\tfmt.Println(\"rgb\", rgb)\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a string S of length N consisting of R, G, and B.\n\nFind the number of triples (i,~j,~k)~(1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nS_i \\neq S_j, S_i \\neq S_k, and S_j \\neq S_k.\n\nj - i \\neq k - j.\n\nConstraints\n\n1 \\leq N \\leq 4000\n\nS is a string of length N consisting of R, G, and B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of triplets in question.\n\nSample Input 1\n\n4\nRRGB\n\nSample Output 1\n\n1\n\nOnly the triplet (1,~3,~4) satisfies both conditions. The triplet (2,~3,~4) satisfies the first condition but not the second, so it does not count.\n\nSample Input 2\n\n39\nRBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB\n\nSample Output 2\n\n1800", "sample_input": "4\nRRGB\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02714", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a string S of length N consisting of R, G, and B.\n\nFind the number of triples (i,~j,~k)~(1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nS_i \\neq S_j, S_i \\neq S_k, and S_j \\neq S_k.\n\nj - i \\neq k - j.\n\nConstraints\n\n1 \\leq N \\leq 4000\n\nS is a string of length N consisting of R, G, and B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of triplets in question.\n\nSample Input 1\n\n4\nRRGB\n\nSample Output 1\n\n1\n\nOnly the triplet (1,~3,~4) satisfies both conditions. The triplet (2,~3,~4) satisfies the first condition but not the second, so it does not count.\n\nSample Input 2\n\n39\nRBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB\n\nSample Output 2\n\n1800", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1142, "cpu_time_ms": 38, "memory_kb": 2080}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s674235361", "group_id": "codeNet:p02714", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\ntype rgb struct {\n\tR, G, B int\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(nextString())\n\treturn n\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tN := nextInt()\n\tS := nextString()\n\n\trc := 0\n\tgc := 0\n\tbc := 0\n\n\tfor _, s := range S {\n\t\tif s == 'R' {\n\t\t\trc++\n\t\t} else if s == 'G' {\n\t\t\tgc++\n\t\t} else {\n\t\t\tbc++\n\t\t}\n\t}\n\n\tsum := rc * gc * bc\n\n\tfor i := 0; i < N; i++ {\n\t\tfor j := i + 1; j < N; j++ {\n\t\t\tk := j + (j - i)\n\t\t\tif k < N {\n\t\t\t\tstr := []byte{S[i], S[j], S[k]}\n\t\t\t\tif isRGB(string(str)) {\n\t\t\t\t\tsum--\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n\nfunc isRGB(subString string) bool {\n\tswitch subString {\n\tcase \"RGB\":\n\t\treturn true\n\tcase \"RBG\":\n\t\treturn true\n\tcase \"GRB\":\n\t\treturn true\n\tcase \"GBR\":\n\t\treturn true\n\tcase \"BRG\":\n\t\treturn true\n\tcase \"BGR\":\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n", "language": "Go", "metadata": {"date": 1586746544, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02714.html", "problem_id": "p02714", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02714/input.txt", "sample_output_relpath": "derived/input_output/data/p02714/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02714/Go/s674235361.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s674235361", "user_id": "u283719735"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\ntype rgb struct {\n\tR, G, B int\n}\n\nfunc nextInt() int {\n\tn, _ := strconv.Atoi(nextString())\n\treturn n\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tN := nextInt()\n\tS := nextString()\n\n\trc := 0\n\tgc := 0\n\tbc := 0\n\n\tfor _, s := range S {\n\t\tif s == 'R' {\n\t\t\trc++\n\t\t} else if s == 'G' {\n\t\t\tgc++\n\t\t} else {\n\t\t\tbc++\n\t\t}\n\t}\n\n\tsum := rc * gc * bc\n\n\tfor i := 0; i < N; i++ {\n\t\tfor j := i + 1; j < N; j++ {\n\t\t\tk := j + (j - i)\n\t\t\tif k < N {\n\t\t\t\tstr := []byte{S[i], S[j], S[k]}\n\t\t\t\tif isRGB(string(str)) {\n\t\t\t\t\tsum--\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n\nfunc isRGB(subString string) bool {\n\tswitch subString {\n\tcase \"RGB\":\n\t\treturn true\n\tcase \"RBG\":\n\t\treturn true\n\tcase \"GRB\":\n\t\treturn true\n\tcase \"GBR\":\n\t\treturn true\n\tcase \"BRG\":\n\t\treturn true\n\tcase \"BGR\":\n\t\treturn true\n\tdefault:\n\t\treturn false\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a string S of length N consisting of R, G, and B.\n\nFind the number of triples (i,~j,~k)~(1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nS_i \\neq S_j, S_i \\neq S_k, and S_j \\neq S_k.\n\nj - i \\neq k - j.\n\nConstraints\n\n1 \\leq N \\leq 4000\n\nS is a string of length N consisting of R, G, and B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of triplets in question.\n\nSample Input 1\n\n4\nRRGB\n\nSample Output 1\n\n1\n\nOnly the triplet (1,~3,~4) satisfies both conditions. The triplet (2,~3,~4) satisfies the first condition but not the second, so it does not count.\n\nSample Input 2\n\n39\nRBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB\n\nSample Output 2\n\n1800", "sample_input": "4\nRRGB\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02714", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a string S of length N consisting of R, G, and B.\n\nFind the number of triples (i,~j,~k)~(1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nS_i \\neq S_j, S_i \\neq S_k, and S_j \\neq S_k.\n\nj - i \\neq k - j.\n\nConstraints\n\n1 \\leq N \\leq 4000\n\nS is a string of length N consisting of R, G, and B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of triplets in question.\n\nSample Input 1\n\n4\nRRGB\n\nSample Output 1\n\n1\n\nOnly the triplet (1,~3,~4) satisfies both conditions. The triplet (2,~3,~4) satisfies the first condition but not the second, so it does not count.\n\nSample Input 2\n\n39\nRBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB\n\nSample Output 2\n\n1800", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 944, "cpu_time_ms": 100, "memory_kb": 1780}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s780551604", "group_id": "codeNet:p02714", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar s [10000]byte\nvar N int\n\nvar rmap map[int]int\nvar gmap map[int]int\nvar bmap map[int]int\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\n\trmap = make(map[int]int)\n\tgmap = make(map[int]int)\n\tbmap = make(map[int]int)\n\t// AUTOGENERATE\n\n\t// STR := io.Next()\n\t// Log(\"string\", STR)\n\n\t// F := io.NextFloat()\n\t// Log(\"float\", F)\n\n\t// parsing int array\n\tN = io.NextInt()\n\tLogf(\"%v\\n\", N)\n\t// M := io.NextInt()\n\t// Logf(\"%v\\n\", M)\n\t// var A [200000]int\n\t// for i := 0 ; i < N; i++ {\n\t// \tA[i] = io.NextInt()\n\t// }\n\t// Logf(\"A %v\\n\", A[0:10])\n\t// sort.Sort(sort.Reverse(sort.IntSlice(A[:])))\n\t// sort.Sort(sort.IntSlice(A[:]))\n\n\t// parsing string as byte array\n\tstr := io.Next()\n\tvar rl, gl, bl [4000]int\n\trc := 0\n\tgc := 0\n\tbc := 0\n\n\tfor i := -N; i < len(str)*2; i++ {\n\t\tbmap[i] = -1\n\t}\n\tfor i := 0; i < len(str); i++ {\n\t\ts[i] = str[i]\n\t\tif int(s[i]) == 82 {\n\t\t\trl[rc] = i\n\t\t\trmap[i] = rc\n\t\t\trc++\n\t\t} else if int(s[i]) == 71 {\n\t\t\tgl[gc] = i\n\t\t\tgmap[i] = gc\n\t\t\tgc++\n\t\t} else if int(s[i]) == 66 {\n\t\t\tbl[bc] = i\n\t\t\tbmap[i] = bc\n\t\t\tbc++\n\t\t}\n\t}\n\tLog(\"byte array\", s[0:10])\n\tLog(\"r\", rl[0:rc])\n\tLog(\"g\", gl[0:gc])\n\tLog(\"b\", bl[0:bc])\n\tLog(\"r\", rmap)\n\tLog(\"g\", gmap)\n\tLog(\"b\", bmap)\n\tLog(\"count\", rc*gc*bc)\n\tcount := 0\n\tcount = rc * gc * bc\n\tfor _, rii := range rl[0:rc] {\n\t\tfor _, gii := range gl[0:gc] {\n\t\t\t// if rii > gii {\n\t\t\t// \tif _, ok := bmap[rii+rii-gii]; ok {\n\t\t\t// \t\tcount--\n\t\t\t// \t}\n\t\t\t// \tif _, ok := bmap[gii-(rii-gii)]; ok {\n\t\t\t// \t\tcount--\n\t\t\t// \t}\n\t\t\t// } else {\n\t\t\t// \tif _, ok := bmap[gii+gii-rii]; ok {\n\t\t\t// \t\tcount--\n\t\t\t// \t}\n\t\t\t// \tif _, ok := bmap[rii-(gii-rii)]; ok {\n\t\t\t// \t\tcount--\n\t\t\t// \t}\n\t\t\t// }\n\t\t\t// Logf(\"0 %4v %4v %5v %5v %5v %5v\\n\", rii, gii, bmap[2*gii-rii], bmap[2*rii-gii], bmap[(rii+gii)/2], count)\n\t\t\t// if _, ok := bmap[2*rii-gii]; 2*rii-gii > 0 && ok {\n\t\t\tif bmap[2*rii-gii] != -1 {\n\t\t\t\t// Logf(\"0 %v %v %v %v\\n\", rii, gii, gii, count)\n\t\t\t\tcount--\n\t\t\t}\n\t\t\t// if _, ok := bmap[2*gii-rii]; 2*gii-rii > 0 && ok {\n\t\t\tif bmap[2*gii-rii] != -1 {\n\t\t\t\t// Logf(\"1 %v %v %v %v\\n\", rii, gii, gii, count)\n\t\t\t\tcount--\n\t\t\t}\n\t\t\t// if _, ok := bmap[(rii+gii)/2]; ok {\n\t\t\tif ((rii+gii)%2 == 0) && bmap[(rii+gii)/2] != -1 {\n\t\t\t\t// Logf(\"2 %v %v %v %v\\n\", rii, gii, gii, count)\n\t\t\t\tcount--\n\t\t\t}\n\t\t\tcontinue\n\t\t\tfor _, bii := range bl[0:bc] {\n\t\t\t\t// Logf(\"0 %v %v %v %v\\n\", rii, gii, bii, count)\n\n\t\t\t\tcontinue\n\t\t\t\tif rii < gii {\n\t\t\t\t\tif gii < bii { // r g b\n\t\t\t\t\t\tif bii-gii != gii-rii {\n\t\t\t\t\t\t\tcount++\n\t\t\t\t\t\t\t// } else {\n\t\t\t\t\t\t\t// Logf(\"1 %v %v %v\\n\", rii, gii, bii)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if rii < bii { // r b g\n\t\t\t\t\t\tif gii-bii != bii-rii {\n\t\t\t\t\t\t\tcount++\n\t\t\t\t\t\t\t// } else {\n\t\t\t\t\t\t\t// \tLogf(\"2 %v %v %v\\n\", rii, gii, bii)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else { // b r g\n\t\t\t\t\t\tif gii-rii != rii-bii {\n\t\t\t\t\t\t\tcount++\n\t\t\t\t\t\t\t// } else {\n\t\t\t\t\t\t\t// \tLogf(\"3 %v %v %v\\n\", rii, gii, bii)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else { // g r\n\t\t\t\t\tif rii < bii { // g r b\n\t\t\t\t\t\tif bii-rii != rii-gii {\n\t\t\t\t\t\t\tcount++\n\t\t\t\t\t\t\t// } else {\n\t\t\t\t\t\t\t// \tLogf(\"4 %v %v %v\\n\", rii, gii, bii)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if gii < bii { // g b r\n\t\t\t\t\t\tif rii-bii != bii-gii {\n\t\t\t\t\t\t\tcount++\n\t\t\t\t\t\t\t// } else {\n\t\t\t\t\t\t\t// \tLogf(\"5 %v %v %v\\n\", rii, gii, bii)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else { // b g r\n\t\t\t\t\t\tif rii-gii != gii-bii {\n\t\t\t\t\t\t\tcount++\n\t\t\t\t\t\t\t// } else {\n\t\t\t\t\t\t\t// \tLogf(\"6 %v %v %v\\n\", rii, gii, bii)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// for i := 0; i < N-2; i++ {\n\t// \tif int(s[i]) == 82 {\n\t// \t\tfor gi := 0 ; gi < gc; gi++ {\n\t// \t\t}\n\t// \t\trl[rc] = i\n\t// \t\trc++\n\t// \t} else if int(s[i]) == 71 {\n\t// \t\tgl[gc] = i\n\t// \t\tgc++\n\t// \t} else if int(s[i]) == 66 {\n\t// \t\tbl[bc] = i\n\t// \t\tbc++\n\t// \t}\n\t// \tcount += part(i)\n\t// \tLogf(\"%v\\n\", count)\n\t// }\n\n\t// count := 0\n\t// for i := N - 1 - 2; i >= 0; i-- {\n\t// \tcount += part(i)\n\t// \tLogf(\"%v\\n\", count)\n\t// }\n\tfmt.Printf(\"%v\\n\", count)\n\t// fmt.Printf(\"%d %d %d\\n\", N, M, intMax(N, M))\n\t// fmt.Printf(\"Lucas %d %d\\n\", combMod(N, M, 13), combination(N, M))\n\n\t// write your own code here\n\n}\n\nfunc part(i int) int {\n\tcount := 0\n\tfor j := i + 1; j < N; j++ {\n\t\tif s[i] == s[j] {\n\t\t\tcontinue\n\t\t}\n\t\tfor k := j + 1; k < N; k++ {\n\t\t\tif (k - j) == (j - i) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif s[i] == s[k] || s[j] == s[k] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tcount++\n\t\t}\n\t}\n\treturn count\n}\n\n// Libraries\n\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\n// NewIo\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\n// Flush\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\n// NextLine\nfunc (io *Io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\n// Next\nfunc (io *Io) Next() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\n// NextInt\nfunc (io *Io) NextInt() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\n// NextFloat\nfunc (io *Io) NextFloat() float64 {\n\ti, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\n// PrintLn\nfunc (io *Io) PrintLn(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\n// Printf\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\n// PrintIntLn\nfunc (io *Io) PrintIntLn(a []int) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\n// PrintStringLn\nfunc (io *Io) PrintStringLn(a []string) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\n// Log\nfunc Log(name string, value interface{}) {\n\tfmt.Fprintf(os.Stderr, \"%s=%+v\\n\", name, value)\n}\n\n// Log format for standard error output\nfunc Logf(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\n}\n\nfunc intMin(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc intMax(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// direct calculation of combination\n// n, m should be \"small\"\nfunc combination(n, m int) int {\n\tif m > n {\n\t\treturn 0\n\t} else if m == n || m == 0 {\n\t\treturn 1\n\t} else {\n\t\tres := 1\n\t\tfor i := 0; i < m; i++ {\n\t\t\tres *= (n - i)\n\t\t}\n\t\tfor i := 1; i <= m; i++ {\n\t\t\tres /= i\n\t\t}\n\t\treturn res\n\t}\n}\n\n// caluclate combination modulo based on Lucas theorem\nfunc lucas(n, m, p int) int {\n\tntemp := n\n\tmtemp := m\n\tres := 1\n\tfor i := 0; i < 100; i++ {\n\t\t// fmt.Printf(\"ntemp: %d\\n\", ntemp)\n\t\tnreminder := ntemp % p\n\t\tntemp = ntemp / p\n\t\tmreminder := mtemp % p\n\t\tmtemp = mtemp / p\n\t\tres = res * (combination(nreminder, mreminder) % p)\n\t\tif ntemp == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn res % p\n}\n\nfunc combMod(n, m, p int) int {\n\treturn lucas(n, m, p)\n}\n\n// BFS/DFS\n//\n// visited := []int{}\n// dfs(1, neighbor, func(node int) {\n// \tvisited = append(visited, node)\n// })\n// fmt.Println(visited)\n\nfunc bfs(start int, nodes map[int][]int, fn func(int)) {\n\tfrontier := []int{start}\n\tvisited := map[int]bool{}\n\tnext := []int{}\n\n\tfor 0 < len(frontier) {\n\t\tnext = []int{}\n\t\tfor _, node := range frontier {\n\t\t\tvisited[node] = true\n\t\t\tfn(node)\n\t\t\tfor _, n := range bfs_frontier(node, nodes, visited) {\n\t\t\t\tnext = append(next, n)\n\t\t\t}\n\t\t}\n\t\tfrontier = next\n\t}\n}\n\nfunc bfs_frontier(node int, nodes map[int][]int, visited map[int]bool) []int {\n\tnext := []int{}\n\titer := func(n int) bool { _, ok := visited[n]; return !ok }\n\tfor _, n := range nodes[node] {\n\t\tif iter(n) {\n\t\t\tnext = append(next, n)\n\t\t}\n\t}\n\treturn next\n}\n\nfunc dfs(node int, nodes map[int][]int, fn func(int)) {\n\tdfs_recur(node, nodes, map[int]bool{}, fn)\n}\n\nfunc dfs_recur(node int, nodes map[int][]int, v map[int]bool, fn func(int)) {\n\tv[node] = true\n\tfn(node)\n\tfor _, n := range nodes[node] {\n\t\tif _, ok := v[n]; !ok {\n\t\t\tdfs_recur(n, nodes, v, fn)\n\t\t}\n\t}\n}\n\n// handles 2 function, one is before entering child tree, and another is\n// after entering child tree.\nfunc dfs2(node int, nodes map[int][]int, fn1, fn2 func(int, int)) {\n\tdfs2_recur(node, -1, nodes, map[int]bool{}, fn1, fn2)\n}\n\nfunc dfs2_recur(node, parent int, nodes map[int][]int, v map[int]bool, fn1, fn2 func(int, int)) {\n\tv[node] = true\n\tfn1(node, parent)\n\tfor _, n := range nodes[node] {\n\t\tif _, ok := v[n]; !ok {\n\t\t\tdfs2_recur(n, node, nodes, v, fn1, fn2)\n\t\t}\n\t}\n\tfn2(node, parent)\n}\n\n// Stack data structure\ntype Stack struct {\n\ttop *Element\n\tsize int\n}\n\ntype Element struct {\n\tvalue interface{}\n\tnext *Element\n}\n\nfunc (s *Stack) Len() int {\n\treturn s.size\n}\n\nfunc (s *Stack) Push(value interface{}) {\n\ts.top = &Element{value, s.top}\n\ts.size++\n}\n\nfunc (s *Stack) Pop() (value interface{}) {\n\tif s.size > 0 {\n\t\tvalue, s.top = s.top.value, s.top.next\n\t\ts.size--\n\t\treturn\n\t}\n\treturn nil\n}\n\n// powerInt (use math.Pow() for float parameters)\nfunc powerInt(n, p int) int {\n\ttmp := 1\n\tfor i := 0; i < n; i++ {\n\t\ttmp *= p\n\t}\n\treturn tmp\n}\n\nfunc findDivisors(n int, a *[]int) {\n\tif n == 1 {\n\t\treturn\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n%i == 0 {\n\t\t\t*a = append(*a, i)\n\t\t\t*a = append(*a, n/i)\n\t\t}\n\t}\n\t*a = append(*a, n)\n}\n\nfunc removeDuplicate(a []int) []int {\n\tm := make(map[int]bool)\n\tfor i := 0; i < len(a); i++ {\n\t\tm[a[i]] = true\n\t}\n\tres := []int{}\n\tfor i, _ := range m {\n\t\tres = append(res, i)\n\t}\n\treturn res\n}\n", "language": "Go", "metadata": {"date": 1586745237, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02714.html", "problem_id": "p02714", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02714/input.txt", "sample_output_relpath": "derived/input_output/data/p02714/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02714/Go/s780551604.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s780551604", "user_id": "u678848631"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar s [10000]byte\nvar N int\n\nvar rmap map[int]int\nvar gmap map[int]int\nvar bmap map[int]int\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\n\trmap = make(map[int]int)\n\tgmap = make(map[int]int)\n\tbmap = make(map[int]int)\n\t// AUTOGENERATE\n\n\t// STR := io.Next()\n\t// Log(\"string\", STR)\n\n\t// F := io.NextFloat()\n\t// Log(\"float\", F)\n\n\t// parsing int array\n\tN = io.NextInt()\n\tLogf(\"%v\\n\", N)\n\t// M := io.NextInt()\n\t// Logf(\"%v\\n\", M)\n\t// var A [200000]int\n\t// for i := 0 ; i < N; i++ {\n\t// \tA[i] = io.NextInt()\n\t// }\n\t// Logf(\"A %v\\n\", A[0:10])\n\t// sort.Sort(sort.Reverse(sort.IntSlice(A[:])))\n\t// sort.Sort(sort.IntSlice(A[:]))\n\n\t// parsing string as byte array\n\tstr := io.Next()\n\tvar rl, gl, bl [4000]int\n\trc := 0\n\tgc := 0\n\tbc := 0\n\n\tfor i := -N; i < len(str)*2; i++ {\n\t\tbmap[i] = -1\n\t}\n\tfor i := 0; i < len(str); i++ {\n\t\ts[i] = str[i]\n\t\tif int(s[i]) == 82 {\n\t\t\trl[rc] = i\n\t\t\trmap[i] = rc\n\t\t\trc++\n\t\t} else if int(s[i]) == 71 {\n\t\t\tgl[gc] = i\n\t\t\tgmap[i] = gc\n\t\t\tgc++\n\t\t} else if int(s[i]) == 66 {\n\t\t\tbl[bc] = i\n\t\t\tbmap[i] = bc\n\t\t\tbc++\n\t\t}\n\t}\n\tLog(\"byte array\", s[0:10])\n\tLog(\"r\", rl[0:rc])\n\tLog(\"g\", gl[0:gc])\n\tLog(\"b\", bl[0:bc])\n\tLog(\"r\", rmap)\n\tLog(\"g\", gmap)\n\tLog(\"b\", bmap)\n\tLog(\"count\", rc*gc*bc)\n\tcount := 0\n\tcount = rc * gc * bc\n\tfor _, rii := range rl[0:rc] {\n\t\tfor _, gii := range gl[0:gc] {\n\t\t\t// if rii > gii {\n\t\t\t// \tif _, ok := bmap[rii+rii-gii]; ok {\n\t\t\t// \t\tcount--\n\t\t\t// \t}\n\t\t\t// \tif _, ok := bmap[gii-(rii-gii)]; ok {\n\t\t\t// \t\tcount--\n\t\t\t// \t}\n\t\t\t// } else {\n\t\t\t// \tif _, ok := bmap[gii+gii-rii]; ok {\n\t\t\t// \t\tcount--\n\t\t\t// \t}\n\t\t\t// \tif _, ok := bmap[rii-(gii-rii)]; ok {\n\t\t\t// \t\tcount--\n\t\t\t// \t}\n\t\t\t// }\n\t\t\t// Logf(\"0 %4v %4v %5v %5v %5v %5v\\n\", rii, gii, bmap[2*gii-rii], bmap[2*rii-gii], bmap[(rii+gii)/2], count)\n\t\t\t// if _, ok := bmap[2*rii-gii]; 2*rii-gii > 0 && ok {\n\t\t\tif bmap[2*rii-gii] != -1 {\n\t\t\t\t// Logf(\"0 %v %v %v %v\\n\", rii, gii, gii, count)\n\t\t\t\tcount--\n\t\t\t}\n\t\t\t// if _, ok := bmap[2*gii-rii]; 2*gii-rii > 0 && ok {\n\t\t\tif bmap[2*gii-rii] != -1 {\n\t\t\t\t// Logf(\"1 %v %v %v %v\\n\", rii, gii, gii, count)\n\t\t\t\tcount--\n\t\t\t}\n\t\t\t// if _, ok := bmap[(rii+gii)/2]; ok {\n\t\t\tif ((rii+gii)%2 == 0) && bmap[(rii+gii)/2] != -1 {\n\t\t\t\t// Logf(\"2 %v %v %v %v\\n\", rii, gii, gii, count)\n\t\t\t\tcount--\n\t\t\t}\n\t\t\tcontinue\n\t\t\tfor _, bii := range bl[0:bc] {\n\t\t\t\t// Logf(\"0 %v %v %v %v\\n\", rii, gii, bii, count)\n\n\t\t\t\tcontinue\n\t\t\t\tif rii < gii {\n\t\t\t\t\tif gii < bii { // r g b\n\t\t\t\t\t\tif bii-gii != gii-rii {\n\t\t\t\t\t\t\tcount++\n\t\t\t\t\t\t\t// } else {\n\t\t\t\t\t\t\t// Logf(\"1 %v %v %v\\n\", rii, gii, bii)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if rii < bii { // r b g\n\t\t\t\t\t\tif gii-bii != bii-rii {\n\t\t\t\t\t\t\tcount++\n\t\t\t\t\t\t\t// } else {\n\t\t\t\t\t\t\t// \tLogf(\"2 %v %v %v\\n\", rii, gii, bii)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else { // b r g\n\t\t\t\t\t\tif gii-rii != rii-bii {\n\t\t\t\t\t\t\tcount++\n\t\t\t\t\t\t\t// } else {\n\t\t\t\t\t\t\t// \tLogf(\"3 %v %v %v\\n\", rii, gii, bii)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else { // g r\n\t\t\t\t\tif rii < bii { // g r b\n\t\t\t\t\t\tif bii-rii != rii-gii {\n\t\t\t\t\t\t\tcount++\n\t\t\t\t\t\t\t// } else {\n\t\t\t\t\t\t\t// \tLogf(\"4 %v %v %v\\n\", rii, gii, bii)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if gii < bii { // g b r\n\t\t\t\t\t\tif rii-bii != bii-gii {\n\t\t\t\t\t\t\tcount++\n\t\t\t\t\t\t\t// } else {\n\t\t\t\t\t\t\t// \tLogf(\"5 %v %v %v\\n\", rii, gii, bii)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else { // b g r\n\t\t\t\t\t\tif rii-gii != gii-bii {\n\t\t\t\t\t\t\tcount++\n\t\t\t\t\t\t\t// } else {\n\t\t\t\t\t\t\t// \tLogf(\"6 %v %v %v\\n\", rii, gii, bii)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// for i := 0; i < N-2; i++ {\n\t// \tif int(s[i]) == 82 {\n\t// \t\tfor gi := 0 ; gi < gc; gi++ {\n\t// \t\t}\n\t// \t\trl[rc] = i\n\t// \t\trc++\n\t// \t} else if int(s[i]) == 71 {\n\t// \t\tgl[gc] = i\n\t// \t\tgc++\n\t// \t} else if int(s[i]) == 66 {\n\t// \t\tbl[bc] = i\n\t// \t\tbc++\n\t// \t}\n\t// \tcount += part(i)\n\t// \tLogf(\"%v\\n\", count)\n\t// }\n\n\t// count := 0\n\t// for i := N - 1 - 2; i >= 0; i-- {\n\t// \tcount += part(i)\n\t// \tLogf(\"%v\\n\", count)\n\t// }\n\tfmt.Printf(\"%v\\n\", count)\n\t// fmt.Printf(\"%d %d %d\\n\", N, M, intMax(N, M))\n\t// fmt.Printf(\"Lucas %d %d\\n\", combMod(N, M, 13), combination(N, M))\n\n\t// write your own code here\n\n}\n\nfunc part(i int) int {\n\tcount := 0\n\tfor j := i + 1; j < N; j++ {\n\t\tif s[i] == s[j] {\n\t\t\tcontinue\n\t\t}\n\t\tfor k := j + 1; k < N; k++ {\n\t\t\tif (k - j) == (j - i) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif s[i] == s[k] || s[j] == s[k] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tcount++\n\t\t}\n\t}\n\treturn count\n}\n\n// Libraries\n\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\n// NewIo\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\n// Flush\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\n// NextLine\nfunc (io *Io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\n// Next\nfunc (io *Io) Next() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\n// NextInt\nfunc (io *Io) NextInt() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\n// NextFloat\nfunc (io *Io) NextFloat() float64 {\n\ti, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\n// PrintLn\nfunc (io *Io) PrintLn(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\n// Printf\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\n// PrintIntLn\nfunc (io *Io) PrintIntLn(a []int) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\n// PrintStringLn\nfunc (io *Io) PrintStringLn(a []string) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\n// Log\nfunc Log(name string, value interface{}) {\n\tfmt.Fprintf(os.Stderr, \"%s=%+v\\n\", name, value)\n}\n\n// Log format for standard error output\nfunc Logf(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\n}\n\nfunc intMin(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc intMax(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// direct calculation of combination\n// n, m should be \"small\"\nfunc combination(n, m int) int {\n\tif m > n {\n\t\treturn 0\n\t} else if m == n || m == 0 {\n\t\treturn 1\n\t} else {\n\t\tres := 1\n\t\tfor i := 0; i < m; i++ {\n\t\t\tres *= (n - i)\n\t\t}\n\t\tfor i := 1; i <= m; i++ {\n\t\t\tres /= i\n\t\t}\n\t\treturn res\n\t}\n}\n\n// caluclate combination modulo based on Lucas theorem\nfunc lucas(n, m, p int) int {\n\tntemp := n\n\tmtemp := m\n\tres := 1\n\tfor i := 0; i < 100; i++ {\n\t\t// fmt.Printf(\"ntemp: %d\\n\", ntemp)\n\t\tnreminder := ntemp % p\n\t\tntemp = ntemp / p\n\t\tmreminder := mtemp % p\n\t\tmtemp = mtemp / p\n\t\tres = res * (combination(nreminder, mreminder) % p)\n\t\tif ntemp == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn res % p\n}\n\nfunc combMod(n, m, p int) int {\n\treturn lucas(n, m, p)\n}\n\n// BFS/DFS\n//\n// visited := []int{}\n// dfs(1, neighbor, func(node int) {\n// \tvisited = append(visited, node)\n// })\n// fmt.Println(visited)\n\nfunc bfs(start int, nodes map[int][]int, fn func(int)) {\n\tfrontier := []int{start}\n\tvisited := map[int]bool{}\n\tnext := []int{}\n\n\tfor 0 < len(frontier) {\n\t\tnext = []int{}\n\t\tfor _, node := range frontier {\n\t\t\tvisited[node] = true\n\t\t\tfn(node)\n\t\t\tfor _, n := range bfs_frontier(node, nodes, visited) {\n\t\t\t\tnext = append(next, n)\n\t\t\t}\n\t\t}\n\t\tfrontier = next\n\t}\n}\n\nfunc bfs_frontier(node int, nodes map[int][]int, visited map[int]bool) []int {\n\tnext := []int{}\n\titer := func(n int) bool { _, ok := visited[n]; return !ok }\n\tfor _, n := range nodes[node] {\n\t\tif iter(n) {\n\t\t\tnext = append(next, n)\n\t\t}\n\t}\n\treturn next\n}\n\nfunc dfs(node int, nodes map[int][]int, fn func(int)) {\n\tdfs_recur(node, nodes, map[int]bool{}, fn)\n}\n\nfunc dfs_recur(node int, nodes map[int][]int, v map[int]bool, fn func(int)) {\n\tv[node] = true\n\tfn(node)\n\tfor _, n := range nodes[node] {\n\t\tif _, ok := v[n]; !ok {\n\t\t\tdfs_recur(n, nodes, v, fn)\n\t\t}\n\t}\n}\n\n// handles 2 function, one is before entering child tree, and another is\n// after entering child tree.\nfunc dfs2(node int, nodes map[int][]int, fn1, fn2 func(int, int)) {\n\tdfs2_recur(node, -1, nodes, map[int]bool{}, fn1, fn2)\n}\n\nfunc dfs2_recur(node, parent int, nodes map[int][]int, v map[int]bool, fn1, fn2 func(int, int)) {\n\tv[node] = true\n\tfn1(node, parent)\n\tfor _, n := range nodes[node] {\n\t\tif _, ok := v[n]; !ok {\n\t\t\tdfs2_recur(n, node, nodes, v, fn1, fn2)\n\t\t}\n\t}\n\tfn2(node, parent)\n}\n\n// Stack data structure\ntype Stack struct {\n\ttop *Element\n\tsize int\n}\n\ntype Element struct {\n\tvalue interface{}\n\tnext *Element\n}\n\nfunc (s *Stack) Len() int {\n\treturn s.size\n}\n\nfunc (s *Stack) Push(value interface{}) {\n\ts.top = &Element{value, s.top}\n\ts.size++\n}\n\nfunc (s *Stack) Pop() (value interface{}) {\n\tif s.size > 0 {\n\t\tvalue, s.top = s.top.value, s.top.next\n\t\ts.size--\n\t\treturn\n\t}\n\treturn nil\n}\n\n// powerInt (use math.Pow() for float parameters)\nfunc powerInt(n, p int) int {\n\ttmp := 1\n\tfor i := 0; i < n; i++ {\n\t\ttmp *= p\n\t}\n\treturn tmp\n}\n\nfunc findDivisors(n int, a *[]int) {\n\tif n == 1 {\n\t\treturn\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n%i == 0 {\n\t\t\t*a = append(*a, i)\n\t\t\t*a = append(*a, n/i)\n\t\t}\n\t}\n\t*a = append(*a, n)\n}\n\nfunc removeDuplicate(a []int) []int {\n\tm := make(map[int]bool)\n\tfor i := 0; i < len(a); i++ {\n\t\tm[a[i]] = true\n\t}\n\tres := []int{}\n\tfor i, _ := range m {\n\t\tres = append(res, i)\n\t}\n\treturn res\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a string S of length N consisting of R, G, and B.\n\nFind the number of triples (i,~j,~k)~(1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nS_i \\neq S_j, S_i \\neq S_k, and S_j \\neq S_k.\n\nj - i \\neq k - j.\n\nConstraints\n\n1 \\leq N \\leq 4000\n\nS is a string of length N consisting of R, G, and B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of triplets in question.\n\nSample Input 1\n\n4\nRRGB\n\nSample Output 1\n\n1\n\nOnly the triplet (1,~3,~4) satisfies both conditions. The triplet (2,~3,~4) satisfies the first condition but not the second, so it does not count.\n\nSample Input 2\n\n39\nRBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB\n\nSample Output 2\n\n1800", "sample_input": "4\nRRGB\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02714", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a string S of length N consisting of R, G, and B.\n\nFind the number of triples (i,~j,~k)~(1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nS_i \\neq S_j, S_i \\neq S_k, and S_j \\neq S_k.\n\nj - i \\neq k - j.\n\nConstraints\n\n1 \\leq N \\leq 4000\n\nS is a string of length N consisting of R, G, and B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of triplets in question.\n\nSample Input 1\n\n4\nRRGB\n\nSample Output 1\n\n1\n\nOnly the triplet (1,~3,~4) satisfies both conditions. The triplet (2,~3,~4) satisfies the first condition but not the second, so it does not count.\n\nSample Input 2\n\n39\nRBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB\n\nSample Output 2\n\n1800", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 9374, "cpu_time_ms": 150, "memory_kb": 4376}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s212376820", "group_id": "codeNet:p02714", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tvar s string\n\tfmt.Scan(&n, &s)\n\n\tcs := make(map[byte][]int)\n\tcs['R'] = make([]int, n+1)\n\tcs['G'] = make([]int, n+1)\n\tcs['B'] = make([]int, n+1)\n\tfor i := 0; i < n; i++ {\n\t\tc := s[i]\n\n\t\tcs['R'][i+1] = cs['R'][i]\n\t\tcs['G'][i+1] = cs['G'][i]\n\t\tcs['B'][i+1] = cs['B'][i]\n\n\t\tcs[c][i+1]++\n\t}\n\n\tans := 0\n\tfor i := 0; i < n-2; i++ {\n\t\trgb := map[byte]int{'R': 0, 'G': 0, 'B': 0}\n\t\trgb[s[i]]++\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\tif s[i] == s[j] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\trgb[s[j]]++\n\n\t\t\tt := byte('@')\n\t\t\tif rgb['R'] == 0 {\n\t\t\t\tt = 'R'\n\t\t\t} else if rgb['G'] == 0 {\n\t\t\t\tt = 'G'\n\t\t\t} else {\n\t\t\t\tt = 'B'\n\t\t\t}\n\n\t\t\tcc := cs[t]\n\t\t\tcnt := cc[n] - cc[j]\n\t\t\td := j - i\n\t\t\tif j+d < n {\n\t\t\t\tif s[j+d] == t {\n\t\t\t\t\tcnt--\n\t\t\t\t}\n\t\t\t}\n\t\t\tans += cnt\n\n\t\t\trgb[s[j]]--\n\t\t}\n\t\trgb[s[i]]--\n\t}\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1586744007, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02714.html", "problem_id": "p02714", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02714/input.txt", "sample_output_relpath": "derived/input_output/data/p02714/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02714/Go/s212376820.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s212376820", "user_id": "u902409225"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tvar s string\n\tfmt.Scan(&n, &s)\n\n\tcs := make(map[byte][]int)\n\tcs['R'] = make([]int, n+1)\n\tcs['G'] = make([]int, n+1)\n\tcs['B'] = make([]int, n+1)\n\tfor i := 0; i < n; i++ {\n\t\tc := s[i]\n\n\t\tcs['R'][i+1] = cs['R'][i]\n\t\tcs['G'][i+1] = cs['G'][i]\n\t\tcs['B'][i+1] = cs['B'][i]\n\n\t\tcs[c][i+1]++\n\t}\n\n\tans := 0\n\tfor i := 0; i < n-2; i++ {\n\t\trgb := map[byte]int{'R': 0, 'G': 0, 'B': 0}\n\t\trgb[s[i]]++\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\tif s[i] == s[j] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\trgb[s[j]]++\n\n\t\t\tt := byte('@')\n\t\t\tif rgb['R'] == 0 {\n\t\t\t\tt = 'R'\n\t\t\t} else if rgb['G'] == 0 {\n\t\t\t\tt = 'G'\n\t\t\t} else {\n\t\t\t\tt = 'B'\n\t\t\t}\n\n\t\t\tcc := cs[t]\n\t\t\tcnt := cc[n] - cc[j]\n\t\t\td := j - i\n\t\t\tif j+d < n {\n\t\t\t\tif s[j+d] == t {\n\t\t\t\t\tcnt--\n\t\t\t\t}\n\t\t\t}\n\t\t\tans += cnt\n\n\t\t\trgb[s[j]]--\n\t\t}\n\t\trgb[s[i]]--\n\t}\n\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a string S of length N consisting of R, G, and B.\n\nFind the number of triples (i,~j,~k)~(1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nS_i \\neq S_j, S_i \\neq S_k, and S_j \\neq S_k.\n\nj - i \\neq k - j.\n\nConstraints\n\n1 \\leq N \\leq 4000\n\nS is a string of length N consisting of R, G, and B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of triplets in question.\n\nSample Input 1\n\n4\nRRGB\n\nSample Output 1\n\n1\n\nOnly the triplet (1,~3,~4) satisfies both conditions. The triplet (2,~3,~4) satisfies the first condition but not the second, so it does not count.\n\nSample Input 2\n\n39\nRBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB\n\nSample Output 2\n\n1800", "sample_input": "4\nRRGB\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02714", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a string S of length N consisting of R, G, and B.\n\nFind the number of triples (i,~j,~k)~(1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nS_i \\neq S_j, S_i \\neq S_k, and S_j \\neq S_k.\n\nj - i \\neq k - j.\n\nConstraints\n\n1 \\leq N \\leq 4000\n\nS is a string of length N consisting of R, G, and B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of triplets in question.\n\nSample Input 1\n\n4\nRRGB\n\nSample Output 1\n\n1\n\nOnly the triplet (1,~3,~4) satisfies both conditions. The triplet (2,~3,~4) satisfies the first condition but not the second, so it does not count.\n\nSample Input 2\n\n39\nRBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB\n\nSample Output 2\n\n1800", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 832, "cpu_time_ms": 546, "memory_kb": 1992}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s184536586", "group_id": "codeNet:p02714", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar s string\n\tfmt.Scan(&s)\n\tfmt.Println(Calc(s))\n}\n\nfunc Calc(s string) int {\n\tvar sum int\n\tn := len(s)\n\tfor i := 0; i <= n-3; i++ {\n\t\tfor j := i + 1; j <= n-2; j++ {\n\t\t\tfor k := j + 1; k <= n-1; k++ {\n\t\t\t\tif s[i] != s[j] && s[i] != s[k] && s[j] != s[k] && j-i != k-j {\n\t\t\t\t\tsum++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn sum\n}\n", "language": "Go", "metadata": {"date": 1586742785, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02714.html", "problem_id": "p02714", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02714/input.txt", "sample_output_relpath": "derived/input_output/data/p02714/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02714/Go/s184536586.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s184536586", "user_id": "u333649441"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar s string\n\tfmt.Scan(&s)\n\tfmt.Println(Calc(s))\n}\n\nfunc Calc(s string) int {\n\tvar sum int\n\tn := len(s)\n\tfor i := 0; i <= n-3; i++ {\n\t\tfor j := i + 1; j <= n-2; j++ {\n\t\t\tfor k := j + 1; k <= n-1; k++ {\n\t\t\t\tif s[i] != s[j] && s[i] != s[k] && s[j] != s[k] && j-i != k-j {\n\t\t\t\t\tsum++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn sum\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a string S of length N consisting of R, G, and B.\n\nFind the number of triples (i,~j,~k)~(1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nS_i \\neq S_j, S_i \\neq S_k, and S_j \\neq S_k.\n\nj - i \\neq k - j.\n\nConstraints\n\n1 \\leq N \\leq 4000\n\nS is a string of length N consisting of R, G, and B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of triplets in question.\n\nSample Input 1\n\n4\nRRGB\n\nSample Output 1\n\n1\n\nOnly the triplet (1,~3,~4) satisfies both conditions. The triplet (2,~3,~4) satisfies the first condition but not the second, so it does not count.\n\nSample Input 2\n\n39\nRBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB\n\nSample Output 2\n\n1800", "sample_input": "4\nRRGB\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02714", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a string S of length N consisting of R, G, and B.\n\nFind the number of triples (i,~j,~k)~(1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nS_i \\neq S_j, S_i \\neq S_k, and S_j \\neq S_k.\n\nj - i \\neq k - j.\n\nConstraints\n\n1 \\leq N \\leq 4000\n\nS is a string of length N consisting of R, G, and B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of triplets in question.\n\nSample Input 1\n\n4\nRRGB\n\nSample Output 1\n\n1\n\nOnly the triplet (1,~3,~4) satisfies both conditions. The triplet (2,~3,~4) satisfies the first condition but not the second, so it does not count.\n\nSample Input 2\n\n39\nRBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB\n\nSample Output 2\n\n1800", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2205, "memory_kb": 1820}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s017864667", "group_id": "codeNet:p02714", "input_text": "package main\n\nimport \"fmt\"\n\ntype key struct {\n\tTo int\n\tColor rune\n}\n\nfunc color3(c1, c2 rune) rune {\n\tif c1 == 'R' && c2 == 'G' {\n\t\treturn 'B'\n\t}\n\tif c1 == 'R' && c2 == 'B' {\n\t\treturn 'G'\n\t}\n\tif c1 == 'G' && c2 == 'B' {\n\t\treturn 'R'\n\t}\n\tif c1 == 'G' && c2 == 'R' {\n\t\treturn 'B'\n\t}\n\tif c1 == 'B' && c2 == 'R' {\n\t\treturn 'G'\n\t}\n\tif c1 == 'B' && c2 == 'G' {\n\t\treturn 'R'\n\t}\n\treturn ' '\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar s string\n\tfmt.Scan(&s)\n\n\tcount := make(map[key]int)\n\tfor i, c := range s {\n\t\tif c == 'R' {\n\t\t\tcount[key{i, 'R'}] = count[key{i - 1, 'R'}] + 1\n\t\t\tcount[key{i, 'G'}] = count[key{i - 1, 'G'}]\n\t\t\tcount[key{i, 'B'}] = count[key{i - 1, 'B'}]\n\t\t} else if c == 'G' {\n\t\t\tcount[key{i, 'R'}] = count[key{i - 1, 'R'}]\n\t\t\tcount[key{i, 'G'}] = count[key{i - 1, 'G'}] + 1\n\t\t\tcount[key{i, 'B'}] = count[key{i - 1, 'B'}]\n\t\t} else {\n\t\t\tcount[key{i, 'R'}] = count[key{i - 1, 'R'}]\n\t\t\tcount[key{i, 'G'}] = count[key{i - 1, 'G'}]\n\t\t\tcount[key{i, 'B'}] = count[key{i - 1, 'B'}] + 1\n\t\t}\n\t}\n\n\tsum := 0\n\tfor i := 0; i <= n-3; i++ {\n\t\tci := s[i]\n\t\tfor j := i; j <= n-2; j++ {\n\t\t\tcj := s[j]\n\t\t\tif ci == cj {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tck := color3(rune(ci), rune(cj))\n\t\t\tcnt := count[key{len(s) - 1, ck}] - count[key{j, ck}]\n\t\t\tdiff := j - i\n\t\t\tif j+diff <= n-1 && rune(s[j+diff]) == ck {\n\t\t\t\tcnt--\n\t\t\t}\n\t\t\tsum += cnt\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n", "language": "Go", "metadata": {"date": 1586742559, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02714.html", "problem_id": "p02714", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02714/input.txt", "sample_output_relpath": "derived/input_output/data/p02714/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02714/Go/s017864667.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s017864667", "user_id": "u275316733"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\ntype key struct {\n\tTo int\n\tColor rune\n}\n\nfunc color3(c1, c2 rune) rune {\n\tif c1 == 'R' && c2 == 'G' {\n\t\treturn 'B'\n\t}\n\tif c1 == 'R' && c2 == 'B' {\n\t\treturn 'G'\n\t}\n\tif c1 == 'G' && c2 == 'B' {\n\t\treturn 'R'\n\t}\n\tif c1 == 'G' && c2 == 'R' {\n\t\treturn 'B'\n\t}\n\tif c1 == 'B' && c2 == 'R' {\n\t\treturn 'G'\n\t}\n\tif c1 == 'B' && c2 == 'G' {\n\t\treturn 'R'\n\t}\n\treturn ' '\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar s string\n\tfmt.Scan(&s)\n\n\tcount := make(map[key]int)\n\tfor i, c := range s {\n\t\tif c == 'R' {\n\t\t\tcount[key{i, 'R'}] = count[key{i - 1, 'R'}] + 1\n\t\t\tcount[key{i, 'G'}] = count[key{i - 1, 'G'}]\n\t\t\tcount[key{i, 'B'}] = count[key{i - 1, 'B'}]\n\t\t} else if c == 'G' {\n\t\t\tcount[key{i, 'R'}] = count[key{i - 1, 'R'}]\n\t\t\tcount[key{i, 'G'}] = count[key{i - 1, 'G'}] + 1\n\t\t\tcount[key{i, 'B'}] = count[key{i - 1, 'B'}]\n\t\t} else {\n\t\t\tcount[key{i, 'R'}] = count[key{i - 1, 'R'}]\n\t\t\tcount[key{i, 'G'}] = count[key{i - 1, 'G'}]\n\t\t\tcount[key{i, 'B'}] = count[key{i - 1, 'B'}] + 1\n\t\t}\n\t}\n\n\tsum := 0\n\tfor i := 0; i <= n-3; i++ {\n\t\tci := s[i]\n\t\tfor j := i; j <= n-2; j++ {\n\t\t\tcj := s[j]\n\t\t\tif ci == cj {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tck := color3(rune(ci), rune(cj))\n\t\t\tcnt := count[key{len(s) - 1, ck}] - count[key{j, ck}]\n\t\t\tdiff := j - i\n\t\t\tif j+diff <= n-1 && rune(s[j+diff]) == ck {\n\t\t\t\tcnt--\n\t\t\t}\n\t\t\tsum += cnt\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a string S of length N consisting of R, G, and B.\n\nFind the number of triples (i,~j,~k)~(1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nS_i \\neq S_j, S_i \\neq S_k, and S_j \\neq S_k.\n\nj - i \\neq k - j.\n\nConstraints\n\n1 \\leq N \\leq 4000\n\nS is a string of length N consisting of R, G, and B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of triplets in question.\n\nSample Input 1\n\n4\nRRGB\n\nSample Output 1\n\n1\n\nOnly the triplet (1,~3,~4) satisfies both conditions. The triplet (2,~3,~4) satisfies the first condition but not the second, so it does not count.\n\nSample Input 2\n\n39\nRBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB\n\nSample Output 2\n\n1800", "sample_input": "4\nRRGB\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02714", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a string S of length N consisting of R, G, and B.\n\nFind the number of triples (i,~j,~k)~(1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nS_i \\neq S_j, S_i \\neq S_k, and S_j \\neq S_k.\n\nj - i \\neq k - j.\n\nConstraints\n\n1 \\leq N \\leq 4000\n\nS is a string of length N consisting of R, G, and B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of triplets in question.\n\nSample Input 1\n\n4\nRRGB\n\nSample Output 1\n\n1\n\nOnly the triplet (1,~3,~4) satisfies both conditions. The triplet (2,~3,~4) satisfies the first condition but not the second, so it does not count.\n\nSample Input 2\n\n39\nRBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB\n\nSample Output 2\n\n1800", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1345, "cpu_time_ms": 417, "memory_kb": 2944}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s139906920", "group_id": "codeNet:p02714", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc solve(N int, s []byte) {\n\tans := 0\n\tfor i := N - 1; i >= 0; i-- {\n\t\tfor j := N - 1; j > i; j-- {\n\t\t\tif s[i] == s[j] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor k := N - 1; k > j; k-- {\n\t\t\t\tif s[i] == s[k] || s[j] == s[k] {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif j-i != k-j {\n\t\t\t\t\tans++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tout(ans)\n}\n\nfunc solve2(N int, s []byte) {\n\tans := 0\n\tfor i := 0; i < N; i++ {\n\t\tfor j := i + 1; j < N; j++ {\n\t\t\tif s[i] == s[j] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor k := j + 1; k < N; k++ {\n\t\t\t\tif s[i] == s[k] || s[j] == s[k] {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif j-i != k-j {\n\t\t\t\t\tans++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tout(ans)\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, 1000000)\n\n\tN := getInt()\n\ts := getString()\n\n\t// N := 4000\n\t// s := make([]byte, N)\n\t// for i := 0; i < N; i++ {\n\t// \tswitch i % 3 {\n\t// \tcase 0:\n\t// \t\ts[i] = 'R'\n\t// \tcase 1:\n\t// \t\ts[i] = 'G'\n\t// \tcase 2:\n\t// \t\ts[i] = 'B'\n\t// \t}\n\t// }\n\n\tsolve(N, []byte(s))\n\n}\n", "language": "Go", "metadata": {"date": 1586742072, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02714.html", "problem_id": "p02714", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02714/input.txt", "sample_output_relpath": "derived/input_output/data/p02714/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02714/Go/s139906920.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s139906920", "user_id": "u814575783"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc solve(N int, s []byte) {\n\tans := 0\n\tfor i := N - 1; i >= 0; i-- {\n\t\tfor j := N - 1; j > i; j-- {\n\t\t\tif s[i] == s[j] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor k := N - 1; k > j; k-- {\n\t\t\t\tif s[i] == s[k] || s[j] == s[k] {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif j-i != k-j {\n\t\t\t\t\tans++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tout(ans)\n}\n\nfunc solve2(N int, s []byte) {\n\tans := 0\n\tfor i := 0; i < N; i++ {\n\t\tfor j := i + 1; j < N; j++ {\n\t\t\tif s[i] == s[j] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor k := j + 1; k < N; k++ {\n\t\t\t\tif s[i] == s[k] || s[j] == s[k] {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif j-i != k-j {\n\t\t\t\t\tans++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tout(ans)\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, 1000000)\n\n\tN := getInt()\n\ts := getString()\n\n\t// N := 4000\n\t// s := make([]byte, N)\n\t// for i := 0; i < N; i++ {\n\t// \tswitch i % 3 {\n\t// \tcase 0:\n\t// \t\ts[i] = 'R'\n\t// \tcase 1:\n\t// \t\ts[i] = 'G'\n\t// \tcase 2:\n\t// \t\ts[i] = 'B'\n\t// \t}\n\t// }\n\n\tsolve(N, []byte(s))\n\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a string S of length N consisting of R, G, and B.\n\nFind the number of triples (i,~j,~k)~(1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nS_i \\neq S_j, S_i \\neq S_k, and S_j \\neq S_k.\n\nj - i \\neq k - j.\n\nConstraints\n\n1 \\leq N \\leq 4000\n\nS is a string of length N consisting of R, G, and B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of triplets in question.\n\nSample Input 1\n\n4\nRRGB\n\nSample Output 1\n\n1\n\nOnly the triplet (1,~3,~4) satisfies both conditions. The triplet (2,~3,~4) satisfies the first condition but not the second, so it does not count.\n\nSample Input 2\n\n39\nRBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB\n\nSample Output 2\n\n1800", "sample_input": "4\nRRGB\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02714", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a string S of length N consisting of R, G, and B.\n\nFind the number of triples (i,~j,~k)~(1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nS_i \\neq S_j, S_i \\neq S_k, and S_j \\neq S_k.\n\nj - i \\neq k - j.\n\nConstraints\n\n1 \\leq N \\leq 4000\n\nS is a string of length N consisting of R, G, and B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of triplets in question.\n\nSample Input 1\n\n4\nRRGB\n\nSample Output 1\n\n1\n\nOnly the triplet (1,~3,~4) satisfies both conditions. The triplet (2,~3,~4) satisfies the first condition but not the second, so it does not count.\n\nSample Input 2\n\n39\nRBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB\n\nSample Output 2\n\n1800", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1520, "cpu_time_ms": 2205, "memory_kb": 1784}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s540426324", "group_id": "codeNet:p02714", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tnum, _ := strconv.Atoi(scanString())\n\treturn num\n}\n\nfunc scanString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc main() {\n\tl := scanInt()\n\ts := scanString()\n\tcnt := 0\n\tfor i := 0; i < l; i++ {\n\t\tfor j := i + 1; j < l; j++ {\n\t\t\tif s[i] == s[j] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tk := strings.Replace(\"RGB\", string(s[i]), \"\", 1)\n\t\t\tk = strings.Replace(k, string(s[j]), \"\", 1)\n\t\t\tcnt += strings.Count(s[j+1:], k)\n\t\t\tif (2*j-i) <= (l-1) && k == string(s[2*j-i]) {\n\t\t\t\tcnt--\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(cnt)\n}\n", "language": "Go", "metadata": {"date": 1586741961, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02714.html", "problem_id": "p02714", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02714/input.txt", "sample_output_relpath": "derived/input_output/data/p02714/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02714/Go/s540426324.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s540426324", "user_id": "u315984289"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tnum, _ := strconv.Atoi(scanString())\n\treturn num\n}\n\nfunc scanString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc main() {\n\tl := scanInt()\n\ts := scanString()\n\tcnt := 0\n\tfor i := 0; i < l; i++ {\n\t\tfor j := i + 1; j < l; j++ {\n\t\t\tif s[i] == s[j] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tk := strings.Replace(\"RGB\", string(s[i]), \"\", 1)\n\t\t\tk = strings.Replace(k, string(s[j]), \"\", 1)\n\t\t\tcnt += strings.Count(s[j+1:], k)\n\t\t\tif (2*j-i) <= (l-1) && k == string(s[2*j-i]) {\n\t\t\t\tcnt--\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(cnt)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a string S of length N consisting of R, G, and B.\n\nFind the number of triples (i,~j,~k)~(1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nS_i \\neq S_j, S_i \\neq S_k, and S_j \\neq S_k.\n\nj - i \\neq k - j.\n\nConstraints\n\n1 \\leq N \\leq 4000\n\nS is a string of length N consisting of R, G, and B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of triplets in question.\n\nSample Input 1\n\n4\nRRGB\n\nSample Output 1\n\n1\n\nOnly the triplet (1,~3,~4) satisfies both conditions. The triplet (2,~3,~4) satisfies the first condition but not the second, so it does not count.\n\nSample Input 2\n\n39\nRBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB\n\nSample Output 2\n\n1800", "sample_input": "4\nRRGB\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02714", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a string S of length N consisting of R, G, and B.\n\nFind the number of triples (i,~j,~k)~(1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nS_i \\neq S_j, S_i \\neq S_k, and S_j \\neq S_k.\n\nj - i \\neq k - j.\n\nConstraints\n\n1 \\leq N \\leq 4000\n\nS is a string of length N consisting of R, G, and B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of triplets in question.\n\nSample Input 1\n\n4\nRRGB\n\nSample Output 1\n\n1\n\nOnly the triplet (1,~3,~4) satisfies both conditions. The triplet (2,~3,~4) satisfies the first condition but not the second, so it does not count.\n\nSample Input 2\n\n39\nRBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB\n\nSample Output 2\n\n1800", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 666, "cpu_time_ms": 936, "memory_kb": 6400}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s900479148", "group_id": "codeNet:p02714", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\n\tr.Split(sf)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\nfunc ReadInt2() (int, int) {\n\treturn int(readInt64()), int(readInt64())\n}\nfunc ReadInt3() (int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64())\n}\nfunc ReadInt4() (int, int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())\n}\n\n// ReadInt64 returns as integer as int64.\nfunc ReadInt64() int64 {\n\treturn readInt64()\n}\nfunc ReadInt64_2() (int64, int64) {\n\treturn readInt64(), readInt64()\n}\nfunc ReadInt64_3() (int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64()\n}\nfunc ReadInt64_4() (int64, int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64(), readInt64()\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadInt64Slice returns as int64 slice that has n integers.\nfunc ReadInt64Slice(n int) []int64 {\n\tb := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt64()\n\t}\n\treturn b\n}\n\n// ReadFloat64 returns an float64.\nfunc ReadFloat64() float64 {\n\treturn float64(readFloat64())\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(ReadString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// ReadFloatSlice returns an float64 slice that has n float64.\nfunc ReadFloat64Slice(n int) []float64 {\n\tb := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadFloat64()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n/*********** Debugging ***********/\n\n// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.\n// For debugging use.\nfunc ZeroPaddingRuneSlice(n, digitsNum int) []rune {\n\tsn := fmt.Sprintf(\"%b\", n)\n\n\tresidualLength := digitsNum - len(sn)\n\tif residualLength <= 0 {\n\t\treturn []rune(sn)\n\t}\n\n\tzeros := make([]rune, residualLength)\n\tfor i := 0; i < len(zeros); i++ {\n\t\tzeros[i] = '0'\n\t}\n\n\tres := []rune{}\n\tres = append(res, zeros...)\n\tres = append(res, []rune(sn)...)\n\n\treturn res\n}\n\n// Strtoi is a wrapper of strconv.Atoi().\n// If strconv.Atoi() returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintIntsLine(A ...int) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.Itoa(A[i])\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintInts64Line(A ...int64) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.FormatInt(A[i], 10) // 64bit int version\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)\nfunc PrintfDebug(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\n}\n\n// PrintfBufStdout is function for output strings to buffered os.Stdout.\n// You may have to call stdout.Flush() finally.\nfunc PrintfBufStdout(format string, a ...interface{}) {\n\tfmt.Fprintf(stdout, format, a...)\n}\n\n/********** FAU standard libraries **********/\n\n//fmt.Sprintf(\"%b\\n\", 255) \t// binary expression\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := ZeroPaddingRuneSlice(num, 32)\n//str := PrintIntsLine(X...)\n\n/*\nASCII code\n\nASCII 10進数 ASCII 10進数 ASCII 10進数\n! 33 \" 34 # 35\n$ 36 % 37 & 38\n' 39 ( 40 ) 41\n* 42 + 43 , 44\n- 45 . 46 / 47\n0 48 1 49 2 50\n3 51 4 52 5 53\n6 54 7 55 8 56\n9 57 : 58 ; 59\n< 60 = 61 > 62\n? 63 @ 64 A 65\nB 66 C 67 D 68\nE 69 F 70 G 71\nH 72 I 73 J 74\nK 75 L 76 M 77\nN 78 O 79 P 80\nQ 81 R 82 S 83\nT 84 U 85 V 86\nW 87 X 88 Y 89\nZ 90 [ 91 \\ 92\n] 93 ^ 94 _ 95\n` 96 a 97 b 98\nc 99 d 100 e 101\nf 102 g 103 h 104\ni 105 j 106 k 107\nl 108 m 109 n 110\no 111 p 112 q 113\nr 114 s 115 t 116\nu 117 v 118 w 119\nx 120 y 121 z 122\n{ 123 | 124 } 125\n~ 126 127\n*/\n\n/*******************************************************************/\n\nconst (\n\t// General purpose\n\tMOD = 1000000000 + 7\n\tALPHABET_NUM = 26\n\tINF_INT64 = math.MaxInt64\n\tINF_BIT60 = 1 << 60\n\tINF_INT32 = math.MaxInt32\n\tINF_BIT30 = 1 << 30\n\tNIL = -1\n\n\t// for dijkstra, prim, and so on\n\tWHITE = 0\n\tGRAY = 1\n\tBLACK = 2\n)\n\nfunc init() {\n\tReadString = newReadString(os.Stdin, bufio.ScanWords)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nvar (\n\tn int\n\tS []rune\n\n\tR, G, B []int\n\tRS, GS, BS []int\n)\n\nfunc main() {\n\tn = ReadInt()\n\tS = ReadRuneSlice()\n\tR, G, B = make([]int, n+1), make([]int, n+1), make([]int, n+1)\n\tRS, GS, BS = make([]int, n+1), make([]int, n+1), make([]int, n+1)\n\n\tif n <= 3 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tif S[i] == 'R' {\n\t\t\tR[i]++\n\t\t} else if S[i] == 'G' {\n\t\t\tG[i]++\n\t\t} else {\n\t\t\tB[i]++\n\t\t}\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tRS[i+1] = RS[i] + R[i]\n\t\tGS[i+1] = GS[i] + G[i]\n\t\tBS[i+1] = BS[i] + B[i]\n\t}\n\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tif S[i] == 'R' {\n\t\t\tbefG, aftB := GS[i], BS[n]-BS[i+1]\n\t\t\tbefB, aftG := BS[i], GS[n]-GS[i+1]\n\t\t\tsum := befG*aftB + befB*aftG\n\n\t\t\tfor j := 1; ; j++ {\n\t\t\t\tif i-j < 0 || i+j >= n {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\tbefore, after := S[i-j], S[i+j]\n\t\t\t\tif (before == 'G' && after == 'B') || (before == 'B' && after == 'G') {\n\t\t\t\t\tsum--\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tans += sum\n\t\t} else if S[i] == 'G' {\n\t\t\tbefR, aftB := RS[i], BS[n]-BS[i+1]\n\t\t\tbefB, aftR := BS[i], RS[n]-RS[i+1]\n\t\t\tsum := befR*aftB + befB*aftR\n\n\t\t\tfor j := 1; ; j++ {\n\t\t\t\tif i-j < 0 || i+j >= n {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\tbefore, after := S[i-j], S[i+j]\n\t\t\t\tif (before == 'R' && after == 'B') || (before == 'B' && after == 'R') {\n\t\t\t\t\tsum--\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tans += sum\n\t\t} else {\n\t\t\t// 'B'\n\t\t\tbefR, aftG := RS[i], GS[n]-GS[i+1]\n\t\t\tbefG, aftR := GS[i], RS[n]-RS[i+1]\n\t\t\tsum := befR*aftG + befG*aftR\n\n\t\t\tfor j := 1; ; j++ {\n\t\t\t\tif i-j < 0 || i+j >= n {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\tbefore, after := S[i-j], S[i+j]\n\t\t\t\tif (before == 'R' && after == 'G') || (before == 'G' && after == 'R') {\n\t\t\t\t\tsum--\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tans += sum\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\n/*\n- まずは全探索を検討しましょう\n- MODは最後にとりましたか?\n- 負のMODはちゃんと関数を使って処理していますか?\n- ループを抜けた後も処理が必要じゃありませんか?\n- 和・積・あまりを求められたらint64が必要ではありませんか?\n- いきなりオーバーフローはしていませんか?\n- MOD取る系はint64必須ですよ?\n- 後ろ・逆・ゴールから考えましたか?\n- 3者のうち真ん中に着目しましたか?\n*/\n\n/*******************************************************************/\n", "language": "Go", "metadata": {"date": 1586741071, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02714.html", "problem_id": "p02714", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02714/input.txt", "sample_output_relpath": "derived/input_output/data/p02714/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02714/Go/s900479148.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s900479148", "user_id": "u103600314"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\n\tr.Split(sf)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\nfunc ReadInt2() (int, int) {\n\treturn int(readInt64()), int(readInt64())\n}\nfunc ReadInt3() (int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64())\n}\nfunc ReadInt4() (int, int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())\n}\n\n// ReadInt64 returns as integer as int64.\nfunc ReadInt64() int64 {\n\treturn readInt64()\n}\nfunc ReadInt64_2() (int64, int64) {\n\treturn readInt64(), readInt64()\n}\nfunc ReadInt64_3() (int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64()\n}\nfunc ReadInt64_4() (int64, int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64(), readInt64()\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadInt64Slice returns as int64 slice that has n integers.\nfunc ReadInt64Slice(n int) []int64 {\n\tb := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt64()\n\t}\n\treturn b\n}\n\n// ReadFloat64 returns an float64.\nfunc ReadFloat64() float64 {\n\treturn float64(readFloat64())\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(ReadString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// ReadFloatSlice returns an float64 slice that has n float64.\nfunc ReadFloat64Slice(n int) []float64 {\n\tb := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadFloat64()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n/*********** Debugging ***********/\n\n// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.\n// For debugging use.\nfunc ZeroPaddingRuneSlice(n, digitsNum int) []rune {\n\tsn := fmt.Sprintf(\"%b\", n)\n\n\tresidualLength := digitsNum - len(sn)\n\tif residualLength <= 0 {\n\t\treturn []rune(sn)\n\t}\n\n\tzeros := make([]rune, residualLength)\n\tfor i := 0; i < len(zeros); i++ {\n\t\tzeros[i] = '0'\n\t}\n\n\tres := []rune{}\n\tres = append(res, zeros...)\n\tres = append(res, []rune(sn)...)\n\n\treturn res\n}\n\n// Strtoi is a wrapper of strconv.Atoi().\n// If strconv.Atoi() returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintIntsLine(A ...int) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.Itoa(A[i])\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintInts64Line(A ...int64) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.FormatInt(A[i], 10) // 64bit int version\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)\nfunc PrintfDebug(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\n}\n\n// PrintfBufStdout is function for output strings to buffered os.Stdout.\n// You may have to call stdout.Flush() finally.\nfunc PrintfBufStdout(format string, a ...interface{}) {\n\tfmt.Fprintf(stdout, format, a...)\n}\n\n/********** FAU standard libraries **********/\n\n//fmt.Sprintf(\"%b\\n\", 255) \t// binary expression\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := ZeroPaddingRuneSlice(num, 32)\n//str := PrintIntsLine(X...)\n\n/*\nASCII code\n\nASCII 10進数 ASCII 10進数 ASCII 10進数\n! 33 \" 34 # 35\n$ 36 % 37 & 38\n' 39 ( 40 ) 41\n* 42 + 43 , 44\n- 45 . 46 / 47\n0 48 1 49 2 50\n3 51 4 52 5 53\n6 54 7 55 8 56\n9 57 : 58 ; 59\n< 60 = 61 > 62\n? 63 @ 64 A 65\nB 66 C 67 D 68\nE 69 F 70 G 71\nH 72 I 73 J 74\nK 75 L 76 M 77\nN 78 O 79 P 80\nQ 81 R 82 S 83\nT 84 U 85 V 86\nW 87 X 88 Y 89\nZ 90 [ 91 \\ 92\n] 93 ^ 94 _ 95\n` 96 a 97 b 98\nc 99 d 100 e 101\nf 102 g 103 h 104\ni 105 j 106 k 107\nl 108 m 109 n 110\no 111 p 112 q 113\nr 114 s 115 t 116\nu 117 v 118 w 119\nx 120 y 121 z 122\n{ 123 | 124 } 125\n~ 126 127\n*/\n\n/*******************************************************************/\n\nconst (\n\t// General purpose\n\tMOD = 1000000000 + 7\n\tALPHABET_NUM = 26\n\tINF_INT64 = math.MaxInt64\n\tINF_BIT60 = 1 << 60\n\tINF_INT32 = math.MaxInt32\n\tINF_BIT30 = 1 << 30\n\tNIL = -1\n\n\t// for dijkstra, prim, and so on\n\tWHITE = 0\n\tGRAY = 1\n\tBLACK = 2\n)\n\nfunc init() {\n\tReadString = newReadString(os.Stdin, bufio.ScanWords)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nvar (\n\tn int\n\tS []rune\n\n\tR, G, B []int\n\tRS, GS, BS []int\n)\n\nfunc main() {\n\tn = ReadInt()\n\tS = ReadRuneSlice()\n\tR, G, B = make([]int, n+1), make([]int, n+1), make([]int, n+1)\n\tRS, GS, BS = make([]int, n+1), make([]int, n+1), make([]int, n+1)\n\n\tif n <= 3 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tif S[i] == 'R' {\n\t\t\tR[i]++\n\t\t} else if S[i] == 'G' {\n\t\t\tG[i]++\n\t\t} else {\n\t\t\tB[i]++\n\t\t}\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tRS[i+1] = RS[i] + R[i]\n\t\tGS[i+1] = GS[i] + G[i]\n\t\tBS[i+1] = BS[i] + B[i]\n\t}\n\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tif S[i] == 'R' {\n\t\t\tbefG, aftB := GS[i], BS[n]-BS[i+1]\n\t\t\tbefB, aftG := BS[i], GS[n]-GS[i+1]\n\t\t\tsum := befG*aftB + befB*aftG\n\n\t\t\tfor j := 1; ; j++ {\n\t\t\t\tif i-j < 0 || i+j >= n {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\tbefore, after := S[i-j], S[i+j]\n\t\t\t\tif (before == 'G' && after == 'B') || (before == 'B' && after == 'G') {\n\t\t\t\t\tsum--\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tans += sum\n\t\t} else if S[i] == 'G' {\n\t\t\tbefR, aftB := RS[i], BS[n]-BS[i+1]\n\t\t\tbefB, aftR := BS[i], RS[n]-RS[i+1]\n\t\t\tsum := befR*aftB + befB*aftR\n\n\t\t\tfor j := 1; ; j++ {\n\t\t\t\tif i-j < 0 || i+j >= n {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\tbefore, after := S[i-j], S[i+j]\n\t\t\t\tif (before == 'R' && after == 'B') || (before == 'B' && after == 'R') {\n\t\t\t\t\tsum--\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tans += sum\n\t\t} else {\n\t\t\t// 'B'\n\t\t\tbefR, aftG := RS[i], GS[n]-GS[i+1]\n\t\t\tbefG, aftR := GS[i], RS[n]-RS[i+1]\n\t\t\tsum := befR*aftG + befG*aftR\n\n\t\t\tfor j := 1; ; j++ {\n\t\t\t\tif i-j < 0 || i+j >= n {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\n\t\t\t\tbefore, after := S[i-j], S[i+j]\n\t\t\t\tif (before == 'R' && after == 'G') || (before == 'G' && after == 'R') {\n\t\t\t\t\tsum--\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tans += sum\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\n/*\n- まずは全探索を検討しましょう\n- MODは最後にとりましたか?\n- 負のMODはちゃんと関数を使って処理していますか?\n- ループを抜けた後も処理が必要じゃありませんか?\n- 和・積・あまりを求められたらint64が必要ではありませんか?\n- いきなりオーバーフローはしていませんか?\n- MOD取る系はint64必須ですよ?\n- 後ろ・逆・ゴールから考えましたか?\n- 3者のうち真ん中に着目しましたか?\n*/\n\n/*******************************************************************/\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a string S of length N consisting of R, G, and B.\n\nFind the number of triples (i,~j,~k)~(1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nS_i \\neq S_j, S_i \\neq S_k, and S_j \\neq S_k.\n\nj - i \\neq k - j.\n\nConstraints\n\n1 \\leq N \\leq 4000\n\nS is a string of length N consisting of R, G, and B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of triplets in question.\n\nSample Input 1\n\n4\nRRGB\n\nSample Output 1\n\n1\n\nOnly the triplet (1,~3,~4) satisfies both conditions. The triplet (2,~3,~4) satisfies the first condition but not the second, so it does not count.\n\nSample Input 2\n\n39\nRBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB\n\nSample Output 2\n\n1800", "sample_input": "4\nRRGB\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02714", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a string S of length N consisting of R, G, and B.\n\nFind the number of triples (i,~j,~k)~(1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nS_i \\neq S_j, S_i \\neq S_k, and S_j \\neq S_k.\n\nj - i \\neq k - j.\n\nConstraints\n\n1 \\leq N \\leq 4000\n\nS is a string of length N consisting of R, G, and B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of triplets in question.\n\nSample Input 1\n\n4\nRRGB\n\nSample Output 1\n\n1\n\nOnly the triplet (1,~3,~4) satisfies both conditions. The triplet (2,~3,~4) satisfies the first condition but not the second, so it does not count.\n\nSample Input 2\n\n39\nRBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB\n\nSample Output 2\n\n1800", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 8462, "cpu_time_ms": 41, "memory_kb": 1996}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s950979391", "group_id": "codeNet:p02714", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N int\n\tvar S string\n\n\tfmt.Scan(&N, &S)\n\tR := make(map[int]struct{})\n\tG := make(map[int]struct{})\n\tB := make(map[int]struct{})\n\n\tfor idx, c := range S {\n\t\tif c == 'R' {\n\t\t\tR[idx] = struct{}{}\n\t\t} else if c == 'G' {\n\t\t\tG[idx] = struct{}{}\n\t\t} else {\n\t\t\tB[idx] = struct{}{}\n\t\t}\n\t}\n\n\tans := 0\n\tfor r, _ := range R {\n\t\tfor g, _ := range G {\n\t\t\tfor b, _ := range B {\n\t\t\t\ti, j, k := po(r, g, b)\n\t\t\t\tif j-i != k-j {\n\t\t\t\t\tans++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc po(a, b, c int) (i, j, k int) {\n\tif a < b && a < c {\n\t\ti = a\n\t\tif b < c {\n\t\t\tj = b\n\t\t\tk = c\n\t\t} else {\n\t\t\tj = c\n\t\t\tk = b\n\t\t}\n\t} else if b < a && b < c {\n\t\ti = b\n\t\tif a < c {\n\t\t\tj = a\n\t\t\tk = c\n\t\t} else {\n\t\t\tj = c\n\t\t\tk = a\n\t\t}\n\t} else {\n\t\ti = c\n\t\tif a < b {\n\t\t\tj = a\n\t\t\tk = b\n\t\t} else {\n\t\t\tj = b\n\t\t\tk = a\n\t\t}\n\t}\n\treturn\n}\n", "language": "Go", "metadata": {"date": 1586740747, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02714.html", "problem_id": "p02714", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02714/input.txt", "sample_output_relpath": "derived/input_output/data/p02714/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02714/Go/s950979391.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s950979391", "user_id": "u061935128"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N int\n\tvar S string\n\n\tfmt.Scan(&N, &S)\n\tR := make(map[int]struct{})\n\tG := make(map[int]struct{})\n\tB := make(map[int]struct{})\n\n\tfor idx, c := range S {\n\t\tif c == 'R' {\n\t\t\tR[idx] = struct{}{}\n\t\t} else if c == 'G' {\n\t\t\tG[idx] = struct{}{}\n\t\t} else {\n\t\t\tB[idx] = struct{}{}\n\t\t}\n\t}\n\n\tans := 0\n\tfor r, _ := range R {\n\t\tfor g, _ := range G {\n\t\t\tfor b, _ := range B {\n\t\t\t\ti, j, k := po(r, g, b)\n\t\t\t\tif j-i != k-j {\n\t\t\t\t\tans++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc po(a, b, c int) (i, j, k int) {\n\tif a < b && a < c {\n\t\ti = a\n\t\tif b < c {\n\t\t\tj = b\n\t\t\tk = c\n\t\t} else {\n\t\t\tj = c\n\t\t\tk = b\n\t\t}\n\t} else if b < a && b < c {\n\t\ti = b\n\t\tif a < c {\n\t\t\tj = a\n\t\t\tk = c\n\t\t} else {\n\t\t\tj = c\n\t\t\tk = a\n\t\t}\n\t} else {\n\t\ti = c\n\t\tif a < b {\n\t\t\tj = a\n\t\t\tk = b\n\t\t} else {\n\t\t\tj = b\n\t\t\tk = a\n\t\t}\n\t}\n\treturn\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a string S of length N consisting of R, G, and B.\n\nFind the number of triples (i,~j,~k)~(1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nS_i \\neq S_j, S_i \\neq S_k, and S_j \\neq S_k.\n\nj - i \\neq k - j.\n\nConstraints\n\n1 \\leq N \\leq 4000\n\nS is a string of length N consisting of R, G, and B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of triplets in question.\n\nSample Input 1\n\n4\nRRGB\n\nSample Output 1\n\n1\n\nOnly the triplet (1,~3,~4) satisfies both conditions. The triplet (2,~3,~4) satisfies the first condition but not the second, so it does not count.\n\nSample Input 2\n\n39\nRBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB\n\nSample Output 2\n\n1800", "sample_input": "4\nRRGB\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02714", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a string S of length N consisting of R, G, and B.\n\nFind the number of triples (i,~j,~k)~(1 \\leq i < j < k \\leq N) that satisfy both of the following conditions:\n\nS_i \\neq S_j, S_i \\neq S_k, and S_j \\neq S_k.\n\nj - i \\neq k - j.\n\nConstraints\n\n1 \\leq N \\leq 4000\n\nS is a string of length N consisting of R, G, and B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of triplets in question.\n\nSample Input 1\n\n4\nRRGB\n\nSample Output 1\n\n1\n\nOnly the triplet (1,~3,~4) satisfies both conditions. The triplet (2,~3,~4) satisfies the first condition but not the second, so it does not count.\n\nSample Input 2\n\n39\nRBRBGRBGGBBRRGBBRRRBGGBRBGBRBGBRBBBGBBB\n\nSample Output 2\n\n1800", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 830, "cpu_time_ms": 2205, "memory_kb": 2048}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s214396265", "group_id": "codeNet:p02717", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x, y, z int\n\t_, _ = fmt.Scanf(\"%d %d %d\", &x, &y, &z)\n\n\tfmt.Println(answer161A(x, y, z))\n}\n\nfunc answer161A(x int, y int, z int) string {\n\treturn fmt.Sprintf(\"%d %d %d\", z, x, y)\n}\n", "language": "Go", "metadata": {"date": 1600473478, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02717.html", "problem_id": "p02717", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02717/input.txt", "sample_output_relpath": "derived/input_output/data/p02717/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02717/Go/s214396265.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s214396265", "user_id": "u325119213"}, "prompt_components": {"gold_output": "3 1 2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x, y, z int\n\t_, _ = fmt.Scanf(\"%d %d %d\", &x, &y, &z)\n\n\tfmt.Println(answer161A(x, y, z))\n}\n\nfunc answer161A(x int, y int, z int) string {\n\treturn fmt.Sprintf(\"%d %d %d\", z, x, y)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have three boxes A, B, and C, each of which contains an integer.\n\nCurrently, the boxes A, B, and C contain the integers X, Y, and Z, respectively.\n\nWe will now do the operations below in order. Find the content of each box afterward.\n\nSwap the contents of the boxes A and B\n\nSwap the contents of the boxes A and C\n\nConstraints\n\n1 \\leq X,Y,Z \\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 Z\n\nOutput\n\nPrint the integers contained in the boxes A, B, and C, in this order, with space in between.\n\nSample Input 1\n\n1 2 3\n\nSample Output 1\n\n3 1 2\n\nAfter the contents of the boxes A and B are swapped, A, B, and C contain 2, 1, and 3, respectively.\n\nThen, after the contents of A and C are swapped, A, B, and C contain 3, 1, and 2, respectively.\n\nSample Input 2\n\n100 100 100\n\nSample Output 2\n\n100 100 100\n\nSample Input 3\n\n41 59 31\n\nSample Output 3\n\n31 41 59", "sample_input": "1 2 3\n"}, "reference_outputs": ["3 1 2\n"], "source_document_id": "p02717", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have three boxes A, B, and C, each of which contains an integer.\n\nCurrently, the boxes A, B, and C contain the integers X, Y, and Z, respectively.\n\nWe will now do the operations below in order. Find the content of each box afterward.\n\nSwap the contents of the boxes A and B\n\nSwap the contents of the boxes A and C\n\nConstraints\n\n1 \\leq X,Y,Z \\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 Z\n\nOutput\n\nPrint the integers contained in the boxes A, B, and C, in this order, with space in between.\n\nSample Input 1\n\n1 2 3\n\nSample Output 1\n\n3 1 2\n\nAfter the contents of the boxes A and B are swapped, A, B, and C contain 2, 1, and 3, respectively.\n\nThen, after the contents of A and C are swapped, A, B, and C contain 3, 1, and 2, respectively.\n\nSample Input 2\n\n100 100 100\n\nSample Output 2\n\n100 100 100\n\nSample Input 3\n\n41 59 31\n\nSample Output 3\n\n31 41 59", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 233, "cpu_time_ms": 10, "memory_kb": 1828}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s288820148", "group_id": "codeNet:p02717", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\n/* sort */\ntype pair struct {\n\tindex int64\n\tp1, p2 interface{}\n}\ntype pairs []pair\n\nfunc (slice pairs) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice pairs) Less(i, j int) bool {\n\treturn slice[i].index < slice[j].index\n}\n\nfunc (slice pairs) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\n\n/* sort */\ntype Int64Slice []int64\n\nfunc (slice Int64Slice) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice Int64Slice) Less(i, j int) bool {\n\treturn slice[i] < slice[j]\n}\n\nfunc (slice Int64Slice) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\nfunc Int64s(a []int64) { sort.Sort(Int64Slice(a)) }\nfunc Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n\tINF = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tdi = []int64{-1, 0, 1, 0}\n\tdj = []int64{0, -1, 0, 1}\n\tdi8 = []int64{-1, -1, 0, 1, 1, 1, 0, -1}\n\tdj8 = []int64{0, -1, -1, -1, 0, 1, 1, 1}\n)\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tscanner.Buffer(buf, maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tX, Y, Z := readInt(), readInt(), readInt()\n\tfmt.Println(Z, X, Y)\n}\n\n/*==========================================\n * Library\n *==========================================*/\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\nfunc doubleAry(h int64, w int64, init int64) (res [][]int64) {\n\tres = make([][]int64, h)\n\tfor i := int64(0); i < h; i++ {\n\t\tres[i] = make([]int64, w)\n\t\tfor j := int64(0); j < w; j++ {\n\t\t\tres[i][j] = init\n\t\t}\n\t}\n\treturn\n}\n\nfunc aryEq(a []int64, b []int64) bool {\n\treturn reflect.DeepEqual(a, b)\n}\n\nfunc clone(n []int64) (r []int64) {\n\tr = make([]int64, len(n))\n\tfor i := 0; i < len(n); i++ {\n\t\tr[i] = n[i]\n\t}\n\treturn\n}\nfunc write(s string) {\n\twriter.WriteString(s)\n}\n\nfunc print() {\n\twriter.Flush()\n}\n\n// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可\nfunc readLine() (s string) {\n\tif scanner.Scan() {\n\t\ts = scanner.Text()\n\t}\n\treturn s\n}\n\nfunc readInt() (read int64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseInt(scanner.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readFloat() (read float64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readRunes() (read []rune) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, v)\n\t}\n\treturn\n}\n\nfunc readString() (read string) {\n\tscanner.Scan()\n\tread = scanner.Text()\n\treturn\n}\n\nfunc readStrings() (read []string) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, string(v))\n\t}\n\treturn\n}\n\nfunc s2i(s string) int64 {\n\tvar intVal, e = strconv.ParseInt(s, 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int64) string {\n\tvar strVal = strconv.FormatInt(i, 10)\n\treturn strVal\n}\n\nfunc s2f(s string) float64 {\n\tvar floatVal, e = strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn floatVal\n}\n\nfunc abs(i int64) int64 {\n\treturn int64(math.Abs(float64(i)))\n}\n\nfunc max(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans < v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\nfunc min(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans > v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc sum(i []int64) int64 {\n\tsum := int64(0)\n\tfor _, val := range i {\n\t\tsum += val\n\t}\n\treturn sum\n}\n\nfunc split(s string) []string {\n\treturn strings.Fields(s)\n}\n\nfunc strAry2intAry(strs []string) []int64 {\n\tvar ret = make([]int64, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal = s2i(str)\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int64) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = i2s(num)\n\t\tret = append(ret, strVal)\n\t}\n\treturn ret\n}\n\nfunc ary2str(strs []string) string {\n\treturn strings.Join(strs, \" \")\n}\n\nfunc reverse(res []int64) []int64 {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\nfunc reverseStr(res []string) []string {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\n\nfunc ini(res []int, init int) {\n\tif len(res) == 0 {\n\t\treturn\n\t}\n\tres[0] = init\n\tfor i := 0; i < len(res); i++ {\n\t\tcopy(res[i:], res[:i])\n\t}\n}\n\n//\n// func regexpExample() {\n// // Your code here!\n// var str = \"13:20\"\n// r := regexp.MustCompile(`(\\d+):(\\d+)`)\n// fmt.Println(r.FindStringSubmatch(str))\n// }\n\n// type Country struct {\n// gold int\n// silver int\n// blonze int\n// }\n\n// // 複数ソートのサンプル\n// func stableSortExample() []Country{\n// var country = []Country {\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:3, blonze:2},\n// {gold:1, silver:3, blonze:3},\n// }\n// sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })\n// return country\n// }\n", "language": "Go", "metadata": {"date": 1590097580, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02717.html", "problem_id": "p02717", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02717/input.txt", "sample_output_relpath": "derived/input_output/data/p02717/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02717/Go/s288820148.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s288820148", "user_id": "u967669872"}, "prompt_components": {"gold_output": "3 1 2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\n/* sort */\ntype pair struct {\n\tindex int64\n\tp1, p2 interface{}\n}\ntype pairs []pair\n\nfunc (slice pairs) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice pairs) Less(i, j int) bool {\n\treturn slice[i].index < slice[j].index\n}\n\nfunc (slice pairs) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\n\n/* sort */\ntype Int64Slice []int64\n\nfunc (slice Int64Slice) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice Int64Slice) Less(i, j int) bool {\n\treturn slice[i] < slice[j]\n}\n\nfunc (slice Int64Slice) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\nfunc Int64s(a []int64) { sort.Sort(Int64Slice(a)) }\nfunc Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n\tINF = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tdi = []int64{-1, 0, 1, 0}\n\tdj = []int64{0, -1, 0, 1}\n\tdi8 = []int64{-1, -1, 0, 1, 1, 1, 0, -1}\n\tdj8 = []int64{0, -1, -1, -1, 0, 1, 1, 1}\n)\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tscanner.Buffer(buf, maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tX, Y, Z := readInt(), readInt(), readInt()\n\tfmt.Println(Z, X, Y)\n}\n\n/*==========================================\n * Library\n *==========================================*/\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\nfunc doubleAry(h int64, w int64, init int64) (res [][]int64) {\n\tres = make([][]int64, h)\n\tfor i := int64(0); i < h; i++ {\n\t\tres[i] = make([]int64, w)\n\t\tfor j := int64(0); j < w; j++ {\n\t\t\tres[i][j] = init\n\t\t}\n\t}\n\treturn\n}\n\nfunc aryEq(a []int64, b []int64) bool {\n\treturn reflect.DeepEqual(a, b)\n}\n\nfunc clone(n []int64) (r []int64) {\n\tr = make([]int64, len(n))\n\tfor i := 0; i < len(n); i++ {\n\t\tr[i] = n[i]\n\t}\n\treturn\n}\nfunc write(s string) {\n\twriter.WriteString(s)\n}\n\nfunc print() {\n\twriter.Flush()\n}\n\n// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可\nfunc readLine() (s string) {\n\tif scanner.Scan() {\n\t\ts = scanner.Text()\n\t}\n\treturn s\n}\n\nfunc readInt() (read int64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseInt(scanner.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readFloat() (read float64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readRunes() (read []rune) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, v)\n\t}\n\treturn\n}\n\nfunc readString() (read string) {\n\tscanner.Scan()\n\tread = scanner.Text()\n\treturn\n}\n\nfunc readStrings() (read []string) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, string(v))\n\t}\n\treturn\n}\n\nfunc s2i(s string) int64 {\n\tvar intVal, e = strconv.ParseInt(s, 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int64) string {\n\tvar strVal = strconv.FormatInt(i, 10)\n\treturn strVal\n}\n\nfunc s2f(s string) float64 {\n\tvar floatVal, e = strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn floatVal\n}\n\nfunc abs(i int64) int64 {\n\treturn int64(math.Abs(float64(i)))\n}\n\nfunc max(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans < v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\nfunc min(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans > v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc sum(i []int64) int64 {\n\tsum := int64(0)\n\tfor _, val := range i {\n\t\tsum += val\n\t}\n\treturn sum\n}\n\nfunc split(s string) []string {\n\treturn strings.Fields(s)\n}\n\nfunc strAry2intAry(strs []string) []int64 {\n\tvar ret = make([]int64, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal = s2i(str)\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int64) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = i2s(num)\n\t\tret = append(ret, strVal)\n\t}\n\treturn ret\n}\n\nfunc ary2str(strs []string) string {\n\treturn strings.Join(strs, \" \")\n}\n\nfunc reverse(res []int64) []int64 {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\nfunc reverseStr(res []string) []string {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\n\nfunc ini(res []int, init int) {\n\tif len(res) == 0 {\n\t\treturn\n\t}\n\tres[0] = init\n\tfor i := 0; i < len(res); i++ {\n\t\tcopy(res[i:], res[:i])\n\t}\n}\n\n//\n// func regexpExample() {\n// // Your code here!\n// var str = \"13:20\"\n// r := regexp.MustCompile(`(\\d+):(\\d+)`)\n// fmt.Println(r.FindStringSubmatch(str))\n// }\n\n// type Country struct {\n// gold int\n// silver int\n// blonze int\n// }\n\n// // 複数ソートのサンプル\n// func stableSortExample() []Country{\n// var country = []Country {\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:3, blonze:2},\n// {gold:1, silver:3, blonze:3},\n// }\n// sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })\n// return country\n// }\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have three boxes A, B, and C, each of which contains an integer.\n\nCurrently, the boxes A, B, and C contain the integers X, Y, and Z, respectively.\n\nWe will now do the operations below in order. Find the content of each box afterward.\n\nSwap the contents of the boxes A and B\n\nSwap the contents of the boxes A and C\n\nConstraints\n\n1 \\leq X,Y,Z \\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 Z\n\nOutput\n\nPrint the integers contained in the boxes A, B, and C, in this order, with space in between.\n\nSample Input 1\n\n1 2 3\n\nSample Output 1\n\n3 1 2\n\nAfter the contents of the boxes A and B are swapped, A, B, and C contain 2, 1, and 3, respectively.\n\nThen, after the contents of A and C are swapped, A, B, and C contain 3, 1, and 2, respectively.\n\nSample Input 2\n\n100 100 100\n\nSample Output 2\n\n100 100 100\n\nSample Input 3\n\n41 59 31\n\nSample Output 3\n\n31 41 59", "sample_input": "1 2 3\n"}, "reference_outputs": ["3 1 2\n"], "source_document_id": "p02717", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have three boxes A, B, and C, each of which contains an integer.\n\nCurrently, the boxes A, B, and C contain the integers X, Y, and Z, respectively.\n\nWe will now do the operations below in order. Find the content of each box afterward.\n\nSwap the contents of the boxes A and B\n\nSwap the contents of the boxes A and C\n\nConstraints\n\n1 \\leq X,Y,Z \\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 Z\n\nOutput\n\nPrint the integers contained in the boxes A, B, and C, in this order, with space in between.\n\nSample Input 1\n\n1 2 3\n\nSample Output 1\n\n3 1 2\n\nAfter the contents of the boxes A and B are swapped, A, B, and C contain 2, 1, and 3, respectively.\n\nThen, after the contents of A and C are swapped, A, B, and C contain 3, 1, and 2, respectively.\n\nSample Input 2\n\n100 100 100\n\nSample Output 2\n\n100 100 100\n\nSample Input 3\n\n41 59 31\n\nSample Output 3\n\n31 41 59", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5629, "cpu_time_ms": 8, "memory_kb": 1756}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s547613328", "group_id": "codeNet:p02717", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x, y, z string\n\t// &はアドレス\n\tfmt.Scan(&x, &y, &z)\n\n\tfmt.Println(z + x + y)\n}\n", "language": "Go", "metadata": {"date": 1586752294, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02717.html", "problem_id": "p02717", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02717/input.txt", "sample_output_relpath": "derived/input_output/data/p02717/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02717/Go/s547613328.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s547613328", "user_id": "u432333240"}, "prompt_components": {"gold_output": "3 1 2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x, y, z string\n\t// &はアドレス\n\tfmt.Scan(&x, &y, &z)\n\n\tfmt.Println(z + x + y)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have three boxes A, B, and C, each of which contains an integer.\n\nCurrently, the boxes A, B, and C contain the integers X, Y, and Z, respectively.\n\nWe will now do the operations below in order. Find the content of each box afterward.\n\nSwap the contents of the boxes A and B\n\nSwap the contents of the boxes A and C\n\nConstraints\n\n1 \\leq X,Y,Z \\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 Z\n\nOutput\n\nPrint the integers contained in the boxes A, B, and C, in this order, with space in between.\n\nSample Input 1\n\n1 2 3\n\nSample Output 1\n\n3 1 2\n\nAfter the contents of the boxes A and B are swapped, A, B, and C contain 2, 1, and 3, respectively.\n\nThen, after the contents of A and C are swapped, A, B, and C contain 3, 1, and 2, respectively.\n\nSample Input 2\n\n100 100 100\n\nSample Output 2\n\n100 100 100\n\nSample Input 3\n\n41 59 31\n\nSample Output 3\n\n31 41 59", "sample_input": "1 2 3\n"}, "reference_outputs": ["3 1 2\n"], "source_document_id": "p02717", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have three boxes A, B, and C, each of which contains an integer.\n\nCurrently, the boxes A, B, and C contain the integers X, Y, and Z, respectively.\n\nWe will now do the operations below in order. Find the content of each box afterward.\n\nSwap the contents of the boxes A and B\n\nSwap the contents of the boxes A and C\n\nConstraints\n\n1 \\leq X,Y,Z \\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 Z\n\nOutput\n\nPrint the integers contained in the boxes A, B, and C, in this order, with space in between.\n\nSample Input 1\n\n1 2 3\n\nSample Output 1\n\n3 1 2\n\nAfter the contents of the boxes A and B are swapped, A, B, and C contain 2, 1, and 3, respectively.\n\nThen, after the contents of A and C are swapped, A, B, and C contain 3, 1, and 2, respectively.\n\nSample Input 2\n\n100 100 100\n\nSample Output 2\n\n100 100 100\n\nSample Input 3\n\n41 59 31\n\nSample Output 3\n\n31 41 59", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s711454172", "group_id": "codeNet:p02717", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, c int\n\n\tfmt.Scan(&a, &b, &c)\n\n\taa := a\n\ta = b\n\tb = aa\n\taaa := a\n\ta = c\n\tc = aaa\n\t\n\tfmt.Println(a, b, c)\n\n}\n", "language": "Go", "metadata": {"date": 1586049968, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02717.html", "problem_id": "p02717", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02717/input.txt", "sample_output_relpath": "derived/input_output/data/p02717/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02717/Go/s711454172.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s711454172", "user_id": "u545203108"}, "prompt_components": {"gold_output": "3 1 2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, c int\n\n\tfmt.Scan(&a, &b, &c)\n\n\taa := a\n\ta = b\n\tb = aa\n\taaa := a\n\ta = c\n\tc = aaa\n\t\n\tfmt.Println(a, b, c)\n\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have three boxes A, B, and C, each of which contains an integer.\n\nCurrently, the boxes A, B, and C contain the integers X, Y, and Z, respectively.\n\nWe will now do the operations below in order. Find the content of each box afterward.\n\nSwap the contents of the boxes A and B\n\nSwap the contents of the boxes A and C\n\nConstraints\n\n1 \\leq X,Y,Z \\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 Z\n\nOutput\n\nPrint the integers contained in the boxes A, B, and C, in this order, with space in between.\n\nSample Input 1\n\n1 2 3\n\nSample Output 1\n\n3 1 2\n\nAfter the contents of the boxes A and B are swapped, A, B, and C contain 2, 1, and 3, respectively.\n\nThen, after the contents of A and C are swapped, A, B, and C contain 3, 1, and 2, respectively.\n\nSample Input 2\n\n100 100 100\n\nSample Output 2\n\n100 100 100\n\nSample Input 3\n\n41 59 31\n\nSample Output 3\n\n31 41 59", "sample_input": "1 2 3\n"}, "reference_outputs": ["3 1 2\n"], "source_document_id": "p02717", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have three boxes A, B, and C, each of which contains an integer.\n\nCurrently, the boxes A, B, and C contain the integers X, Y, and Z, respectively.\n\nWe will now do the operations below in order. Find the content of each box afterward.\n\nSwap the contents of the boxes A and B\n\nSwap the contents of the boxes A and C\n\nConstraints\n\n1 \\leq X,Y,Z \\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 Z\n\nOutput\n\nPrint the integers contained in the boxes A, B, and C, in this order, with space in between.\n\nSample Input 1\n\n1 2 3\n\nSample Output 1\n\n3 1 2\n\nAfter the contents of the boxes A and B are swapped, A, B, and C contain 2, 1, and 3, respectively.\n\nThen, after the contents of A and C are swapped, A, B, and C contain 3, 1, and 2, respectively.\n\nSample Input 2\n\n100 100 100\n\nSample Output 2\n\n100 100 100\n\nSample Input 3\n\n41 59 31\n\nSample Output 3\n\n31 41 59", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s364143474", "group_id": "codeNet:p02717", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\n\tnextReader = newScanner()\n\n\tx, y, z := nextInt(), nextInt(), nextInt()\n\n\tfmt.Println(z, x, y)\n}\n\n/* --------------------------------------------------------------------------\n * std.io\n * ------------------------------------------------------------------------- */\nvar nextReader func() string\n\nfunc newScanner() func() string {\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\treturn func() string {\n\t\tr.Scan()\n\t\treturn r.Text()\n\t}\n}\nfunc nextString() string {\n\treturn nextReader()\n}\nfunc nextInt64() int64 {\n\tv, _ := strconv.ParseInt(nextReader(), 10, 64)\n\treturn v\n}\nfunc nextInt() int {\n\tv, _ := strconv.Atoi(nextReader())\n\treturn v\n}\nfunc nextInts(n int) []int {\n\tr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt()\n\t}\n\treturn r\n}\nfunc nextInt64s(n int) []int64 {\n\tr := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt64()\n\t}\n\treturn r\n}\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(nextReader(), 64)\n\treturn f\n}\n\nfunc maxInt(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc mins(t ...int) int {\n\tif len(t) == 0 {\n\t\treturn 0\n\t}\n\n\tmin := t[0]\n\tfor i := 1; i < len(t); i++ {\n\t\tif min > t[i] {\n\t\t\tmin = t[i]\n\t\t}\n\t}\n\treturn min\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn 0 - a\n\t}\n}\n", "language": "Go", "metadata": {"date": 1586049927, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02717.html", "problem_id": "p02717", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02717/input.txt", "sample_output_relpath": "derived/input_output/data/p02717/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02717/Go/s364143474.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s364143474", "user_id": "u867254940"}, "prompt_components": {"gold_output": "3 1 2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\n\tnextReader = newScanner()\n\n\tx, y, z := nextInt(), nextInt(), nextInt()\n\n\tfmt.Println(z, x, y)\n}\n\n/* --------------------------------------------------------------------------\n * std.io\n * ------------------------------------------------------------------------- */\nvar nextReader func() string\n\nfunc newScanner() func() string {\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\treturn func() string {\n\t\tr.Scan()\n\t\treturn r.Text()\n\t}\n}\nfunc nextString() string {\n\treturn nextReader()\n}\nfunc nextInt64() int64 {\n\tv, _ := strconv.ParseInt(nextReader(), 10, 64)\n\treturn v\n}\nfunc nextInt() int {\n\tv, _ := strconv.Atoi(nextReader())\n\treturn v\n}\nfunc nextInts(n int) []int {\n\tr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt()\n\t}\n\treturn r\n}\nfunc nextInt64s(n int) []int64 {\n\tr := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt64()\n\t}\n\treturn r\n}\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(nextReader(), 64)\n\treturn f\n}\n\nfunc maxInt(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc mins(t ...int) int {\n\tif len(t) == 0 {\n\t\treturn 0\n\t}\n\n\tmin := t[0]\n\tfor i := 1; i < len(t); i++ {\n\t\tif min > t[i] {\n\t\t\tmin = t[i]\n\t\t}\n\t}\n\treturn min\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn 0 - a\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have three boxes A, B, and C, each of which contains an integer.\n\nCurrently, the boxes A, B, and C contain the integers X, Y, and Z, respectively.\n\nWe will now do the operations below in order. Find the content of each box afterward.\n\nSwap the contents of the boxes A and B\n\nSwap the contents of the boxes A and C\n\nConstraints\n\n1 \\leq X,Y,Z \\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 Z\n\nOutput\n\nPrint the integers contained in the boxes A, B, and C, in this order, with space in between.\n\nSample Input 1\n\n1 2 3\n\nSample Output 1\n\n3 1 2\n\nAfter the contents of the boxes A and B are swapped, A, B, and C contain 2, 1, and 3, respectively.\n\nThen, after the contents of A and C are swapped, A, B, and C contain 3, 1, and 2, respectively.\n\nSample Input 2\n\n100 100 100\n\nSample Output 2\n\n100 100 100\n\nSample Input 3\n\n41 59 31\n\nSample Output 3\n\n31 41 59", "sample_input": "1 2 3\n"}, "reference_outputs": ["3 1 2\n"], "source_document_id": "p02717", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have three boxes A, B, and C, each of which contains an integer.\n\nCurrently, the boxes A, B, and C contain the integers X, Y, and Z, respectively.\n\nWe will now do the operations below in order. Find the content of each box afterward.\n\nSwap the contents of the boxes A and B\n\nSwap the contents of the boxes A and C\n\nConstraints\n\n1 \\leq X,Y,Z \\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 Z\n\nOutput\n\nPrint the integers contained in the boxes A, B, and C, in this order, with space in between.\n\nSample Input 1\n\n1 2 3\n\nSample Output 1\n\n3 1 2\n\nAfter the contents of the boxes A and B are swapped, A, B, and C contain 2, 1, and 3, respectively.\n\nThen, after the contents of A and C are swapped, A, B, and C contain 3, 1, and 2, respectively.\n\nSample Input 2\n\n100 100 100\n\nSample Output 2\n\n100 100 100\n\nSample Input 3\n\n41 59 31\n\nSample Output 3\n\n31 41 59", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1545, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s758682601", "group_id": "codeNet:p02717", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scanf(\"%d %d %d\", &a, &b, &c)\n swap(&a, &b)\n swap(&a, &c)\n fmt.Println(a, b, c)\n}\n\nfunc swap(x *int, y *int) {\n\tvar tmp int\n\n\ttmp = *x\n\t*x = *y\n\t*y = tmp\n}\n", "language": "Go", "metadata": {"date": 1586048994, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02717.html", "problem_id": "p02717", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02717/input.txt", "sample_output_relpath": "derived/input_output/data/p02717/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02717/Go/s758682601.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s758682601", "user_id": "u664512314"}, "prompt_components": {"gold_output": "3 1 2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scanf(\"%d %d %d\", &a, &b, &c)\n swap(&a, &b)\n swap(&a, &c)\n fmt.Println(a, b, c)\n}\n\nfunc swap(x *int, y *int) {\n\tvar tmp int\n\n\ttmp = *x\n\t*x = *y\n\t*y = tmp\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have three boxes A, B, and C, each of which contains an integer.\n\nCurrently, the boxes A, B, and C contain the integers X, Y, and Z, respectively.\n\nWe will now do the operations below in order. Find the content of each box afterward.\n\nSwap the contents of the boxes A and B\n\nSwap the contents of the boxes A and C\n\nConstraints\n\n1 \\leq X,Y,Z \\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 Z\n\nOutput\n\nPrint the integers contained in the boxes A, B, and C, in this order, with space in between.\n\nSample Input 1\n\n1 2 3\n\nSample Output 1\n\n3 1 2\n\nAfter the contents of the boxes A and B are swapped, A, B, and C contain 2, 1, and 3, respectively.\n\nThen, after the contents of A and C are swapped, A, B, and C contain 3, 1, and 2, respectively.\n\nSample Input 2\n\n100 100 100\n\nSample Output 2\n\n100 100 100\n\nSample Input 3\n\n41 59 31\n\nSample Output 3\n\n31 41 59", "sample_input": "1 2 3\n"}, "reference_outputs": ["3 1 2\n"], "source_document_id": "p02717", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have three boxes A, B, and C, each of which contains an integer.\n\nCurrently, the boxes A, B, and C contain the integers X, Y, and Z, respectively.\n\nWe will now do the operations below in order. Find the content of each box afterward.\n\nSwap the contents of the boxes A and B\n\nSwap the contents of the boxes A and C\n\nConstraints\n\n1 \\leq X,Y,Z \\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 Z\n\nOutput\n\nPrint the integers contained in the boxes A, B, and C, in this order, with space in between.\n\nSample Input 1\n\n1 2 3\n\nSample Output 1\n\n3 1 2\n\nAfter the contents of the boxes A and B are swapped, A, B, and C contain 2, 1, and 3, respectively.\n\nThen, after the contents of A and C are swapped, A, B, and C contain 3, 1, and 2, respectively.\n\nSample Input 2\n\n100 100 100\n\nSample Output 2\n\n100 100 100\n\nSample Input 3\n\n41 59 31\n\nSample Output 3\n\n31 41 59", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 228, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s450795812", "group_id": "codeNet:p02717", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x int\n\tvar y int\n\tvar z int\n\tfmt.Scan(&x)\n\tfmt.Scan(&y)\n\tfmt.Scan(&z)\n\n\tfmt.Println(z, x, y)\n}\n", "language": "Go", "metadata": {"date": 1586048776, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02717.html", "problem_id": "p02717", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02717/input.txt", "sample_output_relpath": "derived/input_output/data/p02717/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02717/Go/s450795812.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s450795812", "user_id": "u262396543"}, "prompt_components": {"gold_output": "3 1 2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x int\n\tvar y int\n\tvar z int\n\tfmt.Scan(&x)\n\tfmt.Scan(&y)\n\tfmt.Scan(&z)\n\n\tfmt.Println(z, x, y)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have three boxes A, B, and C, each of which contains an integer.\n\nCurrently, the boxes A, B, and C contain the integers X, Y, and Z, respectively.\n\nWe will now do the operations below in order. Find the content of each box afterward.\n\nSwap the contents of the boxes A and B\n\nSwap the contents of the boxes A and C\n\nConstraints\n\n1 \\leq X,Y,Z \\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 Z\n\nOutput\n\nPrint the integers contained in the boxes A, B, and C, in this order, with space in between.\n\nSample Input 1\n\n1 2 3\n\nSample Output 1\n\n3 1 2\n\nAfter the contents of the boxes A and B are swapped, A, B, and C contain 2, 1, and 3, respectively.\n\nThen, after the contents of A and C are swapped, A, B, and C contain 3, 1, and 2, respectively.\n\nSample Input 2\n\n100 100 100\n\nSample Output 2\n\n100 100 100\n\nSample Input 3\n\n41 59 31\n\nSample Output 3\n\n31 41 59", "sample_input": "1 2 3\n"}, "reference_outputs": ["3 1 2\n"], "source_document_id": "p02717", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have three boxes A, B, and C, each of which contains an integer.\n\nCurrently, the boxes A, B, and C contain the integers X, Y, and Z, respectively.\n\nWe will now do the operations below in order. Find the content of each box afterward.\n\nSwap the contents of the boxes A and B\n\nSwap the contents of the boxes A and C\n\nConstraints\n\n1 \\leq X,Y,Z \\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 Z\n\nOutput\n\nPrint the integers contained in the boxes A, B, and C, in this order, with space in between.\n\nSample Input 1\n\n1 2 3\n\nSample Output 1\n\n3 1 2\n\nAfter the contents of the boxes A and B are swapped, A, B, and C contain 2, 1, and 3, respectively.\n\nThen, after the contents of A and C are swapped, A, B, and C contain 3, 1, and 2, respectively.\n\nSample Input 2\n\n100 100 100\n\nSample Output 2\n\n100 100 100\n\nSample Input 3\n\n41 59 31\n\nSample Output 3\n\n31 41 59", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s264034210", "group_id": "codeNet:p02717", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x, y, z int\n\tfmt.Scan(&x, &y, &z)\n\n\ts := x\n\n\tx = y\n\ty = s\n\n\ts = x\n\tx = z\n\tz = s\n\n\tfmt.Println(x, y, z)\n}", "language": "Go", "metadata": {"date": 1586048610, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02717.html", "problem_id": "p02717", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02717/input.txt", "sample_output_relpath": "derived/input_output/data/p02717/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02717/Go/s264034210.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s264034210", "user_id": "u390529125"}, "prompt_components": {"gold_output": "3 1 2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar x, y, z int\n\tfmt.Scan(&x, &y, &z)\n\n\ts := x\n\n\tx = y\n\ty = s\n\n\ts = x\n\tx = z\n\tz = s\n\n\tfmt.Println(x, y, z)\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have three boxes A, B, and C, each of which contains an integer.\n\nCurrently, the boxes A, B, and C contain the integers X, Y, and Z, respectively.\n\nWe will now do the operations below in order. Find the content of each box afterward.\n\nSwap the contents of the boxes A and B\n\nSwap the contents of the boxes A and C\n\nConstraints\n\n1 \\leq X,Y,Z \\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 Z\n\nOutput\n\nPrint the integers contained in the boxes A, B, and C, in this order, with space in between.\n\nSample Input 1\n\n1 2 3\n\nSample Output 1\n\n3 1 2\n\nAfter the contents of the boxes A and B are swapped, A, B, and C contain 2, 1, and 3, respectively.\n\nThen, after the contents of A and C are swapped, A, B, and C contain 3, 1, and 2, respectively.\n\nSample Input 2\n\n100 100 100\n\nSample Output 2\n\n100 100 100\n\nSample Input 3\n\n41 59 31\n\nSample Output 3\n\n31 41 59", "sample_input": "1 2 3\n"}, "reference_outputs": ["3 1 2\n"], "source_document_id": "p02717", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have three boxes A, B, and C, each of which contains an integer.\n\nCurrently, the boxes A, B, and C contain the integers X, Y, and Z, respectively.\n\nWe will now do the operations below in order. Find the content of each box afterward.\n\nSwap the contents of the boxes A and B\n\nSwap the contents of the boxes A and C\n\nConstraints\n\n1 \\leq X,Y,Z \\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 Z\n\nOutput\n\nPrint the integers contained in the boxes A, B, and C, in this order, with space in between.\n\nSample Input 1\n\n1 2 3\n\nSample Output 1\n\n3 1 2\n\nAfter the contents of the boxes A and B are swapped, A, B, and C contain 2, 1, and 3, respectively.\n\nThen, after the contents of A and C are swapped, A, B, and C contain 3, 1, and 2, respectively.\n\nSample Input 2\n\n100 100 100\n\nSample Output 2\n\n100 100 100\n\nSample Input 3\n\n41 59 31\n\nSample Output 3\n\n31 41 59", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 156, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s878626318", "group_id": "codeNet:p02717", "input_text": "//problem_a.go\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t//\"strings\"\n)\n\nconst (\n\tconstMod = int(1e9) + 7\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twr = bufio.NewWriter(os.Stdout)\n)\n\n// -----------------------------------------\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getIntSlice(n int) []int {\n\tns := []int{}\n\tfor i := 0; i < n; i++ {\n\t\tns = append(ns, getInt())\n\t}\n\treturn ns\n}\n\nfunc getIntDoubleSlice(m int, n int) [][]int {\n\tvar nds [][]int\n\tfor i := 0; i < m; i++ {\n\t\tns := getIntSlice(n)\n\t\tnds = append(nds, ns)\n\t}\n\n\treturn nds\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc getStringSlice(n int) []string {\n\tss := []string{}\n\tfor i := 0; i < n; i++ {\n\t\tss = append(ss, getString())\n\t}\n\treturn ss\n}\n\nfunc getStringDoubleSlice(m int, n int) [][]string {\n\tsds := [][]string{}\n\tfor i := 0; i < m; i++ {\n\t\tss := getStringSlice(n)\n\t\tsds = append(sds, ss)\n\t}\n\n\treturn sds\n\n}\n\n// -----------------------------------------\n\n// Sort Fanction\n\nfunc sortIntSlice(ns []int) []int {\n\tsort.Sort(sort.IntSlice(ns))\n\treturn ns\n}\n\nfunc sortIntReverseSlice(ns []int) []int {\n\tsort.Sort(sort.Reverse(sort.IntSlice(ns)))\n\treturn ns\n}\n\n// -----------------------------------------\n\n// Num Fanction\n\n//numAbs(x) = abs(s)\nfunc numAbs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\n\treturn x\n}\n\n//numModPow(a, n, m) = a^n % m\nfunc numModPow(a int, n int, m int) int {\n\tresult := 1\n\n\tfor n > 0 {\n\t\tif n%2 == 1 {\n\t\t\tresult = (result * a) % m\n\t\t}\n\n\t\ta = (a * a) % m\n\t\tn >>= 1\n\t}\n\n\treturn result\n}\n\n// numGcd(a, b) = gcd(a, b)\nfunc numGcd(a int, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\n\treturn numGcd(b, a%b)\n}\n\n// numLcm(a, b) = lcm(a, b)\nfunc numLcm(a int, b int) int {\n\treturn a * b / numGcd(a, b)\n}\n\n// numModInv(a, p) = a^(-1) % p\nfunc numModInv(a int, p int) int {\n\tif a == 1 {\n\t\treturn 1\n\t}\n\n\treturn p - numModInv(p%a, p)*(p/a)%p\n}\n\n// numModFrac(n) = n! % constMod\nfunc numModFrac(n int) []int {\n\tfrac := []int{1}\n\n\tfor i := 1; i <= n; i++ {\n\t\tfrac = append(frac, i*frac[i-1]%constMod)\n\t}\n\n\treturn frac\n}\n\n// numModConb(n, r) = nCr % constMod\nfunc numModConb(n int, r int) int {\n\tfrac := numModFrac(n)\n\n\treturn (frac[n] / ((frac[n-r] * frac[r]) % constMod)) % constMod\n}\n\n// -----------------------------------------\n\nfunc solve() {\n\n\tx, y, z := getInt(), getInt(), getInt()\n\tfmt.Fprintln(wr, z, x, y)\n\n}\n\n// -----------------------------------------\n\nfunc main() {\n\tmaxBufSize := int(1e8)\n\tsc.Buffer(make([]byte, 4096), maxBufSize)\n\tsc.Split(bufio.ScanWords)\n\tsolve()\n\twr.Flush()\n}\n", "language": "Go", "metadata": {"date": 1586048517, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02717.html", "problem_id": "p02717", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02717/input.txt", "sample_output_relpath": "derived/input_output/data/p02717/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02717/Go/s878626318.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s878626318", "user_id": "u973475508"}, "prompt_components": {"gold_output": "3 1 2\n", "input_to_evaluate": "//problem_a.go\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t//\"strings\"\n)\n\nconst (\n\tconstMod = int(1e9) + 7\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twr = bufio.NewWriter(os.Stdout)\n)\n\n// -----------------------------------------\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getIntSlice(n int) []int {\n\tns := []int{}\n\tfor i := 0; i < n; i++ {\n\t\tns = append(ns, getInt())\n\t}\n\treturn ns\n}\n\nfunc getIntDoubleSlice(m int, n int) [][]int {\n\tvar nds [][]int\n\tfor i := 0; i < m; i++ {\n\t\tns := getIntSlice(n)\n\t\tnds = append(nds, ns)\n\t}\n\n\treturn nds\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc getStringSlice(n int) []string {\n\tss := []string{}\n\tfor i := 0; i < n; i++ {\n\t\tss = append(ss, getString())\n\t}\n\treturn ss\n}\n\nfunc getStringDoubleSlice(m int, n int) [][]string {\n\tsds := [][]string{}\n\tfor i := 0; i < m; i++ {\n\t\tss := getStringSlice(n)\n\t\tsds = append(sds, ss)\n\t}\n\n\treturn sds\n\n}\n\n// -----------------------------------------\n\n// Sort Fanction\n\nfunc sortIntSlice(ns []int) []int {\n\tsort.Sort(sort.IntSlice(ns))\n\treturn ns\n}\n\nfunc sortIntReverseSlice(ns []int) []int {\n\tsort.Sort(sort.Reverse(sort.IntSlice(ns)))\n\treturn ns\n}\n\n// -----------------------------------------\n\n// Num Fanction\n\n//numAbs(x) = abs(s)\nfunc numAbs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\n\treturn x\n}\n\n//numModPow(a, n, m) = a^n % m\nfunc numModPow(a int, n int, m int) int {\n\tresult := 1\n\n\tfor n > 0 {\n\t\tif n%2 == 1 {\n\t\t\tresult = (result * a) % m\n\t\t}\n\n\t\ta = (a * a) % m\n\t\tn >>= 1\n\t}\n\n\treturn result\n}\n\n// numGcd(a, b) = gcd(a, b)\nfunc numGcd(a int, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\n\treturn numGcd(b, a%b)\n}\n\n// numLcm(a, b) = lcm(a, b)\nfunc numLcm(a int, b int) int {\n\treturn a * b / numGcd(a, b)\n}\n\n// numModInv(a, p) = a^(-1) % p\nfunc numModInv(a int, p int) int {\n\tif a == 1 {\n\t\treturn 1\n\t}\n\n\treturn p - numModInv(p%a, p)*(p/a)%p\n}\n\n// numModFrac(n) = n! % constMod\nfunc numModFrac(n int) []int {\n\tfrac := []int{1}\n\n\tfor i := 1; i <= n; i++ {\n\t\tfrac = append(frac, i*frac[i-1]%constMod)\n\t}\n\n\treturn frac\n}\n\n// numModConb(n, r) = nCr % constMod\nfunc numModConb(n int, r int) int {\n\tfrac := numModFrac(n)\n\n\treturn (frac[n] / ((frac[n-r] * frac[r]) % constMod)) % constMod\n}\n\n// -----------------------------------------\n\nfunc solve() {\n\n\tx, y, z := getInt(), getInt(), getInt()\n\tfmt.Fprintln(wr, z, x, y)\n\n}\n\n// -----------------------------------------\n\nfunc main() {\n\tmaxBufSize := int(1e8)\n\tsc.Buffer(make([]byte, 4096), maxBufSize)\n\tsc.Split(bufio.ScanWords)\n\tsolve()\n\twr.Flush()\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have three boxes A, B, and C, each of which contains an integer.\n\nCurrently, the boxes A, B, and C contain the integers X, Y, and Z, respectively.\n\nWe will now do the operations below in order. Find the content of each box afterward.\n\nSwap the contents of the boxes A and B\n\nSwap the contents of the boxes A and C\n\nConstraints\n\n1 \\leq X,Y,Z \\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 Z\n\nOutput\n\nPrint the integers contained in the boxes A, B, and C, in this order, with space in between.\n\nSample Input 1\n\n1 2 3\n\nSample Output 1\n\n3 1 2\n\nAfter the contents of the boxes A and B are swapped, A, B, and C contain 2, 1, and 3, respectively.\n\nThen, after the contents of A and C are swapped, A, B, and C contain 3, 1, and 2, respectively.\n\nSample Input 2\n\n100 100 100\n\nSample Output 2\n\n100 100 100\n\nSample Input 3\n\n41 59 31\n\nSample Output 3\n\n31 41 59", "sample_input": "1 2 3\n"}, "reference_outputs": ["3 1 2\n"], "source_document_id": "p02717", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have three boxes A, B, and C, each of which contains an integer.\n\nCurrently, the boxes A, B, and C contain the integers X, Y, and Z, respectively.\n\nWe will now do the operations below in order. Find the content of each box afterward.\n\nSwap the contents of the boxes A and B\n\nSwap the contents of the boxes A and C\n\nConstraints\n\n1 \\leq X,Y,Z \\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 Z\n\nOutput\n\nPrint the integers contained in the boxes A, B, and C, in this order, with space in between.\n\nSample Input 1\n\n1 2 3\n\nSample Output 1\n\n3 1 2\n\nAfter the contents of the boxes A and B are swapped, A, B, and C contain 2, 1, and 3, respectively.\n\nThen, after the contents of A and C are swapped, A, B, and C contain 3, 1, and 2, respectively.\n\nSample Input 2\n\n100 100 100\n\nSample Output 2\n\n100 100 100\n\nSample Input 3\n\n41 59 31\n\nSample Output 3\n\n31 41 59", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2579, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s341794724", "group_id": "codeNet:p02717", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, 1000000)\n\n\tA, B, C := getInt(), getInt(), getInt()\n\tA, B = B, A\n\tA, C = C, A\n\tout(A, B, C)\n}\n", "language": "Go", "metadata": {"date": 1586048512, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02717.html", "problem_id": "p02717", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02717/input.txt", "sample_output_relpath": "derived/input_output/data/p02717/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02717/Go/s341794724.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s341794724", "user_id": "u814575783"}, "prompt_components": {"gold_output": "3 1 2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, 1000000)\n\n\tA, B, C := getInt(), getInt(), getInt()\n\tA, B = B, A\n\tA, C = C, A\n\tout(A, B, C)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have three boxes A, B, and C, each of which contains an integer.\n\nCurrently, the boxes A, B, and C contain the integers X, Y, and Z, respectively.\n\nWe will now do the operations below in order. Find the content of each box afterward.\n\nSwap the contents of the boxes A and B\n\nSwap the contents of the boxes A and C\n\nConstraints\n\n1 \\leq X,Y,Z \\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 Z\n\nOutput\n\nPrint the integers contained in the boxes A, B, and C, in this order, with space in between.\n\nSample Input 1\n\n1 2 3\n\nSample Output 1\n\n3 1 2\n\nAfter the contents of the boxes A and B are swapped, A, B, and C contain 2, 1, and 3, respectively.\n\nThen, after the contents of A and C are swapped, A, B, and C contain 3, 1, and 2, respectively.\n\nSample Input 2\n\n100 100 100\n\nSample Output 2\n\n100 100 100\n\nSample Input 3\n\n41 59 31\n\nSample Output 3\n\n31 41 59", "sample_input": "1 2 3\n"}, "reference_outputs": ["3 1 2\n"], "source_document_id": "p02717", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have three boxes A, B, and C, each of which contains an integer.\n\nCurrently, the boxes A, B, and C contain the integers X, Y, and Z, respectively.\n\nWe will now do the operations below in order. Find the content of each box afterward.\n\nSwap the contents of the boxes A and B\n\nSwap the contents of the boxes A and C\n\nConstraints\n\n1 \\leq X,Y,Z \\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 Z\n\nOutput\n\nPrint the integers contained in the boxes A, B, and C, in this order, with space in between.\n\nSample Input 1\n\n1 2 3\n\nSample Output 1\n\n3 1 2\n\nAfter the contents of the boxes A and B are swapped, A, B, and C contain 2, 1, and 3, respectively.\n\nThen, after the contents of A and C are swapped, A, B, and C contain 3, 1, and 2, respectively.\n\nSample Input 2\n\n100 100 100\n\nSample Output 2\n\n100 100 100\n\nSample Input 3\n\n41 59 31\n\nSample Output 3\n\n31 41 59", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 771, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s776431923", "group_id": "codeNet:p02718", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar N, M int\n\tfmt.Scanf(\"%d %d\", &N, &M)\n\n\tA := make([]int, N)\n\n\tvar all int\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scanf(\"%d\", &A[i])\n\t\tall = all + A[i]\n\t}\n\n\tsort.Sort(sort.Reverse(sort.IntSlice(A)))\n\tvar count int\n\tfor i := 0; i < N; i++ {\n\t\tif A[i]*4*M >= all {\n\t\t\tcount++\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif count >= M {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1595133420, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02718.html", "problem_id": "p02718", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02718/input.txt", "sample_output_relpath": "derived/input_output/data/p02718/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02718/Go/s776431923.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s776431923", "user_id": "u128015095"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar N, M int\n\tfmt.Scanf(\"%d %d\", &N, &M)\n\n\tA := make([]int, N)\n\n\tvar all int\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scanf(\"%d\", &A[i])\n\t\tall = all + A[i]\n\t}\n\n\tsort.Sort(sort.Reverse(sort.IntSlice(A)))\n\tvar count int\n\tfor i := 0; i < N; i++ {\n\t\tif A[i]*4*M >= all {\n\t\t\tcount++\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif count >= M {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "sample_input": "4 1\n5 4 2 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02718", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 426, "cpu_time_ms": 8, "memory_kb": 1848}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s715853855", "group_id": "codeNet:p02718", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc sliceUnique(target []int) (unique []int) {\n\tm := map[int]bool{}\n\n\tfor _, v := range target {\n\t\tif !m[v] {\n\t\t\tm[v] = true\n\t\t\tunique = append(unique, v)\n\t\t}\n\t}\n\n\treturn unique\n}\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\tif m > n {\n\t\treturn\n\t}\n\tpoints := make([]int, n)\n\tsum := 0\n\n\tfor i:=0; i= float64(sum / (4 * m)) {\n\t\tfmt.Println(\"Yes\")\n\t}else{\n\t\tfmt.Print(\"No\")\n\t}\n\n}", "language": "Go", "metadata": {"date": 1592842237, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02718.html", "problem_id": "p02718", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02718/input.txt", "sample_output_relpath": "derived/input_output/data/p02718/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02718/Go/s715853855.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s715853855", "user_id": "u223172005"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc sliceUnique(target []int) (unique []int) {\n\tm := map[int]bool{}\n\n\tfor _, v := range target {\n\t\tif !m[v] {\n\t\t\tm[v] = true\n\t\t\tunique = append(unique, v)\n\t\t}\n\t}\n\n\treturn unique\n}\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\tif m > n {\n\t\treturn\n\t}\n\tpoints := make([]int, n)\n\tsum := 0\n\n\tfor i:=0; i= float64(sum / (4 * m)) {\n\t\tfmt.Println(\"Yes\")\n\t}else{\n\t\tfmt.Print(\"No\")\n\t}\n\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "sample_input": "4 1\n5 4 2 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02718", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 597, "cpu_time_ms": 8, "memory_kb": 1880}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s734731814", "group_id": "codeNet:p02718", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\tif m > n {\n\t\treturn\n\t}\n\tpoints := make([]int, n)\n\tsum := 0\n\n\tfor i:=0; i= sum / (4 * m){\n\t\tfmt.Println(\"Yes\")\n\t}else{\n\t\tfmt.Print(\"No\")\n\t}\n\n}", "language": "Go", "metadata": {"date": 1592842055, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02718.html", "problem_id": "p02718", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02718/input.txt", "sample_output_relpath": "derived/input_output/data/p02718/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02718/Go/s734731814.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s734731814", "user_id": "u223172005"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\tif m > n {\n\t\treturn\n\t}\n\tpoints := make([]int, n)\n\tsum := 0\n\n\tfor i:=0; i= sum / (4 * m){\n\t\tfmt.Println(\"Yes\")\n\t}else{\n\t\tfmt.Print(\"No\")\n\t}\n\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "sample_input": "4 1\n5 4 2 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02718", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 6, "memory_kb": 1844}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s032229444", "group_id": "codeNet:p02718", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n\nfunc scanInt64() int64 {\n\tsc.Scan()\n\ti, _ := strconv.ParseInt(sc.Text(), 10, 64)\n\treturn i\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t}\n\treturn res\n}\n\nfunc scanInts64(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := range res {\n\t\tres[i] = scanInt64()\n\t}\n\treturn res\n}\n\nfunc scanText() string {\n\tsc.Buffer([]byte{}, math.MaxInt64)\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn, m := scanInt(), scanInt()\n\n\ta := scanInts(n)\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\tsum := 0\n\n\tfor i := 0; i < n; i++ {\n\t\tsum += a[i]\n\t}\n\n\tfor i := 0; i < m; i++ {\n\t\tif 4*m*a[i] < sum {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n}\n", "language": "Go", "metadata": {"date": 1592061005, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02718.html", "problem_id": "p02718", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02718/input.txt", "sample_output_relpath": "derived/input_output/data/p02718/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02718/Go/s032229444.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s032229444", "user_id": "u475329018"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n\nfunc scanInt64() int64 {\n\tsc.Scan()\n\ti, _ := strconv.ParseInt(sc.Text(), 10, 64)\n\treturn i\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = scanInt()\n\t}\n\treturn res\n}\n\nfunc scanInts64(n int) []int64 {\n\tres := make([]int64, n)\n\tfor i := range res {\n\t\tres[i] = scanInt64()\n\t}\n\treturn res\n}\n\nfunc scanText() string {\n\tsc.Buffer([]byte{}, math.MaxInt64)\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn, m := scanInt(), scanInt()\n\n\ta := scanInts(n)\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\tsum := 0\n\n\tfor i := 0; i < n; i++ {\n\t\tsum += a[i]\n\t}\n\n\tfor i := 0; i < m; i++ {\n\t\tif 4*m*a[i] < sum {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "sample_input": "4 1\n5 4 2 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02718", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 911, "cpu_time_ms": 2, "memory_kb": 1760}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s301048657", "group_id": "codeNet:p02718", "input_text": "package main\n\nimport (\n \"fmt\"\n \"sort\"\n)\n\nfunc main() {\n var n, m int\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\tv := make([]int, n)\n\tfor i := range v {\n\t\tfmt.Scan(&v[i])\n\t}\n\n\tsort.Sort(sort.Reverse(sort.IntSlice(v)))\n\tr := 0\n\tfor _, i := range v {\n\t\tr = r + i\n\t}\n\tl := r / (m * 4)\n\tvar a string\n\tif v[m-1] > l {\n\t\ta = \"Yes\"\n\t} else {\n\t\ta = \"No\"\n\t}\n\tfmt.Println(a)\n}\n", "language": "Go", "metadata": {"date": 1588577889, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02718.html", "problem_id": "p02718", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02718/input.txt", "sample_output_relpath": "derived/input_output/data/p02718/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02718/Go/s301048657.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s301048657", "user_id": "u887493548"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"sort\"\n)\n\nfunc main() {\n var n, m int\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\tv := make([]int, n)\n\tfor i := range v {\n\t\tfmt.Scan(&v[i])\n\t}\n\n\tsort.Sort(sort.Reverse(sort.IntSlice(v)))\n\tr := 0\n\tfor _, i := range v {\n\t\tr = r + i\n\t}\n\tl := r / (m * 4)\n\tvar a string\n\tif v[m-1] > l {\n\t\ta = \"Yes\"\n\t} else {\n\t\ta = \"No\"\n\t}\n\tfmt.Println(a)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "sample_input": "4 1\n5 4 2 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02718", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 355, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s487155744", "group_id": "codeNet:p02718", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc readLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tvar N, M int\n\tfmt.Scan(&N, &M)\n\n\tinputs := strings.Split(readLine(), \" \")\n\n\tsum := 0\n\n\tfor i := 0; i < N; i++{\n\t\tnum, _ := strconv.Atoi(inputs[i])\n\t\tsum += num\n\t}\n\n\tcount := 0\n\n\tfor i := 0; i < N; i++ {\n\t\tnum, _ := strconv.Atoi(inputs[i])\n\n\t\tif num >= (sum / (4 * M)){\n\t\t\tcount++\n\t\t}\n\t}\n\n\tif count >= M {\n\t\tfmt.Println(\"Yes\")\n\t}else{\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1587869761, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02718.html", "problem_id": "p02718", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02718/input.txt", "sample_output_relpath": "derived/input_output/data/p02718/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02718/Go/s487155744.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s487155744", "user_id": "u942427847"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc readLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tvar N, M int\n\tfmt.Scan(&N, &M)\n\n\tinputs := strings.Split(readLine(), \" \")\n\n\tsum := 0\n\n\tfor i := 0; i < N; i++{\n\t\tnum, _ := strconv.Atoi(inputs[i])\n\t\tsum += num\n\t}\n\n\tcount := 0\n\n\tfor i := 0; i < N; i++ {\n\t\tnum, _ := strconv.Atoi(inputs[i])\n\n\t\tif num >= (sum / (4 * M)){\n\t\t\tcount++\n\t\t}\n\t}\n\n\tif count >= M {\n\t\tfmt.Println(\"Yes\")\n\t}else{\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "sample_input": "4 1\n5 4 2 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02718", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 539, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s117199914", "group_id": "codeNet:p02718", "input_text": "package main\n\nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n \"strconv\"\n \"sort\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc sum(slice []int) int {\n total := 0\n for _, n := range slice {\n total += n\n }\n return total\n}\n\nfunc main() {\n sc.Split(bufio.ScanWords)\n\n n, m := nextInt(), nextInt()\n a := nextIntArr(n)\n sortIntsRev(a)\n\n threshold := sum(a) / (4 * m)\n\n count := 0\n for _, c := range a{\n if threshold <= c {\n count++\n }\n }\n\n if count >= m {\n fmt.Println(\"Yes\")\n } else {\n fmt.Println(\"No\")\n }\n}\n\n\n// Library\n\nfunc nextLine() string {\n sc.Scan()\n return sc.Text()\n}\n\nfunc nextInt() int {\n sc.Scan()\n i, _ := strconv.Atoi(sc.Text())\n return i\n}\n\nfunc nextIntArr(n int) []int {\n var a []int\n for i := 0; i < n; i++ {\n a = append(a, nextInt())\n }\n return a\n}\n\n// 数値を桁区切りのスライスにする\nfunc digit(n int, list []int) []int {\n if n > 0 {\n return digit(n/10, append(list, n%10))\n }\n return list\n}\n\nfunc sortIntsRev(list []int) {\n sort.Sort(sort.Reverse(sort.IntSlice(list)))\n}\n\nfunc strReverse(s string) string {\n runes := []rune(s)\n for i := 0; i < len(s)/2; i++ {\n runes[i], runes[len(s)-1-i] = runes[len(s)-1-i], runes[i]\n }\n return string(runes)\n}\n\n", "language": "Go", "metadata": {"date": 1586790580, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02718.html", "problem_id": "p02718", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02718/input.txt", "sample_output_relpath": "derived/input_output/data/p02718/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02718/Go/s117199914.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s117199914", "user_id": "u027622859"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n \"strconv\"\n \"sort\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc sum(slice []int) int {\n total := 0\n for _, n := range slice {\n total += n\n }\n return total\n}\n\nfunc main() {\n sc.Split(bufio.ScanWords)\n\n n, m := nextInt(), nextInt()\n a := nextIntArr(n)\n sortIntsRev(a)\n\n threshold := sum(a) / (4 * m)\n\n count := 0\n for _, c := range a{\n if threshold <= c {\n count++\n }\n }\n\n if count >= m {\n fmt.Println(\"Yes\")\n } else {\n fmt.Println(\"No\")\n }\n}\n\n\n// Library\n\nfunc nextLine() string {\n sc.Scan()\n return sc.Text()\n}\n\nfunc nextInt() int {\n sc.Scan()\n i, _ := strconv.Atoi(sc.Text())\n return i\n}\n\nfunc nextIntArr(n int) []int {\n var a []int\n for i := 0; i < n; i++ {\n a = append(a, nextInt())\n }\n return a\n}\n\n// 数値を桁区切りのスライスにする\nfunc digit(n int, list []int) []int {\n if n > 0 {\n return digit(n/10, append(list, n%10))\n }\n return list\n}\n\nfunc sortIntsRev(list []int) {\n sort.Sort(sort.Reverse(sort.IntSlice(list)))\n}\n\nfunc strReverse(s string) string {\n runes := []rune(s)\n for i := 0; i < len(s)/2; i++ {\n runes[i], runes[len(s)-1-i] = runes[len(s)-1-i], runes[i]\n }\n return string(runes)\n}\n\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "sample_input": "4 1\n5 4 2 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02718", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1334, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s079279352", "group_id": "codeNet:p02718", "input_text": "package main\n\nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n \"strconv\"\n \"sort\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc sum(slice []int) int {\n total := 0\n for _, n := range slice {\n total += n\n }\n return total\n}\n\nfunc main() {\n sc.Split(bufio.ScanWords)\n\n n, m := nextInt(), nextInt()\n a := nextIntArr(n)\n sortIntsRev(a)\n\n threshold := sum(a) / (4 * m)\n\n count := 0\n for _, c := range a{\n if threshold < c {\n count++\n }\n }\n\n if count >= m {\n fmt.Println(\"Yes\")\n } else {\n fmt.Println(\"No\")\n }\n}\n\n\n// Library\n\nfunc nextLine() string {\n sc.Scan()\n return sc.Text()\n}\n\nfunc nextInt() int {\n sc.Scan()\n i, _ := strconv.Atoi(sc.Text())\n return i\n}\n\nfunc nextIntArr(n int) []int {\n var a []int\n for i := 0; i < n; i++ {\n a = append(a, nextInt())\n }\n return a\n}\n\n// 数値を桁区切りのスライスにする\nfunc digit(n int, list []int) []int {\n if n > 0 {\n return digit(n/10, append(list, n%10))\n }\n return list\n}\n\nfunc sortIntsRev(list []int) {\n sort.Sort(sort.Reverse(sort.IntSlice(list)))\n}\n\nfunc strReverse(s string) string {\n runes := []rune(s)\n for i := 0; i < len(s)/2; i++ {\n runes[i], runes[len(s)-1-i] = runes[len(s)-1-i], runes[i]\n }\n return string(runes)\n}\n\n", "language": "Go", "metadata": {"date": 1586790309, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02718.html", "problem_id": "p02718", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02718/input.txt", "sample_output_relpath": "derived/input_output/data/p02718/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02718/Go/s079279352.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s079279352", "user_id": "u027622859"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n \"strconv\"\n \"sort\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc sum(slice []int) int {\n total := 0\n for _, n := range slice {\n total += n\n }\n return total\n}\n\nfunc main() {\n sc.Split(bufio.ScanWords)\n\n n, m := nextInt(), nextInt()\n a := nextIntArr(n)\n sortIntsRev(a)\n\n threshold := sum(a) / (4 * m)\n\n count := 0\n for _, c := range a{\n if threshold < c {\n count++\n }\n }\n\n if count >= m {\n fmt.Println(\"Yes\")\n } else {\n fmt.Println(\"No\")\n }\n}\n\n\n// Library\n\nfunc nextLine() string {\n sc.Scan()\n return sc.Text()\n}\n\nfunc nextInt() int {\n sc.Scan()\n i, _ := strconv.Atoi(sc.Text())\n return i\n}\n\nfunc nextIntArr(n int) []int {\n var a []int\n for i := 0; i < n; i++ {\n a = append(a, nextInt())\n }\n return a\n}\n\n// 数値を桁区切りのスライスにする\nfunc digit(n int, list []int) []int {\n if n > 0 {\n return digit(n/10, append(list, n%10))\n }\n return list\n}\n\nfunc sortIntsRev(list []int) {\n sort.Sort(sort.Reverse(sort.IntSlice(list)))\n}\n\nfunc strReverse(s string) string {\n runes := []rune(s)\n for i := 0; i < len(s)/2; i++ {\n runes[i], runes[len(s)-1-i] = runes[len(s)-1-i], runes[i]\n }\n return string(runes)\n}\n\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "sample_input": "4 1\n5 4 2 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02718", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1333, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s254723868", "group_id": "codeNet:p02718", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\tnum, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn num\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tvar m, n int\n\tfmt.Scan(&n, &m)\n\ta := make([]int, n)\n\tvar totalVote int\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = nextInt()\n\t\ttotalVote += a[i]\n\t}\n\n\tbar := totalVote / (4 * m)\n\n\tjudge := func() string {\n\t\ttotal := 0\n\t\tfor i := 0; i < n; i++ {\n\t\t\tif a[i] >= bar {\n\t\t\t\ttotal++\n\t\t\t}\n\t\t\tif total >= m {\n\t\t\t\treturn \"Yes\"\n\t\t\t}\n\t\t}\n\t\treturn \"No\"\n\t}()\n\n\tfmt.Println(judge)\n}\n", "language": "Go", "metadata": {"date": 1586724727, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02718.html", "problem_id": "p02718", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02718/input.txt", "sample_output_relpath": "derived/input_output/data/p02718/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02718/Go/s254723868.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s254723868", "user_id": "u481836184"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\tnum, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn num\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tvar m, n int\n\tfmt.Scan(&n, &m)\n\ta := make([]int, n)\n\tvar totalVote int\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = nextInt()\n\t\ttotalVote += a[i]\n\t}\n\n\tbar := totalVote / (4 * m)\n\n\tjudge := func() string {\n\t\ttotal := 0\n\t\tfor i := 0; i < n; i++ {\n\t\t\tif a[i] >= bar {\n\t\t\t\ttotal++\n\t\t\t}\n\t\t\tif total >= m {\n\t\t\t\treturn \"Yes\"\n\t\t\t}\n\t\t}\n\t\treturn \"No\"\n\t}()\n\n\tfmt.Println(judge)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "sample_input": "4 1\n5 4 2 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02718", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 614, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s974852556", "group_id": "codeNet:p02718", "input_text": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n \"strings\"\n)\n\nfunc main() {\n var input [][]string = StrStdin()\n var x []string = input[0]\n var y []string = input[1]\n var xx [2]int\n xx[0], _ = strconv.Atoi(x[0])\n xx[1], _ = strconv.Atoi(x[1])\n N := xx[0]\n M := xx[1]\n\n var yy []int\n\n yy = make([]int, N)\n\n for i := 0; i < N; i++ {\n yy[i], _ = strconv.Atoi(y[i])\n }\n var total int = 0\n for i:=0;i= (total/4)/M{\n result++\n }\n }\n if result >= M{\n fmt.Println(\"Yes\")\n }else{\n fmt.Println(\"No\")\n }\n}\n\n\nfunc StrStdin() [][]string {\n var stringInput string\n scanner := bufio.NewScanner(os.Stdin)\n\n scanner.Scan()\n stringInput = scanner.Text()\n\n stringInput = strings.TrimSpace(stringInput)\n\n s := strings.Split(stringInput, \"\\n\")\n\n var Result [][]string = make([][]string, len(s))\n\n for i, st := range s {\n var line []string\n line = strings.Split(st, \" \")\n\n Result[i] = line\n }\n\n return Result\n}\n", "language": "Go", "metadata": {"date": 1586638355, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02718.html", "problem_id": "p02718", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02718/input.txt", "sample_output_relpath": "derived/input_output/data/p02718/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02718/Go/s974852556.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s974852556", "user_id": "u933249552"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n \"strings\"\n)\n\nfunc main() {\n var input [][]string = StrStdin()\n var x []string = input[0]\n var y []string = input[1]\n var xx [2]int\n xx[0], _ = strconv.Atoi(x[0])\n xx[1], _ = strconv.Atoi(x[1])\n N := xx[0]\n M := xx[1]\n\n var yy []int\n\n yy = make([]int, N)\n\n for i := 0; i < N; i++ {\n yy[i], _ = strconv.Atoi(y[i])\n }\n var total int = 0\n for i:=0;i= (total/4)/M{\n result++\n }\n }\n if result >= M{\n fmt.Println(\"Yes\")\n }else{\n fmt.Println(\"No\")\n }\n}\n\n\nfunc StrStdin() [][]string {\n var stringInput string\n scanner := bufio.NewScanner(os.Stdin)\n\n scanner.Scan()\n stringInput = scanner.Text()\n\n stringInput = strings.TrimSpace(stringInput)\n\n s := strings.Split(stringInput, \"\\n\")\n\n var Result [][]string = make([][]string, len(s))\n\n for i, st := range s {\n var line []string\n line = strings.Split(st, \" \")\n\n Result[i] = line\n }\n\n return Result\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "sample_input": "4 1\n5 4 2 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02718", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1119, "cpu_time_ms": 3, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s818894662", "group_id": "codeNet:p02718", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// 文字列を1行入力\nfunc StrStdin() (stringReturned string) {\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\tscanner.Scan()\n\tstringReturned = scanner.Text()\n\n\tstringReturned = strings.TrimSpace(stringReturned)\n\treturn\n}\n\n// 空白や空文字だけの値を除去したSplit()\nfunc SplitWithoutEmpty(stringTargeted string, delim string) (stringReturned []string) {\n\tstringSplited := strings.Split(stringTargeted, delim)\n\n\tfor _, str := range stringSplited {\n\t\tif str != \"\" {\n\t\t\tstringReturned = append(stringReturned, str)\n\t\t}\n\t}\n\treturn\n}\n\n// デリミタで分割して文字列スライスを取得\nfunc SplitStrStdin(delim string) (stringReturned []string) {\n\t// 文字列で1行取得\n\tstringInput := StrStdin()\n\n\t// 空白で分割\n\t// stringSplited := strings.Split(stringInput, delim)\n\tstringReturned = SplitWithoutEmpty(stringInput, delim)\n\n\treturn\n}\n\n// デリミタで分割して整数値スライスを取得\nfunc SplitIntStdin(delim string) (intSlices []int, err error) {\n\t// 文字列スライスを取得\n\tstringSplited := SplitStrStdin(\" \")\n\n\t// 整数スライスに保存\n\tfor i := range stringSplited {\n\t\tvar iparam int\n\t\tiparam, err = strconv.Atoi(stringSplited[i])\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tintSlices = append(intSlices, iparam)\n\t}\n\treturn\n}\n\nfunc main() {\n\tinput, _ := SplitIntStdin(\" \")\n\t_, M := input[0], input[1]\n\n\tinput, _ = SplitIntStdin(\" \")\n\n\tsum := 0\n\tfor _, x := range input {\n\t\tsum += x\n\t}\n\n\tvar M_f float64 = float64(M)\n\tvar sum_f float64 = float64(sum)\n\n\tcount := 0\n\tfor _, x := range input {\n\t\tvar x_f float64 = float64(x)\n\t\tif x_f >= sum_f/(4.0*M_f) {\n\t\t\tcount += 1\n\t\t}\n\t}\n\n\tif count >= M {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n\n}", "language": "Go", "metadata": {"date": 1586623324, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02718.html", "problem_id": "p02718", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02718/input.txt", "sample_output_relpath": "derived/input_output/data/p02718/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02718/Go/s818894662.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s818894662", "user_id": "u699547221"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// 文字列を1行入力\nfunc StrStdin() (stringReturned string) {\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\tscanner.Scan()\n\tstringReturned = scanner.Text()\n\n\tstringReturned = strings.TrimSpace(stringReturned)\n\treturn\n}\n\n// 空白や空文字だけの値を除去したSplit()\nfunc SplitWithoutEmpty(stringTargeted string, delim string) (stringReturned []string) {\n\tstringSplited := strings.Split(stringTargeted, delim)\n\n\tfor _, str := range stringSplited {\n\t\tif str != \"\" {\n\t\t\tstringReturned = append(stringReturned, str)\n\t\t}\n\t}\n\treturn\n}\n\n// デリミタで分割して文字列スライスを取得\nfunc SplitStrStdin(delim string) (stringReturned []string) {\n\t// 文字列で1行取得\n\tstringInput := StrStdin()\n\n\t// 空白で分割\n\t// stringSplited := strings.Split(stringInput, delim)\n\tstringReturned = SplitWithoutEmpty(stringInput, delim)\n\n\treturn\n}\n\n// デリミタで分割して整数値スライスを取得\nfunc SplitIntStdin(delim string) (intSlices []int, err error) {\n\t// 文字列スライスを取得\n\tstringSplited := SplitStrStdin(\" \")\n\n\t// 整数スライスに保存\n\tfor i := range stringSplited {\n\t\tvar iparam int\n\t\tiparam, err = strconv.Atoi(stringSplited[i])\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tintSlices = append(intSlices, iparam)\n\t}\n\treturn\n}\n\nfunc main() {\n\tinput, _ := SplitIntStdin(\" \")\n\t_, M := input[0], input[1]\n\n\tinput, _ = SplitIntStdin(\" \")\n\n\tsum := 0\n\tfor _, x := range input {\n\t\tsum += x\n\t}\n\n\tvar M_f float64 = float64(M)\n\tvar sum_f float64 = float64(sum)\n\n\tcount := 0\n\tfor _, x := range input {\n\t\tvar x_f float64 = float64(x)\n\t\tif x_f >= sum_f/(4.0*M_f) {\n\t\t\tcount += 1\n\t\t}\n\t}\n\n\tif count >= M {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "sample_input": "4 1\n5 4 2 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02718", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1762, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s497330784", "group_id": "codeNet:p02718", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar N, M int \n\tvar ans int\n\n\tfmt.Scan(&N, &M)\n\t\n\tvar A []int = make([]int, N) \n\n\tfor i := 0 ; i < N ; i++ {\n\t\tfmt.Scan(&A[i])\n\t}\n\n\tfor i := 0 ; i < N ; i++ {\n\t\tans += A[i]\n\t}\n\n\tcnt := 0\n\tfor _, e := range A {\n\t\tif 4 * M * e >= ans {cnt++}\n\t}\n\n\tif cnt >= M {\n\t\tfmt.Println(\"Yes\")\n\t}else {\n\t\tfmt.Println(\"No\")\n\t}\n}", "language": "Go", "metadata": {"date": 1586305867, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02718.html", "problem_id": "p02718", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02718/input.txt", "sample_output_relpath": "derived/input_output/data/p02718/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02718/Go/s497330784.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s497330784", "user_id": "u283295031"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar N, M int \n\tvar ans int\n\n\tfmt.Scan(&N, &M)\n\t\n\tvar A []int = make([]int, N) \n\n\tfor i := 0 ; i < N ; i++ {\n\t\tfmt.Scan(&A[i])\n\t}\n\n\tfor i := 0 ; i < N ; i++ {\n\t\tans += A[i]\n\t}\n\n\tcnt := 0\n\tfor _, e := range A {\n\t\tif 4 * M * e >= ans {cnt++}\n\t}\n\n\tif cnt >= M {\n\t\tfmt.Println(\"Yes\")\n\t}else {\n\t\tfmt.Println(\"No\")\n\t}\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "sample_input": "4 1\n5 4 2 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02718", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s514555510", "group_id": "codeNet:p02718", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\ntype row []string\n\ntype data []row\n\nfunc main() {\n\tnextReader = newScanner()\n\tN := nextInt()\n\tM := nextInt()\n\tsum := 0\n\tAs := []int{}\n\tfor n := 0; n < N; n++ {\n\t\tA := nextInt()\n\t\tAs = append(As, A)\n\t\tsum += A\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(As)))\n\tfor n := 0; n < M; n++ {\n\t\tif As[n] < sum/(4*M) {\n\t\t\tfmt.Print(\"no\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Print(\"yes\")\n}\n\nvar nextReader func() string\n\nfunc newScanner() func() string {\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\t// r.Split(bufio.ScanLines)\n\treturn func() string {\n\t\tr.Scan()\n\t\treturn r.Text()\n\t}\n}\n\nfunc CustomScan(data []byte, atEOF bool) (advance int, token []byte, err error) {\n\tfor i := 0; i < len(data); i++ {\n\t\tif data[i] == ' ' {\n\t\t\treturn i + 1, data[:i], nil\n\t\t}\n\t}\n\tfmt.Println(data)\n\treturn 0, data, bufio.ErrFinalToken\n}\n\nfunc nextStrings() func() string {\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\t// r.Split(bufio.ScanWords)\n\tr.Split(CustomScan)\n\treturn func() string {\n\t\tr.Scan()\n\t\treturn r.Text()\n\t}\n}\n\nfunc nextString() string {\n\treturn nextReader()\n}\nfunc nextInt64() int64 {\n\tv, _ := strconv.ParseInt(nextReader(), 10, 64)\n\treturn v\n}\nfunc nextInt() int {\n\tv, _ := strconv.Atoi(nextReader())\n\treturn v\n}\nfunc nextInts(n int) []int {\n\tr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt()\n\t}\n\treturn r\n}\nfunc nextInt64s(n int) []int64 {\n\tr := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt64()\n\t}\n\treturn r\n}\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(nextReader(), 64)\n\treturn f\n}\n\nfunc maxInt(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n", "language": "Go", "metadata": {"date": 1586264327, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02718.html", "problem_id": "p02718", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02718/input.txt", "sample_output_relpath": "derived/input_output/data/p02718/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02718/Go/s514555510.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s514555510", "user_id": "u796230714"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\ntype row []string\n\ntype data []row\n\nfunc main() {\n\tnextReader = newScanner()\n\tN := nextInt()\n\tM := nextInt()\n\tsum := 0\n\tAs := []int{}\n\tfor n := 0; n < N; n++ {\n\t\tA := nextInt()\n\t\tAs = append(As, A)\n\t\tsum += A\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(As)))\n\tfor n := 0; n < M; n++ {\n\t\tif As[n] < sum/(4*M) {\n\t\t\tfmt.Print(\"no\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Print(\"yes\")\n}\n\nvar nextReader func() string\n\nfunc newScanner() func() string {\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\t// r.Split(bufio.ScanLines)\n\treturn func() string {\n\t\tr.Scan()\n\t\treturn r.Text()\n\t}\n}\n\nfunc CustomScan(data []byte, atEOF bool) (advance int, token []byte, err error) {\n\tfor i := 0; i < len(data); i++ {\n\t\tif data[i] == ' ' {\n\t\t\treturn i + 1, data[:i], nil\n\t\t}\n\t}\n\tfmt.Println(data)\n\treturn 0, data, bufio.ErrFinalToken\n}\n\nfunc nextStrings() func() string {\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\t// r.Split(bufio.ScanWords)\n\tr.Split(CustomScan)\n\treturn func() string {\n\t\tr.Scan()\n\t\treturn r.Text()\n\t}\n}\n\nfunc nextString() string {\n\treturn nextReader()\n}\nfunc nextInt64() int64 {\n\tv, _ := strconv.ParseInt(nextReader(), 10, 64)\n\treturn v\n}\nfunc nextInt() int {\n\tv, _ := strconv.Atoi(nextReader())\n\treturn v\n}\nfunc nextInts(n int) []int {\n\tr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt()\n\t}\n\treturn r\n}\nfunc nextInt64s(n int) []int64 {\n\tr := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt64()\n\t}\n\treturn r\n}\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(nextReader(), 64)\n\treturn f\n}\n\nfunc maxInt(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "sample_input": "4 1\n5 4 2 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02718", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1735, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s938035448", "group_id": "codeNet:p02718", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\nvar (\n\tread = bufio.NewReader(os.Stdin)\n\twrite = bufio.NewWriter(os.Stdout)\n)\n\nfunc min(a, b int) int {\n\tif a <= b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a >= b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc yesno(result bool) {\n\tif result {\n\t\tfmt.Fprintln(write, \"Yes\")\n\t} else {\n\t\tfmt.Fprintln(write, \"No\")\n\t}\n}\n\nfunc printansStr(result bool, a, b string) {\n\tif result {\n\t\tfmt.Fprintln(write, a)\n\t} else {\n\t\tfmt.Fprintln(write, b)\n\t}\n}\n\nfunc printansInt(result bool, a, b int) {\n\tif result {\n\t\tfmt.Fprintln(write, a)\n\t} else {\n\t\tfmt.Fprintln(write, b)\n\t}\n}\n\nfunc main() {\n\tdefer write.Flush()\n\n\tvar n, m int\n\tfmt.Fscan(read, &n, &m)\n\n\ta := make([]int, n)\n\tsum := 0\n\tfor i := range a {\n\t\tfmt.Fscan(read, &a[i])\n\t\tsum += a[i]\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\n\tif a[m-1]*4*m < sum {\n\t\tfmt.Fprintln(write, \"No\")\n\t} else {\n\t\tfmt.Fprintln(write, \"Yes\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1586227628, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02718.html", "problem_id": "p02718", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02718/input.txt", "sample_output_relpath": "derived/input_output/data/p02718/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02718/Go/s938035448.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s938035448", "user_id": "u491550356"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\nvar (\n\tread = bufio.NewReader(os.Stdin)\n\twrite = bufio.NewWriter(os.Stdout)\n)\n\nfunc min(a, b int) int {\n\tif a <= b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a >= b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc yesno(result bool) {\n\tif result {\n\t\tfmt.Fprintln(write, \"Yes\")\n\t} else {\n\t\tfmt.Fprintln(write, \"No\")\n\t}\n}\n\nfunc printansStr(result bool, a, b string) {\n\tif result {\n\t\tfmt.Fprintln(write, a)\n\t} else {\n\t\tfmt.Fprintln(write, b)\n\t}\n}\n\nfunc printansInt(result bool, a, b int) {\n\tif result {\n\t\tfmt.Fprintln(write, a)\n\t} else {\n\t\tfmt.Fprintln(write, b)\n\t}\n}\n\nfunc main() {\n\tdefer write.Flush()\n\n\tvar n, m int\n\tfmt.Fscan(read, &n, &m)\n\n\ta := make([]int, n)\n\tsum := 0\n\tfor i := range a {\n\t\tfmt.Fscan(read, &a[i])\n\t\tsum += a[i]\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\n\tif a[m-1]*4*m < sum {\n\t\tfmt.Fprintln(write, \"No\")\n\t} else {\n\t\tfmt.Fprintln(write, \"Yes\")\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "sample_input": "4 1\n5 4 2 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02718", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 931, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s291424937", "group_id": "codeNet:p02718", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, m, j int\n\tarr := make([]int, 0)\n\ttotal := 0\n\tfmt.Scanf(\"%d %d\\n\", &n, &m)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &j)\n\t\tarr = append(arr, j)\n\t\ttotal += j\n\t}\n\t// popular := total / (4 * m)\n\tsort.Sort(sort.Reverse(sort.IntSlice(arr)))\n\t// flag := true\n\t// for i := 0; i < m; i++ {\n\t// \tif arr[i] < popular {\n\t// \t\tflag = false\n\t// \t\tbreak\n\t// \t}\n\t// }\n\tif arr[m-1]*4*m >= total {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1586118486, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02718.html", "problem_id": "p02718", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02718/input.txt", "sample_output_relpath": "derived/input_output/data/p02718/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02718/Go/s291424937.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s291424937", "user_id": "u991368720"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, m, j int\n\tarr := make([]int, 0)\n\ttotal := 0\n\tfmt.Scanf(\"%d %d\\n\", &n, &m)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &j)\n\t\tarr = append(arr, j)\n\t\ttotal += j\n\t}\n\t// popular := total / (4 * m)\n\tsort.Sort(sort.Reverse(sort.IntSlice(arr)))\n\t// flag := true\n\t// for i := 0; i < m; i++ {\n\t// \tif arr[i] < popular {\n\t// \t\tflag = false\n\t// \t\tbreak\n\t// \t}\n\t// }\n\tif arr[m-1]*4*m >= total {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "sample_input": "4 1\n5 4 2 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02718", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 501, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s864817039", "group_id": "codeNet:p02718", "input_text": "package main\nimport(\n \"fmt\"\n)\nfunc main(){\n var i, n int\n var sum, m, count float64\n sum=0\n count=0\n fmt.Scan(&n, &m)\n a:=make([]float64, n)\n for i=0;i= float64(1)/(4.0*float64(M)) {\n\t\t\tselec++\n\t\t}\n\t}\n\tif selec >= M {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\n/*==========================================\n * Library\n *==========================================*/\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\nfunc doubleAry(h int64, w int64, init int64) (res [][]int64) {\n\tres = make([][]int64, h)\n\tfor i := int64(0); i < h; i++ {\n\t\tres[i] = make([]int64, w)\n\t\tfor j := int64(0); j < w; j++ {\n\t\t\tres[i][j] = init\n\t\t}\n\t}\n\treturn\n}\n\nfunc aryEq(a []int64, b []int64) bool {\n\treturn reflect.DeepEqual(a, b)\n}\n\nfunc clone(n []int64) (r []int64) {\n\tr = make([]int64, len(n))\n\tfor i := 0; i < len(n); i++ {\n\t\tr[i] = n[i]\n\t}\n\treturn\n}\nfunc write(s string) {\n\twriter.WriteString(s)\n}\n\nfunc print() {\n\twriter.Flush()\n}\n\n// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可\nfunc readLine() (s string) {\n\tif scanner.Scan() {\n\t\ts = scanner.Text()\n\t}\n\treturn s\n}\n\nfunc readInt() (read int64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseInt(scanner.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readFloat() (read float64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readRunes() (read []rune) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, v)\n\t}\n\treturn\n}\n\nfunc readString() (read string) {\n\tscanner.Scan()\n\tread = scanner.Text()\n\treturn\n}\n\nfunc readStrings() (read []string) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, string(v))\n\t}\n\treturn\n}\n\nfunc s2i(s string) int64 {\n\tvar intVal, e = strconv.ParseInt(s, 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int64) string {\n\tvar strVal = strconv.FormatInt(i, 10)\n\treturn strVal\n}\n\nfunc s2f(s string) float64 {\n\tvar floatVal, e = strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn floatVal\n}\n\nfunc abs(i int64) int64 {\n\treturn int64(math.Abs(float64(i)))\n}\n\nfunc sum(i []int64) int64 {\n\tsum := int64(0)\n\tfor _, val := range i {\n\t\tsum += val\n\t}\n\treturn sum\n}\n\nfunc split(s string) []string {\n\treturn strings.Fields(s)\n}\n\nfunc strAry2intAry(strs []string) []int64 {\n\tvar ret = make([]int64, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal = s2i(str)\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int64) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = i2s(num)\n\t\tret = append(ret, strVal)\n\t}\n\treturn ret\n}\n\nfunc ary2str(strs []string) string {\n\treturn strings.Join(strs, \" \")\n}\n\nfunc reverse(res []int64) []int64 {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\nfunc reverseStr(res []string) []string {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\n\nfunc ini(res []int, init int) {\n\tif len(res) == 0 {\n\t\treturn\n\t}\n\tres[0] = init\n\tfor i := 0; i < len(res); i++ {\n\t\tcopy(res[i:], res[:i])\n\t}\n}\n\n//\n// func regexpExample() {\n// // Your code here!\n// var str = \"13:20\"\n// r := regexp.MustCompile(`(\\d+):(\\d+)`)\n// fmt.Println(r.FindStringSubmatch(str))\n// }\n\n// type Country struct {\n// gold int\n// silver int\n// blonze int\n// }\n\n// // 複数ソートのサンプル\n// func stableSortExample() []Country{\n// var country = []Country {\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:3, blonze:2},\n// {gold:1, silver:3, blonze:3},\n// }\n// sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })\n// return country\n// }\n", "language": "Go", "metadata": {"date": 1586058681, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02718.html", "problem_id": "p02718", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02718/input.txt", "sample_output_relpath": "derived/input_output/data/p02718/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02718/Go/s766834744.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s766834744", "user_id": "u967669872"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\n/* sort */\ntype pair struct {\n\tindex int64\n\tp1, p2 interface{}\n}\ntype pairs []pair\n\nfunc (slice pairs) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice pairs) Less(i, j int) bool {\n\treturn slice[i].index < slice[j].index\n}\n\nfunc (slice pairs) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\n\n/* sort */\ntype Int64Slice []int64\n\nfunc (slice Int64Slice) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice Int64Slice) Less(i, j int) bool {\n\treturn slice[i] < slice[j]\n}\n\nfunc (slice Int64Slice) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\nfunc Int64s(a []int64) { sort.Sort(Int64Slice(a)) }\nfunc Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n\tINF = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tdi = []int64{-1, 0, 1, 0}\n\tdj = []int64{0, -1, 0, 1}\n)\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tscanner.Buffer(buf, maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tN, M := readInt(), readInt()\n\tA := make([]int64, N)\n\tfor i := int64(0); i < N; i++ {\n\t\tA[i] = readInt()\n\t}\n\tsums := sum(A)\n\tselec := int64(0)\n\tfor i := int64(0); i < N; i++ {\n\t\tif float64(A[i])/float64(sums) >= float64(1)/(4.0*float64(M)) {\n\t\t\tselec++\n\t\t}\n\t}\n\tif selec >= M {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\n/*==========================================\n * Library\n *==========================================*/\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\nfunc doubleAry(h int64, w int64, init int64) (res [][]int64) {\n\tres = make([][]int64, h)\n\tfor i := int64(0); i < h; i++ {\n\t\tres[i] = make([]int64, w)\n\t\tfor j := int64(0); j < w; j++ {\n\t\t\tres[i][j] = init\n\t\t}\n\t}\n\treturn\n}\n\nfunc aryEq(a []int64, b []int64) bool {\n\treturn reflect.DeepEqual(a, b)\n}\n\nfunc clone(n []int64) (r []int64) {\n\tr = make([]int64, len(n))\n\tfor i := 0; i < len(n); i++ {\n\t\tr[i] = n[i]\n\t}\n\treturn\n}\nfunc write(s string) {\n\twriter.WriteString(s)\n}\n\nfunc print() {\n\twriter.Flush()\n}\n\n// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可\nfunc readLine() (s string) {\n\tif scanner.Scan() {\n\t\ts = scanner.Text()\n\t}\n\treturn s\n}\n\nfunc readInt() (read int64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseInt(scanner.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readFloat() (read float64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readRunes() (read []rune) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, v)\n\t}\n\treturn\n}\n\nfunc readString() (read string) {\n\tscanner.Scan()\n\tread = scanner.Text()\n\treturn\n}\n\nfunc readStrings() (read []string) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, string(v))\n\t}\n\treturn\n}\n\nfunc s2i(s string) int64 {\n\tvar intVal, e = strconv.ParseInt(s, 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int64) string {\n\tvar strVal = strconv.FormatInt(i, 10)\n\treturn strVal\n}\n\nfunc s2f(s string) float64 {\n\tvar floatVal, e = strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn floatVal\n}\n\nfunc abs(i int64) int64 {\n\treturn int64(math.Abs(float64(i)))\n}\n\nfunc sum(i []int64) int64 {\n\tsum := int64(0)\n\tfor _, val := range i {\n\t\tsum += val\n\t}\n\treturn sum\n}\n\nfunc split(s string) []string {\n\treturn strings.Fields(s)\n}\n\nfunc strAry2intAry(strs []string) []int64 {\n\tvar ret = make([]int64, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal = s2i(str)\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int64) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = i2s(num)\n\t\tret = append(ret, strVal)\n\t}\n\treturn ret\n}\n\nfunc ary2str(strs []string) string {\n\treturn strings.Join(strs, \" \")\n}\n\nfunc reverse(res []int64) []int64 {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\nfunc reverseStr(res []string) []string {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\n\nfunc ini(res []int, init int) {\n\tif len(res) == 0 {\n\t\treturn\n\t}\n\tres[0] = init\n\tfor i := 0; i < len(res); i++ {\n\t\tcopy(res[i:], res[:i])\n\t}\n}\n\n//\n// func regexpExample() {\n// // Your code here!\n// var str = \"13:20\"\n// r := regexp.MustCompile(`(\\d+):(\\d+)`)\n// fmt.Println(r.FindStringSubmatch(str))\n// }\n\n// type Country struct {\n// gold int\n// silver int\n// blonze int\n// }\n\n// // 複数ソートのサンプル\n// func stableSortExample() []Country{\n// var country = []Country {\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:3, blonze:2},\n// {gold:1, silver:3, blonze:3},\n// }\n// sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })\n// return country\n// }\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "sample_input": "4 1\n5 4 2 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02718", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5511, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s123469105", "group_id": "codeNet:p02718", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc solution(n, m int, a []int) string {\n\tsum := 0\n\tfor _, x := range a {\n\t\tsum += x\n\t}\n\tc := 0\n\tfor _, x := range a {\n\t\tif x < sum/(4*m) {\n\t\t\tcontinue\n\t\t}\n\t\tc++\n\t}\n\tif c >= m {\n\t\treturn \"Yes\"\n\t}\n\treturn \"No\"\n}\n\nfunc main() {\n\tvar n, m, j int\n\tfmt.Scan(&n, &m)\n\ta := make([]int, n)\n\n\tfor i := range a {\n\t\tfmt.Scan(&j)\n\t\ta[i] = j\n\t}\n\tfmt.Println(solution(n, m, a))\n}\n", "language": "Go", "metadata": {"date": 1586050974, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02718.html", "problem_id": "p02718", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02718/input.txt", "sample_output_relpath": "derived/input_output/data/p02718/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02718/Go/s123469105.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s123469105", "user_id": "u568763892"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc solution(n, m int, a []int) string {\n\tsum := 0\n\tfor _, x := range a {\n\t\tsum += x\n\t}\n\tc := 0\n\tfor _, x := range a {\n\t\tif x < sum/(4*m) {\n\t\t\tcontinue\n\t\t}\n\t\tc++\n\t}\n\tif c >= m {\n\t\treturn \"Yes\"\n\t}\n\treturn \"No\"\n}\n\nfunc main() {\n\tvar n, m, j int\n\tfmt.Scan(&n, &m)\n\ta := make([]int, n)\n\n\tfor i := range a {\n\t\tfmt.Scan(&j)\n\t\ta[i] = j\n\t}\n\tfmt.Println(solution(n, m, a))\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "sample_input": "4 1\n5 4 2 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02718", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 400, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s380547081", "group_id": "codeNet:p02718", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\n\tsc.Scan()\n\tN, _ := strconv.Atoi(sc.Text())\n\n\tsc.Scan()\n\tM, _ := strconv.Atoi(sc.Text())\n\n\ttotal := 0\n\ta := make([]int, N)\n\tfor i := range a {\n\t\tsc.Scan()\n\t\ta[i], _ = strconv.Atoi(sc.Text())\n\t\ttotal = total + a[i]\n\t}\n\n\tvar min float64 = float64(total) / float64(4.0*M)\n\n\tfor _, a := range a {\n\t\tif float64(a) > min {\n\t\t\tM = M - 1\n\t\t}\n\t}\n\n\tif M <= 0 {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1586050477, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02718.html", "problem_id": "p02718", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02718/input.txt", "sample_output_relpath": "derived/input_output/data/p02718/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02718/Go/s380547081.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s380547081", "user_id": "u183912232"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\n\tsc.Scan()\n\tN, _ := strconv.Atoi(sc.Text())\n\n\tsc.Scan()\n\tM, _ := strconv.Atoi(sc.Text())\n\n\ttotal := 0\n\ta := make([]int, N)\n\tfor i := range a {\n\t\tsc.Scan()\n\t\ta[i], _ = strconv.Atoi(sc.Text())\n\t\ttotal = total + a[i]\n\t}\n\n\tvar min float64 = float64(total) / float64(4.0*M)\n\n\tfor _, a := range a {\n\t\tif float64(a) > min {\n\t\t\tM = M - 1\n\t\t}\n\t}\n\n\tif M <= 0 {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "sample_input": "4 1\n5 4 2 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02718", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 542, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s841469676", "group_id": "codeNet:p02718", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, m, a int\n\tfmt.Scan(&n, &m)\n\tret := make([]int, n)\n\tmax := 0\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a)\n\t\tret[i] = a\n\t\tmax += a\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(ret)))\n\n\tresult := \"No\"\n\tnum := 0\n\tfor _, r := range ret {\n\t\tif max/(4*m) > r {\n\t\t\tcontinue\n\t\t}\n\t\tnum++\n\t\tif num == m {\n\t\t\tresult = \"Yes\"\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(result)\n}\n", "language": "Go", "metadata": {"date": 1586050256, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02718.html", "problem_id": "p02718", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02718/input.txt", "sample_output_relpath": "derived/input_output/data/p02718/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02718/Go/s841469676.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s841469676", "user_id": "u991577448"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, m, a int\n\tfmt.Scan(&n, &m)\n\tret := make([]int, n)\n\tmax := 0\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a)\n\t\tret[i] = a\n\t\tmax += a\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(ret)))\n\n\tresult := \"No\"\n\tnum := 0\n\tfor _, r := range ret {\n\t\tif max/(4*m) > r {\n\t\t\tcontinue\n\t\t}\n\t\tnum++\n\t\tif num == m {\n\t\t\tresult = \"Yes\"\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(result)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "sample_input": "4 1\n5 4 2 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02718", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 406, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s605073315", "group_id": "codeNet:p02718", "input_text": "package main\n\nimport(\n \"fmt\"\n)\n\nfunc main() {\n var N,M int\n fmt.Scan(&N,&M)\n\n A := make([]int, N)\n sum := 0\n for v := range A{\n\tfmt.Scan(&A[v])\n\tsum += A[v]\n }\n\n var border int\n if sum%(4*M) == 0 {\n\tborder = sum/(4*M) -1\n } else {\n\tborder = sum/(4*M)\n }\n\n count := 0\n for _,v:= range A {\n\tif v >border {\n\t count++\n\t}\n }\n\n if count >= M {\n\tfmt.Println(\"Yes\")\n } else {\n\tfmt.Println(\"No\")\n }\n}\n", "language": "Go", "metadata": {"date": 1586049481, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02718.html", "problem_id": "p02718", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02718/input.txt", "sample_output_relpath": "derived/input_output/data/p02718/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02718/Go/s605073315.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s605073315", "user_id": "u715605488"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport(\n \"fmt\"\n)\n\nfunc main() {\n var N,M int\n fmt.Scan(&N,&M)\n\n A := make([]int, N)\n sum := 0\n for v := range A{\n\tfmt.Scan(&A[v])\n\tsum += A[v]\n }\n\n var border int\n if sum%(4*M) == 0 {\n\tborder = sum/(4*M) -1\n } else {\n\tborder = sum/(4*M)\n }\n\n count := 0\n for _,v:= range A {\n\tif v >border {\n\t count++\n\t}\n }\n\n if count >= M {\n\tfmt.Println(\"Yes\")\n } else {\n\tfmt.Println(\"No\")\n }\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "sample_input": "4 1\n5 4 2 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02718", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 410, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s381573868", "group_id": "codeNet:p02718", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc readInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc readString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn, m := readInt(), readInt()\n\n\ta := make([]int, n)\n\tsum := 0\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = readInt()\n\t\tsum += a[i]\n\t}\n\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\tvar rate float64 = float64(a[m-1]) / float64(sum)\n\n\tif rate < 1.0/float64(4*m) {\n\t\tfmt.Println(\"No\")\n\t} else {\n\t\tfmt.Println(\"Yes\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1586049457, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02718.html", "problem_id": "p02718", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02718/input.txt", "sample_output_relpath": "derived/input_output/data/p02718/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02718/Go/s381573868.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s381573868", "user_id": "u309370374"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc readInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc readString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn, m := readInt(), readInt()\n\n\ta := make([]int, n)\n\tsum := 0\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = readInt()\n\t\tsum += a[i]\n\t}\n\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\tvar rate float64 = float64(a[m-1]) / float64(sum)\n\n\tif rate < 1.0/float64(4*m) {\n\t\tfmt.Println(\"No\")\n\t} else {\n\t\tfmt.Println(\"Yes\")\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "sample_input": "4 1\n5 4 2 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02718", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 623, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s221620188", "group_id": "codeNet:p02718", "input_text": "package main\nimport \"fmt\"\nimport \"sort\"\nfunc main(){\n // Your code here!\n var n, m int\n fmt.Scan(&n, &m)\n \n t := make([]int, n)\n for i := 0; i < n; i++ {\n fmt.Scan(&t[i])\n }\n \n sort.Sort(sort.Reverse(sort.IntSlice(t)))\n var sum int\n for i := 0; i < len(t); i++{\n sum += t[i] \n }\n \n for i := 0; i < m; i++{\n if t[i] < (sum/(4*m)){\n fmt.Println(\"No\")\n return\n }\n }\n fmt.Println(\"Yes\")\n}\n", "language": "Go", "metadata": {"date": 1586049347, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02718.html", "problem_id": "p02718", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02718/input.txt", "sample_output_relpath": "derived/input_output/data/p02718/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02718/Go/s221620188.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s221620188", "user_id": "u167020125"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\nimport \"fmt\"\nimport \"sort\"\nfunc main(){\n // Your code here!\n var n, m int\n fmt.Scan(&n, &m)\n \n t := make([]int, n)\n for i := 0; i < n; i++ {\n fmt.Scan(&t[i])\n }\n \n sort.Sort(sort.Reverse(sort.IntSlice(t)))\n var sum int\n for i := 0; i < len(t); i++{\n sum += t[i] \n }\n \n for i := 0; i < m; i++{\n if t[i] < (sum/(4*m)){\n fmt.Println(\"No\")\n return\n }\n }\n fmt.Println(\"Yes\")\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "sample_input": "4 1\n5 4 2 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02718", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 491, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s138385540", "group_id": "codeNet:p02718", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\tvar N,M int\n\n\tfmt.Scan(&N,&M)\n\n\tA := make([]int,N)\n\n\tfor i:=0;i shikii{\n\n\t\t\tcnt++\n\t\t}\n\t}\n\n\n\tif cnt == M{\n\n\t\tfmt.Println(\"Yes\")\n\n\t}else{\n\n\t\tfmt.Println(\"No\")\n\t}\n\n\n}", "language": "Go", "metadata": {"date": 1586049176, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02718.html", "problem_id": "p02718", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02718/input.txt", "sample_output_relpath": "derived/input_output/data/p02718/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02718/Go/s138385540.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s138385540", "user_id": "u935254309"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\tvar N,M int\n\n\tfmt.Scan(&N,&M)\n\n\tA := make([]int,N)\n\n\tfor i:=0;i shikii{\n\n\t\t\tcnt++\n\t\t}\n\t}\n\n\n\tif cnt == M{\n\n\t\tfmt.Println(\"Yes\")\n\n\t}else{\n\n\t\tfmt.Println(\"No\")\n\t}\n\n\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "sample_input": "4 1\n5 4 2 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02718", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s658662023", "group_id": "codeNet:p02718", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tn := readf()\n\tm := readf()\n\ta := make([]float64, int(n))\n\tvar sum, cnt float64\n\tfor i := range a {\n\t\tfmt.Scan(&a[i])\n\t\tsum += a[i]\n\t}\n\n\tfor i := range a {\n\t\tif a[i] >= sum*(1/(4*m)) {\n\t\t\tcnt++\n\t\t}\n\t}\n\tyesOrNo(cnt >= m)\n}\n\n// IO---------------------------------------------------\n\nfunc readi() (n int) {\n\tfmt.Scan(&n)\n\treturn\n}\n\nfunc readf() (n float64) {\n\tfmt.Scan(&n)\n\treturn\n}\n\nfunc reads() (n string) {\n\tfmt.Scan(&n)\n\treturn\n}\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc readSlice() []string {\n\treturn strings.Split(readLine(), \" \")\n}\n\nfunc atoi(a []string) (b []int) {\n\tb = make([]int, len(a))\n\tfor i := range a {\n\t\tb[i], _ = strconv.Atoi(a[i])\n\t}\n\treturn\n}\n\nfunc atof(a []string) (b []float64) {\n\tb = make([]float64, len(a))\n\tfor i := range a {\n\t\tb[i], _ = strconv.ParseFloat(a[i], 64)\n\t}\n\treturn\n}\n\nfunc readSlice2(n int) (a []int, b []int) {\n\ta = make([]int, n)\n\tb = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i], &b[i])\n\t}\n\treturn\n}\n\nfunc readFloatSlice2(n int) (a []float64, b []float64) {\n\ta = make([]float64, n)\n\tb = make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i], &b[i])\n\t}\n\treturn\n}\n\nfunc yesOrNo(b bool) {\n\tif b {\n\t\tfmt.Println(\"Yes\")\n\t\treturn\n\t}\n\tfmt.Println(\"No\")\n}\n\nfunc yesorNO(b bool) {\n\tif b {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\tfmt.Println(\"NO\")\n}\n\nfunc yesorno(b bool) {\n\tif b {\n\t\tfmt.Println(\"yes\")\n\t\treturn\n\t}\n\tfmt.Println(\"no\")\n}\n\n// calc---------------------------------------------------\n\nfunc abs(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc ave(a []int) (ave int) {\n\tfor i := 0; i < len(a); i++ {\n\t\tave += a[i]\n\t}\n\tave /= len(a)\n\treturn\n}\n\nfunc eq(a []string, b []string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] != b[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc max(a ...int) int {\n\tmax := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tif max < a[i] {\n\t\t\tmax = a[i]\n\t\t}\n\t}\n\treturn max\n}\n\nfunc min(a ...int) int {\n\tmin := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tif min > a[i] {\n\t\t\tmin = a[i]\n\t\t}\n\t}\n\treturn min\n}\n\nfunc mid(a []int) int {\n\tsort.Ints(a)\n\treturn a[len(a)/2]\n}\n\nfunc sum(a []int) (ans int) {\n\tfor i := range a {\n\t\tans += a[i]\n\t}\n\treturn\n}", "language": "Go", "metadata": {"date": 1586049120, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02718.html", "problem_id": "p02718", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02718/input.txt", "sample_output_relpath": "derived/input_output/data/p02718/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02718/Go/s658662023.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s658662023", "user_id": "u963686413"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tn := readf()\n\tm := readf()\n\ta := make([]float64, int(n))\n\tvar sum, cnt float64\n\tfor i := range a {\n\t\tfmt.Scan(&a[i])\n\t\tsum += a[i]\n\t}\n\n\tfor i := range a {\n\t\tif a[i] >= sum*(1/(4*m)) {\n\t\t\tcnt++\n\t\t}\n\t}\n\tyesOrNo(cnt >= m)\n}\n\n// IO---------------------------------------------------\n\nfunc readi() (n int) {\n\tfmt.Scan(&n)\n\treturn\n}\n\nfunc readf() (n float64) {\n\tfmt.Scan(&n)\n\treturn\n}\n\nfunc reads() (n string) {\n\tfmt.Scan(&n)\n\treturn\n}\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc readSlice() []string {\n\treturn strings.Split(readLine(), \" \")\n}\n\nfunc atoi(a []string) (b []int) {\n\tb = make([]int, len(a))\n\tfor i := range a {\n\t\tb[i], _ = strconv.Atoi(a[i])\n\t}\n\treturn\n}\n\nfunc atof(a []string) (b []float64) {\n\tb = make([]float64, len(a))\n\tfor i := range a {\n\t\tb[i], _ = strconv.ParseFloat(a[i], 64)\n\t}\n\treturn\n}\n\nfunc readSlice2(n int) (a []int, b []int) {\n\ta = make([]int, n)\n\tb = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i], &b[i])\n\t}\n\treturn\n}\n\nfunc readFloatSlice2(n int) (a []float64, b []float64) {\n\ta = make([]float64, n)\n\tb = make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i], &b[i])\n\t}\n\treturn\n}\n\nfunc yesOrNo(b bool) {\n\tif b {\n\t\tfmt.Println(\"Yes\")\n\t\treturn\n\t}\n\tfmt.Println(\"No\")\n}\n\nfunc yesorNO(b bool) {\n\tif b {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\tfmt.Println(\"NO\")\n}\n\nfunc yesorno(b bool) {\n\tif b {\n\t\tfmt.Println(\"yes\")\n\t\treturn\n\t}\n\tfmt.Println(\"no\")\n}\n\n// calc---------------------------------------------------\n\nfunc abs(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc ave(a []int) (ave int) {\n\tfor i := 0; i < len(a); i++ {\n\t\tave += a[i]\n\t}\n\tave /= len(a)\n\treturn\n}\n\nfunc eq(a []string, b []string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] != b[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc max(a ...int) int {\n\tmax := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tif max < a[i] {\n\t\t\tmax = a[i]\n\t\t}\n\t}\n\treturn max\n}\n\nfunc min(a ...int) int {\n\tmin := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tif min > a[i] {\n\t\t\tmin = a[i]\n\t\t}\n\t}\n\treturn min\n}\n\nfunc mid(a []int) int {\n\tsort.Ints(a)\n\treturn a[len(a)/2]\n}\n\nfunc sum(a []int) (ans int) {\n\tfor i := range a {\n\t\tans += a[i]\n\t}\n\treturn\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "sample_input": "4 1\n5 4 2 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02718", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2500, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s433304907", "group_id": "codeNet:p02718", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, m, sum int\n\tfmt.Scan(&n, &m)\n\tas := make([]int, n)\n\tfor i := range as {\n\t\tfmt.Scan(&as[i])\n\t\tsum += as[i]\n\t}\n\n\tsort.Ints(as)\n\n\tvar a int\n\tfor i := 0; i < m; i++ {\n\t\ta = as[n-1-i]\n\t}\n\n\tif float64(a) < float64(sum)/float64(4*m) {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\tfmt.Println(\"Yes\")\n}\n", "language": "Go", "metadata": {"date": 1586049006, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02718.html", "problem_id": "p02718", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02718/input.txt", "sample_output_relpath": "derived/input_output/data/p02718/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02718/Go/s433304907.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s433304907", "user_id": "u367908963"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, m, sum int\n\tfmt.Scan(&n, &m)\n\tas := make([]int, n)\n\tfor i := range as {\n\t\tfmt.Scan(&as[i])\n\t\tsum += as[i]\n\t}\n\n\tsort.Ints(as)\n\n\tvar a int\n\tfor i := 0; i < m; i++ {\n\t\ta = as[n-1-i]\n\t}\n\n\tif float64(a) < float64(sum)/float64(4*m) {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\tfmt.Println(\"Yes\")\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "sample_input": "4 1\n5 4 2 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02718", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s538151540", "group_id": "codeNet:p02718", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unsafe\"\n)\n\nfunc main() {\n\t_, M := sc.nextInt(), sc.nextInt()\n\tAn := sc.nextInts()\n\tsort.Ints(An)\n\tvar total int\n\tfor _, v := range An {\n\t\ttotal += v\n\t}\n\n\tfor i := 0; i < M; i++ {\n\t\ttmp := An[len(An)-i-1]\n\t\t// fmt.Println(tmp)\n\t\tif tmp < (total / (4 * M)) {\n\t\t\tno()\n\t\t\treturn\n\t\t}\n\t}\n\tyes()\n}\n\nvar (\n\tsc scanner\n)\n\nfunc init() {\n\tsc = scanner{\n\t\tbuf: make([]string, 0, 0),\n\t\tcur: 0,\n\t\tr: bufio.NewReader(os.Stdin),\n\t}\n}\n\ntype scanner struct {\n\tbuf []string\n\tcur int\n\tr *bufio.Reader\n}\n\nfunc (s *scanner) readln() {\n\trbuf := make([]byte, 0, 0)\n\tfor {\n\t\tline, prefix, err := s.r.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\trbuf = append(rbuf, line...)\n\t\tif prefix == false {\n\t\t\tbreak\n\t\t}\n\t}\n\ts.cur = 0\n\ts.buf = strings.Split(*(*string)(unsafe.Pointer(&rbuf)), \" \")\n}\nfunc (s *scanner) isFull() bool {\n\tif s.cur == len(s.buf) {\n\t\treturn true\n\t}\n\treturn false\n}\nfunc (s *scanner) resetCur() {\n\ts.cur = 0\n}\nfunc (s *scanner) next() string {\n\tif s.cur == 0 {\n\t\ts.readln()\n\t}\n\tres := s.buf[s.cur]\n\ts.cur++\n\tif s.isFull() {\n\t\ts.resetCur()\n\t}\n\treturn res\n}\nfunc (s *scanner) nexts() []string {\n\ts.readln()\n\ts.resetCur()\n\treturn s.buf\n}\nfunc (s *scanner) nextInt() int {\n\tif s.cur == 0 {\n\t\ts.readln()\n\t}\n\tres, _ := strconv.Atoi(s.buf[s.cur])\n\ts.cur++\n\tif s.isFull() {\n\t\ts.resetCur()\n\t}\n\treturn res\n}\nfunc (s *scanner) nextInts() []int {\n\ts.readln()\n\tres := make([]int, len(s.buf))\n\tfor i := range s.buf {\n\t\tres[i], _ = strconv.Atoi(s.buf[i])\n\t}\n\ts.resetCur()\n\treturn res\n}\nfunc (s *scanner) nextFloat() float64 {\n\tif s.cur == 0 {\n\t\ts.readln()\n\t}\n\tres, _ := strconv.ParseFloat(s.buf[s.cur],\n\t\t64)\n\ts.cur++\n\tif s.isFull() {\n\t\ts.resetCur()\n\t}\n\treturn res\n}\nfunc (s *scanner) nextFloats() []float64 {\n\ts.readln()\n\tres := make([]float64, len(s.buf))\n\tfor i := range s.buf {\n\t\tres[i], _ = strconv.ParseFloat(s.buf[i],\n\t\t\t64)\n\t}\n\ts.resetCur()\n\treturn res\n}\nfunc digits(x int) int {\n\treturn len(strconv.Itoa(x))\n}\nfunc powInt(x, p int) (result int) {\n\tresult = 1\n\tfor i := 0; i < p; i++ {\n\t\tresult *= x\n\t}\n\treturn\n}\nfunc max(x, y int) int {\n\treturn int(math.Max(float64(x), float64(y)))\n}\nfunc min(x, y int) int {\n\treturn int(math.Min(float64(x), float64(y)))\n}\nfunc abs(x int) int {\n\treturn int(math.Abs(float64(x)))\n}\nfunc varDump(value ...interface{}) {\n\tfor _, v := range value {\n\t\tfmt.Fprintf(os.Stderr, \"%#v\\n\", v)\n\t}\n}\nfunc yes() {\n\tfmt.Println(\"Yes\")\n}\nfunc no() {\n\tfmt.Println(\"No\")\n}\n\n// Pair a\ntype Pair struct {\n\tfirst int\n\tsecond int\n}\n\n// Queue a\ntype Queue struct {\n\tv []Pair\n}\n\n// Push for queue\nfunc (q *Queue) Push(v Pair) {\n\tq.v = append(q.v, v)\n}\n\n// Pop for queue\nfunc (q *Queue) Pop() Pair {\n\tr := q.v[0]\n\tq.v = q.v[1:]\n\treturn r\n}\n\n// Front for queue\nfunc (q Queue) Front() Pair {\n\treturn q.v[0]\n}\n\n// Empty return true if empty\nfunc (q Queue) Empty() bool {\n\treturn len(q.v) == 0\n}\n", "language": "Go", "metadata": {"date": 1586048848, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02718.html", "problem_id": "p02718", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02718/input.txt", "sample_output_relpath": "derived/input_output/data/p02718/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02718/Go/s538151540.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s538151540", "user_id": "u799236543"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t\"unsafe\"\n)\n\nfunc main() {\n\t_, M := sc.nextInt(), sc.nextInt()\n\tAn := sc.nextInts()\n\tsort.Ints(An)\n\tvar total int\n\tfor _, v := range An {\n\t\ttotal += v\n\t}\n\n\tfor i := 0; i < M; i++ {\n\t\ttmp := An[len(An)-i-1]\n\t\t// fmt.Println(tmp)\n\t\tif tmp < (total / (4 * M)) {\n\t\t\tno()\n\t\t\treturn\n\t\t}\n\t}\n\tyes()\n}\n\nvar (\n\tsc scanner\n)\n\nfunc init() {\n\tsc = scanner{\n\t\tbuf: make([]string, 0, 0),\n\t\tcur: 0,\n\t\tr: bufio.NewReader(os.Stdin),\n\t}\n}\n\ntype scanner struct {\n\tbuf []string\n\tcur int\n\tr *bufio.Reader\n}\n\nfunc (s *scanner) readln() {\n\trbuf := make([]byte, 0, 0)\n\tfor {\n\t\tline, prefix, err := s.r.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\trbuf = append(rbuf, line...)\n\t\tif prefix == false {\n\t\t\tbreak\n\t\t}\n\t}\n\ts.cur = 0\n\ts.buf = strings.Split(*(*string)(unsafe.Pointer(&rbuf)), \" \")\n}\nfunc (s *scanner) isFull() bool {\n\tif s.cur == len(s.buf) {\n\t\treturn true\n\t}\n\treturn false\n}\nfunc (s *scanner) resetCur() {\n\ts.cur = 0\n}\nfunc (s *scanner) next() string {\n\tif s.cur == 0 {\n\t\ts.readln()\n\t}\n\tres := s.buf[s.cur]\n\ts.cur++\n\tif s.isFull() {\n\t\ts.resetCur()\n\t}\n\treturn res\n}\nfunc (s *scanner) nexts() []string {\n\ts.readln()\n\ts.resetCur()\n\treturn s.buf\n}\nfunc (s *scanner) nextInt() int {\n\tif s.cur == 0 {\n\t\ts.readln()\n\t}\n\tres, _ := strconv.Atoi(s.buf[s.cur])\n\ts.cur++\n\tif s.isFull() {\n\t\ts.resetCur()\n\t}\n\treturn res\n}\nfunc (s *scanner) nextInts() []int {\n\ts.readln()\n\tres := make([]int, len(s.buf))\n\tfor i := range s.buf {\n\t\tres[i], _ = strconv.Atoi(s.buf[i])\n\t}\n\ts.resetCur()\n\treturn res\n}\nfunc (s *scanner) nextFloat() float64 {\n\tif s.cur == 0 {\n\t\ts.readln()\n\t}\n\tres, _ := strconv.ParseFloat(s.buf[s.cur],\n\t\t64)\n\ts.cur++\n\tif s.isFull() {\n\t\ts.resetCur()\n\t}\n\treturn res\n}\nfunc (s *scanner) nextFloats() []float64 {\n\ts.readln()\n\tres := make([]float64, len(s.buf))\n\tfor i := range s.buf {\n\t\tres[i], _ = strconv.ParseFloat(s.buf[i],\n\t\t\t64)\n\t}\n\ts.resetCur()\n\treturn res\n}\nfunc digits(x int) int {\n\treturn len(strconv.Itoa(x))\n}\nfunc powInt(x, p int) (result int) {\n\tresult = 1\n\tfor i := 0; i < p; i++ {\n\t\tresult *= x\n\t}\n\treturn\n}\nfunc max(x, y int) int {\n\treturn int(math.Max(float64(x), float64(y)))\n}\nfunc min(x, y int) int {\n\treturn int(math.Min(float64(x), float64(y)))\n}\nfunc abs(x int) int {\n\treturn int(math.Abs(float64(x)))\n}\nfunc varDump(value ...interface{}) {\n\tfor _, v := range value {\n\t\tfmt.Fprintf(os.Stderr, \"%#v\\n\", v)\n\t}\n}\nfunc yes() {\n\tfmt.Println(\"Yes\")\n}\nfunc no() {\n\tfmt.Println(\"No\")\n}\n\n// Pair a\ntype Pair struct {\n\tfirst int\n\tsecond int\n}\n\n// Queue a\ntype Queue struct {\n\tv []Pair\n}\n\n// Push for queue\nfunc (q *Queue) Push(v Pair) {\n\tq.v = append(q.v, v)\n}\n\n// Pop for queue\nfunc (q *Queue) Pop() Pair {\n\tr := q.v[0]\n\tq.v = q.v[1:]\n\treturn r\n}\n\n// Front for queue\nfunc (q Queue) Front() Pair {\n\treturn q.v[0]\n}\n\n// Empty return true if empty\nfunc (q Queue) Empty() bool {\n\treturn len(q.v) == 0\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "sample_input": "4 1\n5 4 2 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02718", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2881, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s837033609", "group_id": "codeNet:p02718", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 1000005), 1000005)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextUint64(scanner *bufio.Scanner) uint64 {\n\ti, _ := strconv.ParseUint(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextFloat64(scanner *bufio.Scanner) float64 {\n\ti, _ := strconv.ParseFloat(getNextString(scanner), 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\twfp := os.Stdout\n\tcnt := 0\n\n\tif os.Getenv(\"MASPY\") == \"ますピ\" {\n\t\tfp, _ = os.Open(os.Getenv(\"BEET_THE_HARMONY_OF_PERFECT\"))\n\t\tcnt = 2\n\t}\n\tif os.Getenv(\"MASPYPY\") == \"ますピッピ\" {\n\t\twfp, _ = os.Create(os.Getenv(\"NGTKANA_IS_GENIUS10\"))\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(wfp)\n\tsolve(scanner, writer)\n\tfor i := 0; i < cnt; i++ {\n\t\tfmt.Fprintln(writer, \"-----------------------------------\")\n\t\tsolve(scanner, writer)\n\t}\n\twriter.Flush()\n}\n\nfunc solve(scanner *bufio.Scanner, writer *bufio.Writer) {\n\tn := getNextInt(scanner)\n\tm := getNextInt(scanner)\n\taa := make([]int, n)\n\tsum := 0\n\tfor i := 0; i < n; i++ {\n\t\taa[i] = getNextInt(scanner)\n\t\tsum += aa[i]\n\t}\n\tmm := m\n\tsort.Ints(aa)\n\tfor i := n - 1; i >= 0 && m > 0; i-- {\n\t\tm--\n\t\tif aa[i]*4*mm < sum {\n\t\t\tfmt.Fprintln(writer, \"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Fprintln(writer, \"Yes\")\n}\n", "language": "Go", "metadata": {"date": 1586048765, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02718.html", "problem_id": "p02718", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02718/input.txt", "sample_output_relpath": "derived/input_output/data/p02718/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02718/Go/s837033609.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s837033609", "user_id": "u150542210"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 1000005), 1000005)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextUint64(scanner *bufio.Scanner) uint64 {\n\ti, _ := strconv.ParseUint(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextFloat64(scanner *bufio.Scanner) float64 {\n\ti, _ := strconv.ParseFloat(getNextString(scanner), 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\twfp := os.Stdout\n\tcnt := 0\n\n\tif os.Getenv(\"MASPY\") == \"ますピ\" {\n\t\tfp, _ = os.Open(os.Getenv(\"BEET_THE_HARMONY_OF_PERFECT\"))\n\t\tcnt = 2\n\t}\n\tif os.Getenv(\"MASPYPY\") == \"ますピッピ\" {\n\t\twfp, _ = os.Create(os.Getenv(\"NGTKANA_IS_GENIUS10\"))\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(wfp)\n\tsolve(scanner, writer)\n\tfor i := 0; i < cnt; i++ {\n\t\tfmt.Fprintln(writer, \"-----------------------------------\")\n\t\tsolve(scanner, writer)\n\t}\n\twriter.Flush()\n}\n\nfunc solve(scanner *bufio.Scanner, writer *bufio.Writer) {\n\tn := getNextInt(scanner)\n\tm := getNextInt(scanner)\n\taa := make([]int, n)\n\tsum := 0\n\tfor i := 0; i < n; i++ {\n\t\taa[i] = getNextInt(scanner)\n\t\tsum += aa[i]\n\t}\n\tmm := m\n\tsort.Ints(aa)\n\tfor i := n - 1; i >= 0 && m > 0; i-- {\n\t\tm--\n\t\tif aa[i]*4*mm < sum {\n\t\t\tfmt.Fprintln(writer, \"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Fprintln(writer, \"Yes\")\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "sample_input": "4 1\n5 4 2 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02718", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1700, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s264904263", "group_id": "codeNet:p02718", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tN := getInt()\n\tM := getInt()\n\tA := getIntArray(N)\n\n\ttotal := 0\n\tfor i := 0; i < N; i++ {\n\t\ttotal += A[i]\n\t}\n\n\tcnt := 0\n\tfor i := 0; i < N; i++ {\n\t\tif A[i] >= total / (4*M) {\n\t\t\tcnt++\n\t\t}\n\t}\n\n\tif cnt >= M {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\ntype Graph struct {\n\tn int\n\tedges [][]int\n}\n\nfunc NewGraph(n int) *Graph {\n\tg := &Graph{\n\t\tn: n,\n\t\tedges: make([][]int, n),\n\t}\n\treturn g\n}\n\nfunc (g *Graph) AddEdge(u, v int) {\n\tg.edges[v] = append(g.edges[v], u)\n\tg.edges[u] = append(g.edges[u], v)\n}\n\nfunc dfs(c int, edges [][]int, visited map[int]struct{}) {\n\tvisited[c] = struct{}{}\n\n\tfor _, v := range edges[c] {\n\t\t_, flag := visited[v]\n\t\tif flag {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(v, edges, visited)\n\t}\n}\n\nfunc bfs(c int, graph *Graph) {\n\tnext := make([]int, 0)\n\tnext = append(next, c)\n\tvisited := make(map[int]struct{})\n\n\tfor ; len(next) != 0; {\n\t\tu := next[0]\n\t\tnext = next[1:]\n\t\tvisited[u] = struct{}{}\n\n\t\tfor v := range graph.edges[u] {\n\t\t\t_, flag := visited[v]\n\t\t\tif flag {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// なにか処理\n\n\t\t\tnext = append(next, v)\n\t\t}\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getIntArray(n int) []int {\n\tarray := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getInt()\n\t}\n\treturn array\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc powMod(n, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 0 {\n\t\tt := powMod(n, p/2)\n\t\treturn calcMod(t * t)\n\t} else {\n\t\treturn calcMod(n * powMod(n, p-1))\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n % 2 == 0 {\n\t\treturn false\n\t}\n\n\tsqrtN := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sqrtN; i += 2 {\n\t\tif n % i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}\n\nfunc powerset2(nums []int) [][]int {\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tindex := 0\n\tresult[index] = []int{}\n\tindex++\n\n\tfor _, n := range nums {\n\t\tmax := index\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[index] = copyAndAppend(result[i], n)\n\t\t\tindex++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc calcGcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t} else if x >= y {\n\t\treturn calcGcd(y, x % y)\n\t} else {\n\t\treturn calcGcd(x, y % x)\n\t}\n}\n\nfunc getDivisor(n int) []int {\n\tvar divisor []int\n\tdivisor = append(divisor, 1)\n\tif n != 1 {\n\t\tdivisor = append(divisor, n)\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n % i == 0 {\n\t\t\tdivisor = append(divisor, i)\n\t\t\tdivisor = append(divisor, n/i)\n\t\t}\n\t}\n\treturn divisor\n}\n\ntype intHeap []int\n\nfunc (h intHeap) Len() int {\n\treturn len(h)\n}\n\nfunc (h intHeap) Less(i, j int) bool {\n\treturn h[i] > h[j]\n}\n\nfunc (h intHeap) Swap(i, j int) {\n\th[i], h[j] = h[j], h[i]\n}\n\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc initHeap() *intHeap {\n\tih := &intHeap{}\n\theap.Init(ih)\n\treturn ih\n}\n\nfunc (h *intHeap) pushHeap(n int) {\n\theap.Push(h, n)\n}\n\nfunc (h *intHeap) popHeap() int {\n\treturn heap.Pop(h).(int)\n}\n\nfunc factMod(n int) int {\n\tvalue := 1\n\tfor ; n > 1; n-- {\n\t\tvalue = calcMod(value * n)\n\t}\n\treturn value\n}\n\nfunc combinationMod(n, k int) int {\n\tfactN := factMod(n)\n\tfactK := factMod(k)\n\tfactNK := factMod(n - k)\n\tfactKR := powMod(factK, mod - 2)\n\tfactNKR := powMod(factNK, mod - 2)\n\treturn calcMod(factN * calcMod(factKR * factNKR))\n}\n", "language": "Go", "metadata": {"date": 1586048588, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02718.html", "problem_id": "p02718", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02718/input.txt", "sample_output_relpath": "derived/input_output/data/p02718/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02718/Go/s264904263.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s264904263", "user_id": "u964273035"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tN := getInt()\n\tM := getInt()\n\tA := getIntArray(N)\n\n\ttotal := 0\n\tfor i := 0; i < N; i++ {\n\t\ttotal += A[i]\n\t}\n\n\tcnt := 0\n\tfor i := 0; i < N; i++ {\n\t\tif A[i] >= total / (4*M) {\n\t\t\tcnt++\n\t\t}\n\t}\n\n\tif cnt >= M {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\ntype Graph struct {\n\tn int\n\tedges [][]int\n}\n\nfunc NewGraph(n int) *Graph {\n\tg := &Graph{\n\t\tn: n,\n\t\tedges: make([][]int, n),\n\t}\n\treturn g\n}\n\nfunc (g *Graph) AddEdge(u, v int) {\n\tg.edges[v] = append(g.edges[v], u)\n\tg.edges[u] = append(g.edges[u], v)\n}\n\nfunc dfs(c int, edges [][]int, visited map[int]struct{}) {\n\tvisited[c] = struct{}{}\n\n\tfor _, v := range edges[c] {\n\t\t_, flag := visited[v]\n\t\tif flag {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(v, edges, visited)\n\t}\n}\n\nfunc bfs(c int, graph *Graph) {\n\tnext := make([]int, 0)\n\tnext = append(next, c)\n\tvisited := make(map[int]struct{})\n\n\tfor ; len(next) != 0; {\n\t\tu := next[0]\n\t\tnext = next[1:]\n\t\tvisited[u] = struct{}{}\n\n\t\tfor v := range graph.edges[u] {\n\t\t\t_, flag := visited[v]\n\t\t\tif flag {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// なにか処理\n\n\t\t\tnext = append(next, v)\n\t\t}\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getIntArray(n int) []int {\n\tarray := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getInt()\n\t}\n\treturn array\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc powMod(n, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 0 {\n\t\tt := powMod(n, p/2)\n\t\treturn calcMod(t * t)\n\t} else {\n\t\treturn calcMod(n * powMod(n, p-1))\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n % 2 == 0 {\n\t\treturn false\n\t}\n\n\tsqrtN := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sqrtN; i += 2 {\n\t\tif n % i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}\n\nfunc powerset2(nums []int) [][]int {\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tindex := 0\n\tresult[index] = []int{}\n\tindex++\n\n\tfor _, n := range nums {\n\t\tmax := index\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[index] = copyAndAppend(result[i], n)\n\t\t\tindex++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc calcGcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t} else if x >= y {\n\t\treturn calcGcd(y, x % y)\n\t} else {\n\t\treturn calcGcd(x, y % x)\n\t}\n}\n\nfunc getDivisor(n int) []int {\n\tvar divisor []int\n\tdivisor = append(divisor, 1)\n\tif n != 1 {\n\t\tdivisor = append(divisor, n)\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n % i == 0 {\n\t\t\tdivisor = append(divisor, i)\n\t\t\tdivisor = append(divisor, n/i)\n\t\t}\n\t}\n\treturn divisor\n}\n\ntype intHeap []int\n\nfunc (h intHeap) Len() int {\n\treturn len(h)\n}\n\nfunc (h intHeap) Less(i, j int) bool {\n\treturn h[i] > h[j]\n}\n\nfunc (h intHeap) Swap(i, j int) {\n\th[i], h[j] = h[j], h[i]\n}\n\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc initHeap() *intHeap {\n\tih := &intHeap{}\n\theap.Init(ih)\n\treturn ih\n}\n\nfunc (h *intHeap) pushHeap(n int) {\n\theap.Push(h, n)\n}\n\nfunc (h *intHeap) popHeap() int {\n\treturn heap.Pop(h).(int)\n}\n\nfunc factMod(n int) int {\n\tvalue := 1\n\tfor ; n > 1; n-- {\n\t\tvalue = calcMod(value * n)\n\t}\n\treturn value\n}\n\nfunc combinationMod(n, k int) int {\n\tfactN := factMod(n)\n\tfactK := factMod(k)\n\tfactNK := factMod(n - k)\n\tfactKR := powMod(factK, mod - 2)\n\tfactNKR := powMod(factNK, mod - 2)\n\treturn calcMod(factN * calcMod(factKR * factNKR))\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "sample_input": "4 1\n5 4 2 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02718", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have held a popularity poll for N items on sale. Item i received A_i votes.\n\nFrom these N items, we will select M as popular items. However, we cannot select an item with less than \\dfrac{1}{4M} of the total number of votes.\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq M \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nA_i are distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_N\n\nOutput\n\nIf M popular items can be selected, print Yes; otherwise, print No.\n\nSample Input 1\n\n4 1\n5 4 2 1\n\nSample Output 1\n\nYes\n\nThere were 12 votes in total. The most popular item received 5 votes, and we can select it.\n\nSample Input 2\n\n3 2\n380 19 1\n\nSample Output 2\n\nNo\n\nThere were 400 votes in total. The second and third most popular items received less than \\dfrac{1}{4\\times 2} of the total number of votes, so we cannot select them. Thus, we cannot select two popular items.\n\nSample Input 3\n\n12 3\n4 56 78 901 2 345 67 890 123 45 6 789\n\nSample Output 3\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5271, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s656541368", "group_id": "codeNet:p02727", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tx, y := readInt(), readInt()\n\ta, b, c := readInt(), readInt(), readInt()\n\tp, q, r := make([]int, a), make([]int, b), make([]int, c)\n\tfor i := range p {\n\t\tp[i] = readInt()\n\t}\n\tfor i := range q {\n\t\tq[i] = readInt()\n\t}\n\tfor i := range r {\n\t\tr[i] = readInt()\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(p)))\n\tsort.Sort(sort.Reverse(sort.IntSlice(q)))\n\tsort.Sort(sort.Reverse(sort.IntSlice(r)))\n\n\tarr := make([]int, 0, x+y)\n\tfor i := 0; i < x; i++ {\n\t\tarr = append(arr, p[i])\n\t}\n\tfor i := 0; i < y; i++ {\n\t\tarr = append(arr, q[i])\n\t}\n\n\tsort.Ints(arr)\n\tfor i := 0; i < min(len(arr)-1, c); i++ {\n\t\tif r[i] < arr[i] {\n\t\t\tbreak\n\t\t}\n\t\tarr[i] = r[i]\n\t}\n\n\t// fmt.Println(p)\n\t// fmt.Println(q)\n\t// fmt.Println(r)\n\n\tans := 0\n\tfor i := range arr {\n\t\tans += arr[i]\n\t}\n\tfmt.Println(ans)\n}\n\n// sort ------------------------------------------------------------\n\ntype xxx struct {\n\tx int\n}\n\ntype sortArray []xxx\n\nfunc (s sortArray) Len() int { return len(s) }\nfunc (s sortArray) Swap(i, j int) { s[i], s[j] = s[j], s[i] }\nfunc (s sortArray) Less(i, j int) bool { return s[i].x < s[j].x }\n\n// -----------------------------------------------------------------\n\nvar (\n\treadString func() string\n\treadBytes func() []byte\n)\n\nfunc init() {\n\tlog.SetFlags(log.Lshortfile)\n\treadString, readBytes = newReadString(os.Stdin)\n}\n\nfunc newReadString(ior io.Reader) (func() string, func() []byte) {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\tf1 := func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n\tf2 := func() []byte {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Bytes()\n\t}\n\treturn f1, f2\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc sum(a []int) int {\n\tvar ret int\n\tfor i := range a {\n\t\tret += a[i]\n\t}\n\treturn ret\n}\n\nfunc sumFloat64(a []float64) float64 {\n\tvar ret float64\n\tfor i := range a {\n\t\tret += a[i]\n\t}\n\treturn ret\n}\n\nfunc gcd(m, n int) int {\n\tfor m%n != 0 {\n\t\tm, n = n, m%n\n\t}\n\treturn n\n}\n\nfunc lcm(m, n int) int {\n\treturn m / gcd(m, n) * n\n}\n", "language": "Go", "metadata": {"date": 1589705477, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02727.html", "problem_id": "p02727", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02727/input.txt", "sample_output_relpath": "derived/input_output/data/p02727/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02727/Go/s656541368.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s656541368", "user_id": "u295946532"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tx, y := readInt(), readInt()\n\ta, b, c := readInt(), readInt(), readInt()\n\tp, q, r := make([]int, a), make([]int, b), make([]int, c)\n\tfor i := range p {\n\t\tp[i] = readInt()\n\t}\n\tfor i := range q {\n\t\tq[i] = readInt()\n\t}\n\tfor i := range r {\n\t\tr[i] = readInt()\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(p)))\n\tsort.Sort(sort.Reverse(sort.IntSlice(q)))\n\tsort.Sort(sort.Reverse(sort.IntSlice(r)))\n\n\tarr := make([]int, 0, x+y)\n\tfor i := 0; i < x; i++ {\n\t\tarr = append(arr, p[i])\n\t}\n\tfor i := 0; i < y; i++ {\n\t\tarr = append(arr, q[i])\n\t}\n\n\tsort.Ints(arr)\n\tfor i := 0; i < min(len(arr)-1, c); i++ {\n\t\tif r[i] < arr[i] {\n\t\t\tbreak\n\t\t}\n\t\tarr[i] = r[i]\n\t}\n\n\t// fmt.Println(p)\n\t// fmt.Println(q)\n\t// fmt.Println(r)\n\n\tans := 0\n\tfor i := range arr {\n\t\tans += arr[i]\n\t}\n\tfmt.Println(ans)\n}\n\n// sort ------------------------------------------------------------\n\ntype xxx struct {\n\tx int\n}\n\ntype sortArray []xxx\n\nfunc (s sortArray) Len() int { return len(s) }\nfunc (s sortArray) Swap(i, j int) { s[i], s[j] = s[j], s[i] }\nfunc (s sortArray) Less(i, j int) bool { return s[i].x < s[j].x }\n\n// -----------------------------------------------------------------\n\nvar (\n\treadString func() string\n\treadBytes func() []byte\n)\n\nfunc init() {\n\tlog.SetFlags(log.Lshortfile)\n\treadString, readBytes = newReadString(os.Stdin)\n}\n\nfunc newReadString(ior io.Reader) (func() string, func() []byte) {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\tf1 := func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n\tf2 := func() []byte {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Bytes()\n\t}\n\treturn f1, f2\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc sum(a []int) int {\n\tvar ret int\n\tfor i := range a {\n\t\tret += a[i]\n\t}\n\treturn ret\n}\n\nfunc sumFloat64(a []float64) float64 {\n\tvar ret float64\n\tfor i := range a {\n\t\tret += a[i]\n\t}\n\treturn ret\n}\n\nfunc gcd(m, n int) int {\n\tfor m%n != 0 {\n\t\tm, n = n, m%n\n\t}\n\treturn n\n}\n\nfunc lcm(m, n int) int {\n\treturn m / gcd(m, n) * n\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nYou are going to eat X red apples and Y green apples.\n\nYou have A red apples of deliciousness p_1,p_2, \\dots, p_A, B green apples of deliciousness q_1,q_2, \\dots, q_B, and C colorless apples of deliciousness r_1,r_2, \\dots, r_C.\n\nBefore eating a colorless apple, you can paint it red or green, and it will count as a red or green apple, respectively.\n\nFrom the apples above, you will choose the apples to eat while making the sum of the deliciousness of the eaten apples as large as possible.\n\nFind the maximum possible sum of the deliciousness of the eaten apples that can be achieved when optimally coloring zero or more colorless apples.\n\nConstraints\n\n1 \\leq X \\leq A \\leq 10^5\n\n1 \\leq Y \\leq B \\leq 10^5\n\n1 \\leq C \\leq 10^5\n\n1 \\leq p_i \\leq 10^9\n\n1 \\leq q_i \\leq 10^9\n\n1 \\leq r_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\nX Y A B C\np_1 p_2 ... p_A\nq_1 q_2 ... q_B\nr_1 r_2 ... r_C\n\nOutput\n\nPrint the maximum possible sum of the deliciousness of the eaten apples.\n\nSample Input 1\n\n1 2 2 2 1\n2 4\n5 1\n3\n\nSample Output 1\n\n12\n\nThe maximum possible sum of the deliciousness of the eaten apples can be achieved as follows:\n\nEat the 2-nd red apple.\n\nEat the 1-st green apple.\n\nPaint the 1-st colorless apple green and eat it.\n\nSample Input 2\n\n2 2 2 2 2\n8 6\n9 1\n2 1\n\nSample Output 2\n\n25\n\nSample Input 3\n\n2 2 4 4 4\n11 12 13 14\n21 22 23 24\n1 2 3 4\n\nSample Output 3\n\n74", "sample_input": "1 2 2 2 1\n2 4\n5 1\n3\n"}, "reference_outputs": ["12\n"], "source_document_id": "p02727", "source_text": "Score : 500 points\n\nProblem Statement\n\nYou are going to eat X red apples and Y green apples.\n\nYou have A red apples of deliciousness p_1,p_2, \\dots, p_A, B green apples of deliciousness q_1,q_2, \\dots, q_B, and C colorless apples of deliciousness r_1,r_2, \\dots, r_C.\n\nBefore eating a colorless apple, you can paint it red or green, and it will count as a red or green apple, respectively.\n\nFrom the apples above, you will choose the apples to eat while making the sum of the deliciousness of the eaten apples as large as possible.\n\nFind the maximum possible sum of the deliciousness of the eaten apples that can be achieved when optimally coloring zero or more colorless apples.\n\nConstraints\n\n1 \\leq X \\leq A \\leq 10^5\n\n1 \\leq Y \\leq B \\leq 10^5\n\n1 \\leq C \\leq 10^5\n\n1 \\leq p_i \\leq 10^9\n\n1 \\leq q_i \\leq 10^9\n\n1 \\leq r_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\nX Y A B C\np_1 p_2 ... p_A\nq_1 q_2 ... q_B\nr_1 r_2 ... r_C\n\nOutput\n\nPrint the maximum possible sum of the deliciousness of the eaten apples.\n\nSample Input 1\n\n1 2 2 2 1\n2 4\n5 1\n3\n\nSample Output 1\n\n12\n\nThe maximum possible sum of the deliciousness of the eaten apples can be achieved as follows:\n\nEat the 2-nd red apple.\n\nEat the 1-st green apple.\n\nPaint the 1-st colorless apple green and eat it.\n\nSample Input 2\n\n2 2 2 2 2\n8 6\n9 1\n2 1\n\nSample Output 2\n\n25\n\nSample Input 3\n\n2 2 4 4 4\n11 12 13 14\n21 22 23 24\n1 2 3 4\n\nSample Output 3\n\n74", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2586, "cpu_time_ms": 222, "memory_kb": 7552}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s342186899", "group_id": "codeNet:p02727", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\ntype Apple struct {\n\tsweetness int\n\tcolor int //0:red,1:green,2:colorless\n}\n\ntype Apples []Apple\n\nfunc (c Apples) Len() int {\n\treturn len(c)\n}\n\nfunc (c Apples) Swap(i, j int) {\n\tc[i], c[j] = c[j], c[i]\n}\n\nfunc (c Apples) Less(i, j int) bool {\n\treturn c[i].sweetness > c[j].sweetness\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush() // !!!!coution!!!! you must use Fprint(out, ) not Print()\n\t/* --- code --- */\n\tX, Y, A, B, C := nextInt(), nextInt(), nextInt(), nextInt(), nextInt()\n\tvar p Apples = make([]Apple, A)\n\tvar q Apples = make([]Apple, B)\n\tvar r Apples = make([]Apple, C)\n\tfor i := 0; i < A; i++ {\n\t\tp[i] = Apple{nextInt(), 0}\n\t}\n\tfor i := 0; i < B; i++ {\n\t\tq[i] = Apple{nextInt(), 1}\n\t}\n\tfor i := 0; i < C; i++ {\n\t\tr[i] = Apple{nextInt(), 2}\n\t}\n\tsort.Sort(p)\n\tsort.Sort(q)\n\tsort.Sort(r)\n\n\tpAns := p[:X]\n\tqAns := q[:Y]\n\tip := len(pAns) - 1\n\tiq := len(qAns) - 1\n\tfor i := 0; i < C; i++ {\n\t\tif pAns[ip].sweetness > r[i].sweetness && qAns[iq].sweetness > r[i].sweetness {\n\t\t\tbreak\n\t\t}\n\t\tif iq < 0 && ip >= 0 {\n\t\t\t// check only p\n\t\t\tif pAns[ip].sweetness < r[i].sweetness {\n\t\t\t\tpAns[ip] = r[i]\n\t\t\t\tip--\n\t\t\t}\n\t\t} else if ip < 0 && iq >= 0 {\n\t\t\t// check only q\n\t\t\tif qAns[iq].sweetness < r[i].sweetness {\n\t\t\t\tqAns[iq] = r[i]\n\t\t\t\tiq--\n\t\t\t}\n\t\t} else if ip < 0 && iq < 0 {\n\t\t\tbreak\n\t\t} else {\n\t\t\tif pAns[ip].sweetness > qAns[iq].sweetness {\n\t\t\t\tqAns[iq] = r[i]\n\t\t\t\tiq--\n\t\t\t} else {\n\t\t\t\tpAns[ip] = r[i]\n\t\t\t\tip--\n\t\t\t}\n\t\t}\n\t}\n\tans := 0\n\tfor i := 0; i < len(pAns); i++ {\n\t\tans += pAns[i].sweetness\n\t}\n\tfor i := 0; i < len(qAns); i++ {\n\t\tans += qAns[i].sweetness\n\t}\n\tfmt.Println(ans)\n\n}\n\n// -*-*-*-*-*-*-*-*-\n// * I/O utilities *\n// -*-*-*-*-*-*-*-*-\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextInt64() int64 {\n\ta, _ := strconv.ParseInt(next(), 10, 64)\n\treturn a\n}\n\nfunc nextFloat64() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\nfunc nextFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextFloat64()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\nfunc split(s string) []string {\n\tret := make([]string, len([]rune(s)))\n\tfor i, v := range []rune(s) {\n\t\tret[i] = string(v)\n\t}\n\treturn ret\n}\n\nfunc PrintOut(src interface{}, joinner string) {\n\tswitch reflect.TypeOf(src).Kind() {\n\tcase reflect.Slice:\n\t\ts := reflect.ValueOf(src)\n\t\tfor idx := 0; idx < s.Len(); idx++ {\n\t\t\tfmt.Fprintf(out, \"%v\", s.Index(idx))\n\t\t\tif idx < s.Len()-1 {\n\t\t\t\tfmt.Fprintf(out, \"%s\", joinner)\n\t\t\t} else {\n\t\t\t\tfmt.Fprintln(out)\n\t\t\t}\n\t\t}\n\tdefault:\n\t\tfmt.Fprintln(out, \"fuck\")\n\t}\n}\n\n// -*-*-*-*-*-*-*-*-\n// * tool snippets *\n// -*-*-*-*-*-*-*-*-\nfunc duplicate2Int(base [][]int) (ret [][]int) {\n\tret = make([][]int, len(base))\n\tfor i, v := range base {\n\t\tret[i] = append([]int{}, v...)\n\t}\n\treturn\n}\n\n// -*-*-*-*-*-*-*-*-*-*-*-*-*-\n// * Algorithms Utility Zone *\n// -*-*-*-*-*-*-*-*-*-*-*-*-*-\n\n// -*-*-*-*-*-*-*-\n// * 1. nibutan *\n// -*-*-*-*-*-*-*-\nfunc lower_bound(arr []int, target int) int {\n\tl, r := 0, len(arr)\n\tfor l < r {\n\t\tmid := (l + r) / 2\n\t\tif arr[mid] < target {\n\t\t\tl = mid + 1\n\t\t} else {\n\t\t\tr = mid\n\t\t}\n\t}\n\treturn l\n}\n\nfunc upper_bound(arr []int, target int) int {\n\tl, r := 0, len(arr)\n\tfor l < r {\n\t\tmid := (l + r) / 2\n\t\tif target < arr[mid] {\n\t\t\tr = mid\n\t\t} else {\n\t\t\tl = mid + 1\n\t\t}\n\t}\n\treturn l\n}\n\n// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-\n// * math flavor typical theories *\n// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-\nfunc gcd(a, b int) int {\n\tif a > b {\n\t\treturn gcd(b, a)\n\t}\n\tfor a != 0 {\n\t\ta, b = b%a, a\n\t}\n\treturn b\n}\n\nfunc pow(a, b int) (ret int) {\n\tret = a\n\t// 10^2 = 100ってことは10に10を1回掛けることだね\n\t// なので初期値を含めると上限b-1未満\n\tfor i := 0; i < b-1; i++ {\n\t\tret *= a\n\t}\n\treturn\n}\n\nfunc powMod(n, m, mod int) (ret int) {\n\tret = 1\n\tfor m > 0 {\n\t\tif m&1 == 1 {\n\t\t\tret *= n\n\t\t\tret %= mod\n\t\t}\n\t\tn *= n\n\t\tn %= mod\n\t\tm >>= 1\n\t}\n\treturn ret\n}\n", "language": "Go", "metadata": {"date": 1588804421, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02727.html", "problem_id": "p02727", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02727/input.txt", "sample_output_relpath": "derived/input_output/data/p02727/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02727/Go/s342186899.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s342186899", "user_id": "u532762536"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\ntype Apple struct {\n\tsweetness int\n\tcolor int //0:red,1:green,2:colorless\n}\n\ntype Apples []Apple\n\nfunc (c Apples) Len() int {\n\treturn len(c)\n}\n\nfunc (c Apples) Swap(i, j int) {\n\tc[i], c[j] = c[j], c[i]\n}\n\nfunc (c Apples) Less(i, j int) bool {\n\treturn c[i].sweetness > c[j].sweetness\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush() // !!!!coution!!!! you must use Fprint(out, ) not Print()\n\t/* --- code --- */\n\tX, Y, A, B, C := nextInt(), nextInt(), nextInt(), nextInt(), nextInt()\n\tvar p Apples = make([]Apple, A)\n\tvar q Apples = make([]Apple, B)\n\tvar r Apples = make([]Apple, C)\n\tfor i := 0; i < A; i++ {\n\t\tp[i] = Apple{nextInt(), 0}\n\t}\n\tfor i := 0; i < B; i++ {\n\t\tq[i] = Apple{nextInt(), 1}\n\t}\n\tfor i := 0; i < C; i++ {\n\t\tr[i] = Apple{nextInt(), 2}\n\t}\n\tsort.Sort(p)\n\tsort.Sort(q)\n\tsort.Sort(r)\n\n\tpAns := p[:X]\n\tqAns := q[:Y]\n\tip := len(pAns) - 1\n\tiq := len(qAns) - 1\n\tfor i := 0; i < C; i++ {\n\t\tif pAns[ip].sweetness > r[i].sweetness && qAns[iq].sweetness > r[i].sweetness {\n\t\t\tbreak\n\t\t}\n\t\tif iq < 0 && ip >= 0 {\n\t\t\t// check only p\n\t\t\tif pAns[ip].sweetness < r[i].sweetness {\n\t\t\t\tpAns[ip] = r[i]\n\t\t\t\tip--\n\t\t\t}\n\t\t} else if ip < 0 && iq >= 0 {\n\t\t\t// check only q\n\t\t\tif qAns[iq].sweetness < r[i].sweetness {\n\t\t\t\tqAns[iq] = r[i]\n\t\t\t\tiq--\n\t\t\t}\n\t\t} else if ip < 0 && iq < 0 {\n\t\t\tbreak\n\t\t} else {\n\t\t\tif pAns[ip].sweetness > qAns[iq].sweetness {\n\t\t\t\tqAns[iq] = r[i]\n\t\t\t\tiq--\n\t\t\t} else {\n\t\t\t\tpAns[ip] = r[i]\n\t\t\t\tip--\n\t\t\t}\n\t\t}\n\t}\n\tans := 0\n\tfor i := 0; i < len(pAns); i++ {\n\t\tans += pAns[i].sweetness\n\t}\n\tfor i := 0; i < len(qAns); i++ {\n\t\tans += qAns[i].sweetness\n\t}\n\tfmt.Println(ans)\n\n}\n\n// -*-*-*-*-*-*-*-*-\n// * I/O utilities *\n// -*-*-*-*-*-*-*-*-\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextInt64() int64 {\n\ta, _ := strconv.ParseInt(next(), 10, 64)\n\treturn a\n}\n\nfunc nextFloat64() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\nfunc nextFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextFloat64()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\nfunc split(s string) []string {\n\tret := make([]string, len([]rune(s)))\n\tfor i, v := range []rune(s) {\n\t\tret[i] = string(v)\n\t}\n\treturn ret\n}\n\nfunc PrintOut(src interface{}, joinner string) {\n\tswitch reflect.TypeOf(src).Kind() {\n\tcase reflect.Slice:\n\t\ts := reflect.ValueOf(src)\n\t\tfor idx := 0; idx < s.Len(); idx++ {\n\t\t\tfmt.Fprintf(out, \"%v\", s.Index(idx))\n\t\t\tif idx < s.Len()-1 {\n\t\t\t\tfmt.Fprintf(out, \"%s\", joinner)\n\t\t\t} else {\n\t\t\t\tfmt.Fprintln(out)\n\t\t\t}\n\t\t}\n\tdefault:\n\t\tfmt.Fprintln(out, \"fuck\")\n\t}\n}\n\n// -*-*-*-*-*-*-*-*-\n// * tool snippets *\n// -*-*-*-*-*-*-*-*-\nfunc duplicate2Int(base [][]int) (ret [][]int) {\n\tret = make([][]int, len(base))\n\tfor i, v := range base {\n\t\tret[i] = append([]int{}, v...)\n\t}\n\treturn\n}\n\n// -*-*-*-*-*-*-*-*-*-*-*-*-*-\n// * Algorithms Utility Zone *\n// -*-*-*-*-*-*-*-*-*-*-*-*-*-\n\n// -*-*-*-*-*-*-*-\n// * 1. nibutan *\n// -*-*-*-*-*-*-*-\nfunc lower_bound(arr []int, target int) int {\n\tl, r := 0, len(arr)\n\tfor l < r {\n\t\tmid := (l + r) / 2\n\t\tif arr[mid] < target {\n\t\t\tl = mid + 1\n\t\t} else {\n\t\t\tr = mid\n\t\t}\n\t}\n\treturn l\n}\n\nfunc upper_bound(arr []int, target int) int {\n\tl, r := 0, len(arr)\n\tfor l < r {\n\t\tmid := (l + r) / 2\n\t\tif target < arr[mid] {\n\t\t\tr = mid\n\t\t} else {\n\t\t\tl = mid + 1\n\t\t}\n\t}\n\treturn l\n}\n\n// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-\n// * math flavor typical theories *\n// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-\nfunc gcd(a, b int) int {\n\tif a > b {\n\t\treturn gcd(b, a)\n\t}\n\tfor a != 0 {\n\t\ta, b = b%a, a\n\t}\n\treturn b\n}\n\nfunc pow(a, b int) (ret int) {\n\tret = a\n\t// 10^2 = 100ってことは10に10を1回掛けることだね\n\t// なので初期値を含めると上限b-1未満\n\tfor i := 0; i < b-1; i++ {\n\t\tret *= a\n\t}\n\treturn\n}\n\nfunc powMod(n, m, mod int) (ret int) {\n\tret = 1\n\tfor m > 0 {\n\t\tif m&1 == 1 {\n\t\t\tret *= n\n\t\t\tret %= mod\n\t\t}\n\t\tn *= n\n\t\tn %= mod\n\t\tm >>= 1\n\t}\n\treturn ret\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nYou are going to eat X red apples and Y green apples.\n\nYou have A red apples of deliciousness p_1,p_2, \\dots, p_A, B green apples of deliciousness q_1,q_2, \\dots, q_B, and C colorless apples of deliciousness r_1,r_2, \\dots, r_C.\n\nBefore eating a colorless apple, you can paint it red or green, and it will count as a red or green apple, respectively.\n\nFrom the apples above, you will choose the apples to eat while making the sum of the deliciousness of the eaten apples as large as possible.\n\nFind the maximum possible sum of the deliciousness of the eaten apples that can be achieved when optimally coloring zero or more colorless apples.\n\nConstraints\n\n1 \\leq X \\leq A \\leq 10^5\n\n1 \\leq Y \\leq B \\leq 10^5\n\n1 \\leq C \\leq 10^5\n\n1 \\leq p_i \\leq 10^9\n\n1 \\leq q_i \\leq 10^9\n\n1 \\leq r_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\nX Y A B C\np_1 p_2 ... p_A\nq_1 q_2 ... q_B\nr_1 r_2 ... r_C\n\nOutput\n\nPrint the maximum possible sum of the deliciousness of the eaten apples.\n\nSample Input 1\n\n1 2 2 2 1\n2 4\n5 1\n3\n\nSample Output 1\n\n12\n\nThe maximum possible sum of the deliciousness of the eaten apples can be achieved as follows:\n\nEat the 2-nd red apple.\n\nEat the 1-st green apple.\n\nPaint the 1-st colorless apple green and eat it.\n\nSample Input 2\n\n2 2 2 2 2\n8 6\n9 1\n2 1\n\nSample Output 2\n\n25\n\nSample Input 3\n\n2 2 4 4 4\n11 12 13 14\n21 22 23 24\n1 2 3 4\n\nSample Output 3\n\n74", "sample_input": "1 2 2 2 1\n2 4\n5 1\n3\n"}, "reference_outputs": ["12\n"], "source_document_id": "p02727", "source_text": "Score : 500 points\n\nProblem Statement\n\nYou are going to eat X red apples and Y green apples.\n\nYou have A red apples of deliciousness p_1,p_2, \\dots, p_A, B green apples of deliciousness q_1,q_2, \\dots, q_B, and C colorless apples of deliciousness r_1,r_2, \\dots, r_C.\n\nBefore eating a colorless apple, you can paint it red or green, and it will count as a red or green apple, respectively.\n\nFrom the apples above, you will choose the apples to eat while making the sum of the deliciousness of the eaten apples as large as possible.\n\nFind the maximum possible sum of the deliciousness of the eaten apples that can be achieved when optimally coloring zero or more colorless apples.\n\nConstraints\n\n1 \\leq X \\leq A \\leq 10^5\n\n1 \\leq Y \\leq B \\leq 10^5\n\n1 \\leq C \\leq 10^5\n\n1 \\leq p_i \\leq 10^9\n\n1 \\leq q_i \\leq 10^9\n\n1 \\leq r_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\nX Y A B C\np_1 p_2 ... p_A\nq_1 q_2 ... q_B\nr_1 r_2 ... r_C\n\nOutput\n\nPrint the maximum possible sum of the deliciousness of the eaten apples.\n\nSample Input 1\n\n1 2 2 2 1\n2 4\n5 1\n3\n\nSample Output 1\n\n12\n\nThe maximum possible sum of the deliciousness of the eaten apples can be achieved as follows:\n\nEat the 2-nd red apple.\n\nEat the 1-st green apple.\n\nPaint the 1-st colorless apple green and eat it.\n\nSample Input 2\n\n2 2 2 2 2\n8 6\n9 1\n2 1\n\nSample Output 2\n\n25\n\nSample Input 3\n\n2 2 4 4 4\n11 12 13 14\n21 22 23 24\n1 2 3 4\n\nSample Output 3\n\n74", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4279, "cpu_time_ms": 166, "memory_kb": 9856}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s013833874", "group_id": "codeNet:p02727", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\ntype Apple struct {\n\tsweetness int\n\tcolor int //0:red,1:green,2:colorless\n}\n\ntype Apples []Apple\n\nfunc (c Apples) Len() int {\n\treturn len(c)\n}\n\nfunc (c Apples) Swap(i, j int) {\n\tc[i], c[j] = c[j], c[i]\n}\n\nfunc (c Apples) Less(i, j int) bool {\n\treturn c[i].sweetness > c[j].sweetness\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush() // !!!!coution!!!! you must use Fprint(out, ) not Print()\n\t/* --- code --- */\n\tX, Y, A, B, C := nextInt(), nextInt(), nextInt(), nextInt(), nextInt()\n\tvar p Apples = make([]Apple, A)\n\tvar q Apples = make([]Apple, B)\n\tvar r Apples = make([]Apple, C)\n\tfor i := 0; i < A; i++ {\n\t\tp[i] = Apple{nextInt(), 0}\n\t}\n\tfor i := 0; i < B; i++ {\n\t\tq[i] = Apple{nextInt(), 1}\n\t}\n\tfor i := 0; i < C; i++ {\n\t\tr[i] = Apple{nextInt(), 2}\n\t}\n\tsort.Sort(p)\n\tsort.Sort(q)\n\tsort.Sort(r)\n\n\tpAns := p[:X]\n\tqAns := q[:Y]\n\tip := len(pAns) - 1\n\tiq := len(qAns) - 1\n\tfor i := 0; i < C; i++ {\n\t\tif pAns[ip].sweetness > r[i].sweetness && qAns[iq].sweetness > r[i].sweetness {\n\t\t\tbreak\n\t\t}\n\t\tif iq < 0 && ip >= 0 {\n\t\t\t// check only p\n\t\t\tif pAns[ip].sweetness < r[i].sweetness {\n\t\t\t\tpAns[ip] = r[i]\n\t\t\t\tip--\n\t\t\t}\n\t\t} else if ip < 0 && iq >= 0 {\n\t\t\t// check only q\n\t\t\tif qAns[iq].sweetness < r[i].sweetness {\n\t\t\t\tqAns[iq] = r[i]\n\t\t\t\tiq--\n\t\t\t}\n\t\t} else {\n\t\t\tif pAns[ip].sweetness > qAns[iq].sweetness {\n\t\t\t\tqAns[iq] = r[i]\n\t\t\t\tiq--\n\t\t\t} else {\n\t\t\t\tpAns[ip] = r[i]\n\t\t\t\tip--\n\t\t\t}\n\t\t}\n\t}\n\tans := 0\n\tfor i := 0; i < len(pAns); i++ {\n\t\tans += pAns[i].sweetness\n\t}\n\tfor i := 0; i < len(qAns); i++ {\n\t\tans += qAns[i].sweetness\n\t}\n\tfmt.Println(ans)\n\n}\n\n// -*-*-*-*-*-*-*-*-\n// * I/O utilities *\n// -*-*-*-*-*-*-*-*-\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextInt64() int64 {\n\ta, _ := strconv.ParseInt(next(), 10, 64)\n\treturn a\n}\n\nfunc nextFloat64() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\nfunc nextFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextFloat64()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\nfunc split(s string) []string {\n\tret := make([]string, len([]rune(s)))\n\tfor i, v := range []rune(s) {\n\t\tret[i] = string(v)\n\t}\n\treturn ret\n}\n\nfunc PrintOut(src interface{}, joinner string) {\n\tswitch reflect.TypeOf(src).Kind() {\n\tcase reflect.Slice:\n\t\ts := reflect.ValueOf(src)\n\t\tfor idx := 0; idx < s.Len(); idx++ {\n\t\t\tfmt.Fprintf(out, \"%v\", s.Index(idx))\n\t\t\tif idx < s.Len()-1 {\n\t\t\t\tfmt.Fprintf(out, \"%s\", joinner)\n\t\t\t} else {\n\t\t\t\tfmt.Fprintln(out)\n\t\t\t}\n\t\t}\n\tdefault:\n\t\tfmt.Fprintln(out, \"fuck\")\n\t}\n}\n\n// -*-*-*-*-*-*-*-*-\n// * tool snippets *\n// -*-*-*-*-*-*-*-*-\nfunc duplicate2Int(base [][]int) (ret [][]int) {\n\tret = make([][]int, len(base))\n\tfor i, v := range base {\n\t\tret[i] = append([]int{}, v...)\n\t}\n\treturn\n}\n\n// -*-*-*-*-*-*-*-*-*-*-*-*-*-\n// * Algorithms Utility Zone *\n// -*-*-*-*-*-*-*-*-*-*-*-*-*-\n\n// -*-*-*-*-*-*-*-\n// * 1. nibutan *\n// -*-*-*-*-*-*-*-\nfunc lower_bound(arr []int, target int) int {\n\tl, r := 0, len(arr)\n\tfor l < r {\n\t\tmid := (l + r) / 2\n\t\tif arr[mid] < target {\n\t\t\tl = mid + 1\n\t\t} else {\n\t\t\tr = mid\n\t\t}\n\t}\n\treturn l\n}\n\nfunc upper_bound(arr []int, target int) int {\n\tl, r := 0, len(arr)\n\tfor l < r {\n\t\tmid := (l + r) / 2\n\t\tif target < arr[mid] {\n\t\t\tr = mid\n\t\t} else {\n\t\t\tl = mid + 1\n\t\t}\n\t}\n\treturn l\n}\n\n// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-\n// * math flavor typical theories *\n// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-\nfunc gcd(a, b int) int {\n\tif a > b {\n\t\treturn gcd(b, a)\n\t}\n\tfor a != 0 {\n\t\ta, b = b%a, a\n\t}\n\treturn b\n}\n\nfunc pow(a, b int) (ret int) {\n\tret = a\n\t// 10^2 = 100ってことは10に10を1回掛けることだね\n\t// なので初期値を含めると上限b-1未満\n\tfor i := 0; i < b-1; i++ {\n\t\tret *= a\n\t}\n\treturn\n}\n\nfunc powMod(n, m, mod int) (ret int) {\n\tret = 1\n\tfor m > 0 {\n\t\tif m&1 == 1 {\n\t\t\tret *= n\n\t\t\tret %= mod\n\t\t}\n\t\tn *= n\n\t\tn %= mod\n\t\tm >>= 1\n\t}\n\treturn ret\n}\n", "language": "Go", "metadata": {"date": 1588804323, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02727.html", "problem_id": "p02727", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02727/input.txt", "sample_output_relpath": "derived/input_output/data/p02727/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02727/Go/s013833874.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s013833874", "user_id": "u532762536"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\ntype Apple struct {\n\tsweetness int\n\tcolor int //0:red,1:green,2:colorless\n}\n\ntype Apples []Apple\n\nfunc (c Apples) Len() int {\n\treturn len(c)\n}\n\nfunc (c Apples) Swap(i, j int) {\n\tc[i], c[j] = c[j], c[i]\n}\n\nfunc (c Apples) Less(i, j int) bool {\n\treturn c[i].sweetness > c[j].sweetness\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush() // !!!!coution!!!! you must use Fprint(out, ) not Print()\n\t/* --- code --- */\n\tX, Y, A, B, C := nextInt(), nextInt(), nextInt(), nextInt(), nextInt()\n\tvar p Apples = make([]Apple, A)\n\tvar q Apples = make([]Apple, B)\n\tvar r Apples = make([]Apple, C)\n\tfor i := 0; i < A; i++ {\n\t\tp[i] = Apple{nextInt(), 0}\n\t}\n\tfor i := 0; i < B; i++ {\n\t\tq[i] = Apple{nextInt(), 1}\n\t}\n\tfor i := 0; i < C; i++ {\n\t\tr[i] = Apple{nextInt(), 2}\n\t}\n\tsort.Sort(p)\n\tsort.Sort(q)\n\tsort.Sort(r)\n\n\tpAns := p[:X]\n\tqAns := q[:Y]\n\tip := len(pAns) - 1\n\tiq := len(qAns) - 1\n\tfor i := 0; i < C; i++ {\n\t\tif pAns[ip].sweetness > r[i].sweetness && qAns[iq].sweetness > r[i].sweetness {\n\t\t\tbreak\n\t\t}\n\t\tif iq < 0 && ip >= 0 {\n\t\t\t// check only p\n\t\t\tif pAns[ip].sweetness < r[i].sweetness {\n\t\t\t\tpAns[ip] = r[i]\n\t\t\t\tip--\n\t\t\t}\n\t\t} else if ip < 0 && iq >= 0 {\n\t\t\t// check only q\n\t\t\tif qAns[iq].sweetness < r[i].sweetness {\n\t\t\t\tqAns[iq] = r[i]\n\t\t\t\tiq--\n\t\t\t}\n\t\t} else {\n\t\t\tif pAns[ip].sweetness > qAns[iq].sweetness {\n\t\t\t\tqAns[iq] = r[i]\n\t\t\t\tiq--\n\t\t\t} else {\n\t\t\t\tpAns[ip] = r[i]\n\t\t\t\tip--\n\t\t\t}\n\t\t}\n\t}\n\tans := 0\n\tfor i := 0; i < len(pAns); i++ {\n\t\tans += pAns[i].sweetness\n\t}\n\tfor i := 0; i < len(qAns); i++ {\n\t\tans += qAns[i].sweetness\n\t}\n\tfmt.Println(ans)\n\n}\n\n// -*-*-*-*-*-*-*-*-\n// * I/O utilities *\n// -*-*-*-*-*-*-*-*-\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextInt64() int64 {\n\ta, _ := strconv.ParseInt(next(), 10, 64)\n\treturn a\n}\n\nfunc nextFloat64() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\nfunc nextFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextFloat64()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\nfunc split(s string) []string {\n\tret := make([]string, len([]rune(s)))\n\tfor i, v := range []rune(s) {\n\t\tret[i] = string(v)\n\t}\n\treturn ret\n}\n\nfunc PrintOut(src interface{}, joinner string) {\n\tswitch reflect.TypeOf(src).Kind() {\n\tcase reflect.Slice:\n\t\ts := reflect.ValueOf(src)\n\t\tfor idx := 0; idx < s.Len(); idx++ {\n\t\t\tfmt.Fprintf(out, \"%v\", s.Index(idx))\n\t\t\tif idx < s.Len()-1 {\n\t\t\t\tfmt.Fprintf(out, \"%s\", joinner)\n\t\t\t} else {\n\t\t\t\tfmt.Fprintln(out)\n\t\t\t}\n\t\t}\n\tdefault:\n\t\tfmt.Fprintln(out, \"fuck\")\n\t}\n}\n\n// -*-*-*-*-*-*-*-*-\n// * tool snippets *\n// -*-*-*-*-*-*-*-*-\nfunc duplicate2Int(base [][]int) (ret [][]int) {\n\tret = make([][]int, len(base))\n\tfor i, v := range base {\n\t\tret[i] = append([]int{}, v...)\n\t}\n\treturn\n}\n\n// -*-*-*-*-*-*-*-*-*-*-*-*-*-\n// * Algorithms Utility Zone *\n// -*-*-*-*-*-*-*-*-*-*-*-*-*-\n\n// -*-*-*-*-*-*-*-\n// * 1. nibutan *\n// -*-*-*-*-*-*-*-\nfunc lower_bound(arr []int, target int) int {\n\tl, r := 0, len(arr)\n\tfor l < r {\n\t\tmid := (l + r) / 2\n\t\tif arr[mid] < target {\n\t\t\tl = mid + 1\n\t\t} else {\n\t\t\tr = mid\n\t\t}\n\t}\n\treturn l\n}\n\nfunc upper_bound(arr []int, target int) int {\n\tl, r := 0, len(arr)\n\tfor l < r {\n\t\tmid := (l + r) / 2\n\t\tif target < arr[mid] {\n\t\t\tr = mid\n\t\t} else {\n\t\t\tl = mid + 1\n\t\t}\n\t}\n\treturn l\n}\n\n// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-\n// * math flavor typical theories *\n// *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-\nfunc gcd(a, b int) int {\n\tif a > b {\n\t\treturn gcd(b, a)\n\t}\n\tfor a != 0 {\n\t\ta, b = b%a, a\n\t}\n\treturn b\n}\n\nfunc pow(a, b int) (ret int) {\n\tret = a\n\t// 10^2 = 100ってことは10に10を1回掛けることだね\n\t// なので初期値を含めると上限b-1未満\n\tfor i := 0; i < b-1; i++ {\n\t\tret *= a\n\t}\n\treturn\n}\n\nfunc powMod(n, m, mod int) (ret int) {\n\tret = 1\n\tfor m > 0 {\n\t\tif m&1 == 1 {\n\t\t\tret *= n\n\t\t\tret %= mod\n\t\t}\n\t\tn *= n\n\t\tn %= mod\n\t\tm >>= 1\n\t}\n\treturn ret\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nYou are going to eat X red apples and Y green apples.\n\nYou have A red apples of deliciousness p_1,p_2, \\dots, p_A, B green apples of deliciousness q_1,q_2, \\dots, q_B, and C colorless apples of deliciousness r_1,r_2, \\dots, r_C.\n\nBefore eating a colorless apple, you can paint it red or green, and it will count as a red or green apple, respectively.\n\nFrom the apples above, you will choose the apples to eat while making the sum of the deliciousness of the eaten apples as large as possible.\n\nFind the maximum possible sum of the deliciousness of the eaten apples that can be achieved when optimally coloring zero or more colorless apples.\n\nConstraints\n\n1 \\leq X \\leq A \\leq 10^5\n\n1 \\leq Y \\leq B \\leq 10^5\n\n1 \\leq C \\leq 10^5\n\n1 \\leq p_i \\leq 10^9\n\n1 \\leq q_i \\leq 10^9\n\n1 \\leq r_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\nX Y A B C\np_1 p_2 ... p_A\nq_1 q_2 ... q_B\nr_1 r_2 ... r_C\n\nOutput\n\nPrint the maximum possible sum of the deliciousness of the eaten apples.\n\nSample Input 1\n\n1 2 2 2 1\n2 4\n5 1\n3\n\nSample Output 1\n\n12\n\nThe maximum possible sum of the deliciousness of the eaten apples can be achieved as follows:\n\nEat the 2-nd red apple.\n\nEat the 1-st green apple.\n\nPaint the 1-st colorless apple green and eat it.\n\nSample Input 2\n\n2 2 2 2 2\n8 6\n9 1\n2 1\n\nSample Output 2\n\n25\n\nSample Input 3\n\n2 2 4 4 4\n11 12 13 14\n21 22 23 24\n1 2 3 4\n\nSample Output 3\n\n74", "sample_input": "1 2 2 2 1\n2 4\n5 1\n3\n"}, "reference_outputs": ["12\n"], "source_document_id": "p02727", "source_text": "Score : 500 points\n\nProblem Statement\n\nYou are going to eat X red apples and Y green apples.\n\nYou have A red apples of deliciousness p_1,p_2, \\dots, p_A, B green apples of deliciousness q_1,q_2, \\dots, q_B, and C colorless apples of deliciousness r_1,r_2, \\dots, r_C.\n\nBefore eating a colorless apple, you can paint it red or green, and it will count as a red or green apple, respectively.\n\nFrom the apples above, you will choose the apples to eat while making the sum of the deliciousness of the eaten apples as large as possible.\n\nFind the maximum possible sum of the deliciousness of the eaten apples that can be achieved when optimally coloring zero or more colorless apples.\n\nConstraints\n\n1 \\leq X \\leq A \\leq 10^5\n\n1 \\leq Y \\leq B \\leq 10^5\n\n1 \\leq C \\leq 10^5\n\n1 \\leq p_i \\leq 10^9\n\n1 \\leq q_i \\leq 10^9\n\n1 \\leq r_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\nX Y A B C\np_1 p_2 ... p_A\nq_1 q_2 ... q_B\nr_1 r_2 ... r_C\n\nOutput\n\nPrint the maximum possible sum of the deliciousness of the eaten apples.\n\nSample Input 1\n\n1 2 2 2 1\n2 4\n5 1\n3\n\nSample Output 1\n\n12\n\nThe maximum possible sum of the deliciousness of the eaten apples can be achieved as follows:\n\nEat the 2-nd red apple.\n\nEat the 1-st green apple.\n\nPaint the 1-st colorless apple green and eat it.\n\nSample Input 2\n\n2 2 2 2 2\n8 6\n9 1\n2 1\n\nSample Output 2\n\n25\n\nSample Input 3\n\n2 2 4 4 4\n11 12 13 14\n21 22 23 24\n1 2 3 4\n\nSample Output 3\n\n74", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4239, "cpu_time_ms": 162, "memory_kb": 9728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s422848475", "group_id": "codeNet:p02727", "input_text": "// 赤X+緑Y個を選びたい、赤Aと緑BとCがありCは赤か緑に変更可能\n// A+BでX+Yが足りる場合(条件から絶対足りるわコレ アホな誤読してた) Cで置換できるものがあれば置換する\n// 置換はRの大きいものからP,Qに対してにぶたんして、優先順位の高いやつからやる\n// 優先順位の高いやつ、それは何\n// なんかどうせ使うんだしP,Qどっちにしても良さそうだしそうする\n// これは懸念ですが雑にやったのでpopleftがおかしいし多分TLEなると思うこれ\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar X, Y, A, B, C int\n\tfmt.Scan(&X, &Y, &A, &B, &C)\n\tP, Q, R := make([]int, A), make([]int, B), make([]int, C)\n\n\tfor i := 0; i < A; i++ {\n\t\tvar V int\n\t\tfmt.Scan(&V)\n\t\tP[i] = V\n\t}\n\tfor i := 0; i < B; i++ {\n\t\tvar V int\n\t\tfmt.Scan(&V)\n\t\tQ[i] = V\n\t}\n\tfor i := 0; i < C; i++ {\n\t\tvar V int\n\t\tfmt.Scan(&V)\n\t\tR[i] = V\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(P)))\n\tsort.Sort(sort.Reverse(sort.IntSlice(Q)))\n\tsort.Sort(sort.Reverse(sort.IntSlice(R)))\n\tP = P[:X]\n\tQ = Q[:Y]\n\t// まずRをPに使えるだけ試し、次に余ったRをQに使えるだけ試す\n\t// いつもならlower boundをフルスクラッチで実装するんだけどこれたまたまsort使ってるのでsortパッケージから使ってみることにする\n\n\tusedCount := 0\n\tfor _, r := range R {\n\t\t// fmt.Printf(\"target = %d\\n\", r)\n\t\tidx := sort.Search(X, func(i int) bool { return P[i] < r })\n\t\t// fmt.Printf(\"idx:= %d\\n\", idx)\n\t\tif idx >= X {\n\t\t\t// fmt.Println(\"もう置換不可能\")\n\t\t\tbreak\n\t\t} else {\n\t\t\t// fmt.Printf(\"置換可能: P[%d]=%d\\n\", idx, P[idx])\n\t\t\tP[idx] = r\n\t\t\tusedCount += 1\n\t\t}\n\t}\n\tR = R[usedCount:]\n\tfor _, r := range R {\n\t\t// fmt.Printf(\"target = %d\\n\", r)\n\t\tidx := sort.Search(X, func(i int) bool { return Q[i] < r })\n\t\t// fmt.Printf(\"idx:= %d\\n\", idx)\n\t\tif idx >= Y {\n\t\t\t// fmt.Println(\"もう置換不可能\")\n\t\t\tbreak\n\t\t} else {\n\t\t\t// fmt.Printf(\"置換可能: Q[%d]=%d\\n\", idx, Q[idx])\n\t\t\tQ[idx] = r\n\t\t\tusedCount += 1\n\t\t}\n\t}\n\tans := 0\n\tfor _, p := range P {\n\t\tans += p\n\t}\n\tfor _, q := range Q {\n\t\tans += q\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1588644674, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02727.html", "problem_id": "p02727", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02727/input.txt", "sample_output_relpath": "derived/input_output/data/p02727/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02727/Go/s422848475.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s422848475", "user_id": "u445624660"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "// 赤X+緑Y個を選びたい、赤Aと緑BとCがありCは赤か緑に変更可能\n// A+BでX+Yが足りる場合(条件から絶対足りるわコレ アホな誤読してた) Cで置換できるものがあれば置換する\n// 置換はRの大きいものからP,Qに対してにぶたんして、優先順位の高いやつからやる\n// 優先順位の高いやつ、それは何\n// なんかどうせ使うんだしP,Qどっちにしても良さそうだしそうする\n// これは懸念ですが雑にやったのでpopleftがおかしいし多分TLEなると思うこれ\n\npackage main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar X, Y, A, B, C int\n\tfmt.Scan(&X, &Y, &A, &B, &C)\n\tP, Q, R := make([]int, A), make([]int, B), make([]int, C)\n\n\tfor i := 0; i < A; i++ {\n\t\tvar V int\n\t\tfmt.Scan(&V)\n\t\tP[i] = V\n\t}\n\tfor i := 0; i < B; i++ {\n\t\tvar V int\n\t\tfmt.Scan(&V)\n\t\tQ[i] = V\n\t}\n\tfor i := 0; i < C; i++ {\n\t\tvar V int\n\t\tfmt.Scan(&V)\n\t\tR[i] = V\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(P)))\n\tsort.Sort(sort.Reverse(sort.IntSlice(Q)))\n\tsort.Sort(sort.Reverse(sort.IntSlice(R)))\n\tP = P[:X]\n\tQ = Q[:Y]\n\t// まずRをPに使えるだけ試し、次に余ったRをQに使えるだけ試す\n\t// いつもならlower boundをフルスクラッチで実装するんだけどこれたまたまsort使ってるのでsortパッケージから使ってみることにする\n\n\tusedCount := 0\n\tfor _, r := range R {\n\t\t// fmt.Printf(\"target = %d\\n\", r)\n\t\tidx := sort.Search(X, func(i int) bool { return P[i] < r })\n\t\t// fmt.Printf(\"idx:= %d\\n\", idx)\n\t\tif idx >= X {\n\t\t\t// fmt.Println(\"もう置換不可能\")\n\t\t\tbreak\n\t\t} else {\n\t\t\t// fmt.Printf(\"置換可能: P[%d]=%d\\n\", idx, P[idx])\n\t\t\tP[idx] = r\n\t\t\tusedCount += 1\n\t\t}\n\t}\n\tR = R[usedCount:]\n\tfor _, r := range R {\n\t\t// fmt.Printf(\"target = %d\\n\", r)\n\t\tidx := sort.Search(X, func(i int) bool { return Q[i] < r })\n\t\t// fmt.Printf(\"idx:= %d\\n\", idx)\n\t\tif idx >= Y {\n\t\t\t// fmt.Println(\"もう置換不可能\")\n\t\t\tbreak\n\t\t} else {\n\t\t\t// fmt.Printf(\"置換可能: Q[%d]=%d\\n\", idx, Q[idx])\n\t\t\tQ[idx] = r\n\t\t\tusedCount += 1\n\t\t}\n\t}\n\tans := 0\n\tfor _, p := range P {\n\t\tans += p\n\t}\n\tfor _, q := range Q {\n\t\tans += q\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nYou are going to eat X red apples and Y green apples.\n\nYou have A red apples of deliciousness p_1,p_2, \\dots, p_A, B green apples of deliciousness q_1,q_2, \\dots, q_B, and C colorless apples of deliciousness r_1,r_2, \\dots, r_C.\n\nBefore eating a colorless apple, you can paint it red or green, and it will count as a red or green apple, respectively.\n\nFrom the apples above, you will choose the apples to eat while making the sum of the deliciousness of the eaten apples as large as possible.\n\nFind the maximum possible sum of the deliciousness of the eaten apples that can be achieved when optimally coloring zero or more colorless apples.\n\nConstraints\n\n1 \\leq X \\leq A \\leq 10^5\n\n1 \\leq Y \\leq B \\leq 10^5\n\n1 \\leq C \\leq 10^5\n\n1 \\leq p_i \\leq 10^9\n\n1 \\leq q_i \\leq 10^9\n\n1 \\leq r_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\nX Y A B C\np_1 p_2 ... p_A\nq_1 q_2 ... q_B\nr_1 r_2 ... r_C\n\nOutput\n\nPrint the maximum possible sum of the deliciousness of the eaten apples.\n\nSample Input 1\n\n1 2 2 2 1\n2 4\n5 1\n3\n\nSample Output 1\n\n12\n\nThe maximum possible sum of the deliciousness of the eaten apples can be achieved as follows:\n\nEat the 2-nd red apple.\n\nEat the 1-st green apple.\n\nPaint the 1-st colorless apple green and eat it.\n\nSample Input 2\n\n2 2 2 2 2\n8 6\n9 1\n2 1\n\nSample Output 2\n\n25\n\nSample Input 3\n\n2 2 4 4 4\n11 12 13 14\n21 22 23 24\n1 2 3 4\n\nSample Output 3\n\n74", "sample_input": "1 2 2 2 1\n2 4\n5 1\n3\n"}, "reference_outputs": ["12\n"], "source_document_id": "p02727", "source_text": "Score : 500 points\n\nProblem Statement\n\nYou are going to eat X red apples and Y green apples.\n\nYou have A red apples of deliciousness p_1,p_2, \\dots, p_A, B green apples of deliciousness q_1,q_2, \\dots, q_B, and C colorless apples of deliciousness r_1,r_2, \\dots, r_C.\n\nBefore eating a colorless apple, you can paint it red or green, and it will count as a red or green apple, respectively.\n\nFrom the apples above, you will choose the apples to eat while making the sum of the deliciousness of the eaten apples as large as possible.\n\nFind the maximum possible sum of the deliciousness of the eaten apples that can be achieved when optimally coloring zero or more colorless apples.\n\nConstraints\n\n1 \\leq X \\leq A \\leq 10^5\n\n1 \\leq Y \\leq B \\leq 10^5\n\n1 \\leq C \\leq 10^5\n\n1 \\leq p_i \\leq 10^9\n\n1 \\leq q_i \\leq 10^9\n\n1 \\leq r_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\nX Y A B C\np_1 p_2 ... p_A\nq_1 q_2 ... q_B\nr_1 r_2 ... r_C\n\nOutput\n\nPrint the maximum possible sum of the deliciousness of the eaten apples.\n\nSample Input 1\n\n1 2 2 2 1\n2 4\n5 1\n3\n\nSample Output 1\n\n12\n\nThe maximum possible sum of the deliciousness of the eaten apples can be achieved as follows:\n\nEat the 2-nd red apple.\n\nEat the 1-st green apple.\n\nPaint the 1-st colorless apple green and eat it.\n\nSample Input 2\n\n2 2 2 2 2\n8 6\n9 1\n2 1\n\nSample Output 2\n\n25\n\nSample Input 3\n\n2 2 4 4 4\n11 12 13 14\n21 22 23 24\n1 2 3 4\n\nSample Output 3\n\n74", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2181, "cpu_time_ms": 2108, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s970728862", "group_id": "codeNet:p02727", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tvar x, y, a, b, c int\n\tfmt.Fscan(r, &x)\n\tfmt.Fscan(r, &y)\n\tfmt.Fscan(r, &a)\n\tfmt.Fscan(r, &b)\n\tfmt.Fscan(r, &c)\n\tas := make([]int, a)\n\tbs := make([]int, b)\n\tcs := make([]int, c)\n\tfor i := 0; i < a; i++ {\n\t\tfmt.Fscan(r, &as[i])\n\t}\n\tfor i := 0; i < b; i++ {\n\t\tfmt.Fscan(r, &bs[i])\n\t}\n\tfor i := 0; i < c; i++ {\n\t\tfmt.Fscan(r, &cs[i])\n\t}\n\tsort.Sort(sort.IntSlice(as))\n\tsort.Sort(sort.IntSlice(bs))\n\tsort.Sort(sort.IntSlice(cs))\n\n\tans := 0\n\tsumX := 0\n\tsumY := 0\n\tasIndex := a - 1\n\tbsIndex := b - 1\n\tcsIndex := c - 1\n\tfor sumX+sumY < x+y {\n\t\tcurrentC := -1\n\t\tif csIndex >= 0 {\n\t\t\tcurrentC = cs[csIndex]\n\t\t}\n\n\t\tif sumX < x && sumY < y {\n\t\t\tif as[asIndex] > bs[bsIndex] {\n\t\t\t\tif as[asIndex] > currentC {\n\t\t\t\t\tans += as[asIndex]\n\t\t\t\t\tasIndex--\n\t\t\t\t\tsumX++\n\t\t\t\t} else {\n\t\t\t\t\tans += currentC\n\t\t\t\t\tcsIndex--\n\t\t\t\t\tsumX++\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif bs[bsIndex] > currentC {\n\t\t\t\t\tans += bs[bsIndex]\n\t\t\t\t\tbsIndex--\n\t\t\t\t\tsumY++\n\t\t\t\t} else {\n\t\t\t\t\tans += currentC\n\t\t\t\t\tcsIndex--\n\t\t\t\t\tsumY++\n\t\t\t\t}\n\t\t\t}\n\t\t} else if sumX < x {\n\t\t\tif as[asIndex] > currentC {\n\t\t\t\tans += as[asIndex]\n\t\t\t\tasIndex--\n\t\t\t\tsumX++\n\t\t\t} else {\n\t\t\t\tans += currentC\n\t\t\t\tcsIndex--\n\t\t\t\tsumX++\n\t\t\t}\n\t\t} else {\n\t\t\tif bs[bsIndex] > currentC {\n\t\t\t\tans += bs[bsIndex]\n\t\t\t\tbsIndex--\n\t\t\t\tsumY++\n\t\t\t} else {\n\t\t\t\tans += currentC\n\t\t\t\tcsIndex--\n\t\t\t\tsumY++\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1585619510, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02727.html", "problem_id": "p02727", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02727/input.txt", "sample_output_relpath": "derived/input_output/data/p02727/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02727/Go/s970728862.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s970728862", "user_id": "u433254839"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tvar x, y, a, b, c int\n\tfmt.Fscan(r, &x)\n\tfmt.Fscan(r, &y)\n\tfmt.Fscan(r, &a)\n\tfmt.Fscan(r, &b)\n\tfmt.Fscan(r, &c)\n\tas := make([]int, a)\n\tbs := make([]int, b)\n\tcs := make([]int, c)\n\tfor i := 0; i < a; i++ {\n\t\tfmt.Fscan(r, &as[i])\n\t}\n\tfor i := 0; i < b; i++ {\n\t\tfmt.Fscan(r, &bs[i])\n\t}\n\tfor i := 0; i < c; i++ {\n\t\tfmt.Fscan(r, &cs[i])\n\t}\n\tsort.Sort(sort.IntSlice(as))\n\tsort.Sort(sort.IntSlice(bs))\n\tsort.Sort(sort.IntSlice(cs))\n\n\tans := 0\n\tsumX := 0\n\tsumY := 0\n\tasIndex := a - 1\n\tbsIndex := b - 1\n\tcsIndex := c - 1\n\tfor sumX+sumY < x+y {\n\t\tcurrentC := -1\n\t\tif csIndex >= 0 {\n\t\t\tcurrentC = cs[csIndex]\n\t\t}\n\n\t\tif sumX < x && sumY < y {\n\t\t\tif as[asIndex] > bs[bsIndex] {\n\t\t\t\tif as[asIndex] > currentC {\n\t\t\t\t\tans += as[asIndex]\n\t\t\t\t\tasIndex--\n\t\t\t\t\tsumX++\n\t\t\t\t} else {\n\t\t\t\t\tans += currentC\n\t\t\t\t\tcsIndex--\n\t\t\t\t\tsumX++\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif bs[bsIndex] > currentC {\n\t\t\t\t\tans += bs[bsIndex]\n\t\t\t\t\tbsIndex--\n\t\t\t\t\tsumY++\n\t\t\t\t} else {\n\t\t\t\t\tans += currentC\n\t\t\t\t\tcsIndex--\n\t\t\t\t\tsumY++\n\t\t\t\t}\n\t\t\t}\n\t\t} else if sumX < x {\n\t\t\tif as[asIndex] > currentC {\n\t\t\t\tans += as[asIndex]\n\t\t\t\tasIndex--\n\t\t\t\tsumX++\n\t\t\t} else {\n\t\t\t\tans += currentC\n\t\t\t\tcsIndex--\n\t\t\t\tsumX++\n\t\t\t}\n\t\t} else {\n\t\t\tif bs[bsIndex] > currentC {\n\t\t\t\tans += bs[bsIndex]\n\t\t\t\tbsIndex--\n\t\t\t\tsumY++\n\t\t\t} else {\n\t\t\t\tans += currentC\n\t\t\t\tcsIndex--\n\t\t\t\tsumY++\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nYou are going to eat X red apples and Y green apples.\n\nYou have A red apples of deliciousness p_1,p_2, \\dots, p_A, B green apples of deliciousness q_1,q_2, \\dots, q_B, and C colorless apples of deliciousness r_1,r_2, \\dots, r_C.\n\nBefore eating a colorless apple, you can paint it red or green, and it will count as a red or green apple, respectively.\n\nFrom the apples above, you will choose the apples to eat while making the sum of the deliciousness of the eaten apples as large as possible.\n\nFind the maximum possible sum of the deliciousness of the eaten apples that can be achieved when optimally coloring zero or more colorless apples.\n\nConstraints\n\n1 \\leq X \\leq A \\leq 10^5\n\n1 \\leq Y \\leq B \\leq 10^5\n\n1 \\leq C \\leq 10^5\n\n1 \\leq p_i \\leq 10^9\n\n1 \\leq q_i \\leq 10^9\n\n1 \\leq r_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\nX Y A B C\np_1 p_2 ... p_A\nq_1 q_2 ... q_B\nr_1 r_2 ... r_C\n\nOutput\n\nPrint the maximum possible sum of the deliciousness of the eaten apples.\n\nSample Input 1\n\n1 2 2 2 1\n2 4\n5 1\n3\n\nSample Output 1\n\n12\n\nThe maximum possible sum of the deliciousness of the eaten apples can be achieved as follows:\n\nEat the 2-nd red apple.\n\nEat the 1-st green apple.\n\nPaint the 1-st colorless apple green and eat it.\n\nSample Input 2\n\n2 2 2 2 2\n8 6\n9 1\n2 1\n\nSample Output 2\n\n25\n\nSample Input 3\n\n2 2 4 4 4\n11 12 13 14\n21 22 23 24\n1 2 3 4\n\nSample Output 3\n\n74", "sample_input": "1 2 2 2 1\n2 4\n5 1\n3\n"}, "reference_outputs": ["12\n"], "source_document_id": "p02727", "source_text": "Score : 500 points\n\nProblem Statement\n\nYou are going to eat X red apples and Y green apples.\n\nYou have A red apples of deliciousness p_1,p_2, \\dots, p_A, B green apples of deliciousness q_1,q_2, \\dots, q_B, and C colorless apples of deliciousness r_1,r_2, \\dots, r_C.\n\nBefore eating a colorless apple, you can paint it red or green, and it will count as a red or green apple, respectively.\n\nFrom the apples above, you will choose the apples to eat while making the sum of the deliciousness of the eaten apples as large as possible.\n\nFind the maximum possible sum of the deliciousness of the eaten apples that can be achieved when optimally coloring zero or more colorless apples.\n\nConstraints\n\n1 \\leq X \\leq A \\leq 10^5\n\n1 \\leq Y \\leq B \\leq 10^5\n\n1 \\leq C \\leq 10^5\n\n1 \\leq p_i \\leq 10^9\n\n1 \\leq q_i \\leq 10^9\n\n1 \\leq r_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\nX Y A B C\np_1 p_2 ... p_A\nq_1 q_2 ... q_B\nr_1 r_2 ... r_C\n\nOutput\n\nPrint the maximum possible sum of the deliciousness of the eaten apples.\n\nSample Input 1\n\n1 2 2 2 1\n2 4\n5 1\n3\n\nSample Output 1\n\n12\n\nThe maximum possible sum of the deliciousness of the eaten apples can be achieved as follows:\n\nEat the 2-nd red apple.\n\nEat the 1-st green apple.\n\nPaint the 1-st colorless apple green and eat it.\n\nSample Input 2\n\n2 2 2 2 2\n8 6\n9 1\n2 1\n\nSample Output 2\n\n25\n\nSample Input 3\n\n2 2 4 4 4\n11 12 13 14\n21 22 23 24\n1 2 3 4\n\nSample Output 3\n\n74", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1428, "cpu_time_ms": 484, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s587099764", "group_id": "codeNet:p02727", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n \"bufio\"\n \"strconv\"\n \"os\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n sc.Split(bufio.ScanWords)\n x, y, a, b, c := nextInt(), nextInt(), nextInt(), nextInt(), nextInt()\n p, q, r := nextInts(a), nextInts(b), nextInts(c)\n\n sort.Sort(sort.Reverse(sort.IntSlice(p)))\n \tsort.Sort(sort.Reverse(sort.IntSlice(q)))\n \tsort.Sort(sort.Reverse(sort.IntSlice(r)))\n\n \tr = append(r, p[:x]...)\n \tr = append(r, q[:y]...)\n \tsort.Sort(sort.Reverse(sort.IntSlice(r)))\n\n \tvar ans int\n \tfor i := 0; i < x+y; i++ {\n \t\tans += r[i]\n \t}\n\n // p = p[len(p)-x:]\n // q = q[len(q)-y:]\n //\n // sort.Ints(p)\n // sort.Ints(q)\n // var d []int\n // d = append(d, p...)\n // d = append(d, q...)\n // d = append(d, r...)\n // sort.Ints(d)\n //\n // var ans int\n\t// for i := 0; i < x+y; i++ {\n // ans += d[len(d)-1]\n // d = d[:len(d)-1]\n\t// }\n\tfmt.Println(ans)\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n\nfunc nextInts(n int) []int {\n\tsl := make([]int, n)\n\tfor i := range sl {\n\t\tsl[i] = nextInt()\n\t}\n\treturn sl\n}\n", "language": "Go", "metadata": {"date": 1585518587, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02727.html", "problem_id": "p02727", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02727/input.txt", "sample_output_relpath": "derived/input_output/data/p02727/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02727/Go/s587099764.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s587099764", "user_id": "u917346607"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n \"bufio\"\n \"strconv\"\n \"os\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n sc.Split(bufio.ScanWords)\n x, y, a, b, c := nextInt(), nextInt(), nextInt(), nextInt(), nextInt()\n p, q, r := nextInts(a), nextInts(b), nextInts(c)\n\n sort.Sort(sort.Reverse(sort.IntSlice(p)))\n \tsort.Sort(sort.Reverse(sort.IntSlice(q)))\n \tsort.Sort(sort.Reverse(sort.IntSlice(r)))\n\n \tr = append(r, p[:x]...)\n \tr = append(r, q[:y]...)\n \tsort.Sort(sort.Reverse(sort.IntSlice(r)))\n\n \tvar ans int\n \tfor i := 0; i < x+y; i++ {\n \t\tans += r[i]\n \t}\n\n // p = p[len(p)-x:]\n // q = q[len(q)-y:]\n //\n // sort.Ints(p)\n // sort.Ints(q)\n // var d []int\n // d = append(d, p...)\n // d = append(d, q...)\n // d = append(d, r...)\n // sort.Ints(d)\n //\n // var ans int\n\t// for i := 0; i < x+y; i++ {\n // ans += d[len(d)-1]\n // d = d[:len(d)-1]\n\t// }\n\tfmt.Println(ans)\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n\nfunc nextInts(n int) []int {\n\tsl := make([]int, n)\n\tfor i := range sl {\n\t\tsl[i] = nextInt()\n\t}\n\treturn sl\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nYou are going to eat X red apples and Y green apples.\n\nYou have A red apples of deliciousness p_1,p_2, \\dots, p_A, B green apples of deliciousness q_1,q_2, \\dots, q_B, and C colorless apples of deliciousness r_1,r_2, \\dots, r_C.\n\nBefore eating a colorless apple, you can paint it red or green, and it will count as a red or green apple, respectively.\n\nFrom the apples above, you will choose the apples to eat while making the sum of the deliciousness of the eaten apples as large as possible.\n\nFind the maximum possible sum of the deliciousness of the eaten apples that can be achieved when optimally coloring zero or more colorless apples.\n\nConstraints\n\n1 \\leq X \\leq A \\leq 10^5\n\n1 \\leq Y \\leq B \\leq 10^5\n\n1 \\leq C \\leq 10^5\n\n1 \\leq p_i \\leq 10^9\n\n1 \\leq q_i \\leq 10^9\n\n1 \\leq r_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\nX Y A B C\np_1 p_2 ... p_A\nq_1 q_2 ... q_B\nr_1 r_2 ... r_C\n\nOutput\n\nPrint the maximum possible sum of the deliciousness of the eaten apples.\n\nSample Input 1\n\n1 2 2 2 1\n2 4\n5 1\n3\n\nSample Output 1\n\n12\n\nThe maximum possible sum of the deliciousness of the eaten apples can be achieved as follows:\n\nEat the 2-nd red apple.\n\nEat the 1-st green apple.\n\nPaint the 1-st colorless apple green and eat it.\n\nSample Input 2\n\n2 2 2 2 2\n8 6\n9 1\n2 1\n\nSample Output 2\n\n25\n\nSample Input 3\n\n2 2 4 4 4\n11 12 13 14\n21 22 23 24\n1 2 3 4\n\nSample Output 3\n\n74", "sample_input": "1 2 2 2 1\n2 4\n5 1\n3\n"}, "reference_outputs": ["12\n"], "source_document_id": "p02727", "source_text": "Score : 500 points\n\nProblem Statement\n\nYou are going to eat X red apples and Y green apples.\n\nYou have A red apples of deliciousness p_1,p_2, \\dots, p_A, B green apples of deliciousness q_1,q_2, \\dots, q_B, and C colorless apples of deliciousness r_1,r_2, \\dots, r_C.\n\nBefore eating a colorless apple, you can paint it red or green, and it will count as a red or green apple, respectively.\n\nFrom the apples above, you will choose the apples to eat while making the sum of the deliciousness of the eaten apples as large as possible.\n\nFind the maximum possible sum of the deliciousness of the eaten apples that can be achieved when optimally coloring zero or more colorless apples.\n\nConstraints\n\n1 \\leq X \\leq A \\leq 10^5\n\n1 \\leq Y \\leq B \\leq 10^5\n\n1 \\leq C \\leq 10^5\n\n1 \\leq p_i \\leq 10^9\n\n1 \\leq q_i \\leq 10^9\n\n1 \\leq r_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\nX Y A B C\np_1 p_2 ... p_A\nq_1 q_2 ... q_B\nr_1 r_2 ... r_C\n\nOutput\n\nPrint the maximum possible sum of the deliciousness of the eaten apples.\n\nSample Input 1\n\n1 2 2 2 1\n2 4\n5 1\n3\n\nSample Output 1\n\n12\n\nThe maximum possible sum of the deliciousness of the eaten apples can be achieved as follows:\n\nEat the 2-nd red apple.\n\nEat the 1-st green apple.\n\nPaint the 1-st colorless apple green and eat it.\n\nSample Input 2\n\n2 2 2 2 2\n8 6\n9 1\n2 1\n\nSample Output 2\n\n25\n\nSample Input 3\n\n2 2 4 4 4\n11 12 13 14\n21 22 23 24\n1 2 3 4\n\nSample Output 3\n\n74", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1087, "cpu_time_ms": 279, "memory_kb": 9984}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s800977816", "group_id": "codeNet:p02727", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar x, y, a, b, c int\n\tfmt.Scan(&x, &y, &a, &b, &c)\n\tp := make([]int, a)\n\tq := make([]int, b)\n\tr := make([]int, c)\n\tfor i := 0; i < a; i++ {\n\t\tfmt.Scan(&p[i])\n\t}\n\tfor i := 0; i < b; i++ {\n\t\tfmt.Scan(&q[i])\n\t}\n\tfor i := 0; i < c; i++ {\n\t\tfmt.Scan(&r[i])\n\t}\n\n\tsort.Sort(sort.Reverse(sort.IntSlice(p)))\n\tsort.Sort(sort.Reverse(sort.IntSlice(q)))\n\tp = p[:x]\n\tq = q[:y]\n\n\td := []int{}\n\td = append(d, p...)\n\td = append(d, q...)\n\td = append(d, r...)\n\tsort.Sort(sort.Reverse(sort.IntSlice(d)))\n\n\tans := 0\n\tfor i := 0; i < x+y; i++ {\n\t\tans += d[i]\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1585457214, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02727.html", "problem_id": "p02727", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02727/input.txt", "sample_output_relpath": "derived/input_output/data/p02727/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02727/Go/s800977816.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s800977816", "user_id": "u902409225"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar x, y, a, b, c int\n\tfmt.Scan(&x, &y, &a, &b, &c)\n\tp := make([]int, a)\n\tq := make([]int, b)\n\tr := make([]int, c)\n\tfor i := 0; i < a; i++ {\n\t\tfmt.Scan(&p[i])\n\t}\n\tfor i := 0; i < b; i++ {\n\t\tfmt.Scan(&q[i])\n\t}\n\tfor i := 0; i < c; i++ {\n\t\tfmt.Scan(&r[i])\n\t}\n\n\tsort.Sort(sort.Reverse(sort.IntSlice(p)))\n\tsort.Sort(sort.Reverse(sort.IntSlice(q)))\n\tp = p[:x]\n\tq = q[:y]\n\n\td := []int{}\n\td = append(d, p...)\n\td = append(d, q...)\n\td = append(d, r...)\n\tsort.Sort(sort.Reverse(sort.IntSlice(d)))\n\n\tans := 0\n\tfor i := 0; i < x+y; i++ {\n\t\tans += d[i]\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nYou are going to eat X red apples and Y green apples.\n\nYou have A red apples of deliciousness p_1,p_2, \\dots, p_A, B green apples of deliciousness q_1,q_2, \\dots, q_B, and C colorless apples of deliciousness r_1,r_2, \\dots, r_C.\n\nBefore eating a colorless apple, you can paint it red or green, and it will count as a red or green apple, respectively.\n\nFrom the apples above, you will choose the apples to eat while making the sum of the deliciousness of the eaten apples as large as possible.\n\nFind the maximum possible sum of the deliciousness of the eaten apples that can be achieved when optimally coloring zero or more colorless apples.\n\nConstraints\n\n1 \\leq X \\leq A \\leq 10^5\n\n1 \\leq Y \\leq B \\leq 10^5\n\n1 \\leq C \\leq 10^5\n\n1 \\leq p_i \\leq 10^9\n\n1 \\leq q_i \\leq 10^9\n\n1 \\leq r_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\nX Y A B C\np_1 p_2 ... p_A\nq_1 q_2 ... q_B\nr_1 r_2 ... r_C\n\nOutput\n\nPrint the maximum possible sum of the deliciousness of the eaten apples.\n\nSample Input 1\n\n1 2 2 2 1\n2 4\n5 1\n3\n\nSample Output 1\n\n12\n\nThe maximum possible sum of the deliciousness of the eaten apples can be achieved as follows:\n\nEat the 2-nd red apple.\n\nEat the 1-st green apple.\n\nPaint the 1-st colorless apple green and eat it.\n\nSample Input 2\n\n2 2 2 2 2\n8 6\n9 1\n2 1\n\nSample Output 2\n\n25\n\nSample Input 3\n\n2 2 4 4 4\n11 12 13 14\n21 22 23 24\n1 2 3 4\n\nSample Output 3\n\n74", "sample_input": "1 2 2 2 1\n2 4\n5 1\n3\n"}, "reference_outputs": ["12\n"], "source_document_id": "p02727", "source_text": "Score : 500 points\n\nProblem Statement\n\nYou are going to eat X red apples and Y green apples.\n\nYou have A red apples of deliciousness p_1,p_2, \\dots, p_A, B green apples of deliciousness q_1,q_2, \\dots, q_B, and C colorless apples of deliciousness r_1,r_2, \\dots, r_C.\n\nBefore eating a colorless apple, you can paint it red or green, and it will count as a red or green apple, respectively.\n\nFrom the apples above, you will choose the apples to eat while making the sum of the deliciousness of the eaten apples as large as possible.\n\nFind the maximum possible sum of the deliciousness of the eaten apples that can be achieved when optimally coloring zero or more colorless apples.\n\nConstraints\n\n1 \\leq X \\leq A \\leq 10^5\n\n1 \\leq Y \\leq B \\leq 10^5\n\n1 \\leq C \\leq 10^5\n\n1 \\leq p_i \\leq 10^9\n\n1 \\leq q_i \\leq 10^9\n\n1 \\leq r_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\nX Y A B C\np_1 p_2 ... p_A\nq_1 q_2 ... q_B\nr_1 r_2 ... r_C\n\nOutput\n\nPrint the maximum possible sum of the deliciousness of the eaten apples.\n\nSample Input 1\n\n1 2 2 2 1\n2 4\n5 1\n3\n\nSample Output 1\n\n12\n\nThe maximum possible sum of the deliciousness of the eaten apples can be achieved as follows:\n\nEat the 2-nd red apple.\n\nEat the 1-st green apple.\n\nPaint the 1-st colorless apple green and eat it.\n\nSample Input 2\n\n2 2 2 2 2\n8 6\n9 1\n2 1\n\nSample Output 2\n\n25\n\nSample Input 3\n\n2 2 4 4 4\n11 12 13 14\n21 22 23 24\n1 2 3 4\n\nSample Output 3\n\n74", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 618, "cpu_time_ms": 2108, "memory_kb": 6656}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s340282781", "group_id": "codeNet:p02727", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc sum(a []int) int {\n\tret := 0\n\tfor _, v := range a {\n\t\tret += v\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer wt.Flush()\n\n\tx, y, a, b, c := nextInt(), nextInt(), nextInt(), nextInt(), nextInt()\n\tp, q, r := nextInts(a), nextInts(b), nextInts(c)\n\tsort.Sort(sort.IntSlice(p))\n\tsort.Sort(sort.IntSlice(q))\n\tsort.Sort(sort.IntSlice(r))\n\n\tp = p[a-x:]\n\tq = q[b-y:]\n\n\tfor i, j, k := 0, 0, c-1; (i < x || j < y) && k >= 0; k-- {\n\t\tif i < x && j < y && p[i] < q[j] && p[i] < r[k] {\n\t\t\t// pの要素が最小\n\t\t\tp[i] = r[k]\n\t\t\ti++\n\t\t} else if i < x && j < y && p[i] > q[j] && q[j] < r[k] {\n\t\t\t// qの要素が最小\n\t\t\tq[j] = r[k]\n\t\t\tj++\n\t\t} else if i < x && p[i] < r[k] {\n\t\t\tp[i] = r[k]\n\t\t\ti++\n\t\t} else if j < y && q[j] < r[k] {\n\t\t\tq[j] = r[k]\n\t\t\tj++\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tans := sum(p) + sum(q)\n\n\tputs(ans)\n}\n\nconst (\n\tinitialBufSize = 100000\n\tmaxBufSize = 10000000\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twt = bufio.NewWriter(os.Stdout)\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(next())\n\treturn i\n}\n\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(next(), 64)\n\treturn f\n}\n\nfunc nextInts(n int) []int {\n\tslice := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tslice[i] = nextInt()\n\t}\n\treturn slice\n}\n\nfunc nextFloat64s(n int) []float64 {\n\tslice := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tslice[i] = nextFloat64()\n\t}\n\treturn slice\n}\n\nfunc putf(format string, a ...interface{}) {\n\tfmt.Fprintf(wt, format, a...)\n}\n\nfunc puts(a ...interface{}) {\n\tfmt.Fprintln(wt, a...)\n}\n", "language": "Go", "metadata": {"date": 1585453923, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02727.html", "problem_id": "p02727", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02727/input.txt", "sample_output_relpath": "derived/input_output/data/p02727/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02727/Go/s340282781.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s340282781", "user_id": "u502813058"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc sum(a []int) int {\n\tret := 0\n\tfor _, v := range a {\n\t\tret += v\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tdefer wt.Flush()\n\n\tx, y, a, b, c := nextInt(), nextInt(), nextInt(), nextInt(), nextInt()\n\tp, q, r := nextInts(a), nextInts(b), nextInts(c)\n\tsort.Sort(sort.IntSlice(p))\n\tsort.Sort(sort.IntSlice(q))\n\tsort.Sort(sort.IntSlice(r))\n\n\tp = p[a-x:]\n\tq = q[b-y:]\n\n\tfor i, j, k := 0, 0, c-1; (i < x || j < y) && k >= 0; k-- {\n\t\tif i < x && j < y && p[i] < q[j] && p[i] < r[k] {\n\t\t\t// pの要素が最小\n\t\t\tp[i] = r[k]\n\t\t\ti++\n\t\t} else if i < x && j < y && p[i] > q[j] && q[j] < r[k] {\n\t\t\t// qの要素が最小\n\t\t\tq[j] = r[k]\n\t\t\tj++\n\t\t} else if i < x && p[i] < r[k] {\n\t\t\tp[i] = r[k]\n\t\t\ti++\n\t\t} else if j < y && q[j] < r[k] {\n\t\t\tq[j] = r[k]\n\t\t\tj++\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tans := sum(p) + sum(q)\n\n\tputs(ans)\n}\n\nconst (\n\tinitialBufSize = 100000\n\tmaxBufSize = 10000000\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twt = bufio.NewWriter(os.Stdout)\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(next())\n\treturn i\n}\n\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(next(), 64)\n\treturn f\n}\n\nfunc nextInts(n int) []int {\n\tslice := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tslice[i] = nextInt()\n\t}\n\treturn slice\n}\n\nfunc nextFloat64s(n int) []float64 {\n\tslice := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tslice[i] = nextFloat64()\n\t}\n\treturn slice\n}\n\nfunc putf(format string, a ...interface{}) {\n\tfmt.Fprintf(wt, format, a...)\n}\n\nfunc puts(a ...interface{}) {\n\tfmt.Fprintln(wt, a...)\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nYou are going to eat X red apples and Y green apples.\n\nYou have A red apples of deliciousness p_1,p_2, \\dots, p_A, B green apples of deliciousness q_1,q_2, \\dots, q_B, and C colorless apples of deliciousness r_1,r_2, \\dots, r_C.\n\nBefore eating a colorless apple, you can paint it red or green, and it will count as a red or green apple, respectively.\n\nFrom the apples above, you will choose the apples to eat while making the sum of the deliciousness of the eaten apples as large as possible.\n\nFind the maximum possible sum of the deliciousness of the eaten apples that can be achieved when optimally coloring zero or more colorless apples.\n\nConstraints\n\n1 \\leq X \\leq A \\leq 10^5\n\n1 \\leq Y \\leq B \\leq 10^5\n\n1 \\leq C \\leq 10^5\n\n1 \\leq p_i \\leq 10^9\n\n1 \\leq q_i \\leq 10^9\n\n1 \\leq r_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\nX Y A B C\np_1 p_2 ... p_A\nq_1 q_2 ... q_B\nr_1 r_2 ... r_C\n\nOutput\n\nPrint the maximum possible sum of the deliciousness of the eaten apples.\n\nSample Input 1\n\n1 2 2 2 1\n2 4\n5 1\n3\n\nSample Output 1\n\n12\n\nThe maximum possible sum of the deliciousness of the eaten apples can be achieved as follows:\n\nEat the 2-nd red apple.\n\nEat the 1-st green apple.\n\nPaint the 1-st colorless apple green and eat it.\n\nSample Input 2\n\n2 2 2 2 2\n8 6\n9 1\n2 1\n\nSample Output 2\n\n25\n\nSample Input 3\n\n2 2 4 4 4\n11 12 13 14\n21 22 23 24\n1 2 3 4\n\nSample Output 3\n\n74", "sample_input": "1 2 2 2 1\n2 4\n5 1\n3\n"}, "reference_outputs": ["12\n"], "source_document_id": "p02727", "source_text": "Score : 500 points\n\nProblem Statement\n\nYou are going to eat X red apples and Y green apples.\n\nYou have A red apples of deliciousness p_1,p_2, \\dots, p_A, B green apples of deliciousness q_1,q_2, \\dots, q_B, and C colorless apples of deliciousness r_1,r_2, \\dots, r_C.\n\nBefore eating a colorless apple, you can paint it red or green, and it will count as a red or green apple, respectively.\n\nFrom the apples above, you will choose the apples to eat while making the sum of the deliciousness of the eaten apples as large as possible.\n\nFind the maximum possible sum of the deliciousness of the eaten apples that can be achieved when optimally coloring zero or more colorless apples.\n\nConstraints\n\n1 \\leq X \\leq A \\leq 10^5\n\n1 \\leq Y \\leq B \\leq 10^5\n\n1 \\leq C \\leq 10^5\n\n1 \\leq p_i \\leq 10^9\n\n1 \\leq q_i \\leq 10^9\n\n1 \\leq r_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\nX Y A B C\np_1 p_2 ... p_A\nq_1 q_2 ... q_B\nr_1 r_2 ... r_C\n\nOutput\n\nPrint the maximum possible sum of the deliciousness of the eaten apples.\n\nSample Input 1\n\n1 2 2 2 1\n2 4\n5 1\n3\n\nSample Output 1\n\n12\n\nThe maximum possible sum of the deliciousness of the eaten apples can be achieved as follows:\n\nEat the 2-nd red apple.\n\nEat the 1-st green apple.\n\nPaint the 1-st colorless apple green and eat it.\n\nSample Input 2\n\n2 2 2 2 2\n8 6\n9 1\n2 1\n\nSample Output 2\n\n25\n\nSample Input 3\n\n2 2 4 4 4\n11 12 13 14\n21 22 23 24\n1 2 3 4\n\nSample Output 3\n\n74", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1686, "cpu_time_ms": 152, "memory_kb": 6016}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s373056027", "group_id": "codeNet:p02727", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tX := readInt()\n\tY := readInt()\n\tA := readInt()\n\tB := readInt()\n\tC := readInt()\n\n\tp := make([]int, A+1)\n\tq := make([]int, B+1)\n\tr := make([]int, C+1)\n\n\tfor i := 0; i < A; i++ {\n\t\tp[i+1] = readInt()\n\t}\n\tfor i := 0; i < B; i++ {\n\t\tq[i+1] = readInt()\n\t}\n\tfor i := 0; i < C; i++ {\n\t\tr[i+1] = readInt()\n\t}\n\n\tsort.Sort(sort.Reverse(sort.IntSlice(p)))\n\tsort.Sort(sort.Reverse(sort.IntSlice(q)))\n\tsort.Sort(sort.Reverse(sort.IntSlice(r)))\n\n\tfor i := 0; i < A-1; i++ {\n\t\tp[i+1] += p[i]\n\t}\n\tfor i := 0; i < B-1; i++ {\n\t\tq[i+1] += q[i]\n\t}\n\tfor i := 0; i < C-1; i++ {\n\t\tr[i+1] += r[i]\n\t}\n\n\tresult := 0\n\tfor i := max(0, X-C); i <= X; i++ {\n\t\tj := 0\n\t\tok := max(0, Y-(C-(X-i)))\n\t\tif ok != Y {\n\t\t\tng := Y\n\t\t\tfor ng-ok != 1 {\n\t\t\t\tm := ok + (ng-ok)/2\n\t\t\t\tt0 := 0\n\t\t\t\tt1 := 0\n\t\t\t\tif m != 0 {\n\t\t\t\t\tt0 += q[m-1]\n\t\t\t\t}\n\t\t\t\tk := (X - i) + (Y - m)\n\t\t\t\tif k != 0 {\n\t\t\t\t\tt0 += r[k-1]\n\t\t\t\t}\n\t\t\t\tt1 += q[m]\n\t\t\t\tk = (X - i) + (Y - (m + 1))\n\t\t\t\tif k != 0 {\n\t\t\t\t\tt1 += r[k-1]\n\t\t\t\t}\n\t\t\t\tif t0 <= t1 {\n\t\t\t\t\tok = m\n\t\t\t\t} else {\n\t\t\t\t\tng = m\n\t\t\t\t}\n\t\t\t}\n\t\t\tj = ok + 1\n\t\t} else {\n\t\t\tj = Y\n\t\t}\n\n\t\tt := 0\n\t\tif i != 0 {\n\t\t\tt += p[i-1]\n\t\t}\n\t\tif j != 0 {\n\t\t\tt += q[j-1]\n\t\t}\n\t\tk := (X - i) + (Y - j)\n\t\tif k != 0 {\n\t\t\tt += r[k-1]\n\t\t}\n\t\tresult = max(result, t)\n\t}\n\n\tfmt.Println(result)\n}\n\nconst (\n\tioBufferSize = 1 * 1024 * 1024 // 1 MB\n)\n\nvar stdinScanner = func() *bufio.Scanner {\n\tresult := bufio.NewScanner(os.Stdin)\n\tresult.Buffer(make([]byte, ioBufferSize), ioBufferSize)\n\tresult.Split(bufio.ScanWords)\n\treturn result\n}()\n\nfunc readString() string {\n\tstdinScanner.Scan()\n\treturn stdinScanner.Text()\n}\n\nfunc readInt() int {\n\tresult, err := strconv.Atoi(readString())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn result\n}\n", "language": "Go", "metadata": {"date": 1585449175, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02727.html", "problem_id": "p02727", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02727/input.txt", "sample_output_relpath": "derived/input_output/data/p02727/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02727/Go/s373056027.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s373056027", "user_id": "u347640436"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tX := readInt()\n\tY := readInt()\n\tA := readInt()\n\tB := readInt()\n\tC := readInt()\n\n\tp := make([]int, A+1)\n\tq := make([]int, B+1)\n\tr := make([]int, C+1)\n\n\tfor i := 0; i < A; i++ {\n\t\tp[i+1] = readInt()\n\t}\n\tfor i := 0; i < B; i++ {\n\t\tq[i+1] = readInt()\n\t}\n\tfor i := 0; i < C; i++ {\n\t\tr[i+1] = readInt()\n\t}\n\n\tsort.Sort(sort.Reverse(sort.IntSlice(p)))\n\tsort.Sort(sort.Reverse(sort.IntSlice(q)))\n\tsort.Sort(sort.Reverse(sort.IntSlice(r)))\n\n\tfor i := 0; i < A-1; i++ {\n\t\tp[i+1] += p[i]\n\t}\n\tfor i := 0; i < B-1; i++ {\n\t\tq[i+1] += q[i]\n\t}\n\tfor i := 0; i < C-1; i++ {\n\t\tr[i+1] += r[i]\n\t}\n\n\tresult := 0\n\tfor i := max(0, X-C); i <= X; i++ {\n\t\tj := 0\n\t\tok := max(0, Y-(C-(X-i)))\n\t\tif ok != Y {\n\t\t\tng := Y\n\t\t\tfor ng-ok != 1 {\n\t\t\t\tm := ok + (ng-ok)/2\n\t\t\t\tt0 := 0\n\t\t\t\tt1 := 0\n\t\t\t\tif m != 0 {\n\t\t\t\t\tt0 += q[m-1]\n\t\t\t\t}\n\t\t\t\tk := (X - i) + (Y - m)\n\t\t\t\tif k != 0 {\n\t\t\t\t\tt0 += r[k-1]\n\t\t\t\t}\n\t\t\t\tt1 += q[m]\n\t\t\t\tk = (X - i) + (Y - (m + 1))\n\t\t\t\tif k != 0 {\n\t\t\t\t\tt1 += r[k-1]\n\t\t\t\t}\n\t\t\t\tif t0 <= t1 {\n\t\t\t\t\tok = m\n\t\t\t\t} else {\n\t\t\t\t\tng = m\n\t\t\t\t}\n\t\t\t}\n\t\t\tj = ok + 1\n\t\t} else {\n\t\t\tj = Y\n\t\t}\n\n\t\tt := 0\n\t\tif i != 0 {\n\t\t\tt += p[i-1]\n\t\t}\n\t\tif j != 0 {\n\t\t\tt += q[j-1]\n\t\t}\n\t\tk := (X - i) + (Y - j)\n\t\tif k != 0 {\n\t\t\tt += r[k-1]\n\t\t}\n\t\tresult = max(result, t)\n\t}\n\n\tfmt.Println(result)\n}\n\nconst (\n\tioBufferSize = 1 * 1024 * 1024 // 1 MB\n)\n\nvar stdinScanner = func() *bufio.Scanner {\n\tresult := bufio.NewScanner(os.Stdin)\n\tresult.Buffer(make([]byte, ioBufferSize), ioBufferSize)\n\tresult.Split(bufio.ScanWords)\n\treturn result\n}()\n\nfunc readString() string {\n\tstdinScanner.Scan()\n\treturn stdinScanner.Text()\n}\n\nfunc readInt() int {\n\tresult, err := strconv.Atoi(readString())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn result\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nYou are going to eat X red apples and Y green apples.\n\nYou have A red apples of deliciousness p_1,p_2, \\dots, p_A, B green apples of deliciousness q_1,q_2, \\dots, q_B, and C colorless apples of deliciousness r_1,r_2, \\dots, r_C.\n\nBefore eating a colorless apple, you can paint it red or green, and it will count as a red or green apple, respectively.\n\nFrom the apples above, you will choose the apples to eat while making the sum of the deliciousness of the eaten apples as large as possible.\n\nFind the maximum possible sum of the deliciousness of the eaten apples that can be achieved when optimally coloring zero or more colorless apples.\n\nConstraints\n\n1 \\leq X \\leq A \\leq 10^5\n\n1 \\leq Y \\leq B \\leq 10^5\n\n1 \\leq C \\leq 10^5\n\n1 \\leq p_i \\leq 10^9\n\n1 \\leq q_i \\leq 10^9\n\n1 \\leq r_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\nX Y A B C\np_1 p_2 ... p_A\nq_1 q_2 ... q_B\nr_1 r_2 ... r_C\n\nOutput\n\nPrint the maximum possible sum of the deliciousness of the eaten apples.\n\nSample Input 1\n\n1 2 2 2 1\n2 4\n5 1\n3\n\nSample Output 1\n\n12\n\nThe maximum possible sum of the deliciousness of the eaten apples can be achieved as follows:\n\nEat the 2-nd red apple.\n\nEat the 1-st green apple.\n\nPaint the 1-st colorless apple green and eat it.\n\nSample Input 2\n\n2 2 2 2 2\n8 6\n9 1\n2 1\n\nSample Output 2\n\n25\n\nSample Input 3\n\n2 2 4 4 4\n11 12 13 14\n21 22 23 24\n1 2 3 4\n\nSample Output 3\n\n74", "sample_input": "1 2 2 2 1\n2 4\n5 1\n3\n"}, "reference_outputs": ["12\n"], "source_document_id": "p02727", "source_text": "Score : 500 points\n\nProblem Statement\n\nYou are going to eat X red apples and Y green apples.\n\nYou have A red apples of deliciousness p_1,p_2, \\dots, p_A, B green apples of deliciousness q_1,q_2, \\dots, q_B, and C colorless apples of deliciousness r_1,r_2, \\dots, r_C.\n\nBefore eating a colorless apple, you can paint it red or green, and it will count as a red or green apple, respectively.\n\nFrom the apples above, you will choose the apples to eat while making the sum of the deliciousness of the eaten apples as large as possible.\n\nFind the maximum possible sum of the deliciousness of the eaten apples that can be achieved when optimally coloring zero or more colorless apples.\n\nConstraints\n\n1 \\leq X \\leq A \\leq 10^5\n\n1 \\leq Y \\leq B \\leq 10^5\n\n1 \\leq C \\leq 10^5\n\n1 \\leq p_i \\leq 10^9\n\n1 \\leq q_i \\leq 10^9\n\n1 \\leq r_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\nX Y A B C\np_1 p_2 ... p_A\nq_1 q_2 ... q_B\nr_1 r_2 ... r_C\n\nOutput\n\nPrint the maximum possible sum of the deliciousness of the eaten apples.\n\nSample Input 1\n\n1 2 2 2 1\n2 4\n5 1\n3\n\nSample Output 1\n\n12\n\nThe maximum possible sum of the deliciousness of the eaten apples can be achieved as follows:\n\nEat the 2-nd red apple.\n\nEat the 1-st green apple.\n\nPaint the 1-st colorless apple green and eat it.\n\nSample Input 2\n\n2 2 2 2 2\n8 6\n9 1\n2 1\n\nSample Output 2\n\n25\n\nSample Input 3\n\n2 2 4 4 4\n11 12 13 14\n21 22 23 24\n1 2 3 4\n\nSample Output 3\n\n74", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1822, "cpu_time_ms": 207, "memory_kb": 8064}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s516668774", "group_id": "codeNet:p02727", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar x, y, a, b, c int\n\tfmt.Scan(&x, &y, &a, &b, &c)\n\tapples := make([]apple, 0, a+b+c)\n\tfor a > 0 {\n\t\ta--\n\t\tvar d int64\n\t\tfmt.Scan(&d)\n\t\tapples = append(apples, apple{d, 1})\n\t}\n\tsort.Sort(byDel(apples))\n\tapples = apples[:x]\n\tfor b > 0 {\n\t\tb--\n\t\tvar d int64\n\t\tfmt.Scan(&d)\n\t\tapples = append(apples, apple{d, 2})\n\t}\n\tsort.Sort(byDel(apples[x:]))\n\tapples = apples[:x+y]\n\tfor c > 0 {\n\t\tc--\n\t\tvar d int64\n\t\tfmt.Scan(&d)\n\t\tapples = append(apples, apple{d, 0})\n\t}\n\tif c > x+y {\n\t\tsort.Sort(byDel(apples[x+y:]))\n\t\tapples = apples[:x+x+y+y]\n\t}\n\tsort.Sort(byDel(apples))\n\teaten := 0\n\tvar total int64\n\tfor _, a := range apples {\n\t\tswitch a.color {\n\t\tcase 0:\n\t\t\teaten++\n\t\t\ttotal += a.del\n\t\tcase 1:\n\t\t\tif x > 0 {\n\t\t\t\tx--\n\t\t\t\ttotal += a.del\n\t\t\t}\n\t\tcase 2:\n\t\t\tif y > 0 {\n\t\t\t\ty--\n\t\t\t\ttotal += a.del\n\t\t\t}\n\t\t}\n\t\tif eaten == x+y {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Printf(\"%d\\n\", total)\n}\n\ntype apple struct {\n\tdel int64\n\tcolor int\n}\n\ntype byDel []apple\n\nfunc (a byDel) Len() int { return len(a) }\nfunc (a byDel) Less(i, j int) bool { return a[i].del > a[j].del }\nfunc (a byDel) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\n", "language": "Go", "metadata": {"date": 1585448494, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02727.html", "problem_id": "p02727", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02727/input.txt", "sample_output_relpath": "derived/input_output/data/p02727/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02727/Go/s516668774.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s516668774", "user_id": "u226445453"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar x, y, a, b, c int\n\tfmt.Scan(&x, &y, &a, &b, &c)\n\tapples := make([]apple, 0, a+b+c)\n\tfor a > 0 {\n\t\ta--\n\t\tvar d int64\n\t\tfmt.Scan(&d)\n\t\tapples = append(apples, apple{d, 1})\n\t}\n\tsort.Sort(byDel(apples))\n\tapples = apples[:x]\n\tfor b > 0 {\n\t\tb--\n\t\tvar d int64\n\t\tfmt.Scan(&d)\n\t\tapples = append(apples, apple{d, 2})\n\t}\n\tsort.Sort(byDel(apples[x:]))\n\tapples = apples[:x+y]\n\tfor c > 0 {\n\t\tc--\n\t\tvar d int64\n\t\tfmt.Scan(&d)\n\t\tapples = append(apples, apple{d, 0})\n\t}\n\tif c > x+y {\n\t\tsort.Sort(byDel(apples[x+y:]))\n\t\tapples = apples[:x+x+y+y]\n\t}\n\tsort.Sort(byDel(apples))\n\teaten := 0\n\tvar total int64\n\tfor _, a := range apples {\n\t\tswitch a.color {\n\t\tcase 0:\n\t\t\teaten++\n\t\t\ttotal += a.del\n\t\tcase 1:\n\t\t\tif x > 0 {\n\t\t\t\tx--\n\t\t\t\ttotal += a.del\n\t\t\t}\n\t\tcase 2:\n\t\t\tif y > 0 {\n\t\t\t\ty--\n\t\t\t\ttotal += a.del\n\t\t\t}\n\t\t}\n\t\tif eaten == x+y {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Printf(\"%d\\n\", total)\n}\n\ntype apple struct {\n\tdel int64\n\tcolor int\n}\n\ntype byDel []apple\n\nfunc (a byDel) Len() int { return len(a) }\nfunc (a byDel) Less(i, j int) bool { return a[i].del > a[j].del }\nfunc (a byDel) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nYou are going to eat X red apples and Y green apples.\n\nYou have A red apples of deliciousness p_1,p_2, \\dots, p_A, B green apples of deliciousness q_1,q_2, \\dots, q_B, and C colorless apples of deliciousness r_1,r_2, \\dots, r_C.\n\nBefore eating a colorless apple, you can paint it red or green, and it will count as a red or green apple, respectively.\n\nFrom the apples above, you will choose the apples to eat while making the sum of the deliciousness of the eaten apples as large as possible.\n\nFind the maximum possible sum of the deliciousness of the eaten apples that can be achieved when optimally coloring zero or more colorless apples.\n\nConstraints\n\n1 \\leq X \\leq A \\leq 10^5\n\n1 \\leq Y \\leq B \\leq 10^5\n\n1 \\leq C \\leq 10^5\n\n1 \\leq p_i \\leq 10^9\n\n1 \\leq q_i \\leq 10^9\n\n1 \\leq r_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\nX Y A B C\np_1 p_2 ... p_A\nq_1 q_2 ... q_B\nr_1 r_2 ... r_C\n\nOutput\n\nPrint the maximum possible sum of the deliciousness of the eaten apples.\n\nSample Input 1\n\n1 2 2 2 1\n2 4\n5 1\n3\n\nSample Output 1\n\n12\n\nThe maximum possible sum of the deliciousness of the eaten apples can be achieved as follows:\n\nEat the 2-nd red apple.\n\nEat the 1-st green apple.\n\nPaint the 1-st colorless apple green and eat it.\n\nSample Input 2\n\n2 2 2 2 2\n8 6\n9 1\n2 1\n\nSample Output 2\n\n25\n\nSample Input 3\n\n2 2 4 4 4\n11 12 13 14\n21 22 23 24\n1 2 3 4\n\nSample Output 3\n\n74", "sample_input": "1 2 2 2 1\n2 4\n5 1\n3\n"}, "reference_outputs": ["12\n"], "source_document_id": "p02727", "source_text": "Score : 500 points\n\nProblem Statement\n\nYou are going to eat X red apples and Y green apples.\n\nYou have A red apples of deliciousness p_1,p_2, \\dots, p_A, B green apples of deliciousness q_1,q_2, \\dots, q_B, and C colorless apples of deliciousness r_1,r_2, \\dots, r_C.\n\nBefore eating a colorless apple, you can paint it red or green, and it will count as a red or green apple, respectively.\n\nFrom the apples above, you will choose the apples to eat while making the sum of the deliciousness of the eaten apples as large as possible.\n\nFind the maximum possible sum of the deliciousness of the eaten apples that can be achieved when optimally coloring zero or more colorless apples.\n\nConstraints\n\n1 \\leq X \\leq A \\leq 10^5\n\n1 \\leq Y \\leq B \\leq 10^5\n\n1 \\leq C \\leq 10^5\n\n1 \\leq p_i \\leq 10^9\n\n1 \\leq q_i \\leq 10^9\n\n1 \\leq r_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\nX Y A B C\np_1 p_2 ... p_A\nq_1 q_2 ... q_B\nr_1 r_2 ... r_C\n\nOutput\n\nPrint the maximum possible sum of the deliciousness of the eaten apples.\n\nSample Input 1\n\n1 2 2 2 1\n2 4\n5 1\n3\n\nSample Output 1\n\n12\n\nThe maximum possible sum of the deliciousness of the eaten apples can be achieved as follows:\n\nEat the 2-nd red apple.\n\nEat the 1-st green apple.\n\nPaint the 1-st colorless apple green and eat it.\n\nSample Input 2\n\n2 2 2 2 2\n8 6\n9 1\n2 1\n\nSample Output 2\n\n25\n\nSample Input 3\n\n2 2 4 4 4\n11 12 13 14\n21 22 23 24\n1 2 3 4\n\nSample Output 3\n\n74", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1163, "cpu_time_ms": 2108, "memory_kb": 10408}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s138515166", "group_id": "codeNet:p02727", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar x, y, a, b, c, ans int\n\tfmt.Scan(&x)\n\tfmt.Scan(&y)\n\tfmt.Scan(&a)\n\tfmt.Scan(&b)\n\tfmt.Scan(&c)\n\tp := make([]int, a)\n\tq := make([]int, b)\n\tr := make([]int, c)\n\tfor i := 0; i < a; i++ {\n\t\tfmt.Scan(&p[i])\n\t}\n\tfor i := 0; i < b; i++ {\n\t\tfmt.Scan(&q[i])\n\t}\n\tfor i := 0; i < c; i++ {\n\t\tfmt.Scan(&r[i])\n\t}\n\n\tsort.Ints(p)\n\tsort.Ints(q)\n\tsort.Ints(r)\n\n\tfor i := 0; i < x; i++ {\n\t\tif p[len(p)-1] > r[len(r)-1] {\n\t\t\tans += p[len(p)-1]\n\t\t\tp = p[:len(p)-1]\n\t\t} else {\n\t\t\tans += r[len(r)-1]\n\t\t\tr = r[:len(r)-1]\n\t\t}\n\t}\n\tfor i := 0; i < y; i++ {\n\t\tif q[len(q)-1] > r[len(r)-1] {\n\t\t\tans += q[len(q)-1]\n\t\t\tq = q[:len(q)-1]\n\t\t} else {\n\t\t\tans += r[len(r)-1]\n\t\t\tr = r[:len(r)-1]\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1585448370, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02727.html", "problem_id": "p02727", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02727/input.txt", "sample_output_relpath": "derived/input_output/data/p02727/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02727/Go/s138515166.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s138515166", "user_id": "u917346607"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar x, y, a, b, c, ans int\n\tfmt.Scan(&x)\n\tfmt.Scan(&y)\n\tfmt.Scan(&a)\n\tfmt.Scan(&b)\n\tfmt.Scan(&c)\n\tp := make([]int, a)\n\tq := make([]int, b)\n\tr := make([]int, c)\n\tfor i := 0; i < a; i++ {\n\t\tfmt.Scan(&p[i])\n\t}\n\tfor i := 0; i < b; i++ {\n\t\tfmt.Scan(&q[i])\n\t}\n\tfor i := 0; i < c; i++ {\n\t\tfmt.Scan(&r[i])\n\t}\n\n\tsort.Ints(p)\n\tsort.Ints(q)\n\tsort.Ints(r)\n\n\tfor i := 0; i < x; i++ {\n\t\tif p[len(p)-1] > r[len(r)-1] {\n\t\t\tans += p[len(p)-1]\n\t\t\tp = p[:len(p)-1]\n\t\t} else {\n\t\t\tans += r[len(r)-1]\n\t\t\tr = r[:len(r)-1]\n\t\t}\n\t}\n\tfor i := 0; i < y; i++ {\n\t\tif q[len(q)-1] > r[len(r)-1] {\n\t\t\tans += q[len(q)-1]\n\t\t\tq = q[:len(q)-1]\n\t\t} else {\n\t\t\tans += r[len(r)-1]\n\t\t\tr = r[:len(r)-1]\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nYou are going to eat X red apples and Y green apples.\n\nYou have A red apples of deliciousness p_1,p_2, \\dots, p_A, B green apples of deliciousness q_1,q_2, \\dots, q_B, and C colorless apples of deliciousness r_1,r_2, \\dots, r_C.\n\nBefore eating a colorless apple, you can paint it red or green, and it will count as a red or green apple, respectively.\n\nFrom the apples above, you will choose the apples to eat while making the sum of the deliciousness of the eaten apples as large as possible.\n\nFind the maximum possible sum of the deliciousness of the eaten apples that can be achieved when optimally coloring zero or more colorless apples.\n\nConstraints\n\n1 \\leq X \\leq A \\leq 10^5\n\n1 \\leq Y \\leq B \\leq 10^5\n\n1 \\leq C \\leq 10^5\n\n1 \\leq p_i \\leq 10^9\n\n1 \\leq q_i \\leq 10^9\n\n1 \\leq r_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\nX Y A B C\np_1 p_2 ... p_A\nq_1 q_2 ... q_B\nr_1 r_2 ... r_C\n\nOutput\n\nPrint the maximum possible sum of the deliciousness of the eaten apples.\n\nSample Input 1\n\n1 2 2 2 1\n2 4\n5 1\n3\n\nSample Output 1\n\n12\n\nThe maximum possible sum of the deliciousness of the eaten apples can be achieved as follows:\n\nEat the 2-nd red apple.\n\nEat the 1-st green apple.\n\nPaint the 1-st colorless apple green and eat it.\n\nSample Input 2\n\n2 2 2 2 2\n8 6\n9 1\n2 1\n\nSample Output 2\n\n25\n\nSample Input 3\n\n2 2 4 4 4\n11 12 13 14\n21 22 23 24\n1 2 3 4\n\nSample Output 3\n\n74", "sample_input": "1 2 2 2 1\n2 4\n5 1\n3\n"}, "reference_outputs": ["12\n"], "source_document_id": "p02727", "source_text": "Score : 500 points\n\nProblem Statement\n\nYou are going to eat X red apples and Y green apples.\n\nYou have A red apples of deliciousness p_1,p_2, \\dots, p_A, B green apples of deliciousness q_1,q_2, \\dots, q_B, and C colorless apples of deliciousness r_1,r_2, \\dots, r_C.\n\nBefore eating a colorless apple, you can paint it red or green, and it will count as a red or green apple, respectively.\n\nFrom the apples above, you will choose the apples to eat while making the sum of the deliciousness of the eaten apples as large as possible.\n\nFind the maximum possible sum of the deliciousness of the eaten apples that can be achieved when optimally coloring zero or more colorless apples.\n\nConstraints\n\n1 \\leq X \\leq A \\leq 10^5\n\n1 \\leq Y \\leq B \\leq 10^5\n\n1 \\leq C \\leq 10^5\n\n1 \\leq p_i \\leq 10^9\n\n1 \\leq q_i \\leq 10^9\n\n1 \\leq r_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\nX Y A B C\np_1 p_2 ... p_A\nq_1 q_2 ... q_B\nr_1 r_2 ... r_C\n\nOutput\n\nPrint the maximum possible sum of the deliciousness of the eaten apples.\n\nSample Input 1\n\n1 2 2 2 1\n2 4\n5 1\n3\n\nSample Output 1\n\n12\n\nThe maximum possible sum of the deliciousness of the eaten apples can be achieved as follows:\n\nEat the 2-nd red apple.\n\nEat the 1-st green apple.\n\nPaint the 1-st colorless apple green and eat it.\n\nSample Input 2\n\n2 2 2 2 2\n8 6\n9 1\n2 1\n\nSample Output 2\n\n25\n\nSample Input 3\n\n2 2 4 4 4\n11 12 13 14\n21 22 23 24\n1 2 3 4\n\nSample Output 3\n\n74", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 743, "cpu_time_ms": 2085, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s912036085", "group_id": "codeNet:p02727", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t_ \"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\n// I/O\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextFloat() float64 {\n\tf, e := strconv.ParseFloat(s.nextStr(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc (s *Scanner) nextFloatSlice(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextFloat()\n\t}\n\treturn res\n}\n\n// Arithmetic\nfunc max(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m < i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m > i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc pow(x, y int) int {\n\tres := 1\n\tfor i := 0; i < y; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\nfunc ceil(a, b int) int {\n\tif a%b == 0 {\n\t\treturn a / b\n\t} else {\n\t\treturn a/b + 1\n\t}\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\treturn a / gcd(a, b) * b\n}\n\n// Sort\ntype RuneSlice []rune\n\nfunc (a RuneSlice) Len() int { return len(a) }\nfunc (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }\nfunc (a RuneSlice) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\n\n// Main\nconst MOD = int(1e+9) + 7\nconst INF = 1 << 60\n\nfunc main() {\n\tsc := NewScanner()\n\twtr := bufio.NewWriter(os.Stdout)\n\tdefer wtr.Flush()\n\tX, Y, A, B, C := sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt()\n\tP := sc.nextIntSlice(A)\n\tQ := sc.nextIntSlice(B)\n\tR := sc.nextIntSlice(C)\n\tsort.Sort(sort.Reverse(sort.IntSlice(P)))\n\tsort.Sort(sort.Reverse(sort.IntSlice(Q)))\n\tsort.Sort(sort.Reverse(sort.IntSlice(R)))\n\tarr := []int{}\n\tfor i := 0; i < X; i++ {\n\t\tarr = append(arr, P[i])\n\t}\n\t//fmt.Fprintln(wtr, \"after P\", arr)\n\tfor i := 0; i < Y; i++ {\n\t\tarr = append(arr, Q[i])\n\t}\n\tsort.Ints(arr)\n\t//fmt.Fprintln(wtr, arr)\n\tidx := 0\n\tfor i := 0; i < len(arr); i++ {\n\t\tif arr[i] < R[idx] {\n\t\t\tarr[i] = R[idx]\n\t\t\tidx++\n\t\t\tif idx == C {\n\t\t\t\tbreak\n\t\t\t}\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\tans := 0\n\tfor i := 0; i < len(arr); i++ {\n\t\tans += arr[i]\n\t}\n\n\tfmt.Fprintln(wtr, ans)\n}\n", "language": "Go", "metadata": {"date": 1585448091, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02727.html", "problem_id": "p02727", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02727/input.txt", "sample_output_relpath": "derived/input_output/data/p02727/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02727/Go/s912036085.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s912036085", "user_id": "u924691798"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t_ \"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\n// I/O\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextFloat() float64 {\n\tf, e := strconv.ParseFloat(s.nextStr(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc (s *Scanner) nextFloatSlice(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextFloat()\n\t}\n\treturn res\n}\n\n// Arithmetic\nfunc max(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m < i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m > i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc pow(x, y int) int {\n\tres := 1\n\tfor i := 0; i < y; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\nfunc ceil(a, b int) int {\n\tif a%b == 0 {\n\t\treturn a / b\n\t} else {\n\t\treturn a/b + 1\n\t}\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\treturn a / gcd(a, b) * b\n}\n\n// Sort\ntype RuneSlice []rune\n\nfunc (a RuneSlice) Len() int { return len(a) }\nfunc (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }\nfunc (a RuneSlice) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\n\n// Main\nconst MOD = int(1e+9) + 7\nconst INF = 1 << 60\n\nfunc main() {\n\tsc := NewScanner()\n\twtr := bufio.NewWriter(os.Stdout)\n\tdefer wtr.Flush()\n\tX, Y, A, B, C := sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt(), sc.nextInt()\n\tP := sc.nextIntSlice(A)\n\tQ := sc.nextIntSlice(B)\n\tR := sc.nextIntSlice(C)\n\tsort.Sort(sort.Reverse(sort.IntSlice(P)))\n\tsort.Sort(sort.Reverse(sort.IntSlice(Q)))\n\tsort.Sort(sort.Reverse(sort.IntSlice(R)))\n\tarr := []int{}\n\tfor i := 0; i < X; i++ {\n\t\tarr = append(arr, P[i])\n\t}\n\t//fmt.Fprintln(wtr, \"after P\", arr)\n\tfor i := 0; i < Y; i++ {\n\t\tarr = append(arr, Q[i])\n\t}\n\tsort.Ints(arr)\n\t//fmt.Fprintln(wtr, arr)\n\tidx := 0\n\tfor i := 0; i < len(arr); i++ {\n\t\tif arr[i] < R[idx] {\n\t\t\tarr[i] = R[idx]\n\t\t\tidx++\n\t\t\tif idx == C {\n\t\t\t\tbreak\n\t\t\t}\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\tans := 0\n\tfor i := 0; i < len(arr); i++ {\n\t\tans += arr[i]\n\t}\n\n\tfmt.Fprintln(wtr, ans)\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nYou are going to eat X red apples and Y green apples.\n\nYou have A red apples of deliciousness p_1,p_2, \\dots, p_A, B green apples of deliciousness q_1,q_2, \\dots, q_B, and C colorless apples of deliciousness r_1,r_2, \\dots, r_C.\n\nBefore eating a colorless apple, you can paint it red or green, and it will count as a red or green apple, respectively.\n\nFrom the apples above, you will choose the apples to eat while making the sum of the deliciousness of the eaten apples as large as possible.\n\nFind the maximum possible sum of the deliciousness of the eaten apples that can be achieved when optimally coloring zero or more colorless apples.\n\nConstraints\n\n1 \\leq X \\leq A \\leq 10^5\n\n1 \\leq Y \\leq B \\leq 10^5\n\n1 \\leq C \\leq 10^5\n\n1 \\leq p_i \\leq 10^9\n\n1 \\leq q_i \\leq 10^9\n\n1 \\leq r_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\nX Y A B C\np_1 p_2 ... p_A\nq_1 q_2 ... q_B\nr_1 r_2 ... r_C\n\nOutput\n\nPrint the maximum possible sum of the deliciousness of the eaten apples.\n\nSample Input 1\n\n1 2 2 2 1\n2 4\n5 1\n3\n\nSample Output 1\n\n12\n\nThe maximum possible sum of the deliciousness of the eaten apples can be achieved as follows:\n\nEat the 2-nd red apple.\n\nEat the 1-st green apple.\n\nPaint the 1-st colorless apple green and eat it.\n\nSample Input 2\n\n2 2 2 2 2\n8 6\n9 1\n2 1\n\nSample Output 2\n\n25\n\nSample Input 3\n\n2 2 4 4 4\n11 12 13 14\n21 22 23 24\n1 2 3 4\n\nSample Output 3\n\n74", "sample_input": "1 2 2 2 1\n2 4\n5 1\n3\n"}, "reference_outputs": ["12\n"], "source_document_id": "p02727", "source_text": "Score : 500 points\n\nProblem Statement\n\nYou are going to eat X red apples and Y green apples.\n\nYou have A red apples of deliciousness p_1,p_2, \\dots, p_A, B green apples of deliciousness q_1,q_2, \\dots, q_B, and C colorless apples of deliciousness r_1,r_2, \\dots, r_C.\n\nBefore eating a colorless apple, you can paint it red or green, and it will count as a red or green apple, respectively.\n\nFrom the apples above, you will choose the apples to eat while making the sum of the deliciousness of the eaten apples as large as possible.\n\nFind the maximum possible sum of the deliciousness of the eaten apples that can be achieved when optimally coloring zero or more colorless apples.\n\nConstraints\n\n1 \\leq X \\leq A \\leq 10^5\n\n1 \\leq Y \\leq B \\leq 10^5\n\n1 \\leq C \\leq 10^5\n\n1 \\leq p_i \\leq 10^9\n\n1 \\leq q_i \\leq 10^9\n\n1 \\leq r_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\nX Y A B C\np_1 p_2 ... p_A\nq_1 q_2 ... q_B\nr_1 r_2 ... r_C\n\nOutput\n\nPrint the maximum possible sum of the deliciousness of the eaten apples.\n\nSample Input 1\n\n1 2 2 2 1\n2 4\n5 1\n3\n\nSample Output 1\n\n12\n\nThe maximum possible sum of the deliciousness of the eaten apples can be achieved as follows:\n\nEat the 2-nd red apple.\n\nEat the 1-st green apple.\n\nPaint the 1-st colorless apple green and eat it.\n\nSample Input 2\n\n2 2 2 2 2\n8 6\n9 1\n2 1\n\nSample Output 2\n\n25\n\nSample Input 3\n\n2 2 4 4 4\n11 12 13 14\n21 22 23 24\n1 2 3 4\n\nSample Output 3\n\n74", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2666, "cpu_time_ms": 225, "memory_kb": 9472}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s388851703", "group_id": "codeNet:p02743", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar A, B, C float64\n\tfmt.Scan(&A, &B, &C)\n\tif C-A-B > 0 && 4*A*B < math.Pow(C-A-B, 2) {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1590818005, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02743.html", "problem_id": "p02743", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02743/input.txt", "sample_output_relpath": "derived/input_output/data/p02743/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02743/Go/s388851703.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s388851703", "user_id": "u445624660"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar A, B, C float64\n\tfmt.Scan(&A, &B, &C)\n\tif C-A-B > 0 && 4*A*B < math.Pow(C-A-B, 2) {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "sample_input": "2 3 9\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02743", "source_text": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s867006510", "group_id": "codeNet:p02743", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\n/* sort */\ntype pair struct {\n\tindex int64\n\tp1, p2 interface{}\n}\ntype pairs []pair\n\nfunc (slice pairs) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice pairs) Less(i, j int) bool {\n\treturn slice[i].index < slice[j].index\n}\n\nfunc (slice pairs) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\n\n/* sort */\ntype Int64Slice []int64\n\nfunc (slice Int64Slice) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice Int64Slice) Less(i, j int) bool {\n\treturn slice[i] < slice[j]\n}\n\nfunc (slice Int64Slice) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\nfunc Int64s(a []int64) { sort.Sort(Int64Slice(a)) }\nfunc Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n\tINF = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tdi = []int64{-1, 0, 1, 0}\n\tdj = []int64{0, -1, 0, 1}\n\tdi8 = []int64{-1, -1, 0, 1, 1, 1, 0, -1}\n\tdj8 = []int64{0, -1, -1, -1, 0, 1, 1, 1}\n)\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tscanner.Buffer(buf, maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\ta, b, c := readInt(), readInt(), readInt()\n\td := c - a - b\n\tif d > 0 && d*d > 4*a*b {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\n/*==========================================\n * Library\n *==========================================*/\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\nfunc doubleAry(h int64, w int64, init int64) (res [][]int64) {\n\tres = make([][]int64, h)\n\tfor i := int64(0); i < h; i++ {\n\t\tres[i] = make([]int64, w)\n\t\tfor j := int64(0); j < w; j++ {\n\t\t\tres[i][j] = init\n\t\t}\n\t}\n\treturn\n}\n\nfunc aryEq(a []int64, b []int64) bool {\n\treturn reflect.DeepEqual(a, b)\n}\n\nfunc clone(n []int64) (r []int64) {\n\tr = make([]int64, len(n))\n\tfor i := 0; i < len(n); i++ {\n\t\tr[i] = n[i]\n\t}\n\treturn\n}\nfunc write(s string) {\n\twriter.WriteString(s)\n}\n\nfunc print() {\n\twriter.Flush()\n}\n\n// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可\nfunc readLine() (s string) {\n\tif scanner.Scan() {\n\t\ts = scanner.Text()\n\t}\n\treturn s\n}\n\nfunc readInt() (read int64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseInt(scanner.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readFloat() (read float64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readRunes() (read []rune) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, v)\n\t}\n\treturn\n}\n\nfunc readString() (read string) {\n\tscanner.Scan()\n\tread = scanner.Text()\n\treturn\n}\n\nfunc readStrings() (read []string) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, string(v))\n\t}\n\treturn\n}\n\nfunc s2i(s string) int64 {\n\tvar intVal, e = strconv.ParseInt(s, 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int64) string {\n\tvar strVal = strconv.FormatInt(i, 10)\n\treturn strVal\n}\n\nfunc s2f(s string) float64 {\n\tvar floatVal, e = strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn floatVal\n}\n\nfunc abs(i int64) int64 {\n\treturn int64(math.Abs(float64(i)))\n}\n\nfunc max(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans < v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\nfunc min(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans > v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc sum(i []int64) int64 {\n\tsum := int64(0)\n\tfor _, val := range i {\n\t\tsum += val\n\t}\n\treturn sum\n}\n\nfunc split(s string) []string {\n\treturn strings.Fields(s)\n}\n\nfunc strAry2intAry(strs []string) []int64 {\n\tvar ret = make([]int64, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal = s2i(str)\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int64) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = i2s(num)\n\t\tret = append(ret, strVal)\n\t}\n\treturn ret\n}\n\nfunc ary2str(strs []string) string {\n\treturn strings.Join(strs, \" \")\n}\n\nfunc reverse(res []int64) []int64 {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\nfunc reverseStr(res []string) []string {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\n\nfunc ini(res []int, init int) {\n\tif len(res) == 0 {\n\t\treturn\n\t}\n\tres[0] = init\n\tfor i := 0; i < len(res); i++ {\n\t\tcopy(res[i:], res[:i])\n\t}\n}\n\n//\n// func regexpExample() {\n// // Your code here!\n// var str = \"13:20\"\n// r := regexp.MustCompile(`(\\d+):(\\d+)`)\n// fmt.Println(r.FindStringSubmatch(str))\n// }\n\n// type Country struct {\n// gold int\n// silver int\n// blonze int\n// }\n\n// // 複数ソートのサンプル\n// func stableSortExample() []Country{\n// var country = []Country {\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:3, blonze:2},\n// {gold:1, silver:3, blonze:3},\n// }\n// sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })\n// return country\n// }\n", "language": "Go", "metadata": {"date": 1588840266, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02743.html", "problem_id": "p02743", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02743/input.txt", "sample_output_relpath": "derived/input_output/data/p02743/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02743/Go/s867006510.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s867006510", "user_id": "u967669872"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\n/* sort */\ntype pair struct {\n\tindex int64\n\tp1, p2 interface{}\n}\ntype pairs []pair\n\nfunc (slice pairs) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice pairs) Less(i, j int) bool {\n\treturn slice[i].index < slice[j].index\n}\n\nfunc (slice pairs) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\n\n/* sort */\ntype Int64Slice []int64\n\nfunc (slice Int64Slice) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice Int64Slice) Less(i, j int) bool {\n\treturn slice[i] < slice[j]\n}\n\nfunc (slice Int64Slice) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\nfunc Int64s(a []int64) { sort.Sort(Int64Slice(a)) }\nfunc Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n\tINF = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tdi = []int64{-1, 0, 1, 0}\n\tdj = []int64{0, -1, 0, 1}\n\tdi8 = []int64{-1, -1, 0, 1, 1, 1, 0, -1}\n\tdj8 = []int64{0, -1, -1, -1, 0, 1, 1, 1}\n)\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tscanner.Buffer(buf, maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\ta, b, c := readInt(), readInt(), readInt()\n\td := c - a - b\n\tif d > 0 && d*d > 4*a*b {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\n/*==========================================\n * Library\n *==========================================*/\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\nfunc doubleAry(h int64, w int64, init int64) (res [][]int64) {\n\tres = make([][]int64, h)\n\tfor i := int64(0); i < h; i++ {\n\t\tres[i] = make([]int64, w)\n\t\tfor j := int64(0); j < w; j++ {\n\t\t\tres[i][j] = init\n\t\t}\n\t}\n\treturn\n}\n\nfunc aryEq(a []int64, b []int64) bool {\n\treturn reflect.DeepEqual(a, b)\n}\n\nfunc clone(n []int64) (r []int64) {\n\tr = make([]int64, len(n))\n\tfor i := 0; i < len(n); i++ {\n\t\tr[i] = n[i]\n\t}\n\treturn\n}\nfunc write(s string) {\n\twriter.WriteString(s)\n}\n\nfunc print() {\n\twriter.Flush()\n}\n\n// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可\nfunc readLine() (s string) {\n\tif scanner.Scan() {\n\t\ts = scanner.Text()\n\t}\n\treturn s\n}\n\nfunc readInt() (read int64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseInt(scanner.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readFloat() (read float64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readRunes() (read []rune) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, v)\n\t}\n\treturn\n}\n\nfunc readString() (read string) {\n\tscanner.Scan()\n\tread = scanner.Text()\n\treturn\n}\n\nfunc readStrings() (read []string) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, string(v))\n\t}\n\treturn\n}\n\nfunc s2i(s string) int64 {\n\tvar intVal, e = strconv.ParseInt(s, 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int64) string {\n\tvar strVal = strconv.FormatInt(i, 10)\n\treturn strVal\n}\n\nfunc s2f(s string) float64 {\n\tvar floatVal, e = strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn floatVal\n}\n\nfunc abs(i int64) int64 {\n\treturn int64(math.Abs(float64(i)))\n}\n\nfunc max(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans < v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\nfunc min(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans > v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc sum(i []int64) int64 {\n\tsum := int64(0)\n\tfor _, val := range i {\n\t\tsum += val\n\t}\n\treturn sum\n}\n\nfunc split(s string) []string {\n\treturn strings.Fields(s)\n}\n\nfunc strAry2intAry(strs []string) []int64 {\n\tvar ret = make([]int64, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal = s2i(str)\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int64) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = i2s(num)\n\t\tret = append(ret, strVal)\n\t}\n\treturn ret\n}\n\nfunc ary2str(strs []string) string {\n\treturn strings.Join(strs, \" \")\n}\n\nfunc reverse(res []int64) []int64 {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\nfunc reverseStr(res []string) []string {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\n\nfunc ini(res []int, init int) {\n\tif len(res) == 0 {\n\t\treturn\n\t}\n\tres[0] = init\n\tfor i := 0; i < len(res); i++ {\n\t\tcopy(res[i:], res[:i])\n\t}\n}\n\n//\n// func regexpExample() {\n// // Your code here!\n// var str = \"13:20\"\n// r := regexp.MustCompile(`(\\d+):(\\d+)`)\n// fmt.Println(r.FindStringSubmatch(str))\n// }\n\n// type Country struct {\n// gold int\n// silver int\n// blonze int\n// }\n\n// // 複数ソートのサンプル\n// func stableSortExample() []Country{\n// var country = []Country {\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:3, blonze:2},\n// {gold:1, silver:3, blonze:3},\n// }\n// sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })\n// return country\n// }\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "sample_input": "2 3 9\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02743", "source_text": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5704, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s972496953", "group_id": "codeNet:p02743", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scan(&a)\n\tfmt.Scan(&b)\n\tfmt.Scan(&c)\n\n\t// if (c-a-b)*(c-a-b) > 4*a*b {\n\tif (c - a - b) > 2*int(math.Sqrt(float64(a*b))) {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1584281285, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02743.html", "problem_id": "p02743", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02743/input.txt", "sample_output_relpath": "derived/input_output/data/p02743/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02743/Go/s972496953.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s972496953", "user_id": "u044916426"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scan(&a)\n\tfmt.Scan(&b)\n\tfmt.Scan(&c)\n\n\t// if (c-a-b)*(c-a-b) > 4*a*b {\n\tif (c - a - b) > 2*int(math.Sqrt(float64(a*b))) {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "sample_input": "2 3 9\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02743", "source_text": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s688422178", "group_id": "codeNet:p02743", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar (\n\t\ta float64\n\t\tb float64\n\t\tc float64\n\t)\n\tfmt.Scan(&a, &b, &c)\n\n\tif c+2*math.Sqrt(a*b) > a+b {\n\t\tfmt.Print(\"Yes\")\n\t} else {\n\t\tfmt.Print(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1584248194, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02743.html", "problem_id": "p02743", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02743/input.txt", "sample_output_relpath": "derived/input_output/data/p02743/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02743/Go/s688422178.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s688422178", "user_id": "u323338590"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar (\n\t\ta float64\n\t\tb float64\n\t\tc float64\n\t)\n\tfmt.Scan(&a, &b, &c)\n\n\tif c+2*math.Sqrt(a*b) > a+b {\n\t\tfmt.Print(\"Yes\")\n\t} else {\n\t\tfmt.Print(\"No\")\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "sample_input": "2 3 9\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02743", "source_text": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s909236385", "group_id": "codeNet:p02743", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, c float64\n\tfmt.Scan(&a, &b, &c)\n\n\tx := c - a - b\n\tif x > 0 && 4*a*b < x*x {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1584246311, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02743.html", "problem_id": "p02743", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02743/input.txt", "sample_output_relpath": "derived/input_output/data/p02743/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02743/Go/s909236385.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s909236385", "user_id": "u367908963"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, c float64\n\tfmt.Scan(&a, &b, &c)\n\n\tx := c - a - b\n\tif x > 0 && 4*a*b < x*x {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "sample_input": "2 3 9\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02743", "source_text": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s082162058", "group_id": "codeNet:p02743", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, c int64\n\n\tfmt.Scan(&a, &b, &c)\n\n\td := c - a - b\n\tif d < 0 {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\n\tif d*d > 4*a*b {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1584241624, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02743.html", "problem_id": "p02743", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02743/input.txt", "sample_output_relpath": "derived/input_output/data/p02743/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02743/Go/s082162058.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s082162058", "user_id": "u422017528"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, c int64\n\n\tfmt.Scan(&a, &b, &c)\n\n\td := c - a - b\n\tif d < 0 {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\n\tif d*d > 4*a*b {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "sample_input": "2 3 9\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02743", "source_text": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 225, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s778306336", "group_id": "codeNet:p02743", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t_ \"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t_ \"sort\"\n\t\"strconv\"\n)\n\n// I/O\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextFloat() float64 {\n\tf, e := strconv.ParseFloat(s.nextStr(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc (s *Scanner) nextFloatSlice(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextFloat()\n\t}\n\treturn res\n}\n\n// Arithmetic\nfunc max(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m < i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m > i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc pow(x, y int) int {\n\tres := 1\n\tfor i := 0; i < y; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\nfunc ceil(a, b int) int {\n\tif a%b == 0 {\n\t\treturn a / b\n\t} else {\n\t\treturn a/b + 1\n\t}\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\treturn a / gcd(a, b) * b\n}\n\n// Sort\ntype RuneSlice []rune\n\nfunc (a RuneSlice) Len() int { return len(a) }\nfunc (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }\nfunc (a RuneSlice) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\n\n// Main\nconst MOD = int(1e+9) + 7\nconst INF = 1 << 60\n\nfunc main() {\n\tsc := NewScanner()\n\twtr := bufio.NewWriter(os.Stdout)\n\tdefer wtr.Flush()\n\ta, b, c := sc.nextInt(), sc.nextInt(), sc.nextInt()\n\tif c-a-b > 0 && 4*a*b < pow(c-a-b, 2) {\n\t\tfmt.Fprintln(wtr, \"Yes\")\n\t} else {\n\t\tfmt.Fprintln(wtr, \"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1584240481, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02743.html", "problem_id": "p02743", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02743/input.txt", "sample_output_relpath": "derived/input_output/data/p02743/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02743/Go/s778306336.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s778306336", "user_id": "u924691798"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t_ \"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t_ \"sort\"\n\t\"strconv\"\n)\n\n// I/O\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextFloat() float64 {\n\tf, e := strconv.ParseFloat(s.nextStr(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc (s *Scanner) nextFloatSlice(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextFloat()\n\t}\n\treturn res\n}\n\n// Arithmetic\nfunc max(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m < i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m > i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc pow(x, y int) int {\n\tres := 1\n\tfor i := 0; i < y; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\nfunc ceil(a, b int) int {\n\tif a%b == 0 {\n\t\treturn a / b\n\t} else {\n\t\treturn a/b + 1\n\t}\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\treturn a / gcd(a, b) * b\n}\n\n// Sort\ntype RuneSlice []rune\n\nfunc (a RuneSlice) Len() int { return len(a) }\nfunc (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }\nfunc (a RuneSlice) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\n\n// Main\nconst MOD = int(1e+9) + 7\nconst INF = 1 << 60\n\nfunc main() {\n\tsc := NewScanner()\n\twtr := bufio.NewWriter(os.Stdout)\n\tdefer wtr.Flush()\n\ta, b, c := sc.nextInt(), sc.nextInt(), sc.nextInt()\n\tif c-a-b > 0 && 4*a*b < pow(c-a-b, 2) {\n\t\tfmt.Fprintln(wtr, \"Yes\")\n\t} else {\n\t\tfmt.Fprintln(wtr, \"No\")\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "sample_input": "2 3 9\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02743", "source_text": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2092, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s139871294", "group_id": "codeNet:p02743", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t_ \"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t_ \"sort\"\n\t\"strconv\"\n)\n\n// I/O\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextFloat() float64 {\n\tf, e := strconv.ParseFloat(s.nextStr(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc (s *Scanner) nextFloatSlice(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextFloat()\n\t}\n\treturn res\n}\n\n// Arithmetic\nfunc max(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m < i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m > i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc pow(x, y int) int {\n\tres := 1\n\tfor i := 0; i < y; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\nfunc ceil(a, b int) int {\n\tif a%b == 0 {\n\t\treturn a / b\n\t} else {\n\t\treturn a/b + 1\n\t}\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\treturn a / gcd(a, b) * b\n}\n\n// Sort\ntype RuneSlice []rune\n\nfunc (a RuneSlice) Len() int { return len(a) }\nfunc (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }\nfunc (a RuneSlice) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\n\n// Main\nconst MOD = int(1e+9) + 7\nconst INF = 1 << 60\n\nfunc main() {\n\tsc := NewScanner()\n\twtr := bufio.NewWriter(os.Stdout)\n\tdefer wtr.Flush()\n\ta, b, c := sc.nextFloat(), sc.nextFloat(), sc.nextFloat()\n\tif c-a-b > 0 && 4*a*b < math.Pow(c-a-b, 2) {\n\t\tfmt.Fprintln(wtr, \"Yes\")\n\t} else {\n\t\tfmt.Fprintln(wtr, \"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1584240404, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02743.html", "problem_id": "p02743", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02743/input.txt", "sample_output_relpath": "derived/input_output/data/p02743/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02743/Go/s139871294.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s139871294", "user_id": "u924691798"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t_ \"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t_ \"sort\"\n\t\"strconv\"\n)\n\n// I/O\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextFloat() float64 {\n\tf, e := strconv.ParseFloat(s.nextStr(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc (s *Scanner) nextFloatSlice(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextFloat()\n\t}\n\treturn res\n}\n\n// Arithmetic\nfunc max(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m < i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m > i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc pow(x, y int) int {\n\tres := 1\n\tfor i := 0; i < y; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\nfunc ceil(a, b int) int {\n\tif a%b == 0 {\n\t\treturn a / b\n\t} else {\n\t\treturn a/b + 1\n\t}\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\treturn a / gcd(a, b) * b\n}\n\n// Sort\ntype RuneSlice []rune\n\nfunc (a RuneSlice) Len() int { return len(a) }\nfunc (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }\nfunc (a RuneSlice) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\n\n// Main\nconst MOD = int(1e+9) + 7\nconst INF = 1 << 60\n\nfunc main() {\n\tsc := NewScanner()\n\twtr := bufio.NewWriter(os.Stdout)\n\tdefer wtr.Flush()\n\ta, b, c := sc.nextFloat(), sc.nextFloat(), sc.nextFloat()\n\tif c-a-b > 0 && 4*a*b < math.Pow(c-a-b, 2) {\n\t\tfmt.Fprintln(wtr, \"Yes\")\n\t} else {\n\t\tfmt.Fprintln(wtr, \"No\")\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "sample_input": "2 3 9\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02743", "source_text": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2111, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s330789358", "group_id": "codeNet:p02743", "input_text": "package main\n\nimport (\n\t\"fmt\"\n \"math\"\n)\n\n// inspired by https://tour.golang.org/flowcontrol/8\n// https://gist.github.com/alenbasic/108417acbff63d765f9da5e036fc018b\n// https://gist.github.com/abesto/3476594\n\n// func Sqrt(loop int, seed, square float64) float64 {\n//\n// \tx := seed\n// \tfor i := 0; i < loop; i++ {\n// \t\tx = x - ((x*x)-square)/(2*x)\n// \t}\n// \treturn x\n//\n// }\nconst DELTA = 0.0000000000001\nconst INITIAL_Z = 100.0\n\nfunc Sqrt(x float64) (z float64) {\n z = INITIAL_Z\n\n step := func() float64 {\n \treturn z - (z*z - x) / (2 * z)\n }\n\n for zz := step(); math.Abs(zz - z) > DELTA\n {\n \tz = zz\n\tzz = step()\n }\n return\n}\n\nfunc main() {\n var a,b,c float64\n fmt.Scan(&a)\n fmt.Scan(&b)\n fmt.Scan(&c)\n\n ra := Sqrt(a)\n rb := Sqrt(b)\n rc := Sqrt(c)\n left := ra+rb\n\n if left < rc {\n fmt.Println(\"Yes\")\n } else {\n fmt.Println(\"No\")\n }\n}\n", "language": "Go", "metadata": {"date": 1584239690, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02743.html", "problem_id": "p02743", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02743/input.txt", "sample_output_relpath": "derived/input_output/data/p02743/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02743/Go/s330789358.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s330789358", "user_id": "u917346607"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n \"math\"\n)\n\n// inspired by https://tour.golang.org/flowcontrol/8\n// https://gist.github.com/alenbasic/108417acbff63d765f9da5e036fc018b\n// https://gist.github.com/abesto/3476594\n\n// func Sqrt(loop int, seed, square float64) float64 {\n//\n// \tx := seed\n// \tfor i := 0; i < loop; i++ {\n// \t\tx = x - ((x*x)-square)/(2*x)\n// \t}\n// \treturn x\n//\n// }\nconst DELTA = 0.0000000000001\nconst INITIAL_Z = 100.0\n\nfunc Sqrt(x float64) (z float64) {\n z = INITIAL_Z\n\n step := func() float64 {\n \treturn z - (z*z - x) / (2 * z)\n }\n\n for zz := step(); math.Abs(zz - z) > DELTA\n {\n \tz = zz\n\tzz = step()\n }\n return\n}\n\nfunc main() {\n var a,b,c float64\n fmt.Scan(&a)\n fmt.Scan(&b)\n fmt.Scan(&c)\n\n ra := Sqrt(a)\n rb := Sqrt(b)\n rc := Sqrt(c)\n left := ra+rb\n\n if left < rc {\n fmt.Println(\"Yes\")\n } else {\n fmt.Println(\"No\")\n }\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "sample_input": "2 3 9\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02743", "source_text": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2107, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s867480943", "group_id": "codeNet:p02743", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 1000005), 1000005)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextUint64(scanner *bufio.Scanner) uint64 {\n\ti, _ := strconv.ParseUint(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextFloat64(scanner *bufio.Scanner) float64 {\n\ti, _ := strconv.ParseFloat(getNextString(scanner), 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\twfp := os.Stdout\n\tcnt := 0\n\n\tif os.Getenv(\"MASPY\") == \"ますピ\" {\n\t\tfp, _ = os.Open(os.Getenv(\"BEET_THE_HARMONY_OF_PERFECT\"))\n\t\tcnt = 1\n\t}\n\tif os.Getenv(\"MASPYPY\") == \"ますピッピ\" {\n\t\twfp, _ = os.Create(os.Getenv(\"NGTKANA_IS_GENIUS10\"))\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(wfp)\n\tsolve(scanner, writer)\n\tfor i := 0; i < cnt; i++ {\n\t\tfmt.Fprintln(writer, \"-----------------------------------\")\n\t\tsolve(scanner, writer)\n\t}\n\twriter.Flush()\n}\n\nfunc solve(scanner *bufio.Scanner, writer *bufio.Writer) {\n\ta := getNextInt64(scanner)\n\tb := getNextInt64(scanner)\n\tc := getNextInt64(scanner)\n\n\tif c-(a+b) >= 0 {\n\t\tif 4*a*b < (c-(a+b))*(c-(a+b)) {\n\t\t\tfmt.Fprintln(writer, \"Yes\")\n\t\t\treturn\n\t\t}\n\t\tfmt.Fprintln(writer, \"No\")\n\t\treturn\n\t}\n\tif 4*a*b > (c-(a+b))*(c-(a+b)) {\n\t\tfmt.Fprintln(writer, \"Yes\")\n\t\treturn\n\t}\n\tfmt.Fprintln(writer, \"No\")\n}\n", "language": "Go", "metadata": {"date": 1584238638, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02743.html", "problem_id": "p02743", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02743/input.txt", "sample_output_relpath": "derived/input_output/data/p02743/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02743/Go/s867480943.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s867480943", "user_id": "u150542210"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 1000005), 1000005)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextUint64(scanner *bufio.Scanner) uint64 {\n\ti, _ := strconv.ParseUint(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextFloat64(scanner *bufio.Scanner) float64 {\n\ti, _ := strconv.ParseFloat(getNextString(scanner), 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\twfp := os.Stdout\n\tcnt := 0\n\n\tif os.Getenv(\"MASPY\") == \"ますピ\" {\n\t\tfp, _ = os.Open(os.Getenv(\"BEET_THE_HARMONY_OF_PERFECT\"))\n\t\tcnt = 1\n\t}\n\tif os.Getenv(\"MASPYPY\") == \"ますピッピ\" {\n\t\twfp, _ = os.Create(os.Getenv(\"NGTKANA_IS_GENIUS10\"))\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(wfp)\n\tsolve(scanner, writer)\n\tfor i := 0; i < cnt; i++ {\n\t\tfmt.Fprintln(writer, \"-----------------------------------\")\n\t\tsolve(scanner, writer)\n\t}\n\twriter.Flush()\n}\n\nfunc solve(scanner *bufio.Scanner, writer *bufio.Writer) {\n\ta := getNextInt64(scanner)\n\tb := getNextInt64(scanner)\n\tc := getNextInt64(scanner)\n\n\tif c-(a+b) >= 0 {\n\t\tif 4*a*b < (c-(a+b))*(c-(a+b)) {\n\t\t\tfmt.Fprintln(writer, \"Yes\")\n\t\t\treturn\n\t\t}\n\t\tfmt.Fprintln(writer, \"No\")\n\t\treturn\n\t}\n\tif 4*a*b > (c-(a+b))*(c-(a+b)) {\n\t\tfmt.Fprintln(writer, \"Yes\")\n\t\treturn\n\t}\n\tfmt.Fprintln(writer, \"No\")\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "sample_input": "2 3 9\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02743", "source_text": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1693, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s723348127", "group_id": "codeNet:p02743", "input_text": "package main\n\nimport \"fmt\"\nimport \"math\"\n\nfunc Sum(values []float64) float64 {\n\tvar partials []float64\n\tfor _, x := range values {\n\t\ti := 0\n\t\tfor _, y := range partials {\n\t\t\tif math.Abs(x) < math.Abs(y) {\n\t\t\t\ttmp := x\n\t\t\t\tx = y\n\t\t\t\ty = tmp\n\t\t\t}\n\t\t\thi := x + y\n\t\t\tlo := y - (hi - x)\n\t\t\tif lo != 0.0 {\n\t\t\t\tpartials[i] = lo\n\t\t\t\ti++\n\t\t\t}\n\t\t\tx = hi\n\t\t}\n\t\tif i < len(partials) {\n\t\t\tpartials[i] = x\n\t\t\tpartials = partials[0 : i+1]\n\t\t} else {\n\t\t\tpartials = append(partials, x)\n\t\t}\n\t}\n\tvar result float64\n\tfor _, x := range partials {\n\t\tresult += x\n\t}\n\treturn result\n}\n\nfunc main() {\n\tvar a, b, c float64\n\tfmt.Scan(&a)\n\tfmt.Scan(&b)\n\tfmt.Scan(&c)\n\n\tar := make([]float64, 2, 2)\n\tar[0] = math.Sqrt(a)\n\tar[1] = math.Sqrt(b)\n\n\tres := Sum(ar) < math.Sqrt(c)\n\n\tif res {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1584238575, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02743.html", "problem_id": "p02743", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02743/input.txt", "sample_output_relpath": "derived/input_output/data/p02743/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02743/Go/s723348127.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s723348127", "user_id": "u346050999"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\nimport \"math\"\n\nfunc Sum(values []float64) float64 {\n\tvar partials []float64\n\tfor _, x := range values {\n\t\ti := 0\n\t\tfor _, y := range partials {\n\t\t\tif math.Abs(x) < math.Abs(y) {\n\t\t\t\ttmp := x\n\t\t\t\tx = y\n\t\t\t\ty = tmp\n\t\t\t}\n\t\t\thi := x + y\n\t\t\tlo := y - (hi - x)\n\t\t\tif lo != 0.0 {\n\t\t\t\tpartials[i] = lo\n\t\t\t\ti++\n\t\t\t}\n\t\t\tx = hi\n\t\t}\n\t\tif i < len(partials) {\n\t\t\tpartials[i] = x\n\t\t\tpartials = partials[0 : i+1]\n\t\t} else {\n\t\t\tpartials = append(partials, x)\n\t\t}\n\t}\n\tvar result float64\n\tfor _, x := range partials {\n\t\tresult += x\n\t}\n\treturn result\n}\n\nfunc main() {\n\tvar a, b, c float64\n\tfmt.Scan(&a)\n\tfmt.Scan(&b)\n\tfmt.Scan(&c)\n\n\tar := make([]float64, 2, 2)\n\tar[0] = math.Sqrt(a)\n\tar[1] = math.Sqrt(b)\n\n\tres := Sum(ar) < math.Sqrt(c)\n\n\tif res {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "sample_input": "2 3 9\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02743", "source_text": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s981326457", "group_id": "codeNet:p02743", "input_text": "package main\n\nimport \"fmt\"\nimport \"math\"\n\nfunc main() {\n\tvar a, b, c float64\n\tfmt.Scan(&a)\n\tfmt.Scan(&b)\n\tfmt.Scan(&c)\n\n\tleft := (a + b - c) / -2\n\tright := math.Sqrt(a*b)\n\n\t// fmt.Println(left)\n\t// fmt.Println(right)\n\n\tres := left > right\n\n\tif res {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1584237981, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02743.html", "problem_id": "p02743", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02743/input.txt", "sample_output_relpath": "derived/input_output/data/p02743/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02743/Go/s981326457.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s981326457", "user_id": "u346050999"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\nimport \"math\"\n\nfunc main() {\n\tvar a, b, c float64\n\tfmt.Scan(&a)\n\tfmt.Scan(&b)\n\tfmt.Scan(&c)\n\n\tleft := (a + b - c) / -2\n\tright := math.Sqrt(a*b)\n\n\t// fmt.Println(left)\n\t// fmt.Println(right)\n\n\tres := left > right\n\n\tif res {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "sample_input": "2 3 9\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02743", "source_text": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 306, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s521560683", "group_id": "codeNet:p02743", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// input scanner\nvar sc = bufio.NewScanner(os.Stdin)\n\nconst (\n\tinitialBufSize = 10e4\n\tmaxBufSize = 10e6\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextInt64() int64 {\n\ta, _ := strconv.ParseInt(next(), 10, 64)\n\treturn a\n}\n\nfunc nextFloat64() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\nfunc nextFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextFloat64()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\n// util\nfunc max(l []int) (int, int) {\n\tidx := 0\n\tans := l[idx]\n\tfor i, n := range l {\n\t\tif n > ans {\n\t\t\tidx = i\n\t\t\tans = n\n\t\t}\n\t}\n\treturn idx, ans\n}\n\nfunc min(l []int) (int, int) {\n\tidx := 0\n\tans := l[idx]\n\tfor i, n := range l {\n\t\tif n < ans {\n\t\t\tidx = i\n\t\t\tans = n\n\t\t}\n\t}\n\treturn idx, ans\n}\n\n// main\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tsc.Buffer(buf, maxBufSize)\n\tsc.Split(bufio.ScanWords)\n\ta := nextFloat64()\n\tb := nextFloat64()\n\tc := nextFloat64()\n\tif math.Pow((math.Sqrt(a)+math.Sqrt(b)), 2.0) < c {\n\t\tfmt.Println(\"Yes\")\n\t\treturn\n\t}\n\tfmt.Println(\"No\")\n}\n", "language": "Go", "metadata": {"date": 1584237208, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02743.html", "problem_id": "p02743", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02743/input.txt", "sample_output_relpath": "derived/input_output/data/p02743/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02743/Go/s521560683.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s521560683", "user_id": "u452900140"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// input scanner\nvar sc = bufio.NewScanner(os.Stdin)\n\nconst (\n\tinitialBufSize = 10e4\n\tmaxBufSize = 10e6\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextInt64() int64 {\n\ta, _ := strconv.ParseInt(next(), 10, 64)\n\treturn a\n}\n\nfunc nextFloat64() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\nfunc nextFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextFloat64()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\n// util\nfunc max(l []int) (int, int) {\n\tidx := 0\n\tans := l[idx]\n\tfor i, n := range l {\n\t\tif n > ans {\n\t\t\tidx = i\n\t\t\tans = n\n\t\t}\n\t}\n\treturn idx, ans\n}\n\nfunc min(l []int) (int, int) {\n\tidx := 0\n\tans := l[idx]\n\tfor i, n := range l {\n\t\tif n < ans {\n\t\t\tidx = i\n\t\t\tans = n\n\t\t}\n\t}\n\treturn idx, ans\n}\n\n// main\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tsc.Buffer(buf, maxBufSize)\n\tsc.Split(bufio.ScanWords)\n\ta := nextFloat64()\n\tb := nextFloat64()\n\tc := nextFloat64()\n\tif math.Pow((math.Sqrt(a)+math.Sqrt(b)), 2.0) < c {\n\t\tfmt.Println(\"Yes\")\n\t\treturn\n\t}\n\tfmt.Println(\"No\")\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "sample_input": "2 3 9\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02743", "source_text": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1401, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s673158643", "group_id": "codeNet:p02743", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc solution(a, b, c int) string {\n\tif math.Sqrt(float64(a))+math.Sqrt(float64(b)) < math.Sqrt(float64(c)) {\n\t\treturn \"Yes\"\n\t}\n\treturn \"No\"\n}\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scan(&a, &b, &c)\n\tfmt.Println(solution(a, b, c))\n}\n", "language": "Go", "metadata": {"date": 1584237168, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02743.html", "problem_id": "p02743", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02743/input.txt", "sample_output_relpath": "derived/input_output/data/p02743/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02743/Go/s673158643.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s673158643", "user_id": "u568763892"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc solution(a, b, c int) string {\n\tif math.Sqrt(float64(a))+math.Sqrt(float64(b)) < math.Sqrt(float64(c)) {\n\t\treturn \"Yes\"\n\t}\n\treturn \"No\"\n}\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scan(&a, &b, &c)\n\tfmt.Println(solution(a, b, c))\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "sample_input": "2 3 9\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02743", "source_text": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s454861313", "group_id": "codeNet:p02743", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"sort\"\n \"math\"\n)\n\n// -----------------------------------------------------------------------------\n\n// IO helper functions\n\n// Returns next token from input. It must be initialized by SetInput()\n// before the first call.\nvar nextToken func() ([]byte, error)\nvar nextLine func() ([]byte, error)\n\n// Holds a buffer for output. It must be initialized by SetOutput().\n// All IO fucntions (read*() and [e]print*()) should write to OutputWriter\n// instead of this.\nvar OutputBuffer *bufio.Writer\n\n// Holds an io.Writer. It must be initialized by SetOutput()\nvar OutputWriter io.Writer\n\n// Set IO functions for interactive input/output.\nfunc SetInteractive(w io.Writer, r io.Reader) {\n\tSetUnbefferedInput(r)\n\tOutputBuffer = nil\n\tOutputWriter = w\n}\n\n// Setup OutputBuffer and OutputWriter.\nfunc SetOutput(w io.Writer) {\n\tOutputBuffer = bufio.NewWriter(w)\n\tOutputWriter = OutputBuffer\n}\n\n// Flushes OutputBuffer\nfunc Flush() {\n\tif OutputBuffer != nil {\n\t\tOutputBuffer.Flush()\n\t}\n}\n\n// Returns true if c is a white space\nfunc IsSpace(c byte) bool {\n\tswitch c {\n\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc IsNewLine(c byte) bool {\n\tswitch c {\n\tcase '\\n', '\\r':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Setup nextToken with input buffer.\nfunc SetInput(r io.Reader) {\n\tbuf := new(bytes.Buffer)\n\tvar b []byte\n\n\tvar i int\n\trest := func() ([]byte, error) {\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\tinitial := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextToken = rest\n\t\treturn rest()\n\t}\n\tnextToken = initial\n\n\trestLn := func() ([]byte, error) {\n\t\tfor i < len(b) && IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\n\tinitialLn := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextLine = restLn\n\t\treturn restLn()\n\t}\n\tnextLine = initialLn\n}\n\n// Setup nextToken without input buffer.\nfunc SetUnbefferedInput(r io.Reader) {\n\tbuf := bufio.NewReader(r)\n\tvar b []byte\n\n\tvar i int\n\tnextToken = func() ([]byte, error) {\n\t\tvar err error\n\t\tif i == len(b) {\n\t\t\tb, err = buf.ReadBytes('\\n')\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ti = 0\n\t\t\tj := len(b) - 1\n\t\t\tfor 0 <= j && IsSpace(b[j]) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tb = b[0 : j+1]\n\t\t}\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n}\n\n// -----------------------------------------------------------------------------\n\n// IO functions\n\n// Reads next token and return it as []byte\nfunc readb() []byte {\n\tb, err := nextToken()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b\n}\n\n// Reads next token and return it as string\nfunc reads() string {\n\treturn string(readb())\n}\n\n// Read next line as []byte\nfunc readbln() []byte {\n\tb, err := nextLine()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b\n}\n\n// Read next line as string\nfunc readsln() string {\n\treturn string(readbln())\n}\n\n// Reads next token and return it as int64\nfunc readll() int64 {\n\ti, err := strconv.ParseInt(reads(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// Reads next token and return it as int\nfunc readi() int {\n\treturn int(readll())\n}\n\n// Reads next token and return it as float64\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(reads(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc readislice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = readi()\n\t}\n\treturn b\n}\n\n// ReadInt64Slice returns as int64 slice that has n integers.\nfunc readllslice(n int) []int64 {\n\tb := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = readll()\n\t}\n\treturn b\n}\n\n// Write args to OutputWriter with the format f\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(OutputWriter, f, args...)\n}\n\n// Write args to OutputWriter without format\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(OutputWriter, args...)\n}\n\n// Write args to stderr with the format f\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// Write args to stderr without format\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\n// -----------------------------------------------------------------------------\n\n// Simple math functions\n\nconst (\n\t// big prime\n\tMOD = 1000000007\n\tINF = math.MaxInt64\n)\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minll(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxll(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absll(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc pow(p, q int) int {\n return int(math.Pow(float64(p), float64(q)))\n}\n\n// egcd(a, b) returns d, x, y:\n// d is gcd(a,b)\n// x, y are integers that satisfy ax + by = d\nfunc egcd(a, b int) (int, int, int) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcd(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc egcdll(a, b int64) (int64, int64, int64) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcdll(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc gcd(a, b int) int {\n\td, _, _ := egcd(a, b)\n\treturn d\n}\n\nfunc gcdll(a, b int64) int64 {\n\td, _, _ := egcdll(a, b)\n\treturn d\n}\n\nfunc lcm(a,b int) int{\n return a * b / gcd(a, b)\n}\n\nfunc isInteger(x float64) bool {\n return math.Floor(x) == x\n}\n\n// lower_bound\nfunc bisectLeft(a []int, x int) int {\n return sort.SearchInts(a, x)\n}\n\n// upper_bound\nfunc bisectRight(a []int, x int) int {\n return sort.Search(len(a), func(i int) bool { return a[i] > x })\n}\n\n// set up IO functions\nfunc init() {\n\t// for non-interactive\n\tSetInput(os.Stdin)\n\tSetOutput(os.Stdout)\n\n\t// Enable below when interactive. Its ok to leave above intact.\n\t// SetInteractive(os.Stdout, os.Stdin)\n}\n\nfunc main() {\n defer Flush()\n\n a,b,c := readi(), readi(), readi()\n\n if a + b < c{\n\t println(\"Yes\")\n } else {\n\t println(\"No\")\n }\n}\n", "language": "Go", "metadata": {"date": 1584236295, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02743.html", "problem_id": "p02743", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02743/input.txt", "sample_output_relpath": "derived/input_output/data/p02743/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02743/Go/s454861313.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s454861313", "user_id": "u846185950"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"sort\"\n \"math\"\n)\n\n// -----------------------------------------------------------------------------\n\n// IO helper functions\n\n// Returns next token from input. It must be initialized by SetInput()\n// before the first call.\nvar nextToken func() ([]byte, error)\nvar nextLine func() ([]byte, error)\n\n// Holds a buffer for output. It must be initialized by SetOutput().\n// All IO fucntions (read*() and [e]print*()) should write to OutputWriter\n// instead of this.\nvar OutputBuffer *bufio.Writer\n\n// Holds an io.Writer. It must be initialized by SetOutput()\nvar OutputWriter io.Writer\n\n// Set IO functions for interactive input/output.\nfunc SetInteractive(w io.Writer, r io.Reader) {\n\tSetUnbefferedInput(r)\n\tOutputBuffer = nil\n\tOutputWriter = w\n}\n\n// Setup OutputBuffer and OutputWriter.\nfunc SetOutput(w io.Writer) {\n\tOutputBuffer = bufio.NewWriter(w)\n\tOutputWriter = OutputBuffer\n}\n\n// Flushes OutputBuffer\nfunc Flush() {\n\tif OutputBuffer != nil {\n\t\tOutputBuffer.Flush()\n\t}\n}\n\n// Returns true if c is a white space\nfunc IsSpace(c byte) bool {\n\tswitch c {\n\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc IsNewLine(c byte) bool {\n\tswitch c {\n\tcase '\\n', '\\r':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Setup nextToken with input buffer.\nfunc SetInput(r io.Reader) {\n\tbuf := new(bytes.Buffer)\n\tvar b []byte\n\n\tvar i int\n\trest := func() ([]byte, error) {\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\tinitial := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextToken = rest\n\t\treturn rest()\n\t}\n\tnextToken = initial\n\n\trestLn := func() ([]byte, error) {\n\t\tfor i < len(b) && IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\n\tinitialLn := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextLine = restLn\n\t\treturn restLn()\n\t}\n\tnextLine = initialLn\n}\n\n// Setup nextToken without input buffer.\nfunc SetUnbefferedInput(r io.Reader) {\n\tbuf := bufio.NewReader(r)\n\tvar b []byte\n\n\tvar i int\n\tnextToken = func() ([]byte, error) {\n\t\tvar err error\n\t\tif i == len(b) {\n\t\t\tb, err = buf.ReadBytes('\\n')\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ti = 0\n\t\t\tj := len(b) - 1\n\t\t\tfor 0 <= j && IsSpace(b[j]) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tb = b[0 : j+1]\n\t\t}\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n}\n\n// -----------------------------------------------------------------------------\n\n// IO functions\n\n// Reads next token and return it as []byte\nfunc readb() []byte {\n\tb, err := nextToken()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b\n}\n\n// Reads next token and return it as string\nfunc reads() string {\n\treturn string(readb())\n}\n\n// Read next line as []byte\nfunc readbln() []byte {\n\tb, err := nextLine()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn b\n}\n\n// Read next line as string\nfunc readsln() string {\n\treturn string(readbln())\n}\n\n// Reads next token and return it as int64\nfunc readll() int64 {\n\ti, err := strconv.ParseInt(reads(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// Reads next token and return it as int\nfunc readi() int {\n\treturn int(readll())\n}\n\n// Reads next token and return it as float64\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(reads(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc readislice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = readi()\n\t}\n\treturn b\n}\n\n// ReadInt64Slice returns as int64 slice that has n integers.\nfunc readllslice(n int) []int64 {\n\tb := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = readll()\n\t}\n\treturn b\n}\n\n// Write args to OutputWriter with the format f\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(OutputWriter, f, args...)\n}\n\n// Write args to OutputWriter without format\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(OutputWriter, args...)\n}\n\n// Write args to stderr with the format f\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// Write args to stderr without format\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\n// -----------------------------------------------------------------------------\n\n// Simple math functions\n\nconst (\n\t// big prime\n\tMOD = 1000000007\n\tINF = math.MaxInt64\n)\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minll(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxll(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absll(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc pow(p, q int) int {\n return int(math.Pow(float64(p), float64(q)))\n}\n\n// egcd(a, b) returns d, x, y:\n// d is gcd(a,b)\n// x, y are integers that satisfy ax + by = d\nfunc egcd(a, b int) (int, int, int) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcd(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc egcdll(a, b int64) (int64, int64, int64) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcdll(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc gcd(a, b int) int {\n\td, _, _ := egcd(a, b)\n\treturn d\n}\n\nfunc gcdll(a, b int64) int64 {\n\td, _, _ := egcdll(a, b)\n\treturn d\n}\n\nfunc lcm(a,b int) int{\n return a * b / gcd(a, b)\n}\n\nfunc isInteger(x float64) bool {\n return math.Floor(x) == x\n}\n\n// lower_bound\nfunc bisectLeft(a []int, x int) int {\n return sort.SearchInts(a, x)\n}\n\n// upper_bound\nfunc bisectRight(a []int, x int) int {\n return sort.Search(len(a), func(i int) bool { return a[i] > x })\n}\n\n// set up IO functions\nfunc init() {\n\t// for non-interactive\n\tSetInput(os.Stdin)\n\tSetOutput(os.Stdout)\n\n\t// Enable below when interactive. Its ok to leave above intact.\n\t// SetInteractive(os.Stdout, os.Stdin)\n}\n\nfunc main() {\n defer Flush()\n\n a,b,c := readi(), readi(), readi()\n\n if a + b < c{\n\t println(\"Yes\")\n } else {\n\t println(\"No\")\n }\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "sample_input": "2 3 9\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02743", "source_text": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6391, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s393481136", "group_id": "codeNet:p02743", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\n\tvar a, b, c float64\n\tfmt.Scan(&a, &b, &c)\n\n\tsum := math.Sqrt(a) + math.Sqrt(b)\n\n\tif sum < math.Sqrt(c) {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1584236066, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02743.html", "problem_id": "p02743", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02743/input.txt", "sample_output_relpath": "derived/input_output/data/p02743/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02743/Go/s393481136.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s393481136", "user_id": "u067471258"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\n\tvar a, b, c float64\n\tfmt.Scan(&a, &b, &c)\n\n\tsum := math.Sqrt(a) + math.Sqrt(b)\n\n\tif sum < math.Sqrt(c) {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "sample_input": "2 3 9\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02743", "source_text": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s341978768", "group_id": "codeNet:p02743", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar a, b, c float64\n\tfmt.Scan(&a, &b, &c)\n\n\tif math.Sqrt(a)+math.Sqrt(b)-math.Sqrt(c) < 0 {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1584236004, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02743.html", "problem_id": "p02743", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02743/input.txt", "sample_output_relpath": "derived/input_output/data/p02743/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02743/Go/s341978768.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s341978768", "user_id": "u902409225"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar a, b, c float64\n\tfmt.Scan(&a, &b, &c)\n\n\tif math.Sqrt(a)+math.Sqrt(b)-math.Sqrt(c) < 0 {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "sample_input": "2 3 9\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02743", "source_text": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 204, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s156152386", "group_id": "codeNet:p02743", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scanf(\"%d %d %d\", &a, &b, &c)\n\tanswer := compareSqrt(a, b, c)\n\tif answer {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\nfunc compareSqrt(a, b, c int) bool {\n\treturn 4*a*b < (c*c + a*a + b*b - 2*c*a - 2*c*b + 2*a*b)\n}\n", "language": "Go", "metadata": {"date": 1584235640, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02743.html", "problem_id": "p02743", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02743/input.txt", "sample_output_relpath": "derived/input_output/data/p02743/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02743/Go/s156152386.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s156152386", "user_id": "u238461782"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scanf(\"%d %d %d\", &a, &b, &c)\n\tanswer := compareSqrt(a, b, c)\n\tif answer {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\nfunc compareSqrt(a, b, c int) bool {\n\treturn 4*a*b < (c*c + a*a + b*b - 2*c*a - 2*c*b + 2*a*b)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "sample_input": "2 3 9\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02743", "source_text": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s437890670", "group_id": "codeNet:p02743", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, c int64\n\tfmt.Scanf(\"%d %d %d\", &a, &b, &c)\n\tif c*c-2*c*(a+b)+(a-b)*(a-b) > 0 {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1584235626, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02743.html", "problem_id": "p02743", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02743/input.txt", "sample_output_relpath": "derived/input_output/data/p02743/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02743/Go/s437890670.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s437890670", "user_id": "u226445453"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, c int64\n\tfmt.Scanf(\"%d %d %d\", &a, &b, &c)\n\tif c*c-2*c*(a+b)+(a-b)*(a-b) > 0 {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "sample_input": "2 3 9\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02743", "source_text": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s662539846", "group_id": "codeNet:p02743", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar a, b, c float64\n\tfmt.Scan(&a)\n\tfmt.Scan(&b)\n\tfmt.Scan(&c)\n\n\tif math.Sqrt(a)+math.Sqrt(b) < math.Sqrt(c) {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n\n}", "language": "Go", "metadata": {"date": 1584235382, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02743.html", "problem_id": "p02743", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02743/input.txt", "sample_output_relpath": "derived/input_output/data/p02743/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02743/Go/s662539846.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s662539846", "user_id": "u321643808"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar a, b, c float64\n\tfmt.Scan(&a)\n\tfmt.Scan(&b)\n\tfmt.Scan(&c)\n\n\tif math.Sqrt(a)+math.Sqrt(b) < math.Sqrt(c) {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "sample_input": "2 3 9\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02743", "source_text": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s923702662", "group_id": "codeNet:p02743", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar (\n\t\ta, b, c float64\n\t)\n\n\tfmt.Scan(&a, &b, &c)\n\n\tif math.Sqrt(a) + math.Sqrt(b) < math.Sqrt(c) {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1584235372, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02743.html", "problem_id": "p02743", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02743/input.txt", "sample_output_relpath": "derived/input_output/data/p02743/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02743/Go/s923702662.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s923702662", "user_id": "u323255029"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar (\n\t\ta, b, c float64\n\t)\n\n\tfmt.Scan(&a, &b, &c)\n\n\tif math.Sqrt(a) + math.Sqrt(b) < math.Sqrt(c) {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "sample_input": "2 3 9\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02743", "source_text": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 213, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s982271677", "group_id": "codeNet:p02743", "input_text": "package main\n\nimport \"fmt\"\n\nvar a, b, c int\n\nfunc main() {\n\tfmt.Scan(&a, &b, &c)\n\tif c-a-b <= 0 {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\n\tn := c*c + (a+b)*(a+b) - 4*a*b - 2*c*(a+b)\n\n\tif n > 0 {\n\t\tfmt.Println(\"Yes\")\n\n\t} else {\n\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1584235035, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02743.html", "problem_id": "p02743", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02743/input.txt", "sample_output_relpath": "derived/input_output/data/p02743/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02743/Go/s982271677.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s982271677", "user_id": "u883678669"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nvar a, b, c int\n\nfunc main() {\n\tfmt.Scan(&a, &b, &c)\n\tif c-a-b <= 0 {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\n\tn := c*c + (a+b)*(a+b) - 4*a*b - 2*c*(a+b)\n\n\tif n > 0 {\n\t\tfmt.Println(\"Yes\")\n\n\t} else {\n\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "sample_input": "2 3 9\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02743", "source_text": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 246, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s899006130", "group_id": "codeNet:p02743", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\n\ta := nextInt64()\n\tb := nextInt64()\n\tc := nextInt64()\n\n\td := c - a - b\n\tif d >= 0 && 4*a*b < d*d {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\nvar stdin = initStdin()\n\nfunc initStdin() *bufio.Scanner {\n\tbufsize := 1 * 1024 * 1024 // 1 MB\n\tvar stdin = bufio.NewScanner(os.Stdin)\n\tstdin.Buffer(make([]byte, bufsize), bufsize)\n\tstdin.Split(bufio.ScanWords)\n\treturn stdin\n}\n\nfunc nextString() string {\n\tstdin.Scan()\n\treturn stdin.Text()\n}\n\nfunc nextBytes() []byte {\n\tstdin.Scan()\n\treturn stdin.Bytes()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(nextString())\n\treturn i\n}\n\nfunc nextInt64() int64 {\n\ti, _ := strconv.ParseInt(nextString(), 10, 64)\n\treturn i\n}\n", "language": "Go", "metadata": {"date": 1584234944, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02743.html", "problem_id": "p02743", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02743/input.txt", "sample_output_relpath": "derived/input_output/data/p02743/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02743/Go/s899006130.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s899006130", "user_id": "u578274732"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\n\ta := nextInt64()\n\tb := nextInt64()\n\tc := nextInt64()\n\n\td := c - a - b\n\tif d >= 0 && 4*a*b < d*d {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\nvar stdin = initStdin()\n\nfunc initStdin() *bufio.Scanner {\n\tbufsize := 1 * 1024 * 1024 // 1 MB\n\tvar stdin = bufio.NewScanner(os.Stdin)\n\tstdin.Buffer(make([]byte, bufsize), bufsize)\n\tstdin.Split(bufio.ScanWords)\n\treturn stdin\n}\n\nfunc nextString() string {\n\tstdin.Scan()\n\treturn stdin.Text()\n}\n\nfunc nextBytes() []byte {\n\tstdin.Scan()\n\treturn stdin.Bytes()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(nextString())\n\treturn i\n}\n\nfunc nextInt64() int64 {\n\ti, _ := strconv.ParseInt(nextString(), 10, 64)\n\treturn i\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "sample_input": "2 3 9\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02743", "source_text": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 743, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s787105130", "group_id": "codeNet:p02743", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar buff []byte\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buff, bufio.MaxScanTokenSize*1024)\n\tlog.SetFlags(log.Lshortfile)\n\ta := nextInt()\n\tb := nextInt()\n\tc := nextInt()\n\tif math.Sqrt(float64(a))+math.Sqrt(float64(b)) < math.Sqrt(float64(c)) {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nvar dy = []int{0, 1, 0, -1}\nvar dx = []int{1, 0, -1, 0}\nvar MAX = math.MaxInt32\n\nfunc pow(a, b int) int {\n\treturn int(math.Pow(float64(a), float64(b)))\n}\n\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\ntype Pair struct {\n\ta, b int\n}\n\ntype Pairs []Pair\n\nfunc (p Pairs) Len() int {\n\treturn len(p)\n}\nfunc (p Pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p Pairs) Less(i, j int) bool {\n\tif p[i].a == p[j].a {\n\t\treturn p[i].b < p[j].b\n\t}\n\treturn p[i].a < p[j].a\n}\n", "language": "Go", "metadata": {"date": 1584234895, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02743.html", "problem_id": "p02743", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02743/input.txt", "sample_output_relpath": "derived/input_output/data/p02743/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02743/Go/s787105130.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s787105130", "user_id": "u696272993"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar buff []byte\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buff, bufio.MaxScanTokenSize*1024)\n\tlog.SetFlags(log.Lshortfile)\n\ta := nextInt()\n\tb := nextInt()\n\tc := nextInt()\n\tif math.Sqrt(float64(a))+math.Sqrt(float64(b)) < math.Sqrt(float64(c)) {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nvar dy = []int{0, 1, 0, -1}\nvar dx = []int{1, 0, -1, 0}\nvar MAX = math.MaxInt32\n\nfunc pow(a, b int) int {\n\treturn int(math.Pow(float64(a), float64(b)))\n}\n\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\ntype Pair struct {\n\ta, b int\n}\n\ntype Pairs []Pair\n\nfunc (p Pairs) Len() int {\n\treturn len(p)\n}\nfunc (p Pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p Pairs) Less(i, j int) bool {\n\tif p[i].a == p[j].a {\n\t\treturn p[i].b < p[j].b\n\t}\n\treturn p[i].a < p[j].a\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "sample_input": "2 3 9\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02743", "source_text": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1536, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s870115757", "group_id": "codeNet:p02743", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\tA, B, C := sc.NextFloat(), sc.NextFloat(), sc.NextFloat()\n\tans := math.Sqrt(A)+math.Sqrt(B) < math.Sqrt(C)\n\tif ans {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *Scanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *Scanner) NextFloat() float64 {\n\tv, _ := strconv.ParseFloat(s.Next(), 64)\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)\n\t\t\tresult = append(result, int(v))\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\n\treturn result\n}\nfunc (s *Scanner) NextInt64Array() []int64 {\n\ts.pre()\n\tstart := s.p\n\tresult := []int64{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1584234537, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02743.html", "problem_id": "p02743", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02743/input.txt", "sample_output_relpath": "derived/input_output/data/p02743/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02743/Go/s870115757.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s870115757", "user_id": "u504669764"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\tA, B, C := sc.NextFloat(), sc.NextFloat(), sc.NextFloat()\n\tans := math.Sqrt(A)+math.Sqrt(B) < math.Sqrt(C)\n\tif ans {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *Scanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *Scanner) NextFloat() float64 {\n\tv, _ := strconv.ParseFloat(s.Next(), 64)\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)\n\t\t\tresult = append(result, int(v))\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\n\treturn result\n}\nfunc (s *Scanner) NextInt64Array() []int64 {\n\ts.pre()\n\tstart := s.p\n\tresult := []int64{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "sample_input": "2 3 9\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02743", "source_text": "Score : 300 points\n\nProblem Statement\n\nDoes \\sqrt{a} + \\sqrt{b} < \\sqrt{c} hold?\n\nConstraints\n\n1 \\leq a, b, c \\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\n\nOutput\n\nIf \\sqrt{a} + \\sqrt{b} < \\sqrt{c}, print Yes; otherwise, print No.\n\nSample Input 1\n\n2 3 9\n\nSample Output 1\n\nNo\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{9} does not hold.\n\nSample Input 2\n\n2 3 10\n\nSample Output 2\n\nYes\n\n\\sqrt{2} + \\sqrt{3} < \\sqrt{10} holds.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2198, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s922137316", "group_id": "codeNet:p02761", "input_text": "package main\n \nimport (\n\t\"fmt\"\n)\n \nfunc main() {\n\tvar N, M, K, V int\n\tfmt.Scan(&N)\n\tfmt.Scan(&M)\n\tl := make([]int, N)\n\tm := make(map[int]int, N)\n\tfor i := 0; i < M; i++ {\n\t fmt.Scan(&K)\n\t\tfmt.Scan(&V)\n\t\tm[K - 1] = m[K - 1] + 1\n\t\tif l[K-1] == 0 {\n\t\t\tl[K-1] = V\n\t\t} else if l[K-1] != V {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t}\n\tif N == 1 {\n\t\tfmt.Println(l[0])\n\t} else if l[0] == 0 && m[0] >= 1 {\n\t\tfmt.Println(-1)\n\t\treturn\n\t} else if l[0] == 0 {\n\t\tl[0] = 1\n\t\tfor _, v := range l {\n\t\t\tfmt.Print(v)\n\t\t}\n\t} else {\n\t\tfor _, v := range l {\n\t\t\tfmt.Print(v)\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1598673497, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02761.html", "problem_id": "p02761", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02761/input.txt", "sample_output_relpath": "derived/input_output/data/p02761/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02761/Go/s922137316.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s922137316", "user_id": "u367908963"}, "prompt_components": {"gold_output": "702\n", "input_to_evaluate": "package main\n \nimport (\n\t\"fmt\"\n)\n \nfunc main() {\n\tvar N, M, K, V int\n\tfmt.Scan(&N)\n\tfmt.Scan(&M)\n\tl := make([]int, N)\n\tm := make(map[int]int, N)\n\tfor i := 0; i < M; i++ {\n\t fmt.Scan(&K)\n\t\tfmt.Scan(&V)\n\t\tm[K - 1] = m[K - 1] + 1\n\t\tif l[K-1] == 0 {\n\t\t\tl[K-1] = V\n\t\t} else if l[K-1] != V {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t}\n\tif N == 1 {\n\t\tfmt.Println(l[0])\n\t} else if l[0] == 0 && m[0] >= 1 {\n\t\tfmt.Println(-1)\n\t\treturn\n\t} else if l[0] == 0 {\n\t\tl[0] = 1\n\t\tfor _, v := range l {\n\t\t\tfmt.Print(v)\n\t\t}\n\t} else {\n\t\tfor _, v := range l {\n\t\t\tfmt.Print(v)\n\t\t}\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "sample_input": "3 3\n1 7\n3 2\n1 7\n"}, "reference_outputs": ["702\n"], "source_document_id": "p02761", "source_text": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 558, "cpu_time_ms": 4, "memory_kb": 1832}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s595202390", "group_id": "codeNet:p02761", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\tvar N, M int\n\tfmt.Scanf(\"%d %d\", &N, &M)\n\n\ts := make([]int, M)\n\tc := make([]int, M)\n\tnumber := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tnumber[i] = -1\n\t}\n\n\tvar flag int = 0\n\tfor i := 0; i < M; i++ {\n\t\tfmt.Scanf(\"%d %d\", &s[i], &c[i])\n\t\tif number[s[i]-1] == -1 {\n\t\t\tnumber[s[i]-1] = c[i]\n\t\t} else if number[s[i]-1] != -1 && number[s[i]-1] != c[i] {\n\t\t\tflag = 1\n\t\t}\n\t}\n\n\tif N > 1 {\n\t\tif number[0] == 0 {\n\t\t\tflag = 1\n\t\t} else if number[0] == -1 {\n\t\t\tnumber[0] = 1\n\t\t}\n\n\t\tfor i := 1; i < N; i++ {\n\t\t\tif number[i] == -1 {\n\t\t\t\tnumber[i] = 0\n\t\t\t}\n\t\t}\n\t} else if N == 1 {\n\t\tif number[0] == -1 {\n\t\t\tnumber[0] = 0\n\t\t}\n\t}\n\n\tif flag == 1 {\n\t\tfmt.Println(\"-1\")\n\t} else {\n\t\tfor i := 0; i < N; i++ {\n\t\t\tfmt.Printf(\"%d\", number[i])\n\t\t}\n\t\tfmt.Printf(\"\\n\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1595633884, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02761.html", "problem_id": "p02761", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02761/input.txt", "sample_output_relpath": "derived/input_output/data/p02761/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02761/Go/s595202390.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s595202390", "user_id": "u128015095"}, "prompt_components": {"gold_output": "702\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\tvar N, M int\n\tfmt.Scanf(\"%d %d\", &N, &M)\n\n\ts := make([]int, M)\n\tc := make([]int, M)\n\tnumber := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tnumber[i] = -1\n\t}\n\n\tvar flag int = 0\n\tfor i := 0; i < M; i++ {\n\t\tfmt.Scanf(\"%d %d\", &s[i], &c[i])\n\t\tif number[s[i]-1] == -1 {\n\t\t\tnumber[s[i]-1] = c[i]\n\t\t} else if number[s[i]-1] != -1 && number[s[i]-1] != c[i] {\n\t\t\tflag = 1\n\t\t}\n\t}\n\n\tif N > 1 {\n\t\tif number[0] == 0 {\n\t\t\tflag = 1\n\t\t} else if number[0] == -1 {\n\t\t\tnumber[0] = 1\n\t\t}\n\n\t\tfor i := 1; i < N; i++ {\n\t\t\tif number[i] == -1 {\n\t\t\t\tnumber[i] = 0\n\t\t\t}\n\t\t}\n\t} else if N == 1 {\n\t\tif number[0] == -1 {\n\t\t\tnumber[0] = 0\n\t\t}\n\t}\n\n\tif flag == 1 {\n\t\tfmt.Println(\"-1\")\n\t} else {\n\t\tfor i := 0; i < N; i++ {\n\t\t\tfmt.Printf(\"%d\", number[i])\n\t\t}\n\t\tfmt.Printf(\"\\n\")\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "sample_input": "3 3\n1 7\n3 2\n1 7\n"}, "reference_outputs": ["702\n"], "source_document_id": "p02761", "source_text": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 795, "cpu_time_ms": 6, "memory_kb": 1832}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s315965488", "group_id": "codeNet:p02761", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"strconv\"\n)\n\ntype (\n\tInn struct {\n\t\tindex int\n\t\tvalue int\n\t}\n)\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\tin := []Inn{}\n\tfor i := 0; i < m; i++ {\n\t\tind := 0\n\t\tval := 0\n\t\tfmt.Scan(&ind, &val)\n\t\tif ind == 1 && val == 0 {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t\tin = append(in, Inn{\n\t\t\tindex: ind,\n\t\t\tvalue: val,\n\t\t})\n\t}\n\n\tfor i := int(math.Pow(10, float64(n-1))); i < int(math.Pow(10, float64(n))); i++ {\n\t\ttemp := strconv.Itoa(i)\n\t\tfor j, v := range in {\n\t\t\tif string(temp[v.index-1]) != strconv.Itoa(v.value) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif j == len(in)-1 {\n\t\t\t\tfmt.Println(i)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(-1)\n}", "language": "Go", "metadata": {"date": 1592164439, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02761.html", "problem_id": "p02761", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02761/input.txt", "sample_output_relpath": "derived/input_output/data/p02761/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02761/Go/s315965488.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s315965488", "user_id": "u370270364"}, "prompt_components": {"gold_output": "702\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"strconv\"\n)\n\ntype (\n\tInn struct {\n\t\tindex int\n\t\tvalue int\n\t}\n)\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\tin := []Inn{}\n\tfor i := 0; i < m; i++ {\n\t\tind := 0\n\t\tval := 0\n\t\tfmt.Scan(&ind, &val)\n\t\tif ind == 1 && val == 0 {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t\tin = append(in, Inn{\n\t\t\tindex: ind,\n\t\t\tvalue: val,\n\t\t})\n\t}\n\n\tfor i := int(math.Pow(10, float64(n-1))); i < int(math.Pow(10, float64(n))); i++ {\n\t\ttemp := strconv.Itoa(i)\n\t\tfor j, v := range in {\n\t\t\tif string(temp[v.index-1]) != strconv.Itoa(v.value) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif j == len(in)-1 {\n\t\t\t\tfmt.Println(i)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(-1)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "sample_input": "3 3\n1 7\n3 2\n1 7\n"}, "reference_outputs": ["702\n"], "source_document_id": "p02761", "source_text": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s067296132", "group_id": "codeNet:p02761", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\ntype (\n\tIn struct {\n\t\tindex int\n\t\tvalue int\n\t}\n)\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\tin := []In{}\n\tfor i := 0; i < m; i++ {\n\t\tind := 0\n\t\tval := 0\n\t\tfmt.Scan(&ind, &val)\n\t\tif ind == 1 && val == 0 {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t\tin = append(in, In{\n\t\t\tindex: ind,\n\t\t\tvalue: val,\n\t\t})\n\t}\n\n\tans := []In{}\n\tfor i := 0; i < m; i++ {\n\t\tif !notIn(in[i].index, in[i].value, ans) {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t\tif !iin(in[i].index, in[i].value, ans) {\n\t\t\tans = append(ans, in[i])\n\t\t}\n\t}\n\n\tfmt.Println(calc(n, ans))\n}\n\nfunc calc(n int, in []In) int {\n\tans := 0\n\tfor _, v := range in {\n\t\tans += int(math.Pow(10, float64(n-v.index)) * float64(v.value))\n\t}\n\treturn ans\n}\n\nfunc notIn(ind, val int, ans []In) bool {\n\tfor _, v := range ans {\n\t\tif v.index == ind && v.value != val {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc iin(ind, val int, ans []In) bool {\n\tfor _, v := range ans {\n\t\tif v.index == ind && v.value == val {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "language": "Go", "metadata": {"date": 1592163380, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02761.html", "problem_id": "p02761", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02761/input.txt", "sample_output_relpath": "derived/input_output/data/p02761/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02761/Go/s067296132.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s067296132", "user_id": "u370270364"}, "prompt_components": {"gold_output": "702\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\ntype (\n\tIn struct {\n\t\tindex int\n\t\tvalue int\n\t}\n)\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\tin := []In{}\n\tfor i := 0; i < m; i++ {\n\t\tind := 0\n\t\tval := 0\n\t\tfmt.Scan(&ind, &val)\n\t\tif ind == 1 && val == 0 {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t\tin = append(in, In{\n\t\t\tindex: ind,\n\t\t\tvalue: val,\n\t\t})\n\t}\n\n\tans := []In{}\n\tfor i := 0; i < m; i++ {\n\t\tif !notIn(in[i].index, in[i].value, ans) {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t\tif !iin(in[i].index, in[i].value, ans) {\n\t\t\tans = append(ans, in[i])\n\t\t}\n\t}\n\n\tfmt.Println(calc(n, ans))\n}\n\nfunc calc(n int, in []In) int {\n\tans := 0\n\tfor _, v := range in {\n\t\tans += int(math.Pow(10, float64(n-v.index)) * float64(v.value))\n\t}\n\treturn ans\n}\n\nfunc notIn(ind, val int, ans []In) bool {\n\tfor _, v := range ans {\n\t\tif v.index == ind && v.value != val {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc iin(ind, val int, ans []In) bool {\n\tfor _, v := range ans {\n\t\tif v.index == ind && v.value == val {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "sample_input": "3 3\n1 7\n3 2\n1 7\n"}, "reference_outputs": ["702\n"], "source_document_id": "p02761", "source_text": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1010, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s785982877", "group_id": "codeNet:p02761", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar n,m int\n\tfmt.Scan(&n,&m)\n\t\n\ts := make(map[int]int, m)\n\t\n\ttmpk, tmpv := 0, 0\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Scan(&tmpk,&tmpv)\n\t\tif s[tmpk] != 0 && s[tmpk] != tmpv {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t} else {\n\t\t\ts[tmpk] = tmpv\n\t\t}\n\t}\n\t//fmt.Println(s)\n\t\n\tans := make([]string, n)\n\t\n\tfor i := 0; i < n; i++{\n\t\tif s[i+1] == 0 {\n\t\t\tans[i] = \"0\"\n\t\t} else {\n\t\t\tans[i] = strconv.Itoa(s[i+1])\n\t\t}\n\t}\n\t\n\tif ans[0] == \"0\" {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\t\n\tfmt.Println(strings.Join(ans,\"\"))\n}", "language": "Go", "metadata": {"date": 1590191388, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02761.html", "problem_id": "p02761", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02761/input.txt", "sample_output_relpath": "derived/input_output/data/p02761/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02761/Go/s785982877.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s785982877", "user_id": "u689167014"}, "prompt_components": {"gold_output": "702\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar n,m int\n\tfmt.Scan(&n,&m)\n\t\n\ts := make(map[int]int, m)\n\t\n\ttmpk, tmpv := 0, 0\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Scan(&tmpk,&tmpv)\n\t\tif s[tmpk] != 0 && s[tmpk] != tmpv {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t} else {\n\t\t\ts[tmpk] = tmpv\n\t\t}\n\t}\n\t//fmt.Println(s)\n\t\n\tans := make([]string, n)\n\t\n\tfor i := 0; i < n; i++{\n\t\tif s[i+1] == 0 {\n\t\t\tans[i] = \"0\"\n\t\t} else {\n\t\t\tans[i] = strconv.Itoa(s[i+1])\n\t\t}\n\t}\n\t\n\tif ans[0] == \"0\" {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\t\n\tfmt.Println(strings.Join(ans,\"\"))\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "sample_input": "3 3\n1 7\n3 2\n1 7\n"}, "reference_outputs": ["702\n"], "source_document_id": "p02761", "source_text": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s408054561", "group_id": "codeNet:p02761", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar first, sc = mirLine(2)\n\tvar N, _ int = first[0], first[1]\n\n\tvar c []int = make([]int, 5)\n\tvar check []bool = make([]bool, 5)\n\n\tfor _, l := range sc {\n\t\tif check[l[0]-1] && c[l[0]-1] != l[1] {\n\t\t\tfmt.Printf(\"%d\", -1)\n\t\t\treturn\n\t\t}\n\n\t\tc[l[0]-1] = l[1]\n\t\tcheck[l[0]-1] = true\n\t}\n\n\tfor i, ch := range check {\n\t\tif !ch {\n\t\t\tif i == 0 && N > 1 {\n\t\t\t\tc[0] = 1\n\t\t\t} else {\n\t\t\t\tc[i] = 0\n\t\t\t}\n\t\t}\n\t}\n\n\tif c[0] == 0 && N > 1 {\n\t\tfmt.Printf(\"%d\", -1)\n\t\treturn\n\t}\n\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Printf(\"%d\", c[i])\n\t}\n\treturn\n}\n\n//minf returns min{a, b}(a, b: float64)\nfunc minf(a, b float64) float64 {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\n//mini returns min{a, b} (a, b: int)\nfunc mini(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\n//paw paw returns f^num\nfunc paw(f float64, num int) float64 {\n\tvar result float64 = 1\n\tfor i := 0; num > i; i++ {\n\t\tresult *= f\n\t}\n\treturn result\n}\n\n//StrStdin Read standard input data\nfunc StrStdin(line int) [][]string {\n\tvar stringInput [][]string\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\tfor i := 0; i < line; i++ {\n\t\tscanner.Scan()\n\t\tif s := scanner.Text(); s != \"\" {\n\t\t\tstringInput = append(stringInput, strings.Split(strings.TrimSpace((scanner.Text())), \" \"))\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn stringInput\n}\n\n//rLine Read all standard input data\nfunc rLine(line int) [][]string {\n\tvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\tvar buf = make([]byte, 0, 1000000)\n\tvar stringInput [][]string\n\n\tfor i := 0; i < line; {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tstringInput = append(stringInput, strings.Split(strings.TrimSpace((string(buf))), \" \"))\n\t\t\tbuf = []byte{}\n\t\t\ti++\n\t\t}\n\t}\n\treturn stringInput\n}\n\n//irLine Read Standard input data and convert into integer\nfunc irLine(i int) [][]int {\n\treturn alitoas(rLine(i))\n}\n\n//mtrLine Read multi-line standard input data\n// put the location of data of the number of lines in a first line\n//ex:\n// 3 5\n// 1 2\n// 2 3\n// 3 5\n// you have to put 1, where the number 3 put in the first line\nfunc mrLine(line int) (first []int, other [][]string) {\n\tvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\tvar buf = make([]byte, 0, 1000000)\n\tvar Input []string\n\tvar stringInput [][]string\n\n\t{\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tInput = strings.Split(strings.TrimSpace((string(buf))), \" \")\n\t\t\tbuf = []byte{}\n\t\t}\n\t}\n\n\tfirst = itoas(Input)\n\n\tfor i := 0; i < first[line-1]; {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tstringInput = append(stringInput, strings.Split(strings.TrimSpace((string(buf))), \" \"))\n\t\t\tbuf = []byte{}\n\t\t\ti++\n\t\t}\n\t}\n\treturn first, stringInput\n}\n\n//mirLine Read multi-line standard input data and convert into integer data\n// put the location of data of the number of lines in a first line\n//ex:\n// 3 5\n// 1 2\n// 2 3\n// 3 5\n// you have to put 1, where the number 3 put in the first line\nfunc mirLine(line int) (first []int, other [][]int) {\n\tvar f, o = mrLine(line)\n\treturn f, alitoas(o)\n}\n\n//itoa converts string to integer\nfunc itoa(s string) int {\n\tvar i, _ = strconv.Atoi(s)\n\treturn i\n}\n\n//itoas converts string slice to integer slice\nfunc itoas(S []string) []int {\n\tvar result = make([]int, len(S))\n\tfor i, s := range S {\n\t\tresult[i] = itoa(s)\n\t}\n\treturn result\n}\n\n//alitoas converts string 2 dimention slice to intger one\nfunc alitoas(S [][]string) [][]int {\n\tvar result = make([][]int, len(S))\n\tfor i, s := range S {\n\t\tresult[i] = itoas(s)\n\t}\n\treturn result\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc gcd3(a, b, c int) int {\n\treturn gcd(gcd(a, b), c)\n}\n", "language": "Go", "metadata": {"date": 1586967800, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02761.html", "problem_id": "p02761", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02761/input.txt", "sample_output_relpath": "derived/input_output/data/p02761/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02761/Go/s408054561.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s408054561", "user_id": "u051492823"}, "prompt_components": {"gold_output": "702\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar first, sc = mirLine(2)\n\tvar N, _ int = first[0], first[1]\n\n\tvar c []int = make([]int, 5)\n\tvar check []bool = make([]bool, 5)\n\n\tfor _, l := range sc {\n\t\tif check[l[0]-1] && c[l[0]-1] != l[1] {\n\t\t\tfmt.Printf(\"%d\", -1)\n\t\t\treturn\n\t\t}\n\n\t\tc[l[0]-1] = l[1]\n\t\tcheck[l[0]-1] = true\n\t}\n\n\tfor i, ch := range check {\n\t\tif !ch {\n\t\t\tif i == 0 && N > 1 {\n\t\t\t\tc[0] = 1\n\t\t\t} else {\n\t\t\t\tc[i] = 0\n\t\t\t}\n\t\t}\n\t}\n\n\tif c[0] == 0 && N > 1 {\n\t\tfmt.Printf(\"%d\", -1)\n\t\treturn\n\t}\n\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Printf(\"%d\", c[i])\n\t}\n\treturn\n}\n\n//minf returns min{a, b}(a, b: float64)\nfunc minf(a, b float64) float64 {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\n//mini returns min{a, b} (a, b: int)\nfunc mini(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\n\n//paw paw returns f^num\nfunc paw(f float64, num int) float64 {\n\tvar result float64 = 1\n\tfor i := 0; num > i; i++ {\n\t\tresult *= f\n\t}\n\treturn result\n}\n\n//StrStdin Read standard input data\nfunc StrStdin(line int) [][]string {\n\tvar stringInput [][]string\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\tfor i := 0; i < line; i++ {\n\t\tscanner.Scan()\n\t\tif s := scanner.Text(); s != \"\" {\n\t\t\tstringInput = append(stringInput, strings.Split(strings.TrimSpace((scanner.Text())), \" \"))\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn stringInput\n}\n\n//rLine Read all standard input data\nfunc rLine(line int) [][]string {\n\tvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\tvar buf = make([]byte, 0, 1000000)\n\tvar stringInput [][]string\n\n\tfor i := 0; i < line; {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tstringInput = append(stringInput, strings.Split(strings.TrimSpace((string(buf))), \" \"))\n\t\t\tbuf = []byte{}\n\t\t\ti++\n\t\t}\n\t}\n\treturn stringInput\n}\n\n//irLine Read Standard input data and convert into integer\nfunc irLine(i int) [][]int {\n\treturn alitoas(rLine(i))\n}\n\n//mtrLine Read multi-line standard input data\n// put the location of data of the number of lines in a first line\n//ex:\n// 3 5\n// 1 2\n// 2 3\n// 3 5\n// you have to put 1, where the number 3 put in the first line\nfunc mrLine(line int) (first []int, other [][]string) {\n\tvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\tvar buf = make([]byte, 0, 1000000)\n\tvar Input []string\n\tvar stringInput [][]string\n\n\t{\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tInput = strings.Split(strings.TrimSpace((string(buf))), \" \")\n\t\t\tbuf = []byte{}\n\t\t}\n\t}\n\n\tfirst = itoas(Input)\n\n\tfor i := 0; i < first[line-1]; {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tstringInput = append(stringInput, strings.Split(strings.TrimSpace((string(buf))), \" \"))\n\t\t\tbuf = []byte{}\n\t\t\ti++\n\t\t}\n\t}\n\treturn first, stringInput\n}\n\n//mirLine Read multi-line standard input data and convert into integer data\n// put the location of data of the number of lines in a first line\n//ex:\n// 3 5\n// 1 2\n// 2 3\n// 3 5\n// you have to put 1, where the number 3 put in the first line\nfunc mirLine(line int) (first []int, other [][]int) {\n\tvar f, o = mrLine(line)\n\treturn f, alitoas(o)\n}\n\n//itoa converts string to integer\nfunc itoa(s string) int {\n\tvar i, _ = strconv.Atoi(s)\n\treturn i\n}\n\n//itoas converts string slice to integer slice\nfunc itoas(S []string) []int {\n\tvar result = make([]int, len(S))\n\tfor i, s := range S {\n\t\tresult[i] = itoa(s)\n\t}\n\treturn result\n}\n\n//alitoas converts string 2 dimention slice to intger one\nfunc alitoas(S [][]string) [][]int {\n\tvar result = make([][]int, len(S))\n\tfor i, s := range S {\n\t\tresult[i] = itoas(s)\n\t}\n\treturn result\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc gcd3(a, b, c int) int {\n\treturn gcd(gcd(a, b), c)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "sample_input": "3 3\n1 7\n3 2\n1 7\n"}, "reference_outputs": ["702\n"], "source_document_id": "p02761", "source_text": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3759, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s058149123", "group_id": "codeNet:p02761", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar N, M, f, t int\n\tfmt.Scan(&N, &M)\n\ts := make([]int, M)\n\tc := make([]int, M)\n\tfor i := 0; i < M; i++ {\n\t\tfmt.Scan(&s[i], &c[i])\n\t}\n\tif N == 1 {\n\t\tf, t = 0, 10\n\t} else if N == 2 {\n\t\tf, t = 10, 100\n\t} else {\n\t\tf, t = 100, 1000\n\t}\n\tfor i := f; i < t; i++ {\n\t\tif calc(i, s, c) {\n\t\t\tfmt.Println(i)\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(-1)\n\n}\nfunc calc(n int, s, c []int) bool {\n\tw := strconv.Itoa(n)\n\tfor i := 0; i < len(s); i++ {\n\t\ts, _ := strconv.Atoi(string(w[s[i]-1]))\n\t\tif s != c[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n", "language": "Go", "metadata": {"date": 1585103008, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02761.html", "problem_id": "p02761", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02761/input.txt", "sample_output_relpath": "derived/input_output/data/p02761/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02761/Go/s058149123.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s058149123", "user_id": "u298152049"}, "prompt_components": {"gold_output": "702\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar N, M, f, t int\n\tfmt.Scan(&N, &M)\n\ts := make([]int, M)\n\tc := make([]int, M)\n\tfor i := 0; i < M; i++ {\n\t\tfmt.Scan(&s[i], &c[i])\n\t}\n\tif N == 1 {\n\t\tf, t = 0, 10\n\t} else if N == 2 {\n\t\tf, t = 10, 100\n\t} else {\n\t\tf, t = 100, 1000\n\t}\n\tfor i := f; i < t; i++ {\n\t\tif calc(i, s, c) {\n\t\t\tfmt.Println(i)\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(-1)\n\n}\nfunc calc(n int, s, c []int) bool {\n\tw := strconv.Itoa(n)\n\tfor i := 0; i < len(s); i++ {\n\t\ts, _ := strconv.Atoi(string(w[s[i]-1]))\n\t\tif s != c[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "sample_input": "3 3\n1 7\n3 2\n1 7\n"}, "reference_outputs": ["702\n"], "source_document_id": "p02761", "source_text": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 577, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s765468602", "group_id": "codeNet:p02761", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\n\tGuessTheNumber()\n\n\n}\n\n\nfunc GuessTheNumber() {\n\n\tvar N, M int\n\n\tfmt.Scan(&N, &M)\n\n\ts := make([]int, M)\n\tc := make([]int, M)\n\n\tfor i := 0; i < M; i++ {\n\n\t\tfmt.Scan(&s[i], &c[i])\n\t}\n\n\tresult := make([]int, N)\n\n\tketa := 0\n\tnumber := 0\n\n\tfor i := 0; i < M; i++ {\n\n\t\tketa = s[i]\n\t\tnumber = c[i]\n\n\t\tif s[i] c[i] {\n\t\t\tr[N-s[i]] = c[i]\n\t\t}\n\t}\n\tif r[N-1] == 0 {\n\t\tfmt.Printf(\"-1\\n\")\n\t\tfmt.Printf(\"B\\n\")\n\t\tos.Exit(0)\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tif i == N-1 && N > 1 && r[i] == 10 {\n\t\t\tr[i] = 1\n\t\t} else if r[i] == 10 {\n\t\t\tr[i] = 0\n\t\t}\n\t}\n\tpower := 1\n\tfor i := 0; i < N; i++ {\n\t\tres += power * r[i]\n\t\tpower *= 10\n\t}\n\n\t// fmt.Printf(\"%v\\n\", M)\n\t// fmt.Printf(\"%v\\n\", s)\n\t// fmt.Printf(\"%v\\n\", c)\n\n\tfmt.Printf(\"%d\\n\", res)\n}\n", "language": "Go", "metadata": {"date": 1583632050, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02761.html", "problem_id": "p02761", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02761/input.txt", "sample_output_relpath": "derived/input_output/data/p02761/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02761/Go/s770590411.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s770590411", "user_id": "u678848631"}, "prompt_components": {"gold_output": "702\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar N, M int\n\tvar s [6]int\n\tvar c [6]int\n\tvar r [6]int\n\n\tres := 0\n\n\tfmt.Scan(&N, &M)\n\tfor i := 0; i < N; i++ {\n\t\tr[i] = 10\n\t}\n\tfor i := 0; i < M; i++ {\n\t\tfmt.Scan(&s[i], &c[i])\n\t\tif r[N-s[i]] > c[i] {\n\t\t\tr[N-s[i]] = c[i]\n\t\t}\n\t}\n\tif r[N-1] == 0 {\n\t\tfmt.Printf(\"-1\\n\")\n\t\tfmt.Printf(\"B\\n\")\n\t\tos.Exit(0)\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tif i == N-1 && N > 1 && r[i] == 10 {\n\t\t\tr[i] = 1\n\t\t} else if r[i] == 10 {\n\t\t\tr[i] = 0\n\t\t}\n\t}\n\tpower := 1\n\tfor i := 0; i < N; i++ {\n\t\tres += power * r[i]\n\t\tpower *= 10\n\t}\n\n\t// fmt.Printf(\"%v\\n\", M)\n\t// fmt.Printf(\"%v\\n\", s)\n\t// fmt.Printf(\"%v\\n\", c)\n\n\tfmt.Printf(\"%d\\n\", res)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "sample_input": "3 3\n1 7\n3 2\n1 7\n"}, "reference_outputs": ["702\n"], "source_document_id": "p02761", "source_text": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 662, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s523287919", "group_id": "codeNet:p02761", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar N, M int\n\tvar s [6]int\n\tvar c [6]int\n\tvar r [6]int\n\n\tres := 0\n\n\tfmt.Scan(&N, &M)\n\tfor i := 0; i < N; i++ {\n\t\tr[i] = 10\n\t}\n\tif N > 1 && M == 0 {\n\t\tfmt.Printf(\"-1\\n\")\n\t\t// fmt.Printf(\"C\\n\")\n\t\tos.Exit(0)\n\t}\n\tfor i := 0; i < M; i++ {\n\t\tfmt.Scan(&s[i], &c[i])\n\t\tif r[N-s[i]] > c[i] {\n\t\t\tr[N-s[i]] = c[i]\n\t\t}\n\t}\n\tif r[N-1] == 0 {\n\t\tfmt.Printf(\"-1\\n\")\n\t\t// fmt.Printf(\"B\\n\")\n\t\tos.Exit(0)\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tif r[i] == 10 {\n\t\t\tr[i] = 0\n\t\t}\n\t}\n\tpower := 1\n\tfor i := 0; i < N; i++ {\n\t\tres += power * r[i]\n\t\tpower *= 10\n\t}\n\n\t// fmt.Printf(\"%v\\n\", M)\n\t// fmt.Printf(\"%v\\n\", s)\n\t// fmt.Printf(\"%v\\n\", c)\n\n\tfmt.Printf(\"%d\\n\", res)\n}\n", "language": "Go", "metadata": {"date": 1583630904, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02761.html", "problem_id": "p02761", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02761/input.txt", "sample_output_relpath": "derived/input_output/data/p02761/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02761/Go/s523287919.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s523287919", "user_id": "u678848631"}, "prompt_components": {"gold_output": "702\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar N, M int\n\tvar s [6]int\n\tvar c [6]int\n\tvar r [6]int\n\n\tres := 0\n\n\tfmt.Scan(&N, &M)\n\tfor i := 0; i < N; i++ {\n\t\tr[i] = 10\n\t}\n\tif N > 1 && M == 0 {\n\t\tfmt.Printf(\"-1\\n\")\n\t\t// fmt.Printf(\"C\\n\")\n\t\tos.Exit(0)\n\t}\n\tfor i := 0; i < M; i++ {\n\t\tfmt.Scan(&s[i], &c[i])\n\t\tif r[N-s[i]] > c[i] {\n\t\t\tr[N-s[i]] = c[i]\n\t\t}\n\t}\n\tif r[N-1] == 0 {\n\t\tfmt.Printf(\"-1\\n\")\n\t\t// fmt.Printf(\"B\\n\")\n\t\tos.Exit(0)\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tif r[i] == 10 {\n\t\t\tr[i] = 0\n\t\t}\n\t}\n\tpower := 1\n\tfor i := 0; i < N; i++ {\n\t\tres += power * r[i]\n\t\tpower *= 10\n\t}\n\n\t// fmt.Printf(\"%v\\n\", M)\n\t// fmt.Printf(\"%v\\n\", s)\n\t// fmt.Printf(\"%v\\n\", c)\n\n\tfmt.Printf(\"%d\\n\", res)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "sample_input": "3 3\n1 7\n3 2\n1 7\n"}, "reference_outputs": ["702\n"], "source_document_id": "p02761", "source_text": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 689, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s101712420", "group_id": "codeNet:p02761", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\n\tnum := make([]int, n)\n\tfor i := range num {\n\t\tnum[i] = -1\n\t}\n\n\tvar s, c int\n\tduplicatedDefinition := false\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Scanf(\"%d %d\", &s, &c)\n\t\tif num[s-1] != -1 && num[s-1] != c {\n\t\t\tduplicatedDefinition = true\n\t\t}\n\t\tnum[s-1] = c\n\t}\n\tif duplicatedDefinition {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tif (num[0] == 0 && n == 1) || (num[0] == -1 && n == 1) {\n\t\tfmt.Println(0)\n\t\treturn\n\t} else if num[0] == 0 {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\n\tanswer := \"\"\n\tfor i, val := range num {\n\t\tif val == -1 {\n\t\t\tif i == 0 {\n\t\t\t\tval = 1\n\t\t\t} else {\n\t\t\t\tval = 0\n\t\t\t}\n\t\t}\n\t\tanswer += fmt.Sprintf(\"%d\", val)\n\t}\n\n\tfmt.Println(answer)\n\n}\n", "language": "Go", "metadata": {"date": 1583156683, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02761.html", "problem_id": "p02761", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02761/input.txt", "sample_output_relpath": "derived/input_output/data/p02761/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02761/Go/s101712420.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s101712420", "user_id": "u238461782"}, "prompt_components": {"gold_output": "702\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\n\tnum := make([]int, n)\n\tfor i := range num {\n\t\tnum[i] = -1\n\t}\n\n\tvar s, c int\n\tduplicatedDefinition := false\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Scanf(\"%d %d\", &s, &c)\n\t\tif num[s-1] != -1 && num[s-1] != c {\n\t\t\tduplicatedDefinition = true\n\t\t}\n\t\tnum[s-1] = c\n\t}\n\tif duplicatedDefinition {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tif (num[0] == 0 && n == 1) || (num[0] == -1 && n == 1) {\n\t\tfmt.Println(0)\n\t\treturn\n\t} else if num[0] == 0 {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\n\tanswer := \"\"\n\tfor i, val := range num {\n\t\tif val == -1 {\n\t\t\tif i == 0 {\n\t\t\t\tval = 1\n\t\t\t} else {\n\t\t\t\tval = 0\n\t\t\t}\n\t\t}\n\t\tanswer += fmt.Sprintf(\"%d\", val)\n\t}\n\n\tfmt.Println(answer)\n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "sample_input": "3 3\n1 7\n3 2\n1 7\n"}, "reference_outputs": ["702\n"], "source_document_id": "p02761", "source_text": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s579031691", "group_id": "codeNet:p02761", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tvar sc [5][2]int\n\tvar n, m int\n\tvar ans [3]int\n\tfmt.Fscan(r, &n)\n\n\tif n < 1 {\n\t\tfmt.Println(\"-1\")\n\t\treturn\n\t}\n\tif m < 0 {\n\t\tfmt.Println(\"-1\")\n\t\treturn\n\t}\n\tif m > 5 {\n\t\tfmt.Println(\"-1\")\n\t\treturn\n\t}\n\tfmt.Fscan(r, &m)\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Fscan(r, &sc[i][0], &sc[i][1])\n\t}\n\tif n > 3 {\n\t\tfmt.Println(\"-1\")\n\t\treturn\n\t}\n\n\tvar l3 []int\n\tvar l2 []int\n\tvar l1 []int\n\tfor _, k := range sc {\n\t\tif k[0] == 3 {\n\t\t\tl3 = append(l3, k[1])\n\t\t}\n\t\tif k[0] == 2 {\n\t\t\tl2 = append(l2, k[1])\n\t\t}\n\t\tif k[0] == 1 {\n\t\t\tl1 = append(l1, k[1])\n\t\t}\n\t\tif k[1] < 0 {\n\t\t\tfmt.Println(\"-1\")\n\t\t\treturn\n\t\t}\n\t\tif k[1] >= 10 {\n\t\t\tfmt.Println(\"-1\")\n\t\t\treturn\n\t\t}\n\t}\n\n\thoge1 := removeDuplicate1(l3)\n\tif len(hoge1) > 1 {\n\t\tfmt.Println(\"-1\")\n\t\treturn\n\t}\n\tsort.Sort(sort.IntSlice(hoge1))\n\tif len(hoge1) < 1 {\n\t\thoge1 = append(hoge1, 0)\n\t}\n\n\thoge2 := removeDuplicate1(l2)\n\tif len(hoge2) > 1 {\n\t\tfmt.Println(\"-1\")\n\t\treturn\n\t}\n\tsort.Sort(sort.IntSlice(hoge2))\n\tif len(hoge2) < 1 {\n\t\thoge2 = append(hoge2, 0)\n\t}\n\n\thoge3 := removeDuplicate1(l1)\n\tif len(hoge3) > 1 {\n\t\tfmt.Println(\"-1\")\n\t\treturn\n\t}\n\tsort.Sort(sort.IntSlice(hoge3))\n\tif len(hoge3) < 1 {\n\t\thoge3 = append(hoge3, 0)\n\t}\n\n\tif n == 3 {\n\t\tans[2] = hoge3[0] * 100\n\t\tans[1] = hoge2[0] * 10\n\t\tans[0] = hoge1[0]\n\t}\n\n\tif n == 2 {\n\t\tans[1] = hoge2[0] * 10\n\t\tans[0] = hoge1[0]\n\t}\n\n\tif n == 1 {\n\t\tans[0] = hoge1[0]\n\t}\n\n\tif n == 3 {\n\t\tif ans[2] == 0 {\n\t\t\tfmt.Println(\"-1\")\n\t\t\treturn\n\t\t}\n\t\tfmt.Println(ans[2] + ans[1] + ans[0])\n\t\treturn\n\t}\n\tif n == 2 {\n\t\tif ans[1] == 0 {\n\t\t\tfmt.Println(\"-1\")\n\t\t\treturn\n\t\t}\n\t\tfmt.Println(ans[1] + ans[0])\n\t\treturn\n\t}\n\tif n == 1 {\n\t\tfmt.Println(ans[0])\n\t\treturn\n\t}\n}\n\nfunc removeDuplicate1(args []int) []int {\n\tresults := make([]int, 0, len(args))\n\tencountered := map[int]bool{}\n\tfor i := 0; i < len(args); i++ {\n\t\tif !encountered[args[i]] {\n\t\t\tencountered[args[i]] = true\n\t\t\tresults = append(results, args[i])\n\t\t}\n\t}\n\treturn results\n}\n", "language": "Go", "metadata": {"date": 1583124358, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02761.html", "problem_id": "p02761", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02761/input.txt", "sample_output_relpath": "derived/input_output/data/p02761/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02761/Go/s579031691.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s579031691", "user_id": "u404328319"}, "prompt_components": {"gold_output": "702\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tvar sc [5][2]int\n\tvar n, m int\n\tvar ans [3]int\n\tfmt.Fscan(r, &n)\n\n\tif n < 1 {\n\t\tfmt.Println(\"-1\")\n\t\treturn\n\t}\n\tif m < 0 {\n\t\tfmt.Println(\"-1\")\n\t\treturn\n\t}\n\tif m > 5 {\n\t\tfmt.Println(\"-1\")\n\t\treturn\n\t}\n\tfmt.Fscan(r, &m)\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Fscan(r, &sc[i][0], &sc[i][1])\n\t}\n\tif n > 3 {\n\t\tfmt.Println(\"-1\")\n\t\treturn\n\t}\n\n\tvar l3 []int\n\tvar l2 []int\n\tvar l1 []int\n\tfor _, k := range sc {\n\t\tif k[0] == 3 {\n\t\t\tl3 = append(l3, k[1])\n\t\t}\n\t\tif k[0] == 2 {\n\t\t\tl2 = append(l2, k[1])\n\t\t}\n\t\tif k[0] == 1 {\n\t\t\tl1 = append(l1, k[1])\n\t\t}\n\t\tif k[1] < 0 {\n\t\t\tfmt.Println(\"-1\")\n\t\t\treturn\n\t\t}\n\t\tif k[1] >= 10 {\n\t\t\tfmt.Println(\"-1\")\n\t\t\treturn\n\t\t}\n\t}\n\n\thoge1 := removeDuplicate1(l3)\n\tif len(hoge1) > 1 {\n\t\tfmt.Println(\"-1\")\n\t\treturn\n\t}\n\tsort.Sort(sort.IntSlice(hoge1))\n\tif len(hoge1) < 1 {\n\t\thoge1 = append(hoge1, 0)\n\t}\n\n\thoge2 := removeDuplicate1(l2)\n\tif len(hoge2) > 1 {\n\t\tfmt.Println(\"-1\")\n\t\treturn\n\t}\n\tsort.Sort(sort.IntSlice(hoge2))\n\tif len(hoge2) < 1 {\n\t\thoge2 = append(hoge2, 0)\n\t}\n\n\thoge3 := removeDuplicate1(l1)\n\tif len(hoge3) > 1 {\n\t\tfmt.Println(\"-1\")\n\t\treturn\n\t}\n\tsort.Sort(sort.IntSlice(hoge3))\n\tif len(hoge3) < 1 {\n\t\thoge3 = append(hoge3, 0)\n\t}\n\n\tif n == 3 {\n\t\tans[2] = hoge3[0] * 100\n\t\tans[1] = hoge2[0] * 10\n\t\tans[0] = hoge1[0]\n\t}\n\n\tif n == 2 {\n\t\tans[1] = hoge2[0] * 10\n\t\tans[0] = hoge1[0]\n\t}\n\n\tif n == 1 {\n\t\tans[0] = hoge1[0]\n\t}\n\n\tif n == 3 {\n\t\tif ans[2] == 0 {\n\t\t\tfmt.Println(\"-1\")\n\t\t\treturn\n\t\t}\n\t\tfmt.Println(ans[2] + ans[1] + ans[0])\n\t\treturn\n\t}\n\tif n == 2 {\n\t\tif ans[1] == 0 {\n\t\t\tfmt.Println(\"-1\")\n\t\t\treturn\n\t\t}\n\t\tfmt.Println(ans[1] + ans[0])\n\t\treturn\n\t}\n\tif n == 1 {\n\t\tfmt.Println(ans[0])\n\t\treturn\n\t}\n}\n\nfunc removeDuplicate1(args []int) []int {\n\tresults := make([]int, 0, len(args))\n\tencountered := map[int]bool{}\n\tfor i := 0; i < len(args); i++ {\n\t\tif !encountered[args[i]] {\n\t\t\tencountered[args[i]] = true\n\t\t\tresults = append(results, args[i])\n\t\t}\n\t}\n\treturn results\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "sample_input": "3 3\n1 7\n3 2\n1 7\n"}, "reference_outputs": ["702\n"], "source_document_id": "p02761", "source_text": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1983, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s405454125", "group_id": "codeNet:p02761", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// I/O\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextFloat() float64 {\n\tf, e := strconv.ParseFloat(s.nextStr(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc (s *Scanner) nextFloatSlice(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextFloat()\n\t}\n\treturn res\n}\n\nfunc main() {\n\tsolve(NewScanner())\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\ntype rule struct {\n\ts int\n\tc int\n}\n\nfunc solve(s *Scanner) {\n\twtr := bufio.NewWriter(os.Stdout)\n\n\tN, M := s.nextInt(), s.nextInt()\n\n\tss := make([]int, M)\n\tcs := make([]int, M)\n\n\tfor k := 0; k < M; k++ {\n\t\tss[k], cs[k] = s.nextInt(), s.nextInt()\n\t}\n\n\tansArray := make([]int, N)\n\n\tfor i := 1; i <= N; i++ {\n\t\tansArray[i-1] = 0\n\t\ttmps := 10\n\t\ttmpc := 10\n\t\tfor j := 0; j < M; j++ {\n\t\t\tif ss[j] == i {\n\t\t\t\tansArray[i-1] = cs[j]\n\t\t\t\tif tmps == ss[j] && tmpc != cs[j] {\n\t\t\t\t\tfmt.Fprintln(wtr, \"-1\")\n\t\t\t\t\twtr.Flush()\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\ttmps = ss[j]\n\t\t\t\ttmpc = cs[j]\n\t\t\t}\n\t\t}\n\t}\n\n\tif M == 0 {\n\t\tif N == 1 {\n\t\t\tfmt.Fprintln(wtr, \"0\")\n\t\t\twtr.Flush()\n\t\t\treturn\n\t\t}\n\n\t\tansArray[0] = 1\n\t}\n\n\tif ansArray[0] == 0 {\n\t\tfmt.Fprintln(wtr, \"-1\")\n\t\twtr.Flush()\n\t\treturn\n\t}\n\n\tans := \"\"\n\tfor i := 0; i < len(ansArray); i++ {\n\t\tans += strconv.Itoa(ansArray[i])\n\t}\n\n\tfmt.Fprintln(wtr, ans)\n\twtr.Flush()\n}\n", "language": "Go", "metadata": {"date": 1583123459, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02761.html", "problem_id": "p02761", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02761/input.txt", "sample_output_relpath": "derived/input_output/data/p02761/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02761/Go/s405454125.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s405454125", "user_id": "u058781705"}, "prompt_components": {"gold_output": "702\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// I/O\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextFloat() float64 {\n\tf, e := strconv.ParseFloat(s.nextStr(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc (s *Scanner) nextFloatSlice(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextFloat()\n\t}\n\treturn res\n}\n\nfunc main() {\n\tsolve(NewScanner())\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\ntype rule struct {\n\ts int\n\tc int\n}\n\nfunc solve(s *Scanner) {\n\twtr := bufio.NewWriter(os.Stdout)\n\n\tN, M := s.nextInt(), s.nextInt()\n\n\tss := make([]int, M)\n\tcs := make([]int, M)\n\n\tfor k := 0; k < M; k++ {\n\t\tss[k], cs[k] = s.nextInt(), s.nextInt()\n\t}\n\n\tansArray := make([]int, N)\n\n\tfor i := 1; i <= N; i++ {\n\t\tansArray[i-1] = 0\n\t\ttmps := 10\n\t\ttmpc := 10\n\t\tfor j := 0; j < M; j++ {\n\t\t\tif ss[j] == i {\n\t\t\t\tansArray[i-1] = cs[j]\n\t\t\t\tif tmps == ss[j] && tmpc != cs[j] {\n\t\t\t\t\tfmt.Fprintln(wtr, \"-1\")\n\t\t\t\t\twtr.Flush()\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\ttmps = ss[j]\n\t\t\t\ttmpc = cs[j]\n\t\t\t}\n\t\t}\n\t}\n\n\tif M == 0 {\n\t\tif N == 1 {\n\t\t\tfmt.Fprintln(wtr, \"0\")\n\t\t\twtr.Flush()\n\t\t\treturn\n\t\t}\n\n\t\tansArray[0] = 1\n\t}\n\n\tif ansArray[0] == 0 {\n\t\tfmt.Fprintln(wtr, \"-1\")\n\t\twtr.Flush()\n\t\treturn\n\t}\n\n\tans := \"\"\n\tfor i := 0; i < len(ansArray); i++ {\n\t\tans += strconv.Itoa(ansArray[i])\n\t}\n\n\tfmt.Fprintln(wtr, ans)\n\twtr.Flush()\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "sample_input": "3 3\n1 7\n3 2\n1 7\n"}, "reference_outputs": ["702\n"], "source_document_id": "p02761", "source_text": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1968, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s477471504", "group_id": "codeNet:p02761", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// I/O\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextFloat() float64 {\n\tf, e := strconv.ParseFloat(s.nextStr(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc (s *Scanner) nextFloatSlice(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextFloat()\n\t}\n\treturn res\n}\n\nfunc main() {\n\tsolve(NewScanner())\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\ntype rule struct {\n\ts int\n\tc int\n}\n\nfunc solve(s *Scanner) {\n\twtr := bufio.NewWriter(os.Stdout)\n\n\tN, M := s.nextInt(), s.nextInt()\n\n\tss := make([]int, M)\n\tcs := make([]int, M)\n\n\tfor k := 0; k < M; k++ {\n\t\tss[k], cs[k] = s.nextInt(), s.nextInt()\n\t}\n\n\tansArray := make([]int, N)\n\n\tfor i := 1; i <= N; i++ {\n\t\tansArray[i-1] = 0\n\t\ttmp := 10\n\t\tfor j := 0; j < M; j++ {\n\t\t\tif ss[j] == i {\n\t\t\t\tif cs[j] < tmp {\n\t\t\t\t\tansArray[i-1] = cs[j]\n\t\t\t\t}\n\t\t\t\ttmp = cs[j]\n\t\t\t}\n\t\t}\n\t}\n\n\tif M == 0 {\n\t\tif N == 1 {\n\t\t\tfmt.Fprintln(wtr, \"0\")\n\t\t\twtr.Flush()\n\t\t\treturn\n\t\t}\n\n\t\tansArray[0] = 1\n\t}\n\n\tif ansArray[0] == 0 {\n\t\tfmt.Fprintln(wtr, \"-1\")\n\t\twtr.Flush()\n\t\treturn\n\t}\n\n\tans := \"\"\n\tfor i := 0; i < len(ansArray); i++ {\n\t\tans += strconv.Itoa(ansArray[i])\n\t}\n\n\tfmt.Fprintln(wtr, ans)\n\twtr.Flush()\n}\n", "language": "Go", "metadata": {"date": 1583120284, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02761.html", "problem_id": "p02761", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02761/input.txt", "sample_output_relpath": "derived/input_output/data/p02761/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02761/Go/s477471504.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s477471504", "user_id": "u058781705"}, "prompt_components": {"gold_output": "702\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// I/O\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextFloat() float64 {\n\tf, e := strconv.ParseFloat(s.nextStr(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc (s *Scanner) nextFloatSlice(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextFloat()\n\t}\n\treturn res\n}\n\nfunc main() {\n\tsolve(NewScanner())\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\ntype rule struct {\n\ts int\n\tc int\n}\n\nfunc solve(s *Scanner) {\n\twtr := bufio.NewWriter(os.Stdout)\n\n\tN, M := s.nextInt(), s.nextInt()\n\n\tss := make([]int, M)\n\tcs := make([]int, M)\n\n\tfor k := 0; k < M; k++ {\n\t\tss[k], cs[k] = s.nextInt(), s.nextInt()\n\t}\n\n\tansArray := make([]int, N)\n\n\tfor i := 1; i <= N; i++ {\n\t\tansArray[i-1] = 0\n\t\ttmp := 10\n\t\tfor j := 0; j < M; j++ {\n\t\t\tif ss[j] == i {\n\t\t\t\tif cs[j] < tmp {\n\t\t\t\t\tansArray[i-1] = cs[j]\n\t\t\t\t}\n\t\t\t\ttmp = cs[j]\n\t\t\t}\n\t\t}\n\t}\n\n\tif M == 0 {\n\t\tif N == 1 {\n\t\t\tfmt.Fprintln(wtr, \"0\")\n\t\t\twtr.Flush()\n\t\t\treturn\n\t\t}\n\n\t\tansArray[0] = 1\n\t}\n\n\tif ansArray[0] == 0 {\n\t\tfmt.Fprintln(wtr, \"-1\")\n\t\twtr.Flush()\n\t\treturn\n\t}\n\n\tans := \"\"\n\tfor i := 0; i < len(ansArray); i++ {\n\t\tans += strconv.Itoa(ansArray[i])\n\t}\n\n\tfmt.Fprintln(wtr, ans)\n\twtr.Flush()\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "sample_input": "3 3\n1 7\n3 2\n1 7\n"}, "reference_outputs": ["702\n"], "source_document_id": "p02761", "source_text": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1860, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s637453268", "group_id": "codeNet:p02761", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn, m := nextInt(), nextInt()\n\n\tnum := make(map[int]int, n)\n\tfor i := 0; i 1 && answerString[0] == \"*\" {\n answerString[0] = \"1\"\n } else if len(answerString) == 1 && answerString[0] == \"*\" {\n answerString[0] = \"0\"\n }\n\n for i:=1; i 1 && answerString[0] == \"0\" {\n fmt.Println(\"-1\")\n return\n }\n\n fmt.Println(strings.Join(answerString, \"\"))\n}\n", "language": "Go", "metadata": {"date": 1583119064, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02761.html", "problem_id": "p02761", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02761/input.txt", "sample_output_relpath": "derived/input_output/data/p02761/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02761/Go/s101358371.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s101358371", "user_id": "u710397679"}, "prompt_components": {"gold_output": "702\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"sort\"\n \"strconv\"\n \"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextLine() string {\n sc.Scan()\n return sc.Text()\n}\n\nfunc nextLineValue() int {\n sc.Scan()\n return getInt(sc.Text())\n}\n\nfunc nextLineValues() []int {\n sc.Scan()\n return getIntArray(sc.Text())\n}\n\nfunc getInt(s string) int {\n v, _ := strconv.Atoi(s)\n return v\n}\n\nfunc getIntArray(s string) []int {\n var v []int\n valstr := strings.Split(s, \" \")\n for _, c := range valstr {\n va, _ := strconv.Atoi(c)\n v = append(v, va)\n }\n return v\n}\n\nfunc digitTotal(v int) int {\n total := 0\n d := strings.Split(strconv.Itoa(v), \"\")\n for _, c := range d {\n dv, _ := strconv.Atoi(c)\n total += dv\n }\n return total\n}\n\nfunc sortDesc(v *[]int) {\n sort.Sort(sort.Reverse(sort.IntSlice(*v)))\n}\n\nfunc removeDupIntSlice(values *[]int) []int {\n m := make(map[int]bool)\n uniq := []int{}\n for _, v := range *values {\n if !m[v] {\n uniq = append(uniq, v)\n m[v] = true\n }\n }\n return uniq\n}\n\n\n\nfunc main() {\n nm := nextLineValues()\n\n answerString := make([]string, nm[0])\n for i:=0; i 1 && answerString[0] == \"*\" {\n answerString[0] = \"1\"\n } else if len(answerString) == 1 && answerString[0] == \"*\" {\n answerString[0] = \"0\"\n }\n\n for i:=1; i 1 && answerString[0] == \"0\" {\n fmt.Println(\"-1\")\n return\n }\n\n fmt.Println(strings.Join(answerString, \"\"))\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "sample_input": "3 3\n1 7\n3 2\n1 7\n"}, "reference_outputs": ["702\n"], "source_document_id": "p02761", "source_text": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1826, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s321866286", "group_id": "codeNet:p02761", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\n\tcharNumber := make([]byte, n)\n\tvar s, c int\n\tduplicatedDefinition := false\n\tzeroSpecifiedAt := 99\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Scanf(\"%d %d\", &s, &c)\n\t\tnewNumber := byte(c + 48)\n\t\tif charNumber[s-1] != 0 && charNumber[s-1] != newNumber {\n\t\t\tduplicatedDefinition = true\n\t\t}\n\t\tcharNumber[s-1] = newNumber\n\t\tif c == 0 && zeroSpecifiedAt > s {\n\t\t\tzeroSpecifiedAt = s\n\t\t}\n\t}\n\tif m == 1 && charNumber[0] == 48 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tif duplicatedDefinition {\n\t\tfmt.Println(-1)\n\t\tos.Exit(0)\n\t}\n\tif zeroSpecifiedAt == 1 {\n\t\tfmt.Println(-1)\n\t\treturn\n\t} else if zeroSpecifiedAt > 1 && zeroSpecifiedAt != 99 {\n\t\tneedToSetOneAtTop := true\n\t\tfor i := zeroSpecifiedAt - 1; i >= 0; i-- {\n\t\t\tif charNumber[i] != 0 {\n\t\t\t\tneedToSetOneAtTop = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif needToSetOneAtTop {\n\t\t\tcharNumber[0] = 1 + 48\n\t\t}\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tif charNumber[i] == 0 {\n\t\t\tcharNumber[i] = 48 // set zero\n\t\t}\n\t}\n\tif charNumber[0] == 48 {\n\t\tcharNumber[0] = 49 // head of digit cannot be zero\n\t}\n\n\tstrNumber := string(charNumber)\n\n\tanswer, err := strconv.ParseInt(strNumber, 10, 64)\n\n\tif err == nil && countDigit(answer) == n {\n\t\tfmt.Println(answer)\n\t} else {\n\t\tfmt.Println(-1)\n\t}\n}\n\nfunc countDigit(n int64) int {\n\tcnt := 1\n\tfor n/10 > 0 {\n\t\tn = n / 10\n\t\tcnt++\n\t}\n\treturn cnt\n}\n", "language": "Go", "metadata": {"date": 1583118692, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02761.html", "problem_id": "p02761", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02761/input.txt", "sample_output_relpath": "derived/input_output/data/p02761/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02761/Go/s321866286.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s321866286", "user_id": "u238461782"}, "prompt_components": {"gold_output": "702\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\n\tcharNumber := make([]byte, n)\n\tvar s, c int\n\tduplicatedDefinition := false\n\tzeroSpecifiedAt := 99\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Scanf(\"%d %d\", &s, &c)\n\t\tnewNumber := byte(c + 48)\n\t\tif charNumber[s-1] != 0 && charNumber[s-1] != newNumber {\n\t\t\tduplicatedDefinition = true\n\t\t}\n\t\tcharNumber[s-1] = newNumber\n\t\tif c == 0 && zeroSpecifiedAt > s {\n\t\t\tzeroSpecifiedAt = s\n\t\t}\n\t}\n\tif m == 1 && charNumber[0] == 48 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tif duplicatedDefinition {\n\t\tfmt.Println(-1)\n\t\tos.Exit(0)\n\t}\n\tif zeroSpecifiedAt == 1 {\n\t\tfmt.Println(-1)\n\t\treturn\n\t} else if zeroSpecifiedAt > 1 && zeroSpecifiedAt != 99 {\n\t\tneedToSetOneAtTop := true\n\t\tfor i := zeroSpecifiedAt - 1; i >= 0; i-- {\n\t\t\tif charNumber[i] != 0 {\n\t\t\t\tneedToSetOneAtTop = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif needToSetOneAtTop {\n\t\t\tcharNumber[0] = 1 + 48\n\t\t}\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tif charNumber[i] == 0 {\n\t\t\tcharNumber[i] = 48 // set zero\n\t\t}\n\t}\n\tif charNumber[0] == 48 {\n\t\tcharNumber[0] = 49 // head of digit cannot be zero\n\t}\n\n\tstrNumber := string(charNumber)\n\n\tanswer, err := strconv.ParseInt(strNumber, 10, 64)\n\n\tif err == nil && countDigit(answer) == n {\n\t\tfmt.Println(answer)\n\t} else {\n\t\tfmt.Println(-1)\n\t}\n}\n\nfunc countDigit(n int64) int {\n\tcnt := 1\n\tfor n/10 > 0 {\n\t\tn = n / 10\n\t\tcnt++\n\t}\n\treturn cnt\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "sample_input": "3 3\n1 7\n3 2\n1 7\n"}, "reference_outputs": ["702\n"], "source_document_id": "p02761", "source_text": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1385, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s048125751", "group_id": "codeNet:p02761", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\tnums := make([]int, n)\n\tvar s, c int\n\tvar flag, flag2 bool\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Scanf(\"%d %d\", &s, &c)\n\t\tif s == 1 && c == 0 {\n\t\t\tflag = true\n\t\t}\n\t\tif nums[s-1] == 0 || nums[s-1] == c {\n\t\t\tnums[s-1] = c\n\t\t} else {\n\t\t\tflag2 = true\n\t\t}\n\t}\n\tif flag {\n\t\tfmt.Print(\"1\")\n\t\tfor i := 1; i < n; i++ {\n\t\t\tfmt.Print(\"0\")\n\t\t}\n\t\treturn\n\t}\n\tif flag2 {\n\t\tfmt.Println(\"-1\")\n\t\treturn\n\t}\n\tif m == 0 {\n\t\tif n == 1 {\n\t\t\tfmt.Println(\"0\")\n\t\t\treturn\n\t\t}\n\t\tfmt.Print(\"1\")\n\t\tfor i := 1; i < n; i++ {\n\t\t\tfmt.Print(\"0\")\n\t\t}\n\t\treturn\n\t}\n\tif n > 2 && nums[0] == 0 {\n\t\tfmt.Println(\"-1\")\n\t\treturn\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Print(nums[i])\n\t}\n}\n", "language": "Go", "metadata": {"date": 1583118409, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02761.html", "problem_id": "p02761", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02761/input.txt", "sample_output_relpath": "derived/input_output/data/p02761/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02761/Go/s048125751.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s048125751", "user_id": "u422903328"}, "prompt_components": {"gold_output": "702\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scanf(\"%d %d\", &n, &m)\n\tnums := make([]int, n)\n\tvar s, c int\n\tvar flag, flag2 bool\n\tfor i := 0; i < m; i++ {\n\t\tfmt.Scanf(\"%d %d\", &s, &c)\n\t\tif s == 1 && c == 0 {\n\t\t\tflag = true\n\t\t}\n\t\tif nums[s-1] == 0 || nums[s-1] == c {\n\t\t\tnums[s-1] = c\n\t\t} else {\n\t\t\tflag2 = true\n\t\t}\n\t}\n\tif flag {\n\t\tfmt.Print(\"1\")\n\t\tfor i := 1; i < n; i++ {\n\t\t\tfmt.Print(\"0\")\n\t\t}\n\t\treturn\n\t}\n\tif flag2 {\n\t\tfmt.Println(\"-1\")\n\t\treturn\n\t}\n\tif m == 0 {\n\t\tif n == 1 {\n\t\t\tfmt.Println(\"0\")\n\t\t\treturn\n\t\t}\n\t\tfmt.Print(\"1\")\n\t\tfor i := 1; i < n; i++ {\n\t\t\tfmt.Print(\"0\")\n\t\t}\n\t\treturn\n\t}\n\tif n > 2 && nums[0] == 0 {\n\t\tfmt.Println(\"-1\")\n\t\treturn\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Print(nums[i])\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "sample_input": "3 3\n1 7\n3 2\n1 7\n"}, "reference_outputs": ["702\n"], "source_document_id": "p02761", "source_text": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 717, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s681320349", "group_id": "codeNet:p02761", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000009\n)\n\nvar buf []byte = make([]byte, maxBufSize)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBufSize)\n}\n\nfunc main() {\n\tN := nextInt()\n\tM := nextInt()\n\tconditions := make([]int, N)\n\tnums := make([]int, N)\n\tfor i := 0; i < M; i++ {\n\t\ts := nextInt() - 1\n\t\tc := nextInt()\n\t\tif conditions[s] == 1 && nums[s] != c {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t\tnums[s] = c\n\t\tconditions[s] = 1\n\t\t// fmt.Println(nums)\n\t}\n\tans := nums[0]*100 + nums[1]*10 + nums[2]\n\tif nums[0] == 0 {\n\t\tfmt.Println(-1)\n\t} else if ans >= 0 {\n\t\tfmt.Println(ans)\n\t} else {\n\t\tfmt.Println(-1)\n\t}\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n", "language": "Go", "metadata": {"date": 1583118263, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02761.html", "problem_id": "p02761", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02761/input.txt", "sample_output_relpath": "derived/input_output/data/p02761/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02761/Go/s681320349.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s681320349", "user_id": "u605443479"}, "prompt_components": {"gold_output": "702\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000009\n)\n\nvar buf []byte = make([]byte, maxBufSize)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBufSize)\n}\n\nfunc main() {\n\tN := nextInt()\n\tM := nextInt()\n\tconditions := make([]int, N)\n\tnums := make([]int, N)\n\tfor i := 0; i < M; i++ {\n\t\ts := nextInt() - 1\n\t\tc := nextInt()\n\t\tif conditions[s] == 1 && nums[s] != c {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t\tnums[s] = c\n\t\tconditions[s] = 1\n\t\t// fmt.Println(nums)\n\t}\n\tans := nums[0]*100 + nums[1]*10 + nums[2]\n\tif nums[0] == 0 {\n\t\tfmt.Println(-1)\n\t} else if ans >= 0 {\n\t\tfmt.Println(ans)\n\t} else {\n\t\tfmt.Println(-1)\n\t}\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "sample_input": "3 3\n1 7\n3 2\n1 7\n"}, "reference_outputs": ["702\n"], "source_document_id": "p02761", "source_text": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 834, "cpu_time_ms": 16, "memory_kb": 32128}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s308458416", "group_id": "codeNet:p02761", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn, m := nextInt(), nextInt()\n\n\tnum := make(map[int]int, n)\n\tfor i := 0; i max {\n\t\t\tmax = n\n\t\t}\n\t}\n\treturn max\n}\nfunc min(ns ...int) int {\n\tmin := ns[0]\n\tfor _, n := range ns {\n\t\tif n < min {\n\t\t\tmin = n\n\t\t}\n\t}\n\treturn min\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\ntype SC struct {\n\ts int\n\tc int\n\tN int\n}\n\nfunc (sc *SC) check(n int) bool {\n\tswitch sc.N {\n\tcase 1:\n\t\treturn n == sc.c\n\tcase 2:\n\t\tswitch sc.s {\n\t\tcase 1:\n\t\t\treturn n/10 == sc.c\n\t\tcase 2:\n\t\t\treturn n%10 == sc.c\n\t\t}\n\tcase 3:\n\t\tswitch sc.s {\n\t\tcase 1:\n\t\t\treturn n/100 == sc.c\n\t\tcase 2:\n\t\t\treturn (n%100)/10 == sc.c\n\t\tcase 3:\n\t\t\treturn n%10 == sc.c\n\t\t}\n\t}\n\treturn false\n}\n\nfunc main() {\n\tN, M := readInt2()\n\tvar start, end int\n\tswitch N {\n\tcase 1:\n\t\tstart = 0\n\t\tend = 9\n\tcase 2:\n\t\tstart = 10\n\t\tend = 99\n\tcase 3:\n\t\tstart = 100\n\t\tend = 999\n\t}\n\n\tsc := make([]SC, M)\n\tfor i := 0; i < M; i++ {\n\t\ts, c := readInt2()\n\t\tsc[i] = SC{s: s, c: c, N: N}\n\t}\n\n\tfor n := start; n <= end; n++ {\n\t\tisFulfill := true\n\t\tfor i := 0; i < M; i++ {\n\t\t\tif !sc[i].check(n) {\n\t\t\t\tisFulfill = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif isFulfill {\n\t\t\tfmt.Println(n)\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(-1)\n\n}\n\n//func main() {\n//\tN, M := readInt2()\n//\n//\tvar str string\n//\tfor i := 0; i < N; i++ {\n//\t\tstr += \"a\"\n//\t}\n//\n//\tfor i := 0; i < M; i++ {\n//\t\ts, c := readInt2()\n//\t\ttarget := string(str[s-1])\n//\t\tif target == \"a\" || target == strconv.Itoa(c) {\n//\t\t\tstr = str[:s-1] + strconv.Itoa(c) + str[s:]\n//\t\t} else {\n//\t\t\tfmt.Println(-1)\n//\t\t\treturn\n//\t\t}\n//\t}\n//\n//\tstr = strings.Replace(str, \"a\", \"0\", -1)\n//\n//\tif N != 1 && string(str[0]) == \"0\" {\n//\t\tfmt.Println(-1)\n//\t\treturn\n//\t}\n//\tresult, _ := strconv.Atoi(str)\n//\tfmt.Println(result)\n//}\n", "language": "Go", "metadata": {"date": 1583117378, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02761.html", "problem_id": "p02761", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02761/input.txt", "sample_output_relpath": "derived/input_output/data/p02761/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02761/Go/s225856243.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s225856243", "user_id": "u502098699"}, "prompt_components": {"gold_output": "702\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner\n\nfunc init() {\n\t// 100MB\n\tbufsize := 100 * 1024 * 1024\n\tsc = bufio.NewScanner(os.Stdin)\n\tsc.Buffer(make([]byte, bufio.MaxScanTokenSize), bufsize)\n\tsc.Split(bufio.ScanWords)\n}\nfunc readInt() int { return readIntArray(1)[0] }\nfunc readInt2() (int, int) { a := readIntArray(2); return a[0], a[1] }\nfunc readInt3() (int, int, int) { a := readIntArray(3); return a[0], a[1], a[2] }\nfunc readIntArray(n int) []int {\n\ts := readStringArray(n)\n\ta := make([]int, n)\n\tfor i := range a {\n\t\ta[i], _ = strconv.Atoi(s[i])\n\t}\n\treturn a\n}\nfunc readString() string { return readStringArray(1)[0] }\nfunc readString2() (string, string) { a := readStringArray(2); return a[0], a[1] }\nfunc readStringArray(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tsc.Scan()\n\t\ta[i] = sc.Text()\n\t}\n\treturn a\n}\nfunc max(ns ...int) int {\n\tmax := ns[0]\n\tfor _, n := range ns {\n\t\tif n > max {\n\t\t\tmax = n\n\t\t}\n\t}\n\treturn max\n}\nfunc min(ns ...int) int {\n\tmin := ns[0]\n\tfor _, n := range ns {\n\t\tif n < min {\n\t\t\tmin = n\n\t\t}\n\t}\n\treturn min\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\ntype SC struct {\n\ts int\n\tc int\n\tN int\n}\n\nfunc (sc *SC) check(n int) bool {\n\tswitch sc.N {\n\tcase 1:\n\t\treturn n == sc.c\n\tcase 2:\n\t\tswitch sc.s {\n\t\tcase 1:\n\t\t\treturn n/10 == sc.c\n\t\tcase 2:\n\t\t\treturn n%10 == sc.c\n\t\t}\n\tcase 3:\n\t\tswitch sc.s {\n\t\tcase 1:\n\t\t\treturn n/100 == sc.c\n\t\tcase 2:\n\t\t\treturn (n%100)/10 == sc.c\n\t\tcase 3:\n\t\t\treturn n%10 == sc.c\n\t\t}\n\t}\n\treturn false\n}\n\nfunc main() {\n\tN, M := readInt2()\n\tvar start, end int\n\tswitch N {\n\tcase 1:\n\t\tstart = 0\n\t\tend = 9\n\tcase 2:\n\t\tstart = 10\n\t\tend = 99\n\tcase 3:\n\t\tstart = 100\n\t\tend = 999\n\t}\n\n\tsc := make([]SC, M)\n\tfor i := 0; i < M; i++ {\n\t\ts, c := readInt2()\n\t\tsc[i] = SC{s: s, c: c, N: N}\n\t}\n\n\tfor n := start; n <= end; n++ {\n\t\tisFulfill := true\n\t\tfor i := 0; i < M; i++ {\n\t\t\tif !sc[i].check(n) {\n\t\t\t\tisFulfill = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif isFulfill {\n\t\t\tfmt.Println(n)\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(-1)\n\n}\n\n//func main() {\n//\tN, M := readInt2()\n//\n//\tvar str string\n//\tfor i := 0; i < N; i++ {\n//\t\tstr += \"a\"\n//\t}\n//\n//\tfor i := 0; i < M; i++ {\n//\t\ts, c := readInt2()\n//\t\ttarget := string(str[s-1])\n//\t\tif target == \"a\" || target == strconv.Itoa(c) {\n//\t\t\tstr = str[:s-1] + strconv.Itoa(c) + str[s:]\n//\t\t} else {\n//\t\t\tfmt.Println(-1)\n//\t\t\treturn\n//\t\t}\n//\t}\n//\n//\tstr = strings.Replace(str, \"a\", \"0\", -1)\n//\n//\tif N != 1 && string(str[0]) == \"0\" {\n//\t\tfmt.Println(-1)\n//\t\treturn\n//\t}\n//\tresult, _ := strconv.Atoi(str)\n//\tfmt.Println(result)\n//}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "sample_input": "3 3\n1 7\n3 2\n1 7\n"}, "reference_outputs": ["702\n"], "source_document_id": "p02761", "source_text": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2587, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s372166694", "group_id": "codeNet:p02761", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar s []int\nvar c []int\n\nfunc checkDigits(num int) int {\n\tif num == 0 {\n\t\treturn 1\n\t}\n\n\tdigits := 0\n\tfor num > 0 {\n\t\tnum /= 10\n\t\tdigits++\n\t}\n\n\treturn digits\n}\n\nvar dic map[int]int\n\nfunc main() {\n\tvar n, m int\n\n\tn = readInt()\n\tm = readInt()\n\tdic = make(map[int]int, 0)\n\n\ts = make([]int, m)\n\tc = make([]int, m)\n\tmin, max := math.MaxInt64, 0\n\tfor i := 0; i < m; i++ {\n\t\ts[i] = readInt()\n\t\tc[i] = readInt()\n\t\tdic[s[i]] = c[i]\n\t\tif s[i] > max {\n\t\t\tmax = s[i]\n\t\t}\n\t\tif s[i] < min {\n\t\t\tmin = s[i]\n\t\t}\n\t\t//fmt.Printf(\"s[%d] = %d, c[%d] = %d\\n\", i, s[i], i, c[i])\n\t}\n\n\t//fmt.Printf(\"n = %d, m = %d\\n\", n, m)\n\t/*\n\t\tfor k, v := range dic {\n\t\t\tfmt.Printf(\"dic[%d] = %d\\n\", k, v)\n\t\t}\n\t*/\n\tif n == max {\n\t\tresStr := make([]rune, max)\n\t\tfor i := 1; i <= max; i++ {\n\t\t\tif _, exist := dic[i]; exist {\n\t\t\t\tresStr[i-1] = rune(dic[i] + '0')\n\t\t\t} else {\n\t\t\t\tresStr[i-1] = '0'\n\t\t\t}\n\t\t}\n\n\t\tfmt.Println(string(resStr))\n\n\t} else {\n\t\tfmt.Println(-1)\n\n\t}\n}\n\nconst (\n\tioBufferSize = 1 * 1024 * 1024 // 1 MB\n)\n\nvar stdinScanner = func() *bufio.Scanner {\n\tresult := bufio.NewScanner(os.Stdin)\n\tresult.Buffer(make([]byte, ioBufferSize), ioBufferSize)\n\tresult.Split(bufio.ScanWords)\n\treturn result\n}()\n\nfunc readString() string {\n\tstdinScanner.Scan()\n\treturn stdinScanner.Text()\n}\n\nfunc readInt() int {\n\tresult, err := strconv.Atoi(readString())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn result\n}\n", "language": "Go", "metadata": {"date": 1583117206, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02761.html", "problem_id": "p02761", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02761/input.txt", "sample_output_relpath": "derived/input_output/data/p02761/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02761/Go/s372166694.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s372166694", "user_id": "u067604172"}, "prompt_components": {"gold_output": "702\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar s []int\nvar c []int\n\nfunc checkDigits(num int) int {\n\tif num == 0 {\n\t\treturn 1\n\t}\n\n\tdigits := 0\n\tfor num > 0 {\n\t\tnum /= 10\n\t\tdigits++\n\t}\n\n\treturn digits\n}\n\nvar dic map[int]int\n\nfunc main() {\n\tvar n, m int\n\n\tn = readInt()\n\tm = readInt()\n\tdic = make(map[int]int, 0)\n\n\ts = make([]int, m)\n\tc = make([]int, m)\n\tmin, max := math.MaxInt64, 0\n\tfor i := 0; i < m; i++ {\n\t\ts[i] = readInt()\n\t\tc[i] = readInt()\n\t\tdic[s[i]] = c[i]\n\t\tif s[i] > max {\n\t\t\tmax = s[i]\n\t\t}\n\t\tif s[i] < min {\n\t\t\tmin = s[i]\n\t\t}\n\t\t//fmt.Printf(\"s[%d] = %d, c[%d] = %d\\n\", i, s[i], i, c[i])\n\t}\n\n\t//fmt.Printf(\"n = %d, m = %d\\n\", n, m)\n\t/*\n\t\tfor k, v := range dic {\n\t\t\tfmt.Printf(\"dic[%d] = %d\\n\", k, v)\n\t\t}\n\t*/\n\tif n == max {\n\t\tresStr := make([]rune, max)\n\t\tfor i := 1; i <= max; i++ {\n\t\t\tif _, exist := dic[i]; exist {\n\t\t\t\tresStr[i-1] = rune(dic[i] + '0')\n\t\t\t} else {\n\t\t\t\tresStr[i-1] = '0'\n\t\t\t}\n\t\t}\n\n\t\tfmt.Println(string(resStr))\n\n\t} else {\n\t\tfmt.Println(-1)\n\n\t}\n}\n\nconst (\n\tioBufferSize = 1 * 1024 * 1024 // 1 MB\n)\n\nvar stdinScanner = func() *bufio.Scanner {\n\tresult := bufio.NewScanner(os.Stdin)\n\tresult.Buffer(make([]byte, ioBufferSize), ioBufferSize)\n\tresult.Split(bufio.ScanWords)\n\treturn result\n}()\n\nfunc readString() string {\n\tstdinScanner.Scan()\n\treturn stdinScanner.Text()\n}\n\nfunc readInt() int {\n\tresult, err := strconv.Atoi(readString())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn result\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "sample_input": "3 3\n1 7\n3 2\n1 7\n"}, "reference_outputs": ["702\n"], "source_document_id": "p02761", "source_text": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1431, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s269299609", "group_id": "codeNet:p02761", "input_text": "package main\n\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n \"strconv\"\n \"math\"\n)\n\n\nvar sc = bufio.NewScanner(os.Stdin)\nfunc nextInt() int {\n sc.Scan()\n i, e := strconv.Atoi(sc.Text())\n if e != nil {\n panic(e)\n }\n return i\n}\n\nfunc main() {\n sc.Split(bufio.ScanWords)\n n := nextInt()\n m := nextInt()\n if m == 0 {\n fmt.Println(int(math.Pow(10, float64(n-1))))\n return\n }\n var cex map[int]bool = map[int]bool{}\n var cs map[int]int = map[int]int{}\n for i := 0; i < m; i++ {\n s := nextInt()\n c := nextInt()\n if n != 1 && s == 1 && c == 0 {\n fmt.Println(-1)\n return\n }\n if cex[s] && cs[s] != c {\n fmt.Println(-1)\n return\n }\n cex[s] = true\n cs[s] = c\n }\n ans := 0\n min := 5\n for s, c := range cs {\n if s < min {\n min = s\n }\n ans += c * int(math.Pow(10, float64(n - s)))\n }\n if n != 1 && cs[min] == 0 {\n fmt.Println(-1)\n return\n }\n if min != 1 {\n ans += int(math.Pow(10, float64(n-1)))\n }\n fmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1583117099, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02761.html", "problem_id": "p02761", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02761/input.txt", "sample_output_relpath": "derived/input_output/data/p02761/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02761/Go/s269299609.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s269299609", "user_id": "u835488697"}, "prompt_components": {"gold_output": "702\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n \"strconv\"\n \"math\"\n)\n\n\nvar sc = bufio.NewScanner(os.Stdin)\nfunc nextInt() int {\n sc.Scan()\n i, e := strconv.Atoi(sc.Text())\n if e != nil {\n panic(e)\n }\n return i\n}\n\nfunc main() {\n sc.Split(bufio.ScanWords)\n n := nextInt()\n m := nextInt()\n if m == 0 {\n fmt.Println(int(math.Pow(10, float64(n-1))))\n return\n }\n var cex map[int]bool = map[int]bool{}\n var cs map[int]int = map[int]int{}\n for i := 0; i < m; i++ {\n s := nextInt()\n c := nextInt()\n if n != 1 && s == 1 && c == 0 {\n fmt.Println(-1)\n return\n }\n if cex[s] && cs[s] != c {\n fmt.Println(-1)\n return\n }\n cex[s] = true\n cs[s] = c\n }\n ans := 0\n min := 5\n for s, c := range cs {\n if s < min {\n min = s\n }\n ans += c * int(math.Pow(10, float64(n - s)))\n }\n if n != 1 && cs[min] == 0 {\n fmt.Println(-1)\n return\n }\n if min != 1 {\n ans += int(math.Pow(10, float64(n-1)))\n }\n fmt.Println(ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "sample_input": "3 3\n1 7\n3 2\n1 7\n"}, "reference_outputs": ["702\n"], "source_document_id": "p02761", "source_text": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1003, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s615564325", "group_id": "codeNet:p02761", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar n,m int;\n\tfmt.Scan(&n,&m)\n\ts := make([]int,m)\n\tc := make([]int,m)\n\tvar temp_s,temp_c int\n\tans := true\n\tfor i := 0 ; i < m ; i++ {\n\t\tfmt.Scan(&temp_s,&temp_c)\n\t\tfor j := 0; j < i ; j++ {\n\t\t\tif temp_s == s[j] && temp_c != c[j] {\n\t\t\t\tans = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif ans == true {\n\t\t\ts[i] = temp_s\n\t\t\tc[i] = temp_c\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\tif ans {\n\t\tif n == 1 {\n\t\t\tfor j := 0 ; j < m ; j++ {\n\t\t\t\tif s[j] == 1 {\n\t\t\t\t\tfmt.Print(c[j])\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t} else if n == 2{\n\t\t\tone := -1\n\t\t\tten := -1\n\t\t\tfor j := 0 ; j < m ; j++ {\n\t\t\t\tif s[j] == 1 {\n\t\t\t\t\tten = c[j]\n\t\t\t\t} else if s[j] == 2 {\n\t\t\t\t\tone = c[j]\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ten == 0 {\n\t\t\t\tfmt.Println(\"-1\")\n\t\t\t} else if ten > 0 {\n\t\t\t\tif one == -1 {\n\t\t\t\t\tfmt.Println(ten*10)\n\t\t\t\t} else {\n\t\t\t\t\tfmt.Println(ten*10 + one)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif one == -1 {\n\t\t\t\t\tfmt.Println(\"10\")\n\t\t\t\t} else {\n\t\t\t\t\tfmt.Println(10+one)\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tone := -1\n\t\t\tten := -1\n\t\t\thun := -1\n\t\t\tfor j := 0 ; j < m ; j++ {\n\t\t\t\tif s[j] == 1 {\n\t\t\t\t\thun = c[j]\n\t\t\t\t} else if s[j] == 2 {\n\t\t\t\t\tten = c[j]\n\t\t\t\t} else if s[j] == 3 {\n\t\t\t\t\tone = c[j]\n\t\t\t\t}\n\t\t\t}\n//fmt.Println(hun,ten,one)\n\t\t\tif hun == 0 {\n\t\t\t\tfmt.Println(\"-1\")\n\t\t\t} else if hun > 0 {\n\t\t\t\tif ten != -1 {\n\t\t\t\t\tif one != -1 {\n\t\t\t\t\t\tfmt.Println(hun*100+ten*10+one)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfmt.Println(hun*100+ten*10)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif one != -1 {\n\t\t\t\t\t\tfmt.Println(hun*100+one)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfmt.Println(hun*100)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ten != -1 {\n\t\t\t\t\tif one != -1 {\n\t\t\t\t\t\tfmt.Println(100+ten*10+one)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfmt.Println(100+ten*10)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif one != -1 {\n\t\t\t\t\t\tfmt.Println(100+one)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfmt.Println(\"100\")\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfmt.Println(\"-1\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1583116998, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02761.html", "problem_id": "p02761", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02761/input.txt", "sample_output_relpath": "derived/input_output/data/p02761/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02761/Go/s615564325.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s615564325", "user_id": "u145635628"}, "prompt_components": {"gold_output": "702\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar n,m int;\n\tfmt.Scan(&n,&m)\n\ts := make([]int,m)\n\tc := make([]int,m)\n\tvar temp_s,temp_c int\n\tans := true\n\tfor i := 0 ; i < m ; i++ {\n\t\tfmt.Scan(&temp_s,&temp_c)\n\t\tfor j := 0; j < i ; j++ {\n\t\t\tif temp_s == s[j] && temp_c != c[j] {\n\t\t\t\tans = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif ans == true {\n\t\t\ts[i] = temp_s\n\t\t\tc[i] = temp_c\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\tif ans {\n\t\tif n == 1 {\n\t\t\tfor j := 0 ; j < m ; j++ {\n\t\t\t\tif s[j] == 1 {\n\t\t\t\t\tfmt.Print(c[j])\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t} else if n == 2{\n\t\t\tone := -1\n\t\t\tten := -1\n\t\t\tfor j := 0 ; j < m ; j++ {\n\t\t\t\tif s[j] == 1 {\n\t\t\t\t\tten = c[j]\n\t\t\t\t} else if s[j] == 2 {\n\t\t\t\t\tone = c[j]\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ten == 0 {\n\t\t\t\tfmt.Println(\"-1\")\n\t\t\t} else if ten > 0 {\n\t\t\t\tif one == -1 {\n\t\t\t\t\tfmt.Println(ten*10)\n\t\t\t\t} else {\n\t\t\t\t\tfmt.Println(ten*10 + one)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif one == -1 {\n\t\t\t\t\tfmt.Println(\"10\")\n\t\t\t\t} else {\n\t\t\t\t\tfmt.Println(10+one)\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tone := -1\n\t\t\tten := -1\n\t\t\thun := -1\n\t\t\tfor j := 0 ; j < m ; j++ {\n\t\t\t\tif s[j] == 1 {\n\t\t\t\t\thun = c[j]\n\t\t\t\t} else if s[j] == 2 {\n\t\t\t\t\tten = c[j]\n\t\t\t\t} else if s[j] == 3 {\n\t\t\t\t\tone = c[j]\n\t\t\t\t}\n\t\t\t}\n//fmt.Println(hun,ten,one)\n\t\t\tif hun == 0 {\n\t\t\t\tfmt.Println(\"-1\")\n\t\t\t} else if hun > 0 {\n\t\t\t\tif ten != -1 {\n\t\t\t\t\tif one != -1 {\n\t\t\t\t\t\tfmt.Println(hun*100+ten*10+one)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfmt.Println(hun*100+ten*10)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif one != -1 {\n\t\t\t\t\t\tfmt.Println(hun*100+one)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfmt.Println(hun*100)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ten != -1 {\n\t\t\t\t\tif one != -1 {\n\t\t\t\t\t\tfmt.Println(100+ten*10+one)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfmt.Println(100+ten*10)\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif one != -1 {\n\t\t\t\t\t\tfmt.Println(100+one)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfmt.Println(\"100\")\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\tfmt.Println(\"-1\")\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "sample_input": "3 3\n1 7\n3 2\n1 7\n"}, "reference_outputs": ["702\n"], "source_document_id": "p02761", "source_text": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1768, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s599587524", "group_id": "codeNet:p02761", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\n\tn, m := io.Int(), io.Int()\n\n\tif n == 1 && m == 0 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\ttype input struct {\n\t\ts, c int\n\t}\n\n\tinputs := make([]input, m)\n\n\tdupCheck := map[int]int{}\n\n\tfor i := 0; i < m; i++ {\n\t\ts := io.Int()\n\t\tc := io.Int()\n\n\t\tif v, ok := dupCheck[s]; ok && v != c {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t\tdupCheck[s] = c\n\t\tinputs[i] = input{\n\t\t\ts: s - 1,\n\t\t\tc: c,\n\t\t}\n\t}\n\n\tnums := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tnums[i] = -1\n\t}\n\n\tfor _, i := range inputs {\n\t\tnums[i.s] = i.c\n\t}\n\n\tansStr := \"\"\n\tfirstNum := false\n\tfor _, n := range nums {\n\t\tif firstNum {\n\t\t\tif n != -1 {\n\t\t\t\tansStr += strconv.Itoa(n)\n\t\t\t} else {\n\t\t\t\tansStr += \"0\"\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tif !firstNum {\n\t\t\tfirstNum = true\n\t\t\tif n != -1 {\n\t\t\t\tansStr += strconv.Itoa(n)\n\t\t\t\tfirstNum = true\n\t\t\t} else {\n\t\t\t\tansStr += \"1\"\n\t\t\t}\n\t\t}\n\t}\n\tans, _ := strconv.Atoi(ansStr)\n\n\tif ans == 0 && n == 1 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tif float64(ans) < math.Pow(10, float64(n-1)) {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tfmt.Println(ansStr)\n\n}\n\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc (io *Io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\nfunc (io *Io) Next() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\nfunc (io *Io) Int() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) Float() float64 {\n\ti, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) PrintLn(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\nfunc (io *Io) PrintIntLn(a []int) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc (io *Io) PrintStringLn(a []string) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc Log(name string, value interface{}) {\n\tfmt.Fprintf(os.Stderr, \"%s=%+v\\n\", name, value)\n}\n\nfunc Abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc Pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc Min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc Max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc SortAsc(a []int) []int {\n\tsort.Ints(a)\n\treturn a\n}\n\nfunc SortDesc(a []int) []int {\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\treturn a\n}\n\nfunc GCD(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn GCD(b, a%b)\n}\n\nfunc LCM(a, b int) int {\n\tif a == 0 && b == 0 {\n\t\treturn 0\n\t}\n\treturn a * b / GCD(a, b)\n}\n\nfunc CumSum(nums []int) []int {\n\tsums := []int{0}\n\n\tfor i := 0; i < len(nums); i++ {\n\t\tsums = append(sums, sums[i]+nums[i])\n\t}\n\treturn sums\n}\n\nfunc BisectLeft(nums []int, left, right int, target int) int {\n\tif left == right {\n\t\tif nums[left] == target {\n\t\t\treturn left\n\t\t} else if nums[left] < target {\n\t\t\treturn left + 1\n\t\t} else {\n\t\t\treturn left\n\t\t}\n\t}\n\n\tmid := (left + right) / 2\n\tif nums[mid] == target {\n\t\treturn mid\n\t}\n\n\tif nums[mid] > target {\n\t\treturn BisectLeft(nums, left, mid, target)\n\t} else if nums[mid] < target {\n\t\treturn BisectLeft(nums, mid+1, right, target)\n\t}\n\treturn 0\n}\n\nfunc Permutations(nums []int) [][]int {\n\tn := len(nums)\n\tif n == 0 {\n\t\treturn [][]int{}\n\t}\n\tans := [][]int{}\n\n\tfor _, n := range nums {\n\t\trest := remove(nums, n)\n\t\tlists := Permutations(rest)\n\t\tif len(lists) == 0 {\n\t\t\tlists = [][]int{nil}\n\t\t}\n\n\t\tfor i := 0; i < len(lists); i++ {\n\t\t\tlists[i] = append(lists[i], n)\n\t\t\tans = append(ans, lists[i])\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc remove(nums []int, target int) []int {\n\tresult := []int{}\n\tfor i := 0; i < len(nums); i++ {\n\t\tif nums[i] != target {\n\t\t\tresult = append(result, nums[i])\n\t\t}\n\t}\n\treturn result\n}\n\nfunc PowerSet(nums []int) [][]int {\n\tsize := Pow(2, len(nums))\n\tresult := make([][]int, size)\n\n\tidx := 0\n\tresult[idx] = []int{}\n\tidx++\n\n\tfor _, n := range nums {\n\t\tmax := idx\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[idx] = copyAndAppend(result[i], n)\n\t\t\tidx++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc Combination(nums []int, k int) [][]int {\n\tsize := len(nums)\n\tresult := make([][]int, CombinationCount(int64(len(nums)), int64(k), 10e9))\n\tbi := (1 << uint(k)) - 1\n\tmax := 1 << uint(size)\n\tidx := 0\n\n\tfor bi < max {\n\t\tflags := bi\n\t\ts := []int{}\n\t\tfor _, n := range nums {\n\t\t\tif flags%2 != 0 {\n\t\t\t\ts = append(s, n)\n\t\t\t}\n\t\t\tflags /= 2\n\t\t}\n\t\tresult[idx] = s\n\t\tidx++\n\t\tbi = Combination2NextIndex(bi)\n\t}\n\treturn result\n}\n\nfunc Combination2NextIndex(n int) int {\n\tsmallest := n & -n\n\tripple := n + smallest\n\tnewSmallest := ripple & -ripple\n\tones := ((newSmallest / smallest) >> 1) - 1\n\treturn ripple | ones\n}\n\n// CombinationCount はnCmを計算する関数。メモ化を使って計算量を削減する。\nfunc CombinationCount(n, m, maxInput int64) int64 {\n\tmemo := map[int64]map[int64]int64{}\n\tfor i := int64(1); i <= maxInput*maxInput; i++ {\n\t\tmemo[int64(i)] = map[int64]int64{}\n\t}\n\treturn combinationCount(n, m, memo)\n}\nfunc combinationCount(n, m int64, memo map[int64]map[int64]int64) int64 {\n\tif n == m || m == 0 {\n\t\treturn 1\n\t}\n\n\tleft, lOK := memo[n-1][m-1]\n\tright, rOK := memo[n-1][m]\n\n\tif lOK && rOK {\n\t\treturn left + right\n\t}\n\n\tif lOK {\n\t\tright = combinationCount(n-1, m, memo)\n\t\tmemo[n-1][m] = right\n\t\treturn left + right\n\t}\n\n\tif rOK {\n\t\tleft = combinationCount(n-1, m-1, memo)\n\t\tmemo[n-1][m-1] = left\n\t\treturn left + right\n\t}\n\n\tleft = combinationCount(n-1, m-1, memo)\n\tright = combinationCount(n-1, m, memo)\n\tmemo[n-1][m-1] = left\n\tmemo[n-1][m] = right\n\treturn left + right\n}\n\nfunc Fact(n int) int {\n\tif n == 0 {\n\t\treturn 1\n\t} else {\n\t\treturn n * Fact(n-1)\n\t}\n}\n\nfunc Divisors(n int) []int {\n\tdivisors := map[int]bool{}\n\tfor i := 1; i < int(math.Sqrt(float64(n)))+1; i++ {\n\t\tif n%i == 0 {\n\t\t\tdivisors[i] = true\n\t\t\t//divisors = append(divisors, i)\n\t\t\tif i != n {\n\t\t\t\tdivisors[n/i] = true\n\t\t\t\t//divisors = append(divisors, n/i)\n\t\t\t}\n\t\t}\n\n\t}\n\tans := []int{}\n\tfor k := range divisors {\n\t\tans = append(ans, k)\n\t}\n\treturn ans\n}\n", "language": "Go", "metadata": {"date": 1583116964, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02761.html", "problem_id": "p02761", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02761/input.txt", "sample_output_relpath": "derived/input_output/data/p02761/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02761/Go/s599587524.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s599587524", "user_id": "u134387396"}, "prompt_components": {"gold_output": "702\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\n\tn, m := io.Int(), io.Int()\n\n\tif n == 1 && m == 0 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\ttype input struct {\n\t\ts, c int\n\t}\n\n\tinputs := make([]input, m)\n\n\tdupCheck := map[int]int{}\n\n\tfor i := 0; i < m; i++ {\n\t\ts := io.Int()\n\t\tc := io.Int()\n\n\t\tif v, ok := dupCheck[s]; ok && v != c {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t\tdupCheck[s] = c\n\t\tinputs[i] = input{\n\t\t\ts: s - 1,\n\t\t\tc: c,\n\t\t}\n\t}\n\n\tnums := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tnums[i] = -1\n\t}\n\n\tfor _, i := range inputs {\n\t\tnums[i.s] = i.c\n\t}\n\n\tansStr := \"\"\n\tfirstNum := false\n\tfor _, n := range nums {\n\t\tif firstNum {\n\t\t\tif n != -1 {\n\t\t\t\tansStr += strconv.Itoa(n)\n\t\t\t} else {\n\t\t\t\tansStr += \"0\"\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tif !firstNum {\n\t\t\tfirstNum = true\n\t\t\tif n != -1 {\n\t\t\t\tansStr += strconv.Itoa(n)\n\t\t\t\tfirstNum = true\n\t\t\t} else {\n\t\t\t\tansStr += \"1\"\n\t\t\t}\n\t\t}\n\t}\n\tans, _ := strconv.Atoi(ansStr)\n\n\tif ans == 0 && n == 1 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tif float64(ans) < math.Pow(10, float64(n-1)) {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tfmt.Println(ansStr)\n\n}\n\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc (io *Io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\nfunc (io *Io) Next() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\nfunc (io *Io) Int() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) Float() float64 {\n\ti, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) PrintLn(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\nfunc (io *Io) PrintIntLn(a []int) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc (io *Io) PrintStringLn(a []string) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc Log(name string, value interface{}) {\n\tfmt.Fprintf(os.Stderr, \"%s=%+v\\n\", name, value)\n}\n\nfunc Abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc Pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc Min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc Max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc SortAsc(a []int) []int {\n\tsort.Ints(a)\n\treturn a\n}\n\nfunc SortDesc(a []int) []int {\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\treturn a\n}\n\nfunc GCD(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn GCD(b, a%b)\n}\n\nfunc LCM(a, b int) int {\n\tif a == 0 && b == 0 {\n\t\treturn 0\n\t}\n\treturn a * b / GCD(a, b)\n}\n\nfunc CumSum(nums []int) []int {\n\tsums := []int{0}\n\n\tfor i := 0; i < len(nums); i++ {\n\t\tsums = append(sums, sums[i]+nums[i])\n\t}\n\treturn sums\n}\n\nfunc BisectLeft(nums []int, left, right int, target int) int {\n\tif left == right {\n\t\tif nums[left] == target {\n\t\t\treturn left\n\t\t} else if nums[left] < target {\n\t\t\treturn left + 1\n\t\t} else {\n\t\t\treturn left\n\t\t}\n\t}\n\n\tmid := (left + right) / 2\n\tif nums[mid] == target {\n\t\treturn mid\n\t}\n\n\tif nums[mid] > target {\n\t\treturn BisectLeft(nums, left, mid, target)\n\t} else if nums[mid] < target {\n\t\treturn BisectLeft(nums, mid+1, right, target)\n\t}\n\treturn 0\n}\n\nfunc Permutations(nums []int) [][]int {\n\tn := len(nums)\n\tif n == 0 {\n\t\treturn [][]int{}\n\t}\n\tans := [][]int{}\n\n\tfor _, n := range nums {\n\t\trest := remove(nums, n)\n\t\tlists := Permutations(rest)\n\t\tif len(lists) == 0 {\n\t\t\tlists = [][]int{nil}\n\t\t}\n\n\t\tfor i := 0; i < len(lists); i++ {\n\t\t\tlists[i] = append(lists[i], n)\n\t\t\tans = append(ans, lists[i])\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc remove(nums []int, target int) []int {\n\tresult := []int{}\n\tfor i := 0; i < len(nums); i++ {\n\t\tif nums[i] != target {\n\t\t\tresult = append(result, nums[i])\n\t\t}\n\t}\n\treturn result\n}\n\nfunc PowerSet(nums []int) [][]int {\n\tsize := Pow(2, len(nums))\n\tresult := make([][]int, size)\n\n\tidx := 0\n\tresult[idx] = []int{}\n\tidx++\n\n\tfor _, n := range nums {\n\t\tmax := idx\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[idx] = copyAndAppend(result[i], n)\n\t\t\tidx++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc Combination(nums []int, k int) [][]int {\n\tsize := len(nums)\n\tresult := make([][]int, CombinationCount(int64(len(nums)), int64(k), 10e9))\n\tbi := (1 << uint(k)) - 1\n\tmax := 1 << uint(size)\n\tidx := 0\n\n\tfor bi < max {\n\t\tflags := bi\n\t\ts := []int{}\n\t\tfor _, n := range nums {\n\t\t\tif flags%2 != 0 {\n\t\t\t\ts = append(s, n)\n\t\t\t}\n\t\t\tflags /= 2\n\t\t}\n\t\tresult[idx] = s\n\t\tidx++\n\t\tbi = Combination2NextIndex(bi)\n\t}\n\treturn result\n}\n\nfunc Combination2NextIndex(n int) int {\n\tsmallest := n & -n\n\tripple := n + smallest\n\tnewSmallest := ripple & -ripple\n\tones := ((newSmallest / smallest) >> 1) - 1\n\treturn ripple | ones\n}\n\n// CombinationCount はnCmを計算する関数。メモ化を使って計算量を削減する。\nfunc CombinationCount(n, m, maxInput int64) int64 {\n\tmemo := map[int64]map[int64]int64{}\n\tfor i := int64(1); i <= maxInput*maxInput; i++ {\n\t\tmemo[int64(i)] = map[int64]int64{}\n\t}\n\treturn combinationCount(n, m, memo)\n}\nfunc combinationCount(n, m int64, memo map[int64]map[int64]int64) int64 {\n\tif n == m || m == 0 {\n\t\treturn 1\n\t}\n\n\tleft, lOK := memo[n-1][m-1]\n\tright, rOK := memo[n-1][m]\n\n\tif lOK && rOK {\n\t\treturn left + right\n\t}\n\n\tif lOK {\n\t\tright = combinationCount(n-1, m, memo)\n\t\tmemo[n-1][m] = right\n\t\treturn left + right\n\t}\n\n\tif rOK {\n\t\tleft = combinationCount(n-1, m-1, memo)\n\t\tmemo[n-1][m-1] = left\n\t\treturn left + right\n\t}\n\n\tleft = combinationCount(n-1, m-1, memo)\n\tright = combinationCount(n-1, m, memo)\n\tmemo[n-1][m-1] = left\n\tmemo[n-1][m] = right\n\treturn left + right\n}\n\nfunc Fact(n int) int {\n\tif n == 0 {\n\t\treturn 1\n\t} else {\n\t\treturn n * Fact(n-1)\n\t}\n}\n\nfunc Divisors(n int) []int {\n\tdivisors := map[int]bool{}\n\tfor i := 1; i < int(math.Sqrt(float64(n)))+1; i++ {\n\t\tif n%i == 0 {\n\t\t\tdivisors[i] = true\n\t\t\t//divisors = append(divisors, i)\n\t\t\tif i != n {\n\t\t\t\tdivisors[n/i] = true\n\t\t\t\t//divisors = append(divisors, n/i)\n\t\t\t}\n\t\t}\n\n\t}\n\tans := []int{}\n\tfor k := range divisors {\n\t\tans = append(ans, k)\n\t}\n\treturn ans\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "sample_input": "3 3\n1 7\n3 2\n1 7\n"}, "reference_outputs": ["702\n"], "source_document_id": "p02761", "source_text": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 7052, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s457675581", "group_id": "codeNet:p02761", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\tvar N, M int\n\tfmt.Scanf(\"%d %d\\n\", &N, &M)\n\tr := make([]int, N)\n\tfor i := 0; i < N; i ++ {\n\t\tif i == 0 {\n\t\t\tr[0] = 1\n\t\t} else {\n\t\t\tr[i] = 0\n\t\t}\n\t}\n\tvar re string\n\tcache := map[int]int{}\n\tfor i := 0; i < M; i ++ {\n\t\tvar j, n int\n\t\tfmt.Scanf(\"%d %d\\n\", &j, &n)\n\t\tif j == 1 && n == 0 {\n\t\t\tre = \"-1\"\n\t\t\tbreak\n\t\t}\n\t\tif num, exists := cache[j]; exists && num != n {\n\t\t\tre = \"-1\"\n\t\t\tbreak\n\t\t}\n\t\tr[j-1] = n\n\t\tcache[j] = n\n\t}\n\tif re != \"-1\" {\n\t\tfor _, n := range r {\n\t\t\tre += fmt.Sprint(n)\n\t\t}\n\t}\n\tfmt.Println(re)\n}\n", "language": "Go", "metadata": {"date": 1583116135, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02761.html", "problem_id": "p02761", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02761/input.txt", "sample_output_relpath": "derived/input_output/data/p02761/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02761/Go/s457675581.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s457675581", "user_id": "u534481484"}, "prompt_components": {"gold_output": "702\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\n\tvar N, M int\n\tfmt.Scanf(\"%d %d\\n\", &N, &M)\n\tr := make([]int, N)\n\tfor i := 0; i < N; i ++ {\n\t\tif i == 0 {\n\t\t\tr[0] = 1\n\t\t} else {\n\t\t\tr[i] = 0\n\t\t}\n\t}\n\tvar re string\n\tcache := map[int]int{}\n\tfor i := 0; i < M; i ++ {\n\t\tvar j, n int\n\t\tfmt.Scanf(\"%d %d\\n\", &j, &n)\n\t\tif j == 1 && n == 0 {\n\t\t\tre = \"-1\"\n\t\t\tbreak\n\t\t}\n\t\tif num, exists := cache[j]; exists && num != n {\n\t\t\tre = \"-1\"\n\t\t\tbreak\n\t\t}\n\t\tr[j-1] = n\n\t\tcache[j] = n\n\t}\n\tif re != \"-1\" {\n\t\tfor _, n := range r {\n\t\t\tre += fmt.Sprint(n)\n\t\t}\n\t}\n\tfmt.Println(re)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "sample_input": "3 3\n1 7\n3 2\n1 7\n"}, "reference_outputs": ["702\n"], "source_document_id": "p02761", "source_text": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 556, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s674822620", "group_id": "codeNet:p02761", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tsc.Scan()\n\tiv, _ := strconv.Atoi(sc.Text())\n\treturn iv\n}\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc main() {\n\tn, m := scanInt(), scanInt()\n\txs := make([]int, n)\n\tfor i := range xs {\n\t\txs[i] = -1\n\t}\n\n\tfor i := 0; i < m; i++ {\n\t\ts, c := scanInt(), scanInt()\n\t\tif xs[s-1] != -1 && xs[s-1] != c {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t\txs[s-1] = c\n\t}\n\n\tans := \"\"\n\tfor i := range xs {\n\t\tif xs[i] == -1 {\n\t\t\tans = ans + \"0\"\n\t\t} else {\n\t\t\tans = ans + strconv.Itoa(xs[i])\n\t\t}\n\t}\n\tzero := true\n\tfor i := n - 1; i >= 0; i-- {\n\t\tif ans[i] != '0' {\n\t\t\tzero = false\n\t\t} else if zero {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1583115910, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02761.html", "problem_id": "p02761", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02761/input.txt", "sample_output_relpath": "derived/input_output/data/p02761/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02761/Go/s674822620.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s674822620", "user_id": "u461993794"}, "prompt_components": {"gold_output": "702\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tsc.Scan()\n\tiv, _ := strconv.Atoi(sc.Text())\n\treturn iv\n}\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc main() {\n\tn, m := scanInt(), scanInt()\n\txs := make([]int, n)\n\tfor i := range xs {\n\t\txs[i] = -1\n\t}\n\n\tfor i := 0; i < m; i++ {\n\t\ts, c := scanInt(), scanInt()\n\t\tif xs[s-1] != -1 && xs[s-1] != c {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t\txs[s-1] = c\n\t}\n\n\tans := \"\"\n\tfor i := range xs {\n\t\tif xs[i] == -1 {\n\t\t\tans = ans + \"0\"\n\t\t} else {\n\t\t\tans = ans + strconv.Itoa(xs[i])\n\t\t}\n\t}\n\tzero := true\n\tfor i := n - 1; i >= 0; i-- {\n\t\tif ans[i] != '0' {\n\t\t\tzero = false\n\t\t} else if zero {\n\t\t\tfmt.Println(-1)\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "sample_input": "3 3\n1 7\n3 2\n1 7\n"}, "reference_outputs": ["702\n"], "source_document_id": "p02761", "source_text": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 749, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s385145100", "group_id": "codeNet:p02761", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc scanString() string { sc.Scan(); return sc.Text() }\nfunc scanInt() int { a,_ := strconv.Atoi(scanString()); return a }\nfunc scanInt64() int64 { a,_ := strconv.ParseInt(scanString(),10,64); return a }\nfunc scanFloat64() float64 { a,_ := strconv.ParseFloat(scanString(),64); return a }\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n); for i := 0; i < n; i++ { res[i] = scanInt() }; return res\n}\n\nfunc abs(a int) int { if a<0 { return -a }; return a }\nfunc min(a,b int) int { if ab { return a }; return b }\n\n//•*¨*•.¸¸♪Main•*¨*•.¸¸♪( -ω-)ノ ( ・ω・)\n\nfunc main() {\n\tdefer wr.Flush()\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1001001)\n\n\tn := scanInt()\n\tm := scanInt()\n\n\tc := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tc[i] = -1\n\t}\n\tfor i := 0; i < m; i++ {\n\t\ts := scanInt()-1\n\t\tnum := scanInt()\n\n\t\tif c[s] == -1 {\n\t\t\tc[s] = num\n\t\t} else {\n\t\t\tif c[s] != num {\n\t\t\t\tfmt.Fprintln(wr, -1)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tans := 0\n\td := 100\n\tfor i := 0; i < n; i++ {\n\t\tif ans == 0 && c[i] == 0 {\n\t\t\tfmt.Fprintln(wr, -1)\n\t\t\treturn\n\t\t}\n\n\t\tif c[i] == -1 {\n\t\t\td /= 10\n\t\t\tcontinue\n\t\t}\n\n\t\tans += d*c[i]\n\t\td /= 10\n\t}\n\n\tfmt.Fprintln(wr, ans)\n\t\n}\n", "language": "Go", "metadata": {"date": 1583115555, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02761.html", "problem_id": "p02761", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02761/input.txt", "sample_output_relpath": "derived/input_output/data/p02761/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02761/Go/s385145100.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s385145100", "user_id": "u548992197"}, "prompt_components": {"gold_output": "702\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc scanString() string { sc.Scan(); return sc.Text() }\nfunc scanInt() int { a,_ := strconv.Atoi(scanString()); return a }\nfunc scanInt64() int64 { a,_ := strconv.ParseInt(scanString(),10,64); return a }\nfunc scanFloat64() float64 { a,_ := strconv.ParseFloat(scanString(),64); return a }\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n); for i := 0; i < n; i++ { res[i] = scanInt() }; return res\n}\n\nfunc abs(a int) int { if a<0 { return -a }; return a }\nfunc min(a,b int) int { if ab { return a }; return b }\n\n//•*¨*•.¸¸♪Main•*¨*•.¸¸♪( -ω-)ノ ( ・ω・)\n\nfunc main() {\n\tdefer wr.Flush()\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1001001)\n\n\tn := scanInt()\n\tm := scanInt()\n\n\tc := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tc[i] = -1\n\t}\n\tfor i := 0; i < m; i++ {\n\t\ts := scanInt()-1\n\t\tnum := scanInt()\n\n\t\tif c[s] == -1 {\n\t\t\tc[s] = num\n\t\t} else {\n\t\t\tif c[s] != num {\n\t\t\t\tfmt.Fprintln(wr, -1)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tans := 0\n\td := 100\n\tfor i := 0; i < n; i++ {\n\t\tif ans == 0 && c[i] == 0 {\n\t\t\tfmt.Fprintln(wr, -1)\n\t\t\treturn\n\t\t}\n\n\t\tif c[i] == -1 {\n\t\t\td /= 10\n\t\t\tcontinue\n\t\t}\n\n\t\tans += d*c[i]\n\t\td /= 10\n\t}\n\n\tfmt.Fprintln(wr, ans)\n\t\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "sample_input": "3 3\n1 7\n3 2\n1 7\n"}, "reference_outputs": ["702\n"], "source_document_id": "p02761", "source_text": "Score : 300 points\n\nProblem Statement\n\nIf there is an integer not less than 0 satisfying the following conditions, print the smallest such integer; otherwise, print -1.\n\nThe integer has exactly N digits in base ten. (We assume 0 to be a 1-digit integer. For other integers, leading zeros are not allowed.)\n\nThe s_i-th digit from the left is c_i. \\left(i = 1, 2, \\cdots, M\\right)\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 3\n\n0 \\leq M \\leq 5\n\n1 \\leq s_i \\leq N\n\n0 \\leq c_i \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\ns_1 c_1\n\\vdots\ns_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 3\n1 7\n3 2\n1 7\n\nSample Output 1\n\n702\n\n702 satisfies the conditions - its 1-st and 3-rd digits are 7 and 2, respectively - while no non-negative integer less than 702 satisfies them.\n\nSample Input 2\n\n3 2\n2 1\n2 3\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n3 1\n1 0\n\nSample Output 3\n\n-1", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1362, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s290470125", "group_id": "codeNet:p02774", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc solution(n, k int, nums []int) int {\n\tl := (n * (n - 1)) / 2\n\n\tvar stack = make([][]int, 3)\n\tfor i := range nums {\n\t\tswitch {\n\t\tcase nums[i] < 0:\n\t\t\tstack[0] = append(stack[0], nums[i])\n\t\tcase nums[i] == 0:\n\t\t\tstack[1] = append(stack[1], nums[i])\n\t\tcase nums[i] > 0:\n\t\t\tstack[2] = append(stack[2], nums[i])\n\t\t}\n\t}\n\tnn := len(stack[0])\n\tpn := len(stack[2])\n\tnns := pn * nn\n\tpns := (pn*(pn-1))/2 + (nn*(nn-1))/2\n\tzns := l - (nns + pns)\n\n\tvar ans int\n\tswitch {\n\tcase k <= nns:\n\t\tmemo := make([]int, nns)\n\t\tfor _, n := range stack[0] {\n\t\t\tfor _, p := range stack[2] {\n\t\t\t\tmemo = append(memo, n*p)\n\t\t\t}\n\t\t}\n\t\tsort.Ints(memo)\n\t\tans = memo[k-1]\n\n\tcase k > nns && k <= nns+zns:\n\t\tans = 0\n\tcase k > nns+zns:\n\t\tmemo := make([]int, 0, pns)\n\t\tfor i := 0; i < nn; i++ {\n\t\t\tfor j := i + 1; j < nn; j++ {\n\t\t\t\tmemo = append(memo, stack[0][i]*stack[0][j])\n\t\t\t}\n\t\t}\n\t\tfor i := 0; i < pn; i++ {\n\t\t\tfor j := i + 1; j < pn; j++ {\n\t\t\t\tmemo = append(memo, stack[2][i]*stack[2][j])\n\t\t\t}\n\t\t}\n\t\tsort.Ints(memo)\n\t\tans = memo[k-1-(nns+zns)]\n\t}\n\treturn ans\n}\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scan(&n, &k)\n\n\treader := bufio.NewReaderSize(os.Stdin, 2*1e6)\n\tstr, _, _ := reader.ReadLine()\n\tnums := make([]int, n)\n\tfor i, s := range strings.Split(string(str), \" \") {\n\t\tnums[i], _ = strconv.Atoi(s)\n\t}\n\n\tfmt.Println(solution(n, k, nums))\n}\n", "language": "Go", "metadata": {"date": 1581954399, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02774.html", "problem_id": "p02774", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02774/input.txt", "sample_output_relpath": "derived/input_output/data/p02774/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02774/Go/s290470125.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s290470125", "user_id": "u568763892"}, "prompt_components": {"gold_output": "-6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc solution(n, k int, nums []int) int {\n\tl := (n * (n - 1)) / 2\n\n\tvar stack = make([][]int, 3)\n\tfor i := range nums {\n\t\tswitch {\n\t\tcase nums[i] < 0:\n\t\t\tstack[0] = append(stack[0], nums[i])\n\t\tcase nums[i] == 0:\n\t\t\tstack[1] = append(stack[1], nums[i])\n\t\tcase nums[i] > 0:\n\t\t\tstack[2] = append(stack[2], nums[i])\n\t\t}\n\t}\n\tnn := len(stack[0])\n\tpn := len(stack[2])\n\tnns := pn * nn\n\tpns := (pn*(pn-1))/2 + (nn*(nn-1))/2\n\tzns := l - (nns + pns)\n\n\tvar ans int\n\tswitch {\n\tcase k <= nns:\n\t\tmemo := make([]int, nns)\n\t\tfor _, n := range stack[0] {\n\t\t\tfor _, p := range stack[2] {\n\t\t\t\tmemo = append(memo, n*p)\n\t\t\t}\n\t\t}\n\t\tsort.Ints(memo)\n\t\tans = memo[k-1]\n\n\tcase k > nns && k <= nns+zns:\n\t\tans = 0\n\tcase k > nns+zns:\n\t\tmemo := make([]int, 0, pns)\n\t\tfor i := 0; i < nn; i++ {\n\t\t\tfor j := i + 1; j < nn; j++ {\n\t\t\t\tmemo = append(memo, stack[0][i]*stack[0][j])\n\t\t\t}\n\t\t}\n\t\tfor i := 0; i < pn; i++ {\n\t\t\tfor j := i + 1; j < pn; j++ {\n\t\t\t\tmemo = append(memo, stack[2][i]*stack[2][j])\n\t\t\t}\n\t\t}\n\t\tsort.Ints(memo)\n\t\tans = memo[k-1-(nns+zns)]\n\t}\n\treturn ans\n}\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scan(&n, &k)\n\n\treader := bufio.NewReaderSize(os.Stdin, 2*1e6)\n\tstr, _, _ := reader.ReadLine()\n\tnums := make([]int, n)\n\tfor i, s := range strings.Split(string(str), \" \") {\n\t\tnums[i], _ = strconv.Atoi(s)\n\t}\n\n\tfmt.Println(solution(n, k, nums))\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nWe have N integers A_1, A_2, ..., A_N.\n\nThere are \\frac{N(N-1)}{2} ways to choose two of them and form a pair. If we compute the product of each of those pairs and sort the results in ascending order, what will be the K-th number in that list?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq \\frac{N(N-1)}{2}\n\n-10^9 \\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 K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 3\n3 3 -4 -2\n\nSample Output 1\n\n-6\n\nThere are six ways to form a pair. The products of those pairs are 9, -12, -6, -12, -6, 8.\n\nSorting those numbers in ascending order, we have -12, -12, -6, -6, 8, 9. The third number in this list is -6.\n\nSample Input 2\n\n10 40\n5 4 3 2 -1 0 0 0 0 0\n\nSample Output 2\n\n6\n\nSample Input 3\n\n30 413\n-170202098 -268409015 537203564 983211703 21608710 -443999067 -937727165 -97596546 -372334013 398994917 -972141167 798607104 -949068442 -959948616 37909651 0 886627544 -20098238 0 -948955241 0 -214720580 277222296 -18897162 834475626 0 -425610555 110117526 663621752 0\n\nSample Output 3\n\n448283280358331064", "sample_input": "4 3\n3 3 -4 -2\n"}, "reference_outputs": ["-6\n"], "source_document_id": "p02774", "source_text": "Score: 400 points\n\nProblem Statement\n\nWe have N integers A_1, A_2, ..., A_N.\n\nThere are \\frac{N(N-1)}{2} ways to choose two of them and form a pair. If we compute the product of each of those pairs and sort the results in ascending order, what will be the K-th number in that list?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq \\frac{N(N-1)}{2}\n\n-10^9 \\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 K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 3\n3 3 -4 -2\n\nSample Output 1\n\n-6\n\nThere are six ways to form a pair. The products of those pairs are 9, -12, -6, -12, -6, 8.\n\nSorting those numbers in ascending order, we have -12, -12, -6, -6, 8, 9. The third number in this list is -6.\n\nSample Input 2\n\n10 40\n5 4 3 2 -1 0 0 0 0 0\n\nSample Output 2\n\n6\n\nSample Input 3\n\n30 413\n-170202098 -268409015 537203564 983211703 21608710 -443999067 -937727165 -97596546 -372334013 398994917 -972141167 798607104 -949068442 -959948616 37909651 0 886627544 -20098238 0 -948955241 0 -214720580 277222296 -18897162 834475626 0 -425610555 110117526 663621752 0\n\nSample Output 3\n\n448283280358331064", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1390, "cpu_time_ms": 2113, "memory_kb": 1908992}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s919168351", "group_id": "codeNet:p02774", "input_text": "package main\nimport (\n \"fmt\"\n \"sort\"\n)\nfunc main() {\n var n,k,x,y,z,c int\n fmt.Scan(&n,&k)\n a := make([]int,n)\n for i:=0;i 1 {\n y = (x+z)/2\n c = 0\n for i:=0;i 1 {\n m := (l+r)/2\n if a[i]*t[m] < y { l = m } else { r = m }\n }\n c += r\n }\n if c < k { x = y } else { z = y }\n }\n fmt.Println(x)\n}", "language": "Go", "metadata": {"date": 1581899408, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02774.html", "problem_id": "p02774", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02774/input.txt", "sample_output_relpath": "derived/input_output/data/p02774/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02774/Go/s919168351.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s919168351", "user_id": "u506403362"}, "prompt_components": {"gold_output": "-6\n", "input_to_evaluate": "package main\nimport (\n \"fmt\"\n \"sort\"\n)\nfunc main() {\n var n,k,x,y,z,c int\n fmt.Scan(&n,&k)\n a := make([]int,n)\n for i:=0;i 1 {\n y = (x+z)/2\n c = 0\n for i:=0;i 1 {\n m := (l+r)/2\n if a[i]*t[m] < y { l = m } else { r = m }\n }\n c += r\n }\n if c < k { x = y } else { z = y }\n }\n fmt.Println(x)\n}", "problem_context": "Score: 400 points\n\nProblem Statement\n\nWe have N integers A_1, A_2, ..., A_N.\n\nThere are \\frac{N(N-1)}{2} ways to choose two of them and form a pair. If we compute the product of each of those pairs and sort the results in ascending order, what will be the K-th number in that list?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq \\frac{N(N-1)}{2}\n\n-10^9 \\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 K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 3\n3 3 -4 -2\n\nSample Output 1\n\n-6\n\nThere are six ways to form a pair. The products of those pairs are 9, -12, -6, -12, -6, 8.\n\nSorting those numbers in ascending order, we have -12, -12, -6, -6, 8, 9. The third number in this list is -6.\n\nSample Input 2\n\n10 40\n5 4 3 2 -1 0 0 0 0 0\n\nSample Output 2\n\n6\n\nSample Input 3\n\n30 413\n-170202098 -268409015 537203564 983211703 21608710 -443999067 -937727165 -97596546 -372334013 398994917 -972141167 798607104 -949068442 -959948616 37909651 0 886627544 -20098238 0 -948955241 0 -214720580 277222296 -18897162 834475626 0 -425610555 110117526 663621752 0\n\nSample Output 3\n\n448283280358331064", "sample_input": "4 3\n3 3 -4 -2\n"}, "reference_outputs": ["-6\n"], "source_document_id": "p02774", "source_text": "Score: 400 points\n\nProblem Statement\n\nWe have N integers A_1, A_2, ..., A_N.\n\nThere are \\frac{N(N-1)}{2} ways to choose two of them and form a pair. If we compute the product of each of those pairs and sort the results in ascending order, what will be the K-th number in that list?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq \\frac{N(N-1)}{2}\n\n-10^9 \\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 K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 3\n3 3 -4 -2\n\nSample Output 1\n\n-6\n\nThere are six ways to form a pair. The products of those pairs are 9, -12, -6, -12, -6, 8.\n\nSorting those numbers in ascending order, we have -12, -12, -6, -6, 8, 9. The third number in this list is -6.\n\nSample Input 2\n\n10 40\n5 4 3 2 -1 0 0 0 0 0\n\nSample Output 2\n\n6\n\nSample Input 3\n\n30 413\n-170202098 -268409015 537203564 983211703 21608710 -443999067 -937727165 -97596546 -372334013 398994917 -972141167 798607104 -949068442 -959948616 37909651 0 886627544 -20098238 0 -948955241 0 -214720580 277222296 -18897162 834475626 0 -425610555 110117526 663621752 0\n\nSample Output 3\n\n448283280358331064", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 570, "cpu_time_ms": 2108, "memory_kb": 7296}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s385117452", "group_id": "codeNet:p02774", "input_text": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n \"fmt\"\n \"sort\"\n)\n\nvar reader = bufio.NewReaderSize(os.Stdin, 1000000)\nvar writer = bufio.NewWriter(os.Stdout)\nfunc NextLine() string {\n buffer := make([]byte, 0)\n for true {\n line, isPrefix, err := reader.ReadLine()\n if err != nil { panic(err) }\n buffer = append(buffer, line...)\n if !isPrefix { break }\n }\n return string(buffer)\n}\nfunc NextInt(A ...*int) {\n L := strings.Split(NextLine(), \" \")\n for i, a := range A {\n *a, _ = strconv.Atoi(L[i])\n }\n}\nfunc NextIntVec(A *[]int) {\n L := strings.Split(NextLine(), \" \")\n (*A) = make([]int, len(L))\n for i, l := range L {\n (*A)[i], _ = strconv.Atoi(l)\n }\n}\nfunc NextFloat(A ...*float64) {\n L := strings.Split(NextLine(), \" \")\n for i, a := range A {\n *a, _ = strconv.ParseFloat(L[i], 64)\n }\n}\nfunc NextFloatVec(A *[]float64) {\n L := strings.Split(NextLine(), \" \")\n (*A) = make([]float64, len(L))\n for i, l := range L {\n (*A)[i], _ = strconv.ParseFloat(l, 64)\n }\n}\nfunc Write(s interface{}) {\n fmt.Fprintln(writer, s)\n}\nfunc WriteIntVec(A []int) {\n S := make([]string, len(A))\n for i, a := range A {\n S[i] = strconv.Itoa(a)\n }\n Write(strings.Join(S, \" \"))\n}\nfunc Output() {\n _ = writer.Flush()\n}\n\nfunc MaxInt(A ...int) int {\n max := A[0]\n for _, a := range A {\n if max < a { max = a }\n }\n return max\n}\nfunc MinInt(A ...int) int {\n min := A[0]\n for _, a := range A {\n if a < min { min = a }\n }\n return min\n}\n\nfunc Search(A []int, x int) int {\n N := len(A)\n if x < A[0] { return 0 }\n if A[N - 1] <= x { return N }\n lex, gtx := 0, N - 1\n for 1 < gtx - lex {\n med := (gtx + lex) / 2\n if x < A[med] {\n gtx = med\n } else {\n lex = med\n }\n }\n return lex + 1\n}\n\nfunc Count(A []int, x int) int {\n N := len(A)\n cnt := 0\n for i, a := range A {\n if a == 0 {\n if 0 <= x { cnt += N - i - 1 }\n } else if 0 < a {\n k := x / a\n if x < 0 && x % a != 0 { k-- }\n cnt += MaxInt(Search(A, k) - i - 1, 0)\n } else {\n k := x / a\n if 0 < x || x % a == 0 { k-- }\n cnt += MaxInt(N - MaxInt(Search(A, k), i + 1), 0)\n }\n }\n return cnt\n}\n\nfunc Solve() {\n var N, K int\n NextInt(&N, &K)\n var A []int\n NextIntVec(&A)\n sort.Ints(A)\n M := MaxInt(A[0] * A[0], A[N - 1] * A[N - 1])\n m := MinInt(A[0] * A[0], A[0] * A[N - 1], A[N - 1] * A[N - 1]) - 1\n for 1 < M - m {\n med := (M + m) / 2\n if Count(A, med) < K {\n m = med\n } else {\n M = med\n }\n }\n Write(M)\n return\n}\n\nfunc main() {\n Solve()\n Output()\n}", "language": "Go", "metadata": {"date": 1581896429, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02774.html", "problem_id": "p02774", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02774/input.txt", "sample_output_relpath": "derived/input_output/data/p02774/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02774/Go/s385117452.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s385117452", "user_id": "u415905784"}, "prompt_components": {"gold_output": "-6\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n \"fmt\"\n \"sort\"\n)\n\nvar reader = bufio.NewReaderSize(os.Stdin, 1000000)\nvar writer = bufio.NewWriter(os.Stdout)\nfunc NextLine() string {\n buffer := make([]byte, 0)\n for true {\n line, isPrefix, err := reader.ReadLine()\n if err != nil { panic(err) }\n buffer = append(buffer, line...)\n if !isPrefix { break }\n }\n return string(buffer)\n}\nfunc NextInt(A ...*int) {\n L := strings.Split(NextLine(), \" \")\n for i, a := range A {\n *a, _ = strconv.Atoi(L[i])\n }\n}\nfunc NextIntVec(A *[]int) {\n L := strings.Split(NextLine(), \" \")\n (*A) = make([]int, len(L))\n for i, l := range L {\n (*A)[i], _ = strconv.Atoi(l)\n }\n}\nfunc NextFloat(A ...*float64) {\n L := strings.Split(NextLine(), \" \")\n for i, a := range A {\n *a, _ = strconv.ParseFloat(L[i], 64)\n }\n}\nfunc NextFloatVec(A *[]float64) {\n L := strings.Split(NextLine(), \" \")\n (*A) = make([]float64, len(L))\n for i, l := range L {\n (*A)[i], _ = strconv.ParseFloat(l, 64)\n }\n}\nfunc Write(s interface{}) {\n fmt.Fprintln(writer, s)\n}\nfunc WriteIntVec(A []int) {\n S := make([]string, len(A))\n for i, a := range A {\n S[i] = strconv.Itoa(a)\n }\n Write(strings.Join(S, \" \"))\n}\nfunc Output() {\n _ = writer.Flush()\n}\n\nfunc MaxInt(A ...int) int {\n max := A[0]\n for _, a := range A {\n if max < a { max = a }\n }\n return max\n}\nfunc MinInt(A ...int) int {\n min := A[0]\n for _, a := range A {\n if a < min { min = a }\n }\n return min\n}\n\nfunc Search(A []int, x int) int {\n N := len(A)\n if x < A[0] { return 0 }\n if A[N - 1] <= x { return N }\n lex, gtx := 0, N - 1\n for 1 < gtx - lex {\n med := (gtx + lex) / 2\n if x < A[med] {\n gtx = med\n } else {\n lex = med\n }\n }\n return lex + 1\n}\n\nfunc Count(A []int, x int) int {\n N := len(A)\n cnt := 0\n for i, a := range A {\n if a == 0 {\n if 0 <= x { cnt += N - i - 1 }\n } else if 0 < a {\n k := x / a\n if x < 0 && x % a != 0 { k-- }\n cnt += MaxInt(Search(A, k) - i - 1, 0)\n } else {\n k := x / a\n if 0 < x || x % a == 0 { k-- }\n cnt += MaxInt(N - MaxInt(Search(A, k), i + 1), 0)\n }\n }\n return cnt\n}\n\nfunc Solve() {\n var N, K int\n NextInt(&N, &K)\n var A []int\n NextIntVec(&A)\n sort.Ints(A)\n M := MaxInt(A[0] * A[0], A[N - 1] * A[N - 1])\n m := MinInt(A[0] * A[0], A[0] * A[N - 1], A[N - 1] * A[N - 1]) - 1\n for 1 < M - m {\n med := (M + m) / 2\n if Count(A, med) < K {\n m = med\n } else {\n M = med\n }\n }\n Write(M)\n return\n}\n\nfunc main() {\n Solve()\n Output()\n}", "problem_context": "Score: 400 points\n\nProblem Statement\n\nWe have N integers A_1, A_2, ..., A_N.\n\nThere are \\frac{N(N-1)}{2} ways to choose two of them and form a pair. If we compute the product of each of those pairs and sort the results in ascending order, what will be the K-th number in that list?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq \\frac{N(N-1)}{2}\n\n-10^9 \\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 K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 3\n3 3 -4 -2\n\nSample Output 1\n\n-6\n\nThere are six ways to form a pair. The products of those pairs are 9, -12, -6, -12, -6, 8.\n\nSorting those numbers in ascending order, we have -12, -12, -6, -6, 8, 9. The third number in this list is -6.\n\nSample Input 2\n\n10 40\n5 4 3 2 -1 0 0 0 0 0\n\nSample Output 2\n\n6\n\nSample Input 3\n\n30 413\n-170202098 -268409015 537203564 983211703 21608710 -443999067 -937727165 -97596546 -372334013 398994917 -972141167 798607104 -949068442 -959948616 37909651 0 886627544 -20098238 0 -948955241 0 -214720580 277222296 -18897162 834475626 0 -425610555 110117526 663621752 0\n\nSample Output 3\n\n448283280358331064", "sample_input": "4 3\n3 3 -4 -2\n"}, "reference_outputs": ["-6\n"], "source_document_id": "p02774", "source_text": "Score: 400 points\n\nProblem Statement\n\nWe have N integers A_1, A_2, ..., A_N.\n\nThere are \\frac{N(N-1)}{2} ways to choose two of them and form a pair. If we compute the product of each of those pairs and sort the results in ascending order, what will be the K-th number in that list?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq \\frac{N(N-1)}{2}\n\n-10^9 \\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 K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 3\n3 3 -4 -2\n\nSample Output 1\n\n-6\n\nThere are six ways to form a pair. The products of those pairs are 9, -12, -6, -12, -6, 8.\n\nSorting those numbers in ascending order, we have -12, -12, -6, -6, 8, 9. The third number in this list is -6.\n\nSample Input 2\n\n10 40\n5 4 3 2 -1 0 0 0 0 0\n\nSample Output 2\n\n6\n\nSample Input 3\n\n30 413\n-170202098 -268409015 537203564 983211703 21608710 -443999067 -937727165 -97596546 -372334013 398994917 -972141167 798607104 -949068442 -959948616 37909651 0 886627544 -20098238 0 -948955241 0 -214720580 277222296 -18897162 834475626 0 -425610555 110117526 663621752 0\n\nSample Output 3\n\n448283280358331064", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2550, "cpu_time_ms": 921, "memory_kb": 11392}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s050813453", "group_id": "codeNet:p02774", "input_text": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n \"fmt\"\n \"sort\"\n)\n\nvar reader = bufio.NewReaderSize(os.Stdin, 1000000)\nvar writer = bufio.NewWriter(os.Stdout)\nfunc NextLine() string {\n buffer := make([]byte, 0)\n for true {\n line, isPrefix, err := reader.ReadLine()\n if err != nil { panic(err) }\n buffer = append(buffer, line...)\n if !isPrefix { break }\n }\n return string(buffer)\n}\nfunc NextInt(A ...*int) {\n L := strings.Split(NextLine(), \" \")\n for i, a := range A {\n *a, _ = strconv.Atoi(L[i])\n }\n}\nfunc NextIntVec(A *[]int) {\n L := strings.Split(NextLine(), \" \")\n (*A) = make([]int, len(L))\n for i, l := range L {\n (*A)[i], _ = strconv.Atoi(l)\n }\n}\nfunc NextFloat(A ...*float64) {\n L := strings.Split(NextLine(), \" \")\n for i, a := range A {\n *a, _ = strconv.ParseFloat(L[i], 64)\n }\n}\nfunc NextFloatVec(A *[]float64) {\n L := strings.Split(NextLine(), \" \")\n (*A) = make([]float64, len(L))\n for i, l := range L {\n (*A)[i], _ = strconv.ParseFloat(l, 64)\n }\n}\nfunc Write(s interface{}) {\n fmt.Fprintln(writer, s)\n}\nfunc WriteIntVec(A []int) {\n S := make([]string, len(A))\n for i, a := range A {\n S[i] = strconv.Itoa(a)\n }\n Write(strings.Join(S, \" \"))\n}\nfunc Output() {\n _ = writer.Flush()\n}\n\nfunc MaxInt(A ...int) int {\n max := A[0]\n for _, a := range A {\n if max < a { max = a }\n }\n return max\n}\nfunc MinInt(A ...int) int {\n min := A[0]\n for _, a := range A {\n if a < min { min = a }\n }\n return min\n}\n\nfunc Search(A []int, x int) int {\n N := len(A)\n if x < A[0] { return 0 }\n if A[N - 1] <= x { return N }\n lex, gtx := 0, N - 1\n for 1 < gtx - lex {\n med := (gtx + lex) / 2\n if x < A[med] {\n gtx = med\n } else {\n lex = med\n }\n }\n return lex + 1\n}\n\nfunc Count(A []int, x int) int {\n N := len(A)\n cnt := 0\n for i, a := range A {\n if a == 0 {\n if 0 <= x { cnt += N - i - 1 }\n } else if 0 < a {\n k := x / a\n if x < 0 && x % a != 0 { k-- }\n cnt += MaxInt(Search(A, k) - i - 1, 0)\n } else {\n k := x / a\n if x % a == 0 { k-- }\n cnt += MaxInt(N - MaxInt(Search(A, k), i + 1), 0)\n }\n }\n return cnt\n}\n\nfunc Solve() {\n var N, K int\n NextInt(&N, &K)\n var A []int\n NextIntVec(&A)\n sort.Ints(A)\n M := MaxInt(A[0] * A[0], A[N - 1] * A[N - 1])\n m := MinInt(A[0] * A[0], A[0] * A[N - 1], A[N - 1] * A[N - 1]) - 1\n for 1 < M - m {\n med := (M + m) / 2\n if Count(A, med) < K {\n m = med\n } else {\n M = med\n }\n }\n Write(M)\n return\n}\n\nfunc main() {\n Solve()\n Output()\n}", "language": "Go", "metadata": {"date": 1581894761, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02774.html", "problem_id": "p02774", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02774/input.txt", "sample_output_relpath": "derived/input_output/data/p02774/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02774/Go/s050813453.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s050813453", "user_id": "u415905784"}, "prompt_components": {"gold_output": "-6\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n \"fmt\"\n \"sort\"\n)\n\nvar reader = bufio.NewReaderSize(os.Stdin, 1000000)\nvar writer = bufio.NewWriter(os.Stdout)\nfunc NextLine() string {\n buffer := make([]byte, 0)\n for true {\n line, isPrefix, err := reader.ReadLine()\n if err != nil { panic(err) }\n buffer = append(buffer, line...)\n if !isPrefix { break }\n }\n return string(buffer)\n}\nfunc NextInt(A ...*int) {\n L := strings.Split(NextLine(), \" \")\n for i, a := range A {\n *a, _ = strconv.Atoi(L[i])\n }\n}\nfunc NextIntVec(A *[]int) {\n L := strings.Split(NextLine(), \" \")\n (*A) = make([]int, len(L))\n for i, l := range L {\n (*A)[i], _ = strconv.Atoi(l)\n }\n}\nfunc NextFloat(A ...*float64) {\n L := strings.Split(NextLine(), \" \")\n for i, a := range A {\n *a, _ = strconv.ParseFloat(L[i], 64)\n }\n}\nfunc NextFloatVec(A *[]float64) {\n L := strings.Split(NextLine(), \" \")\n (*A) = make([]float64, len(L))\n for i, l := range L {\n (*A)[i], _ = strconv.ParseFloat(l, 64)\n }\n}\nfunc Write(s interface{}) {\n fmt.Fprintln(writer, s)\n}\nfunc WriteIntVec(A []int) {\n S := make([]string, len(A))\n for i, a := range A {\n S[i] = strconv.Itoa(a)\n }\n Write(strings.Join(S, \" \"))\n}\nfunc Output() {\n _ = writer.Flush()\n}\n\nfunc MaxInt(A ...int) int {\n max := A[0]\n for _, a := range A {\n if max < a { max = a }\n }\n return max\n}\nfunc MinInt(A ...int) int {\n min := A[0]\n for _, a := range A {\n if a < min { min = a }\n }\n return min\n}\n\nfunc Search(A []int, x int) int {\n N := len(A)\n if x < A[0] { return 0 }\n if A[N - 1] <= x { return N }\n lex, gtx := 0, N - 1\n for 1 < gtx - lex {\n med := (gtx + lex) / 2\n if x < A[med] {\n gtx = med\n } else {\n lex = med\n }\n }\n return lex + 1\n}\n\nfunc Count(A []int, x int) int {\n N := len(A)\n cnt := 0\n for i, a := range A {\n if a == 0 {\n if 0 <= x { cnt += N - i - 1 }\n } else if 0 < a {\n k := x / a\n if x < 0 && x % a != 0 { k-- }\n cnt += MaxInt(Search(A, k) - i - 1, 0)\n } else {\n k := x / a\n if x % a == 0 { k-- }\n cnt += MaxInt(N - MaxInt(Search(A, k), i + 1), 0)\n }\n }\n return cnt\n}\n\nfunc Solve() {\n var N, K int\n NextInt(&N, &K)\n var A []int\n NextIntVec(&A)\n sort.Ints(A)\n M := MaxInt(A[0] * A[0], A[N - 1] * A[N - 1])\n m := MinInt(A[0] * A[0], A[0] * A[N - 1], A[N - 1] * A[N - 1]) - 1\n for 1 < M - m {\n med := (M + m) / 2\n if Count(A, med) < K {\n m = med\n } else {\n M = med\n }\n }\n Write(M)\n return\n}\n\nfunc main() {\n Solve()\n Output()\n}", "problem_context": "Score: 400 points\n\nProblem Statement\n\nWe have N integers A_1, A_2, ..., A_N.\n\nThere are \\frac{N(N-1)}{2} ways to choose two of them and form a pair. If we compute the product of each of those pairs and sort the results in ascending order, what will be the K-th number in that list?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq \\frac{N(N-1)}{2}\n\n-10^9 \\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 K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 3\n3 3 -4 -2\n\nSample Output 1\n\n-6\n\nThere are six ways to form a pair. The products of those pairs are 9, -12, -6, -12, -6, 8.\n\nSorting those numbers in ascending order, we have -12, -12, -6, -6, 8, 9. The third number in this list is -6.\n\nSample Input 2\n\n10 40\n5 4 3 2 -1 0 0 0 0 0\n\nSample Output 2\n\n6\n\nSample Input 3\n\n30 413\n-170202098 -268409015 537203564 983211703 21608710 -443999067 -937727165 -97596546 -372334013 398994917 -972141167 798607104 -949068442 -959948616 37909651 0 886627544 -20098238 0 -948955241 0 -214720580 277222296 -18897162 834475626 0 -425610555 110117526 663621752 0\n\nSample Output 3\n\n448283280358331064", "sample_input": "4 3\n3 3 -4 -2\n"}, "reference_outputs": ["-6\n"], "source_document_id": "p02774", "source_text": "Score: 400 points\n\nProblem Statement\n\nWe have N integers A_1, A_2, ..., A_N.\n\nThere are \\frac{N(N-1)}{2} ways to choose two of them and form a pair. If we compute the product of each of those pairs and sort the results in ascending order, what will be the K-th number in that list?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq \\frac{N(N-1)}{2}\n\n-10^9 \\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 K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 3\n3 3 -4 -2\n\nSample Output 1\n\n-6\n\nThere are six ways to form a pair. The products of those pairs are 9, -12, -6, -12, -6, 8.\n\nSorting those numbers in ascending order, we have -12, -12, -6, -6, 8, 9. The third number in this list is -6.\n\nSample Input 2\n\n10 40\n5 4 3 2 -1 0 0 0 0 0\n\nSample Output 2\n\n6\n\nSample Input 3\n\n30 413\n-170202098 -268409015 537203564 983211703 21608710 -443999067 -937727165 -97596546 -372334013 398994917 -972141167 798607104 -949068442 -959948616 37909651 0 886627544 -20098238 0 -948955241 0 -214720580 277222296 -18897162 834475626 0 -425610555 110117526 663621752 0\n\nSample Output 3\n\n448283280358331064", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2541, "cpu_time_ms": 912, "memory_kb": 13600}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s325626338", "group_id": "codeNet:p02774", "input_text": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n \"fmt\"\n \"sort\"\n)\n\nvar reader = bufio.NewReaderSize(os.Stdin, 1000000)\nvar writer = bufio.NewWriter(os.Stdout)\nfunc NextLine() string {\n buffer := make([]byte, 0)\n for true {\n line, isPrefix, err := reader.ReadLine()\n if err != nil { panic(err) }\n buffer = append(buffer, line...)\n if !isPrefix { break }\n }\n return string(buffer)\n}\nfunc NextInt(A ...*int) {\n L := strings.Split(NextLine(), \" \")\n for i, a := range A {\n *a, _ = strconv.Atoi(L[i])\n }\n}\nfunc NextIntVec(A *[]int) {\n L := strings.Split(NextLine(), \" \")\n (*A) = make([]int, len(L))\n for i, l := range L {\n (*A)[i], _ = strconv.Atoi(l)\n }\n}\nfunc NextFloat(A ...*float64) {\n L := strings.Split(NextLine(), \" \")\n for i, a := range A {\n *a, _ = strconv.ParseFloat(L[i], 64)\n }\n}\nfunc NextFloatVec(A *[]float64) {\n L := strings.Split(NextLine(), \" \")\n (*A) = make([]float64, len(L))\n for i, l := range L {\n (*A)[i], _ = strconv.ParseFloat(l, 64)\n }\n}\nfunc Write(s interface{}) {\n fmt.Fprintln(writer, s)\n}\nfunc WriteIntVec(A []int) {\n S := make([]string, len(A))\n for i, a := range A {\n S[i] = strconv.Itoa(a)\n }\n Write(strings.Join(S, \" \"))\n}\nfunc Output() {\n _ = writer.Flush()\n}\n\nfunc MaxInt(A ...int) int {\n max := A[0]\n for _, a := range A {\n if max < a { max = a }\n }\n return max\n}\nfunc MinInt(A ...int) int {\n min := A[0]\n for _, a := range A {\n if a < min { min = a }\n }\n return min\n}\n\nfunc Search(A []int, x int) int {\n N := len(A)\n if x < A[0] { return 0 }\n if A[N - 1] <= x { return N }\n lex, gtx := 0, N - 1\n for 1 < gtx - lex {\n med := (gtx + lex) / 2\n if x < A[med] {\n gtx = med\n } else {\n lex = med\n }\n }\n return lex + 1\n}\n\nfunc Count(A []int, x int) int {\n N := len(A)\n cnt := 0\n for i, a := range A {\n if a == 0 {\n if 0 <= x { cnt += N - i - 1 }\n } else if 0 < a {\n k := x / a\n if x < 0 && x % a != 0 { k-- }\n cnt += MaxInt(Search(A, k) - i - 1, 0)\n } else {\n k := x / a\n if x <= 0 {\n if x % a == 0 { k-- }\n } else {\n if x % a != 0 { k-- }\n }\n cnt += MaxInt(N - MaxInt(Search(A, k), i + 1), 0)\n }\n }\n return cnt\n}\n\nfunc Solve() {\n var N, K int\n NextInt(&N, &K)\n var A []int\n NextIntVec(&A)\n sort.Ints(A)\n M := MaxInt(A[0] * A[0], A[N - 1] * A[N - 1])\n m := MinInt(A[0] * A[0], A[0] * A[N - 1], A[N - 1] * A[N - 1]) - 1\n for 1 < M - m {\n med := (M + m) / 2\n if Count(A, med) < K {\n m = med\n } else {\n M = med\n }\n }\n Write(M)\n return\n}\n\nfunc main() {\n Solve()\n Output()\n}", "language": "Go", "metadata": {"date": 1581893489, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02774.html", "problem_id": "p02774", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02774/input.txt", "sample_output_relpath": "derived/input_output/data/p02774/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02774/Go/s325626338.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s325626338", "user_id": "u415905784"}, "prompt_components": {"gold_output": "-6\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n \"fmt\"\n \"sort\"\n)\n\nvar reader = bufio.NewReaderSize(os.Stdin, 1000000)\nvar writer = bufio.NewWriter(os.Stdout)\nfunc NextLine() string {\n buffer := make([]byte, 0)\n for true {\n line, isPrefix, err := reader.ReadLine()\n if err != nil { panic(err) }\n buffer = append(buffer, line...)\n if !isPrefix { break }\n }\n return string(buffer)\n}\nfunc NextInt(A ...*int) {\n L := strings.Split(NextLine(), \" \")\n for i, a := range A {\n *a, _ = strconv.Atoi(L[i])\n }\n}\nfunc NextIntVec(A *[]int) {\n L := strings.Split(NextLine(), \" \")\n (*A) = make([]int, len(L))\n for i, l := range L {\n (*A)[i], _ = strconv.Atoi(l)\n }\n}\nfunc NextFloat(A ...*float64) {\n L := strings.Split(NextLine(), \" \")\n for i, a := range A {\n *a, _ = strconv.ParseFloat(L[i], 64)\n }\n}\nfunc NextFloatVec(A *[]float64) {\n L := strings.Split(NextLine(), \" \")\n (*A) = make([]float64, len(L))\n for i, l := range L {\n (*A)[i], _ = strconv.ParseFloat(l, 64)\n }\n}\nfunc Write(s interface{}) {\n fmt.Fprintln(writer, s)\n}\nfunc WriteIntVec(A []int) {\n S := make([]string, len(A))\n for i, a := range A {\n S[i] = strconv.Itoa(a)\n }\n Write(strings.Join(S, \" \"))\n}\nfunc Output() {\n _ = writer.Flush()\n}\n\nfunc MaxInt(A ...int) int {\n max := A[0]\n for _, a := range A {\n if max < a { max = a }\n }\n return max\n}\nfunc MinInt(A ...int) int {\n min := A[0]\n for _, a := range A {\n if a < min { min = a }\n }\n return min\n}\n\nfunc Search(A []int, x int) int {\n N := len(A)\n if x < A[0] { return 0 }\n if A[N - 1] <= x { return N }\n lex, gtx := 0, N - 1\n for 1 < gtx - lex {\n med := (gtx + lex) / 2\n if x < A[med] {\n gtx = med\n } else {\n lex = med\n }\n }\n return lex + 1\n}\n\nfunc Count(A []int, x int) int {\n N := len(A)\n cnt := 0\n for i, a := range A {\n if a == 0 {\n if 0 <= x { cnt += N - i - 1 }\n } else if 0 < a {\n k := x / a\n if x < 0 && x % a != 0 { k-- }\n cnt += MaxInt(Search(A, k) - i - 1, 0)\n } else {\n k := x / a\n if x <= 0 {\n if x % a == 0 { k-- }\n } else {\n if x % a != 0 { k-- }\n }\n cnt += MaxInt(N - MaxInt(Search(A, k), i + 1), 0)\n }\n }\n return cnt\n}\n\nfunc Solve() {\n var N, K int\n NextInt(&N, &K)\n var A []int\n NextIntVec(&A)\n sort.Ints(A)\n M := MaxInt(A[0] * A[0], A[N - 1] * A[N - 1])\n m := MinInt(A[0] * A[0], A[0] * A[N - 1], A[N - 1] * A[N - 1]) - 1\n for 1 < M - m {\n med := (M + m) / 2\n if Count(A, med) < K {\n m = med\n } else {\n M = med\n }\n }\n Write(M)\n return\n}\n\nfunc main() {\n Solve()\n Output()\n}", "problem_context": "Score: 400 points\n\nProblem Statement\n\nWe have N integers A_1, A_2, ..., A_N.\n\nThere are \\frac{N(N-1)}{2} ways to choose two of them and form a pair. If we compute the product of each of those pairs and sort the results in ascending order, what will be the K-th number in that list?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq \\frac{N(N-1)}{2}\n\n-10^9 \\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 K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 3\n3 3 -4 -2\n\nSample Output 1\n\n-6\n\nThere are six ways to form a pair. The products of those pairs are 9, -12, -6, -12, -6, 8.\n\nSorting those numbers in ascending order, we have -12, -12, -6, -6, 8, 9. The third number in this list is -6.\n\nSample Input 2\n\n10 40\n5 4 3 2 -1 0 0 0 0 0\n\nSample Output 2\n\n6\n\nSample Input 3\n\n30 413\n-170202098 -268409015 537203564 983211703 21608710 -443999067 -937727165 -97596546 -372334013 398994917 -972141167 798607104 -949068442 -959948616 37909651 0 886627544 -20098238 0 -948955241 0 -214720580 277222296 -18897162 834475626 0 -425610555 110117526 663621752 0\n\nSample Output 3\n\n448283280358331064", "sample_input": "4 3\n3 3 -4 -2\n"}, "reference_outputs": ["-6\n"], "source_document_id": "p02774", "source_text": "Score: 400 points\n\nProblem Statement\n\nWe have N integers A_1, A_2, ..., A_N.\n\nThere are \\frac{N(N-1)}{2} ways to choose two of them and form a pair. If we compute the product of each of those pairs and sort the results in ascending order, what will be the K-th number in that list?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq \\frac{N(N-1)}{2}\n\n-10^9 \\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 K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 3\n3 3 -4 -2\n\nSample Output 1\n\n-6\n\nThere are six ways to form a pair. The products of those pairs are 9, -12, -6, -12, -6, 8.\n\nSorting those numbers in ascending order, we have -12, -12, -6, -6, 8, 9. The third number in this list is -6.\n\nSample Input 2\n\n10 40\n5 4 3 2 -1 0 0 0 0 0\n\nSample Output 2\n\n6\n\nSample Input 3\n\n30 413\n-170202098 -268409015 537203564 983211703 21608710 -443999067 -937727165 -97596546 -372334013 398994917 -972141167 798607104 -949068442 -959948616 37909651 0 886627544 -20098238 0 -948955241 0 -214720580 277222296 -18897162 834475626 0 -425610555 110117526 663621752 0\n\nSample Output 3\n\n448283280358331064", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2614, "cpu_time_ms": 920, "memory_kb": 13600}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s088109689", "group_id": "codeNet:p02774", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\n\tvar Nstr string\n\tsc1 := bufio.NewScanner(os.Stdin)\n\n\tif sc1.Scan() {\n\t\tNstr = sc1.Text()\n\t}\n\n\tN, _ := strconv.Atoi(strings.Split(Nstr, \" \")[0])\n\tK, _ := strconv.Atoi(strings.Split(Nstr, \" \")[1])\n\n\tvar cardStr string\n\tsc := bufio.NewScanner(os.Stdin)\n\tif sc.Scan() {\n\t\tcardStr = sc.Text()\n\t}\n\n\tNtotal := (N * (N - 1) / 2) + 1\n\n\tvar total []int\n\ttotal = make([]int, Ntotal, Ntotal)\n\n\tcardArray := strings.Split(cardStr, \" \")\n\n\t// var tmpInt []int\n\t// tmpInt = make([]int, N, N)\n\t// for i, valueStr := range cardArray {\n\t// \tvalue, _ := strconv.Atoi(valueStr)\n\t// \ttmpInt[i] = value\n\t// }\n\n\tcnt := 1\n\tfor i := 0; i < N; i++ {\n\t\tfor j := i + 1; j < N; j++ {\n\t\t\tvalue1, _ := strconv.Atoi(cardArray[i])\n\t\t\tvalue2, _ := strconv.Atoi(cardArray[j])\n\t\t\ttotal[cnt] = value1 * value2\n\t\t\tcnt++\n\t\t}\n\t}\n\n\tsort.Sort(sort.IntSlice(total))\n\n\tfmt.Println(total[K])\n\n}\n", "language": "Go", "metadata": {"date": 1581888622, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02774.html", "problem_id": "p02774", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02774/input.txt", "sample_output_relpath": "derived/input_output/data/p02774/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02774/Go/s088109689.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s088109689", "user_id": "u799236543"}, "prompt_components": {"gold_output": "-6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\n\tvar Nstr string\n\tsc1 := bufio.NewScanner(os.Stdin)\n\n\tif sc1.Scan() {\n\t\tNstr = sc1.Text()\n\t}\n\n\tN, _ := strconv.Atoi(strings.Split(Nstr, \" \")[0])\n\tK, _ := strconv.Atoi(strings.Split(Nstr, \" \")[1])\n\n\tvar cardStr string\n\tsc := bufio.NewScanner(os.Stdin)\n\tif sc.Scan() {\n\t\tcardStr = sc.Text()\n\t}\n\n\tNtotal := (N * (N - 1) / 2) + 1\n\n\tvar total []int\n\ttotal = make([]int, Ntotal, Ntotal)\n\n\tcardArray := strings.Split(cardStr, \" \")\n\n\t// var tmpInt []int\n\t// tmpInt = make([]int, N, N)\n\t// for i, valueStr := range cardArray {\n\t// \tvalue, _ := strconv.Atoi(valueStr)\n\t// \ttmpInt[i] = value\n\t// }\n\n\tcnt := 1\n\tfor i := 0; i < N; i++ {\n\t\tfor j := i + 1; j < N; j++ {\n\t\t\tvalue1, _ := strconv.Atoi(cardArray[i])\n\t\t\tvalue2, _ := strconv.Atoi(cardArray[j])\n\t\t\ttotal[cnt] = value1 * value2\n\t\t\tcnt++\n\t\t}\n\t}\n\n\tsort.Sort(sort.IntSlice(total))\n\n\tfmt.Println(total[K])\n\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nWe have N integers A_1, A_2, ..., A_N.\n\nThere are \\frac{N(N-1)}{2} ways to choose two of them and form a pair. If we compute the product of each of those pairs and sort the results in ascending order, what will be the K-th number in that list?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq \\frac{N(N-1)}{2}\n\n-10^9 \\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 K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 3\n3 3 -4 -2\n\nSample Output 1\n\n-6\n\nThere are six ways to form a pair. The products of those pairs are 9, -12, -6, -12, -6, 8.\n\nSorting those numbers in ascending order, we have -12, -12, -6, -6, 8, 9. The third number in this list is -6.\n\nSample Input 2\n\n10 40\n5 4 3 2 -1 0 0 0 0 0\n\nSample Output 2\n\n6\n\nSample Input 3\n\n30 413\n-170202098 -268409015 537203564 983211703 21608710 -443999067 -937727165 -97596546 -372334013 398994917 -972141167 798607104 -949068442 -959948616 37909651 0 886627544 -20098238 0 -948955241 0 -214720580 277222296 -18897162 834475626 0 -425610555 110117526 663621752 0\n\nSample Output 3\n\n448283280358331064", "sample_input": "4 3\n3 3 -4 -2\n"}, "reference_outputs": ["-6\n"], "source_document_id": "p02774", "source_text": "Score: 400 points\n\nProblem Statement\n\nWe have N integers A_1, A_2, ..., A_N.\n\nThere are \\frac{N(N-1)}{2} ways to choose two of them and form a pair. If we compute the product of each of those pairs and sort the results in ascending order, what will be the K-th number in that list?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq \\frac{N(N-1)}{2}\n\n-10^9 \\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 K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 3\n3 3 -4 -2\n\nSample Output 1\n\n-6\n\nThere are six ways to form a pair. The products of those pairs are 9, -12, -6, -12, -6, 8.\n\nSorting those numbers in ascending order, we have -12, -12, -6, -6, 8, 9. The third number in this list is -6.\n\nSample Input 2\n\n10 40\n5 4 3 2 -1 0 0 0 0 0\n\nSample Output 2\n\n6\n\nSample Input 3\n\n30 413\n-170202098 -268409015 537203564 983211703 21608710 -443999067 -937727165 -97596546 -372334013 398994917 -972141167 798607104 -949068442 -959948616 37909651 0 886627544 -20098238 0 -948955241 0 -214720580 277222296 -18897162 834475626 0 -425610555 110117526 663621752 0\n\nSample Output 3\n\n448283280358331064", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 943, "cpu_time_ms": 2107, "memory_kb": 106368}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s825638081", "group_id": "codeNet:p02774", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, k int\n\tvar base int\n\tvar count int\n\n\tfmt.Scan(&n, &k)\n\n\ta := make([]int, n)\n\tresult := make([]int, n*(n-1)/2)\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\n\tfor i := 0; i < n-1; i++ {\n\t\tbase = a[i]\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\tresult[count] = base * a[j]\n\t\t\tcount++\n\t\t}\n\t}\n\n\tsort.Sort(sort.IntSlice(result))\n\tfmt.Println(result[k-1])\n}\n", "language": "Go", "metadata": {"date": 1581888248, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02774.html", "problem_id": "p02774", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02774/input.txt", "sample_output_relpath": "derived/input_output/data/p02774/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02774/Go/s825638081.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s825638081", "user_id": "u410825686"}, "prompt_components": {"gold_output": "-6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, k int\n\tvar base int\n\tvar count int\n\n\tfmt.Scan(&n, &k)\n\n\ta := make([]int, n)\n\tresult := make([]int, n*(n-1)/2)\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\n\tfor i := 0; i < n-1; i++ {\n\t\tbase = a[i]\n\t\tfor j := i + 1; j < n; j++ {\n\t\t\tresult[count] = base * a[j]\n\t\t\tcount++\n\t\t}\n\t}\n\n\tsort.Sort(sort.IntSlice(result))\n\tfmt.Println(result[k-1])\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nWe have N integers A_1, A_2, ..., A_N.\n\nThere are \\frac{N(N-1)}{2} ways to choose two of them and form a pair. If we compute the product of each of those pairs and sort the results in ascending order, what will be the K-th number in that list?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq \\frac{N(N-1)}{2}\n\n-10^9 \\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 K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 3\n3 3 -4 -2\n\nSample Output 1\n\n-6\n\nThere are six ways to form a pair. The products of those pairs are 9, -12, -6, -12, -6, 8.\n\nSorting those numbers in ascending order, we have -12, -12, -6, -6, 8, 9. The third number in this list is -6.\n\nSample Input 2\n\n10 40\n5 4 3 2 -1 0 0 0 0 0\n\nSample Output 2\n\n6\n\nSample Input 3\n\n30 413\n-170202098 -268409015 537203564 983211703 21608710 -443999067 -937727165 -97596546 -372334013 398994917 -972141167 798607104 -949068442 -959948616 37909651 0 886627544 -20098238 0 -948955241 0 -214720580 277222296 -18897162 834475626 0 -425610555 110117526 663621752 0\n\nSample Output 3\n\n448283280358331064", "sample_input": "4 3\n3 3 -4 -2\n"}, "reference_outputs": ["-6\n"], "source_document_id": "p02774", "source_text": "Score: 400 points\n\nProblem Statement\n\nWe have N integers A_1, A_2, ..., A_N.\n\nThere are \\frac{N(N-1)}{2} ways to choose two of them and form a pair. If we compute the product of each of those pairs and sort the results in ascending order, what will be the K-th number in that list?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq \\frac{N(N-1)}{2}\n\n-10^9 \\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 K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 3\n3 3 -4 -2\n\nSample Output 1\n\n-6\n\nThere are six ways to form a pair. The products of those pairs are 9, -12, -6, -12, -6, 8.\n\nSorting those numbers in ascending order, we have -12, -12, -6, -6, 8, 9. The third number in this list is -6.\n\nSample Input 2\n\n10 40\n5 4 3 2 -1 0 0 0 0 0\n\nSample Output 2\n\n6\n\nSample Input 3\n\n30 413\n-170202098 -268409015 537203564 983211703 21608710 -443999067 -937727165 -97596546 -372334013 398994917 -972141167 798607104 -949068442 -959948616 37909651 0 886627544 -20098238 0 -948955241 0 -214720580 277222296 -18897162 834475626 0 -425610555 110117526 663621752 0\n\nSample Output 3\n\n448283280358331064", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 407, "cpu_time_ms": 2119, "memory_kb": 489344}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s617571755", "group_id": "codeNet:p02774", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\n\tvar Nstr string\n\tsc1 := bufio.NewScanner(os.Stdin)\n\n\tif sc1.Scan() {\n\t\tNstr = sc1.Text()\n\t}\n\n\tN, _ := strconv.Atoi(strings.Split(Nstr, \" \")[0])\n\tK, _ := strconv.Atoi(strings.Split(Nstr, \" \")[1])\n\n\tvar cardStr string\n\tsc := bufio.NewScanner(os.Stdin)\n\tif sc.Scan() {\n\t\tcardStr = sc.Text()\n\t}\n\n\tNtotal := N * (N - 1) / 2\n\tvar tmpInt []int\n\ttmpInt = make([]int, N, N)\n\n\tvar total []int\n\ttotal = make([]int, Ntotal, Ntotal)\n\n\tcardArray := strings.Split(cardStr, \" \")\n\n\tfor i, valueStr := range cardArray {\n\t\tvalue, _ := strconv.Atoi(valueStr)\n\t\ttmpInt[i] = value\n\t}\n\n\tvar cnt int\n\tfor i := 0; i < N; i++ {\n\t\tfor j := i + 1; j < N; j++ {\n\t\t\ttotal[cnt] = tmpInt[i] * tmpInt[j]\n\t\t\tcnt++\n\t\t}\n\t}\n\n\tsort.Sort(sort.IntSlice(total))\n\n\tfmt.Println(total[K-1])\n\n}\n", "language": "Go", "metadata": {"date": 1581888054, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02774.html", "problem_id": "p02774", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02774/input.txt", "sample_output_relpath": "derived/input_output/data/p02774/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02774/Go/s617571755.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s617571755", "user_id": "u799236543"}, "prompt_components": {"gold_output": "-6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\n\tvar Nstr string\n\tsc1 := bufio.NewScanner(os.Stdin)\n\n\tif sc1.Scan() {\n\t\tNstr = sc1.Text()\n\t}\n\n\tN, _ := strconv.Atoi(strings.Split(Nstr, \" \")[0])\n\tK, _ := strconv.Atoi(strings.Split(Nstr, \" \")[1])\n\n\tvar cardStr string\n\tsc := bufio.NewScanner(os.Stdin)\n\tif sc.Scan() {\n\t\tcardStr = sc.Text()\n\t}\n\n\tNtotal := N * (N - 1) / 2\n\tvar tmpInt []int\n\ttmpInt = make([]int, N, N)\n\n\tvar total []int\n\ttotal = make([]int, Ntotal, Ntotal)\n\n\tcardArray := strings.Split(cardStr, \" \")\n\n\tfor i, valueStr := range cardArray {\n\t\tvalue, _ := strconv.Atoi(valueStr)\n\t\ttmpInt[i] = value\n\t}\n\n\tvar cnt int\n\tfor i := 0; i < N; i++ {\n\t\tfor j := i + 1; j < N; j++ {\n\t\t\ttotal[cnt] = tmpInt[i] * tmpInt[j]\n\t\t\tcnt++\n\t\t}\n\t}\n\n\tsort.Sort(sort.IntSlice(total))\n\n\tfmt.Println(total[K-1])\n\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nWe have N integers A_1, A_2, ..., A_N.\n\nThere are \\frac{N(N-1)}{2} ways to choose two of them and form a pair. If we compute the product of each of those pairs and sort the results in ascending order, what will be the K-th number in that list?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq \\frac{N(N-1)}{2}\n\n-10^9 \\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 K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 3\n3 3 -4 -2\n\nSample Output 1\n\n-6\n\nThere are six ways to form a pair. The products of those pairs are 9, -12, -6, -12, -6, 8.\n\nSorting those numbers in ascending order, we have -12, -12, -6, -6, 8, 9. The third number in this list is -6.\n\nSample Input 2\n\n10 40\n5 4 3 2 -1 0 0 0 0 0\n\nSample Output 2\n\n6\n\nSample Input 3\n\n30 413\n-170202098 -268409015 537203564 983211703 21608710 -443999067 -937727165 -97596546 -372334013 398994917 -972141167 798607104 -949068442 -959948616 37909651 0 886627544 -20098238 0 -948955241 0 -214720580 277222296 -18897162 834475626 0 -425610555 110117526 663621752 0\n\nSample Output 3\n\n448283280358331064", "sample_input": "4 3\n3 3 -4 -2\n"}, "reference_outputs": ["-6\n"], "source_document_id": "p02774", "source_text": "Score: 400 points\n\nProblem Statement\n\nWe have N integers A_1, A_2, ..., A_N.\n\nThere are \\frac{N(N-1)}{2} ways to choose two of them and form a pair. If we compute the product of each of those pairs and sort the results in ascending order, what will be the K-th number in that list?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq \\frac{N(N-1)}{2}\n\n-10^9 \\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 K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 3\n3 3 -4 -2\n\nSample Output 1\n\n-6\n\nThere are six ways to form a pair. The products of those pairs are 9, -12, -6, -12, -6, 8.\n\nSorting those numbers in ascending order, we have -12, -12, -6, -6, 8, 9. The third number in this list is -6.\n\nSample Input 2\n\n10 40\n5 4 3 2 -1 0 0 0 0 0\n\nSample Output 2\n\n6\n\nSample Input 3\n\n30 413\n-170202098 -268409015 537203564 983211703 21608710 -443999067 -937727165 -97596546 -372334013 398994917 -972141167 798607104 -949068442 -959948616 37909651 0 886627544 -20098238 0 -948955241 0 -214720580 277222296 -18897162 834475626 0 -425610555 110117526 663621752 0\n\nSample Output 3\n\n448283280358331064", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 844, "cpu_time_ms": 2124, "memory_kb": 488832}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s765956050", "group_id": "codeNet:p02774", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main(){\n\tvar k,n int\n\tfmt.Scan(&n,&k)\n\ta := make([]int,n)\n\tp := n*(n-1)/2\n\tpro := make([]int,p)\n\tfor i := 0 ; i < n ; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\t//fmt.Println(a)\n\tc := 0\n\tfor i := 0 ; i < n-1; i++ {\n\t\tfor j := i+1 ; j < n ; j++ {\n\t\t\tpro[c] = a[i] * a[j]\n\t\t\tc++\n\t\t}\n\t}\n\tsort.Ints(pro)\n\tfmt.Println(pro[k-1])\n}\n", "language": "Go", "metadata": {"date": 1581887017, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02774.html", "problem_id": "p02774", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02774/input.txt", "sample_output_relpath": "derived/input_output/data/p02774/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02774/Go/s765956050.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s765956050", "user_id": "u145635628"}, "prompt_components": {"gold_output": "-6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main(){\n\tvar k,n int\n\tfmt.Scan(&n,&k)\n\ta := make([]int,n)\n\tp := n*(n-1)/2\n\tpro := make([]int,p)\n\tfor i := 0 ; i < n ; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\t//fmt.Println(a)\n\tc := 0\n\tfor i := 0 ; i < n-1; i++ {\n\t\tfor j := i+1 ; j < n ; j++ {\n\t\t\tpro[c] = a[i] * a[j]\n\t\t\tc++\n\t\t}\n\t}\n\tsort.Ints(pro)\n\tfmt.Println(pro[k-1])\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nWe have N integers A_1, A_2, ..., A_N.\n\nThere are \\frac{N(N-1)}{2} ways to choose two of them and form a pair. If we compute the product of each of those pairs and sort the results in ascending order, what will be the K-th number in that list?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq \\frac{N(N-1)}{2}\n\n-10^9 \\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 K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 3\n3 3 -4 -2\n\nSample Output 1\n\n-6\n\nThere are six ways to form a pair. The products of those pairs are 9, -12, -6, -12, -6, 8.\n\nSorting those numbers in ascending order, we have -12, -12, -6, -6, 8, 9. The third number in this list is -6.\n\nSample Input 2\n\n10 40\n5 4 3 2 -1 0 0 0 0 0\n\nSample Output 2\n\n6\n\nSample Input 3\n\n30 413\n-170202098 -268409015 537203564 983211703 21608710 -443999067 -937727165 -97596546 -372334013 398994917 -972141167 798607104 -949068442 -959948616 37909651 0 886627544 -20098238 0 -948955241 0 -214720580 277222296 -18897162 834475626 0 -425610555 110117526 663621752 0\n\nSample Output 3\n\n448283280358331064", "sample_input": "4 3\n3 3 -4 -2\n"}, "reference_outputs": ["-6\n"], "source_document_id": "p02774", "source_text": "Score: 400 points\n\nProblem Statement\n\nWe have N integers A_1, A_2, ..., A_N.\n\nThere are \\frac{N(N-1)}{2} ways to choose two of them and form a pair. If we compute the product of each of those pairs and sort the results in ascending order, what will be the K-th number in that list?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq \\frac{N(N-1)}{2}\n\n-10^9 \\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 K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 3\n3 3 -4 -2\n\nSample Output 1\n\n-6\n\nThere are six ways to form a pair. The products of those pairs are 9, -12, -6, -12, -6, 8.\n\nSorting those numbers in ascending order, we have -12, -12, -6, -6, 8, 9. The third number in this list is -6.\n\nSample Input 2\n\n10 40\n5 4 3 2 -1 0 0 0 0 0\n\nSample Output 2\n\n6\n\nSample Input 3\n\n30 413\n-170202098 -268409015 537203564 983211703 21608710 -443999067 -937727165 -97596546 -372334013 398994917 -972141167 798607104 -949068442 -959948616 37909651 0 886627544 -20098238 0 -948955241 0 -214720580 277222296 -18897162 834475626 0 -425610555 110117526 663621752 0\n\nSample Output 3\n\n448283280358331064", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2129, "memory_kb": 489216}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s053931427", "group_id": "codeNet:p02774", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\nfunc run() int {\n\tvar n, k int\n\tfmt.Scanf(\"%d %d\\n\", &n, &k)\n\tan := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &an[i])\n\t}\n\n\tlist := make([]int, (len(an)*(len(an)-1))/2)\n\tidx := 0\n\tfor i := 0; i < len(an); i++ {\n\t\tfor j := i + 1; j < len(an); j++ {\n\t\t\tlist[idx] = an[i] * an[j]\n\t\t\tidx++\n\t\t}\n\t}\n \n sort.Ints(list)\n\n\tfmt.Println(list[k-1])\n\n\treturn 0\n}\n\nfunc main() {\n\tos.Exit(run())\n}\n", "language": "Go", "metadata": {"date": 1581886225, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02774.html", "problem_id": "p02774", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02774/input.txt", "sample_output_relpath": "derived/input_output/data/p02774/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02774/Go/s053931427.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s053931427", "user_id": "u737368452"}, "prompt_components": {"gold_output": "-6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n)\n\nfunc run() int {\n\tvar n, k int\n\tfmt.Scanf(\"%d %d\\n\", &n, &k)\n\tan := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &an[i])\n\t}\n\n\tlist := make([]int, (len(an)*(len(an)-1))/2)\n\tidx := 0\n\tfor i := 0; i < len(an); i++ {\n\t\tfor j := i + 1; j < len(an); j++ {\n\t\t\tlist[idx] = an[i] * an[j]\n\t\t\tidx++\n\t\t}\n\t}\n \n sort.Ints(list)\n\n\tfmt.Println(list[k-1])\n\n\treturn 0\n}\n\nfunc main() {\n\tos.Exit(run())\n}\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nWe have N integers A_1, A_2, ..., A_N.\n\nThere are \\frac{N(N-1)}{2} ways to choose two of them and form a pair. If we compute the product of each of those pairs and sort the results in ascending order, what will be the K-th number in that list?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq \\frac{N(N-1)}{2}\n\n-10^9 \\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 K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 3\n3 3 -4 -2\n\nSample Output 1\n\n-6\n\nThere are six ways to form a pair. The products of those pairs are 9, -12, -6, -12, -6, 8.\n\nSorting those numbers in ascending order, we have -12, -12, -6, -6, 8, 9. The third number in this list is -6.\n\nSample Input 2\n\n10 40\n5 4 3 2 -1 0 0 0 0 0\n\nSample Output 2\n\n6\n\nSample Input 3\n\n30 413\n-170202098 -268409015 537203564 983211703 21608710 -443999067 -937727165 -97596546 -372334013 398994917 -972141167 798607104 -949068442 -959948616 37909651 0 886627544 -20098238 0 -948955241 0 -214720580 277222296 -18897162 834475626 0 -425610555 110117526 663621752 0\n\nSample Output 3\n\n448283280358331064", "sample_input": "4 3\n3 3 -4 -2\n"}, "reference_outputs": ["-6\n"], "source_document_id": "p02774", "source_text": "Score: 400 points\n\nProblem Statement\n\nWe have N integers A_1, A_2, ..., A_N.\n\nThere are \\frac{N(N-1)}{2} ways to choose two of them and form a pair. If we compute the product of each of those pairs and sort the results in ascending order, what will be the K-th number in that list?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq \\frac{N(N-1)}{2}\n\n-10^9 \\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 K\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 3\n3 3 -4 -2\n\nSample Output 1\n\n-6\n\nThere are six ways to form a pair. The products of those pairs are 9, -12, -6, -12, -6, 8.\n\nSorting those numbers in ascending order, we have -12, -12, -6, -6, 8, 9. The third number in this list is -6.\n\nSample Input 2\n\n10 40\n5 4 3 2 -1 0 0 0 0 0\n\nSample Output 2\n\n6\n\nSample Input 3\n\n30 413\n-170202098 -268409015 537203564 983211703 21608710 -443999067 -937727165 -97596546 -372334013 398994917 -972141167 798607104 -949068442 -959948616 37909651 0 886627544 -20098238 0 -948955241 0 -214720580 277222296 -18897162 834475626 0 -425610555 110117526 663621752 0\n\nSample Output 3\n\n448283280358331064", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2118, "memory_kb": 489344}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s816567523", "group_id": "codeNet:p02879", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tif a <= 9 && b <= 9 {\n\t\tfmt.Println(a * b)\n\t} else {\n\t\tfmt.Println(-1)\n\t}\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n", "language": "Go", "metadata": {"date": 1595214509, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02879.html", "problem_id": "p02879", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02879/input.txt", "sample_output_relpath": "derived/input_output/data/p02879/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02879/Go/s816567523.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s816567523", "user_id": "u282164747"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tif a <= 9 && b <= 9 {\n\t\tfmt.Println(a * b)\n\t} else {\n\t\tfmt.Println(-1)\n\t}\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.\n\nGiven are two integers A and B.\n\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1 instead.\n\nConstraints\n\n1 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\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\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\n2 \\times 5 = 10.\n\nSample Input 2\n\n5 10\n\nSample Output 2\n\n-1\n\n5\\times 10 = 50, but Takahashi cannot do this calculation, so print -1 instead.\n\nSample Input 3\n\n9 9\n\nSample Output 3\n\n81", "sample_input": "2 5\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02879", "source_text": "Score : 100 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.\n\nGiven are two integers A and B.\n\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1 instead.\n\nConstraints\n\n1 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\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\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\n2 \\times 5 = 10.\n\nSample Input 2\n\n5 10\n\nSample Output 2\n\n-1\n\n5\\times 10 = 50, but Takahashi cannot do this calculation, so print -1 instead.\n\nSample Input 3\n\n9 9\n\nSample Output 3\n\n81", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 6, "memory_kb": 1772}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s382681455", "group_id": "codeNet:p02879", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getInts(N int) []int {\n\tret := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tret[i] = getInt()\n\t}\n\treturn ret\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc lowerBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] >= x\n\t})\n\treturn idx\n}\n\nfunc upperBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] > x\n\t})\n\treturn idx\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\ta, b := getInt(), getInt()\n\tif a < 10 && b < 10 {\n\t\tout(a * b)\n\t\treturn\n\t}\n\tout(-1)\n}\n", "language": "Go", "metadata": {"date": 1593909796, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02879.html", "problem_id": "p02879", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02879/input.txt", "sample_output_relpath": "derived/input_output/data/p02879/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02879/Go/s382681455.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s382681455", "user_id": "u814575783"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getInts(N int) []int {\n\tret := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tret[i] = getInt()\n\t}\n\treturn ret\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc lowerBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] >= x\n\t})\n\treturn idx\n}\n\nfunc upperBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] > x\n\t})\n\treturn idx\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\ta, b := getInt(), getInt()\n\tif a < 10 && b < 10 {\n\t\tout(a * b)\n\t\treturn\n\t}\n\tout(-1)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.\n\nGiven are two integers A and B.\n\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1 instead.\n\nConstraints\n\n1 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\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\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\n2 \\times 5 = 10.\n\nSample Input 2\n\n5 10\n\nSample Output 2\n\n-1\n\n5\\times 10 = 50, but Takahashi cannot do this calculation, so print -1 instead.\n\nSample Input 3\n\n9 9\n\nSample Output 3\n\n81", "sample_input": "2 5\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02879", "source_text": "Score : 100 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.\n\nGiven are two integers A and B.\n\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1 instead.\n\nConstraints\n\n1 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\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\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\n2 \\times 5 = 10.\n\nSample Input 2\n\n5 10\n\nSample Output 2\n\n-1\n\n5\\times 10 = 50, but Takahashi cannot do this calculation, so print -1 instead.\n\nSample Input 3\n\n9 9\n\nSample Output 3\n\n81", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1112, "cpu_time_ms": 6, "memory_kb": 1772}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s934978423", "group_id": "codeNet:p02879", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\n\tif a <= 9 && b <= 9 {\n\t\tfmt.Println(a * b)\n\t} else {\n\t\tfmt.Println(-1)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1588632613, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02879.html", "problem_id": "p02879", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02879/input.txt", "sample_output_relpath": "derived/input_output/data/p02879/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02879/Go/s934978423.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s934978423", "user_id": "u214033538"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\n\tif a <= 9 && b <= 9 {\n\t\tfmt.Println(a * b)\n\t} else {\n\t\tfmt.Println(-1)\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.\n\nGiven are two integers A and B.\n\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1 instead.\n\nConstraints\n\n1 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\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\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\n2 \\times 5 = 10.\n\nSample Input 2\n\n5 10\n\nSample Output 2\n\n-1\n\n5\\times 10 = 50, but Takahashi cannot do this calculation, so print -1 instead.\n\nSample Input 3\n\n9 9\n\nSample Output 3\n\n81", "sample_input": "2 5\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02879", "source_text": "Score : 100 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.\n\nGiven are two integers A and B.\n\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1 instead.\n\nConstraints\n\n1 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\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\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\n2 \\times 5 = 10.\n\nSample Input 2\n\n5 10\n\nSample Output 2\n\n-1\n\n5\\times 10 = 50, but Takahashi cannot do this calculation, so print -1 instead.\n\nSample Input 3\n\n9 9\n\nSample Output 3\n\n81", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s991429558", "group_id": "codeNet:p02879", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tif (1 <= a && a <= 9) && (1 <= b && b <= 9) {\n\t\tfmt.Println(a * b)\n\t} else {\n\t\tfmt.Println(-1)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1581179793, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02879.html", "problem_id": "p02879", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02879/input.txt", "sample_output_relpath": "derived/input_output/data/p02879/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02879/Go/s991429558.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s991429558", "user_id": "u363118893"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tif (1 <= a && a <= 9) && (1 <= b && b <= 9) {\n\t\tfmt.Println(a * b)\n\t} else {\n\t\tfmt.Println(-1)\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.\n\nGiven are two integers A and B.\n\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1 instead.\n\nConstraints\n\n1 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\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\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\n2 \\times 5 = 10.\n\nSample Input 2\n\n5 10\n\nSample Output 2\n\n-1\n\n5\\times 10 = 50, but Takahashi cannot do this calculation, so print -1 instead.\n\nSample Input 3\n\n9 9\n\nSample Output 3\n\n81", "sample_input": "2 5\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02879", "source_text": "Score : 100 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.\n\nGiven are two integers A and B.\n\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1 instead.\n\nConstraints\n\n1 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\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\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\n2 \\times 5 = 10.\n\nSample Input 2\n\n5 10\n\nSample Output 2\n\n-1\n\n5\\times 10 = 50, but Takahashi cannot do this calculation, so print -1 instead.\n\nSample Input 3\n\n9 9\n\nSample Output 3\n\n81", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s455895930", "group_id": "codeNet:p02879", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\n//=====I/O=====\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twr = bufio.NewWriter(os.Stdout)\n)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ta,_ := strconv.Atoi(sc.Text())\n\treturn a\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ { res[i] = scanInt() }\n\treturn res\n}\n\nfunc scanText() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc printInts(a ...int) {\n\tfor i, e := range a {\n\t\tfmt.Fprint(wr, e)\n\t\tif i != len(a)-1 { fmt.Fprint(wr, \" \") }\n\t}\n\tfmt.Fprintln(wr)\n\twr.Flush()\n}\n\n//=====main=====\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\ta, b := scanInt(), scanInt()\n\n\tif a < 10 && b < 10 {\n\t\tfmt.Println(a*b)\n\t} else {\n\t\tfmt.Println(-1)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1576378446, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02879.html", "problem_id": "p02879", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02879/input.txt", "sample_output_relpath": "derived/input_output/data/p02879/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02879/Go/s455895930.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s455895930", "user_id": "u548992197"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n)\n\n//=====I/O=====\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twr = bufio.NewWriter(os.Stdout)\n)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ta,_ := strconv.Atoi(sc.Text())\n\treturn a\n}\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ { res[i] = scanInt() }\n\treturn res\n}\n\nfunc scanText() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc printInts(a ...int) {\n\tfor i, e := range a {\n\t\tfmt.Fprint(wr, e)\n\t\tif i != len(a)-1 { fmt.Fprint(wr, \" \") }\n\t}\n\tfmt.Fprintln(wr)\n\twr.Flush()\n}\n\n//=====main=====\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\ta, b := scanInt(), scanInt()\n\n\tif a < 10 && b < 10 {\n\t\tfmt.Println(a*b)\n\t} else {\n\t\tfmt.Println(-1)\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.\n\nGiven are two integers A and B.\n\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1 instead.\n\nConstraints\n\n1 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\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\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\n2 \\times 5 = 10.\n\nSample Input 2\n\n5 10\n\nSample Output 2\n\n-1\n\n5\\times 10 = 50, but Takahashi cannot do this calculation, so print -1 instead.\n\nSample Input 3\n\n9 9\n\nSample Output 3\n\n81", "sample_input": "2 5\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02879", "source_text": "Score : 100 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.\n\nGiven are two integers A and B.\n\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1 instead.\n\nConstraints\n\n1 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\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\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\n2 \\times 5 = 10.\n\nSample Input 2\n\n5 10\n\nSample Output 2\n\n-1\n\n5\\times 10 = 50, but Takahashi cannot do this calculation, so print -1 instead.\n\nSample Input 3\n\n9 9\n\nSample Output 3\n\n81", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s550925552", "group_id": "codeNet:p02879", "input_text": "package main\n \nimport (\n\t\"fmt\"\n)\n \nfunc main() {\n\tvar a,b int\n\tfmt.Scan(&a, &b)\n\tif a >= 10 || b >= 10 {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(a*b)\n\t}\n}", "language": "Go", "metadata": {"date": 1576099547, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02879.html", "problem_id": "p02879", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02879/input.txt", "sample_output_relpath": "derived/input_output/data/p02879/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02879/Go/s550925552.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s550925552", "user_id": "u078274014"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n \nimport (\n\t\"fmt\"\n)\n \nfunc main() {\n\tvar a,b int\n\tfmt.Scan(&a, &b)\n\tif a >= 10 || b >= 10 {\n\t\tfmt.Println(-1)\n\t} else {\n\t\tfmt.Println(a*b)\n\t}\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.\n\nGiven are two integers A and B.\n\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1 instead.\n\nConstraints\n\n1 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\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\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\n2 \\times 5 = 10.\n\nSample Input 2\n\n5 10\n\nSample Output 2\n\n-1\n\n5\\times 10 = 50, but Takahashi cannot do this calculation, so print -1 instead.\n\nSample Input 3\n\n9 9\n\nSample Output 3\n\n81", "sample_input": "2 5\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02879", "source_text": "Score : 100 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.\n\nGiven are two integers A and B.\n\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1 instead.\n\nConstraints\n\n1 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\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\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\n2 \\times 5 = 10.\n\nSample Input 2\n\n5 10\n\nSample Output 2\n\n-1\n\n5\\times 10 = 50, but Takahashi cannot do this calculation, so print -1 instead.\n\nSample Input 3\n\n9 9\n\nSample Output 3\n\n81", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 156, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s852151747", "group_id": "codeNet:p02879", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var A, B int\n fmt.Scan(&A, &B)\n \n if A < 10 && B < 10 {\n fmt.Println(A * B)\n } else {\n fmt.Println(-1)\n }\n}", "language": "Go", "metadata": {"date": 1574173026, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02879.html", "problem_id": "p02879", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02879/input.txt", "sample_output_relpath": "derived/input_output/data/p02879/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02879/Go/s852151747.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s852151747", "user_id": "u195309147"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var A, B int\n fmt.Scan(&A, &B)\n \n if A < 10 && B < 10 {\n fmt.Println(A * B)\n } else {\n fmt.Println(-1)\n }\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.\n\nGiven are two integers A and B.\n\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1 instead.\n\nConstraints\n\n1 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\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\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\n2 \\times 5 = 10.\n\nSample Input 2\n\n5 10\n\nSample Output 2\n\n-1\n\n5\\times 10 = 50, but Takahashi cannot do this calculation, so print -1 instead.\n\nSample Input 3\n\n9 9\n\nSample Output 3\n\n81", "sample_input": "2 5\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02879", "source_text": "Score : 100 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.\n\nGiven are two integers A and B.\n\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1 instead.\n\nConstraints\n\n1 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\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\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\n2 \\times 5 = 10.\n\nSample Input 2\n\n5 10\n\nSample Output 2\n\n-1\n\n5\\times 10 = 50, but Takahashi cannot do this calculation, so print -1 instead.\n\nSample Input 3\n\n9 9\n\nSample Output 3\n\n81", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s866547023", "group_id": "codeNet:p02879", "input_text": "package main\n \nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n \"strconv\"\n \"strings\"\n)\n\nfunc main() {\n scanner := bufio.NewScanner(os.Stdin)\n scanner.Scan()\n stdInput := scanner.Text()\n valueList := strings.Split(stdInput, \" \")\n a, _ := strconv.Atoi(valueList[0])\n b, _ := strconv.Atoi(valueList[1])\n \n if 0 < a && a < 10 && 0 < b && b < 10 {\n fmt.Println(a * b)\n } else {\n fmt.Println(\"-1\")\n }\n}", "language": "Go", "metadata": {"date": 1572536932, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02879.html", "problem_id": "p02879", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02879/input.txt", "sample_output_relpath": "derived/input_output/data/p02879/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02879/Go/s866547023.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s866547023", "user_id": "u150749188"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n \nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n \"strconv\"\n \"strings\"\n)\n\nfunc main() {\n scanner := bufio.NewScanner(os.Stdin)\n scanner.Scan()\n stdInput := scanner.Text()\n valueList := strings.Split(stdInput, \" \")\n a, _ := strconv.Atoi(valueList[0])\n b, _ := strconv.Atoi(valueList[1])\n \n if 0 < a && a < 10 && 0 < b && b < 10 {\n fmt.Println(a * b)\n } else {\n fmt.Println(\"-1\")\n }\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.\n\nGiven are two integers A and B.\n\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1 instead.\n\nConstraints\n\n1 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\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\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\n2 \\times 5 = 10.\n\nSample Input 2\n\n5 10\n\nSample Output 2\n\n-1\n\n5\\times 10 = 50, but Takahashi cannot do this calculation, so print -1 instead.\n\nSample Input 3\n\n9 9\n\nSample Output 3\n\n81", "sample_input": "2 5\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02879", "source_text": "Score : 100 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.\n\nGiven are two integers A and B.\n\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1 instead.\n\nConstraints\n\n1 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\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\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\n2 \\times 5 = 10.\n\nSample Input 2\n\n5 10\n\nSample Output 2\n\n-1\n\n5\\times 10 = 50, but Takahashi cannot do this calculation, so print -1 instead.\n\nSample Input 3\n\n9 9\n\nSample Output 3\n\n81", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 400, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s742386222", "group_id": "codeNet:p02879", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\n// main is ...\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\n\tisValid := isValid(a) && isValid(b)\n\tif isValid {\n\t\tfmt.Print(a * b)\n\t\treturn\n\n\t}\n\n\tfmt.Print(-1)\n}\n\nfunc isValid(a int) bool {\n\treturn 0 <= a && a < 10\n}\n\n", "language": "Go", "metadata": {"date": 1572227647, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02879.html", "problem_id": "p02879", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02879/input.txt", "sample_output_relpath": "derived/input_output/data/p02879/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02879/Go/s742386222.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s742386222", "user_id": "u618957182"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\n// main is ...\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\n\tisValid := isValid(a) && isValid(b)\n\tif isValid {\n\t\tfmt.Print(a * b)\n\t\treturn\n\n\t}\n\n\tfmt.Print(-1)\n}\n\nfunc isValid(a int) bool {\n\treturn 0 <= a && a < 10\n}\n\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.\n\nGiven are two integers A and B.\n\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1 instead.\n\nConstraints\n\n1 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\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\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\n2 \\times 5 = 10.\n\nSample Input 2\n\n5 10\n\nSample Output 2\n\n-1\n\n5\\times 10 = 50, but Takahashi cannot do this calculation, so print -1 instead.\n\nSample Input 3\n\n9 9\n\nSample Output 3\n\n81", "sample_input": "2 5\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02879", "source_text": "Score : 100 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.\n\nGiven are two integers A and B.\n\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1 instead.\n\nConstraints\n\n1 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\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\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\n2 \\times 5 = 10.\n\nSample Input 2\n\n5 10\n\nSample Output 2\n\n-1\n\n5\\times 10 = 50, but Takahashi cannot do this calculation, so print -1 instead.\n\nSample Input 3\n\n9 9\n\nSample Output 3\n\n81", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 252, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s245186482", "group_id": "codeNet:p02879", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar s = bufio.NewScanner(os.Stdin)\n\nfunc Scan() string {\n\ts.Scan()\n\treturn s.Text()\n}\n\nfunc main() {\n\tfmt.Println(p())\n}\n\nfunc ScanInt() int {\n\ta, err := strconv.Atoi(Scan())\n\tif err != nil {\n\t\treturn 0\n\t}\n\treturn a\n}\n\nfunc test(n int) string {\n\tfor i := 9; i > 1; i-- {\n\t\tif n%i == 0 {\n\t\t\ta := n / i\n\t\t\tif a < 10 {\n\t\t\t\treturn \"Yes\"\n\t\t\t}\n\t\t\treturn \"No\"\n\t\t}\n\t}\n\treturn \"No\"\n}\n\nfunc p() string {\n\ta := ScanInt()\n\tif a == 0 || a > 81 {\n\t\treturn \"No\"\n\t}\n\treturn test(a)\n}\n", "language": "Go", "metadata": {"date": 1572227416, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02879.html", "problem_id": "p02879", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02879/input.txt", "sample_output_relpath": "derived/input_output/data/p02879/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02879/Go/s245186482.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s245186482", "user_id": "u658811315"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar s = bufio.NewScanner(os.Stdin)\n\nfunc Scan() string {\n\ts.Scan()\n\treturn s.Text()\n}\n\nfunc main() {\n\tfmt.Println(p())\n}\n\nfunc ScanInt() int {\n\ta, err := strconv.Atoi(Scan())\n\tif err != nil {\n\t\treturn 0\n\t}\n\treturn a\n}\n\nfunc test(n int) string {\n\tfor i := 9; i > 1; i-- {\n\t\tif n%i == 0 {\n\t\t\ta := n / i\n\t\t\tif a < 10 {\n\t\t\t\treturn \"Yes\"\n\t\t\t}\n\t\t\treturn \"No\"\n\t\t}\n\t}\n\treturn \"No\"\n}\n\nfunc p() string {\n\ta := ScanInt()\n\tif a == 0 || a > 81 {\n\t\treturn \"No\"\n\t}\n\treturn test(a)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.\n\nGiven are two integers A and B.\n\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1 instead.\n\nConstraints\n\n1 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\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\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\n2 \\times 5 = 10.\n\nSample Input 2\n\n5 10\n\nSample Output 2\n\n-1\n\n5\\times 10 = 50, but Takahashi cannot do this calculation, so print -1 instead.\n\nSample Input 3\n\n9 9\n\nSample Output 3\n\n81", "sample_input": "2 5\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02879", "source_text": "Score : 100 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.\n\nGiven are two integers A and B.\n\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1 instead.\n\nConstraints\n\n1 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\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\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\n2 \\times 5 = 10.\n\nSample Input 2\n\n5 10\n\nSample Output 2\n\n-1\n\n5\\times 10 = 50, but Takahashi cannot do this calculation, so print -1 instead.\n\nSample Input 3\n\n9 9\n\nSample Output 3\n\n81", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s304747864", "group_id": "codeNet:p02879", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar s = bufio.NewScanner(os.Stdin)\n\nfunc ScanLine() string {\n\ts.Scan()\n\treturn s.Text()\n}\n\nfunc main() {\n\tp()\n}\n\nfunc ScanInts() (int, int) {\n\tstr := ScanLine()\n\tv := strings.Split(str, \" \")\n\ta, _ := strconv.Atoi(v[0])\n\tb, _ := strconv.Atoi(v[1])\n\treturn a, b\n}\n\nfunc p() int {\n\ta, b := ScanInts()\n\tif a > 10 || b > 10 {\n\t\treturn -1\n\t}\n\treturn a * b\n}\n", "language": "Go", "metadata": {"date": 1572225567, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02879.html", "problem_id": "p02879", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02879/input.txt", "sample_output_relpath": "derived/input_output/data/p02879/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02879/Go/s304747864.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s304747864", "user_id": "u658811315"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar s = bufio.NewScanner(os.Stdin)\n\nfunc ScanLine() string {\n\ts.Scan()\n\treturn s.Text()\n}\n\nfunc main() {\n\tp()\n}\n\nfunc ScanInts() (int, int) {\n\tstr := ScanLine()\n\tv := strings.Split(str, \" \")\n\ta, _ := strconv.Atoi(v[0])\n\tb, _ := strconv.Atoi(v[1])\n\treturn a, b\n}\n\nfunc p() int {\n\ta, b := ScanInts()\n\tif a > 10 || b > 10 {\n\t\treturn -1\n\t}\n\treturn a * b\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.\n\nGiven are two integers A and B.\n\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1 instead.\n\nConstraints\n\n1 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\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\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\n2 \\times 5 = 10.\n\nSample Input 2\n\n5 10\n\nSample Output 2\n\n-1\n\n5\\times 10 = 50, but Takahashi cannot do this calculation, so print -1 instead.\n\nSample Input 3\n\n9 9\n\nSample Output 3\n\n81", "sample_input": "2 5\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02879", "source_text": "Score : 100 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.\n\nGiven are two integers A and B.\n\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1 instead.\n\nConstraints\n\n1 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\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\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\n2 \\times 5 = 10.\n\nSample Input 2\n\n5 10\n\nSample Output 2\n\n-1\n\n5\\times 10 = 50, but Takahashi cannot do this calculation, so print -1 instead.\n\nSample Input 3\n\n9 9\n\nSample Output 3\n\n81", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s321666374", "group_id": "codeNet:p02879", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tA := oneInt()\n\tB := oneInt()\n\tans := A * B\n\tif 0 < A && A < 10 {\n\n\t} else {\n\t\tfmt.Print(-1)\n\t\treturn\n\t}\n\n\tif 0 < B && B < 10 {\n\n\t} else {\n\t\tfmt.Print(-1)\n\t}\n\n\tif 0 < ans && ans < 82 {\n\t\tfmt.Print(ans)\n\t} else {\n\t\tfmt.Print(-1)\n\t}\n\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc oneInt() int {\n\tvar a int\n\tfmt.Scan(&a)\n\treturn a\n}\nfunc oneStr() string {\n\tvar a string\n\tfmt.Scan(&a)\n\treturn a\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc scanNums() (nums []int) {\n\ts := nextLine()\n\tnumStr := strings.Split(s, \" \")\n\n\tfor _, n := range numStr {\n\t\ti, _ := strconv.Atoi(n)\n\t\tnums = append(nums, i)\n\t}\n\treturn nums\n}\n\nfunc scanStrings() (strs []string) {\n\ts := nextLine()\n\tlist := strings.Split(s, \" \")\n\tstrs = append(strs, list...)\n\treturn strs\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc sortAsc(a []int) []int {\n\tsort.Ints(a)\n\treturn a\n}\n\nfunc sortDesc(a []int) []int {\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\treturn a\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\tif a == 0 && b == 0 {\n\t\treturn 0\n\t}\n\treturn a * b / gcd(a, b)\n}\n", "language": "Go", "metadata": {"date": 1572225541, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02879.html", "problem_id": "p02879", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02879/input.txt", "sample_output_relpath": "derived/input_output/data/p02879/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02879/Go/s321666374.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s321666374", "user_id": "u643520570"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tA := oneInt()\n\tB := oneInt()\n\tans := A * B\n\tif 0 < A && A < 10 {\n\n\t} else {\n\t\tfmt.Print(-1)\n\t\treturn\n\t}\n\n\tif 0 < B && B < 10 {\n\n\t} else {\n\t\tfmt.Print(-1)\n\t}\n\n\tif 0 < ans && ans < 82 {\n\t\tfmt.Print(ans)\n\t} else {\n\t\tfmt.Print(-1)\n\t}\n\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc oneInt() int {\n\tvar a int\n\tfmt.Scan(&a)\n\treturn a\n}\nfunc oneStr() string {\n\tvar a string\n\tfmt.Scan(&a)\n\treturn a\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc scanNums() (nums []int) {\n\ts := nextLine()\n\tnumStr := strings.Split(s, \" \")\n\n\tfor _, n := range numStr {\n\t\ti, _ := strconv.Atoi(n)\n\t\tnums = append(nums, i)\n\t}\n\treturn nums\n}\n\nfunc scanStrings() (strs []string) {\n\ts := nextLine()\n\tlist := strings.Split(s, \" \")\n\tstrs = append(strs, list...)\n\treturn strs\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc sortAsc(a []int) []int {\n\tsort.Ints(a)\n\treturn a\n}\n\nfunc sortDesc(a []int) []int {\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\treturn a\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\tif a == 0 && b == 0 {\n\t\treturn 0\n\t}\n\treturn a * b / gcd(a, b)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.\n\nGiven are two integers A and B.\n\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1 instead.\n\nConstraints\n\n1 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\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\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\n2 \\times 5 = 10.\n\nSample Input 2\n\n5 10\n\nSample Output 2\n\n-1\n\n5\\times 10 = 50, but Takahashi cannot do this calculation, so print -1 instead.\n\nSample Input 3\n\n9 9\n\nSample Output 3\n\n81", "sample_input": "2 5\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02879", "source_text": "Score : 100 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.\n\nGiven are two integers A and B.\n\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1 instead.\n\nConstraints\n\n1 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\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\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\n2 \\times 5 = 10.\n\nSample Input 2\n\n5 10\n\nSample Output 2\n\n-1\n\n5\\times 10 = 50, but Takahashi cannot do this calculation, so print -1 instead.\n\nSample Input 3\n\n9 9\n\nSample Output 3\n\n81", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1898, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s138203111", "group_id": "codeNet:p02879", "input_text": "package main\n\nimport(\n \"fmt\"\n)\n\nfunc main() {\n var a, b int\n fmt.Scan(&a, &b)\n if a > 9 || b > 9 {\n fmt.Println(-1)\n }else {\n fmt.Println(a*b)\n }\n}", "language": "Go", "metadata": {"date": 1572224651, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02879.html", "problem_id": "p02879", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02879/input.txt", "sample_output_relpath": "derived/input_output/data/p02879/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02879/Go/s138203111.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s138203111", "user_id": "u017829818"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport(\n \"fmt\"\n)\n\nfunc main() {\n var a, b int\n fmt.Scan(&a, &b)\n if a > 9 || b > 9 {\n fmt.Println(-1)\n }else {\n fmt.Println(a*b)\n }\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.\n\nGiven are two integers A and B.\n\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1 instead.\n\nConstraints\n\n1 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\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\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\n2 \\times 5 = 10.\n\nSample Input 2\n\n5 10\n\nSample Output 2\n\n-1\n\n5\\times 10 = 50, but Takahashi cannot do this calculation, so print -1 instead.\n\nSample Input 3\n\n9 9\n\nSample Output 3\n\n81", "sample_input": "2 5\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02879", "source_text": "Score : 100 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.\n\nGiven are two integers A and B.\n\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1 instead.\n\nConstraints\n\n1 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\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\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\n2 \\times 5 = 10.\n\nSample Input 2\n\n5 10\n\nSample Output 2\n\n-1\n\n5\\times 10 = 50, but Takahashi cannot do this calculation, so print -1 instead.\n\nSample Input 3\n\n9 9\n\nSample Output 3\n\n81", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s807027520", "group_id": "codeNet:p02879", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\ta := nextInt()\n\tb := nextInt()\n\n\tif 1 <= a && a <= 9 && 1 <= b && b <= 9 {\n\t\tfmt.Println(a * b)\n\t} else {\n\t\tfmt.Println(-1)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1572224646, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02879.html", "problem_id": "p02879", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02879/input.txt", "sample_output_relpath": "derived/input_output/data/p02879/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02879/Go/s807027520.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s807027520", "user_id": "u651597583"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\ta := nextInt()\n\tb := nextInt()\n\n\tif 1 <= a && a <= 9 && 1 <= b && b <= 9 {\n\t\tfmt.Println(a * b)\n\t} else {\n\t\tfmt.Println(-1)\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.\n\nGiven are two integers A and B.\n\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1 instead.\n\nConstraints\n\n1 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\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\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\n2 \\times 5 = 10.\n\nSample Input 2\n\n5 10\n\nSample Output 2\n\n-1\n\n5\\times 10 = 50, but Takahashi cannot do this calculation, so print -1 instead.\n\nSample Input 3\n\n9 9\n\nSample Output 3\n\n81", "sample_input": "2 5\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02879", "source_text": "Score : 100 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.\n\nGiven are two integers A and B.\n\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1 instead.\n\nConstraints\n\n1 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\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\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\n2 \\times 5 = 10.\n\nSample Input 2\n\n5 10\n\nSample Output 2\n\n-1\n\n5\\times 10 = 50, but Takahashi cannot do this calculation, so print -1 instead.\n\nSample Input 3\n\n9 9\n\nSample Output 3\n\n81", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 374, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s357588572", "group_id": "codeNet:p02879", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var a, b int\n fmt.Scanf(\"%d %d\", &a, &b)\n\n if a >= 1 && a <= 9 && b >= 1 && b <= 9 {\n fmt.Println(a * b)\n } else {\n fmt.Println(-1)\n }\n}\n", "language": "Go", "metadata": {"date": 1572224588, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02879.html", "problem_id": "p02879", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02879/input.txt", "sample_output_relpath": "derived/input_output/data/p02879/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02879/Go/s357588572.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s357588572", "user_id": "u502098699"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var a, b int\n fmt.Scanf(\"%d %d\", &a, &b)\n\n if a >= 1 && a <= 9 && b >= 1 && b <= 9 {\n fmt.Println(a * b)\n } else {\n fmt.Println(-1)\n }\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.\n\nGiven are two integers A and B.\n\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1 instead.\n\nConstraints\n\n1 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\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\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\n2 \\times 5 = 10.\n\nSample Input 2\n\n5 10\n\nSample Output 2\n\n-1\n\n5\\times 10 = 50, but Takahashi cannot do this calculation, so print -1 instead.\n\nSample Input 3\n\n9 9\n\nSample Output 3\n\n81", "sample_input": "2 5\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02879", "source_text": "Score : 100 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.\n\nGiven are two integers A and B.\n\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1 instead.\n\nConstraints\n\n1 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\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\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\n2 \\times 5 = 10.\n\nSample Input 2\n\n5 10\n\nSample Output 2\n\n-1\n\n5\\times 10 = 50, but Takahashi cannot do this calculation, so print -1 instead.\n\nSample Input 3\n\n9 9\n\nSample Output 3\n\n81", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 257, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s089710613", "group_id": "codeNet:p02879", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\ta:=nextInt()\n\tb:=nextInt()\n\n\tif a < 1 || a > 9 {\n\t\tfmt.Printf(\"-1\")\n\t\treturn\n\t}\n\tif b < 1 || b > 9 {\n\t\tfmt.Printf(\"-1\")\n\t\treturn\n\t}\n\n\tfmt.Printf(\"%d\", a * b)\n}\n", "language": "Go", "metadata": {"date": 1572224523, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02879.html", "problem_id": "p02879", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02879/input.txt", "sample_output_relpath": "derived/input_output/data/p02879/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02879/Go/s089710613.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s089710613", "user_id": "u638629468"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\ta:=nextInt()\n\tb:=nextInt()\n\n\tif a < 1 || a > 9 {\n\t\tfmt.Printf(\"-1\")\n\t\treturn\n\t}\n\tif b < 1 || b > 9 {\n\t\tfmt.Printf(\"-1\")\n\t\treturn\n\t}\n\n\tfmt.Printf(\"%d\", a * b)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.\n\nGiven are two integers A and B.\n\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1 instead.\n\nConstraints\n\n1 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\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\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\n2 \\times 5 = 10.\n\nSample Input 2\n\n5 10\n\nSample Output 2\n\n-1\n\n5\\times 10 = 50, but Takahashi cannot do this calculation, so print -1 instead.\n\nSample Input 3\n\n9 9\n\nSample Output 3\n\n81", "sample_input": "2 5\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02879", "source_text": "Score : 100 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.\n\nGiven are two integers A and B.\n\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1 instead.\n\nConstraints\n\n1 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\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\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\n2 \\times 5 = 10.\n\nSample Input 2\n\n5 10\n\nSample Output 2\n\n-1\n\n5\\times 10 = 50, but Takahashi cannot do this calculation, so print -1 instead.\n\nSample Input 3\n\n9 9\n\nSample Output 3\n\n81", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 422, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s289367067", "group_id": "codeNet:p02879", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tif a < 10 && b < 10 {\n\t\tfmt.Println(a * b)\n\t} else {\n\t\tfmt.Println(-1)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1572224501, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02879.html", "problem_id": "p02879", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02879/input.txt", "sample_output_relpath": "derived/input_output/data/p02879/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02879/Go/s289367067.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s289367067", "user_id": "u068177169"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tif a < 10 && b < 10 {\n\t\tfmt.Println(a * b)\n\t} else {\n\t\tfmt.Println(-1)\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.\n\nGiven are two integers A and B.\n\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1 instead.\n\nConstraints\n\n1 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\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\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\n2 \\times 5 = 10.\n\nSample Input 2\n\n5 10\n\nSample Output 2\n\n-1\n\n5\\times 10 = 50, but Takahashi cannot do this calculation, so print -1 instead.\n\nSample Input 3\n\n9 9\n\nSample Output 3\n\n81", "sample_input": "2 5\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02879", "source_text": "Score : 100 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together. He cannot do any other calculation.\n\nGiven are two integers A and B.\n\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1 instead.\n\nConstraints\n\n1 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\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\nIf Takahashi can calculate A \\times B, print the result; if he cannot, print -1.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\n2 \\times 5 = 10.\n\nSample Input 2\n\n5 10\n\nSample Output 2\n\n-1\n\n5\\times 10 = 50, but Takahashi cannot do this calculation, so print -1 instead.\n\nSample Input 3\n\n9 9\n\nSample Output 3\n\n81", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s285745448", "group_id": "codeNet:p02891", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\n/* sort */\ntype pair struct {\n\tindex int64\n\tp1, p2 interface{}\n}\ntype pairs []pair\n\nfunc (slice pairs) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice pairs) Less(i, j int) bool {\n\treturn slice[i].index < slice[j].index\n}\n\nfunc (slice pairs) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\n\n/* sort */\ntype Int64Slice []int64\n\nfunc (slice Int64Slice) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice Int64Slice) Less(i, j int) bool {\n\treturn slice[i] < slice[j]\n}\n\nfunc (slice Int64Slice) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\nfunc Int64s(a []int64) { sort.Sort(Int64Slice(a)) }\nfunc Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n\tINF = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tdi = []int64{-1, 0, 1, 0}\n\tdj = []int64{0, -1, 0, 1}\n\tdi8 = []int64{-1, -1, 0, 1, 1, 1, 0, -1}\n\tdj8 = []int64{0, -1, -1, -1, 0, 1, 1, 1}\n)\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tscanner.Buffer(buf, maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tS := readString()\n\tK := readInt()\n\t// 最初の同じ文字列を抽出、検査する文字列にくっつける\n\t//\tvar s string = string(S[0])\n\tvar prev = S[0]\n\tvar ans int64\n\t// for i := 1; i < len(S); i++ {\n\t// \tif prev != S[i] {\n\t// \t\tbreak\n\t// \t}\n\t// \tprev = S[i]\n\t// \ts += string(prev)\n\t// }\n\t// S += s\n\n\t// 連続する部分を数えて / 2 する\n\tprev = S[0]\n\tvar cont int64 = 1\n\tfor i := 1; i < len(S); i++ {\n\t\tif prev != S[i] {\n\t\t\tif cont > 1 {\n\t\t\t\tans += cont / 2 * K\n\t\t\t}\n\t\t\tcont = 0\n\t\t}\n\t\tprev = S[i]\n\t\tcont++\n\t}\n\tans += cont / 2 * K\n\tif cont == int64(len(S)) {\n\t\tans = cont * K / 2\n\t}\n\tfmt.Println(ans)\n}\n\n/*==========================================\n * Library\n *==========================================*/\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\nfunc doubleAry(h int64, w int64, init int64) (res [][]int64) {\n\tres = make([][]int64, h)\n\tfor i := int64(0); i < h; i++ {\n\t\tres[i] = make([]int64, w)\n\t\tfor j := int64(0); j < w; j++ {\n\t\t\tres[i][j] = init\n\t\t}\n\t}\n\treturn\n}\n\nfunc aryEq(a []int64, b []int64) bool {\n\treturn reflect.DeepEqual(a, b)\n}\n\nfunc clone(n []int64) (r []int64) {\n\tr = make([]int64, len(n))\n\tfor i := 0; i < len(n); i++ {\n\t\tr[i] = n[i]\n\t}\n\treturn\n}\nfunc write(s string) {\n\twriter.WriteString(s)\n}\n\nfunc print() {\n\twriter.Flush()\n}\n\n// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可\nfunc readLine() (s string) {\n\tif scanner.Scan() {\n\t\ts = scanner.Text()\n\t}\n\treturn s\n}\n\nfunc readInt() (read int64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseInt(scanner.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readFloat() (read float64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readRunes() (read []rune) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, v)\n\t}\n\treturn\n}\n\nfunc readString() (read string) {\n\tscanner.Scan()\n\tread = scanner.Text()\n\treturn\n}\n\nfunc readStrings() (read []string) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, string(v))\n\t}\n\treturn\n}\n\nfunc s2i(s string) int64 {\n\tvar intVal, e = strconv.ParseInt(s, 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int64) string {\n\tvar strVal = strconv.FormatInt(i, 10)\n\treturn strVal\n}\n\nfunc s2f(s string) float64 {\n\tvar floatVal, e = strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn floatVal\n}\n\nfunc abs(i int64) int64 {\n\treturn int64(math.Abs(float64(i)))\n}\n\nfunc max(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans < v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\nfunc min(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans > v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc sum(i []int64) int64 {\n\tsum := int64(0)\n\tfor _, val := range i {\n\t\tsum += val\n\t}\n\treturn sum\n}\n\nfunc split(s string) []string {\n\treturn strings.Fields(s)\n}\n\nfunc strAry2intAry(strs []string) []int64 {\n\tvar ret = make([]int64, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal = s2i(str)\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int64) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = i2s(num)\n\t\tret = append(ret, strVal)\n\t}\n\treturn ret\n}\n\nfunc ary2str(strs []string) string {\n\treturn strings.Join(strs, \" \")\n}\n\nfunc reverse(res []int64) []int64 {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\nfunc reverseStr(res []string) []string {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\n\nfunc ini(res []int, init int) {\n\tif len(res) == 0 {\n\t\treturn\n\t}\n\tres[0] = init\n\tfor i := 0; i < len(res); i++ {\n\t\tcopy(res[i:], res[:i])\n\t}\n}\n\n//\n// func regexpExample() {\n// // Your code here!\n// var str = \"13:20\"\n// r := regexp.MustCompile(`(\\d+):(\\d+)`)\n// fmt.Println(r.FindStringSubmatch(str))\n// }\n\n// type Country struct {\n// gold int\n// silver int\n// blonze int\n// }\n\n// // 複数ソートのサンプル\n// func stableSortExample() []Country{\n// var country = []Country {\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:3, blonze:2},\n// {gold:1, silver:3, blonze:3},\n// }\n// sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })\n// return country\n// }\n", "language": "Go", "metadata": {"date": 1597100145, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02891.html", "problem_id": "p02891", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02891/input.txt", "sample_output_relpath": "derived/input_output/data/p02891/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02891/Go/s285745448.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s285745448", "user_id": "u967669872"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\n/* sort */\ntype pair struct {\n\tindex int64\n\tp1, p2 interface{}\n}\ntype pairs []pair\n\nfunc (slice pairs) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice pairs) Less(i, j int) bool {\n\treturn slice[i].index < slice[j].index\n}\n\nfunc (slice pairs) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\n\n/* sort */\ntype Int64Slice []int64\n\nfunc (slice Int64Slice) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice Int64Slice) Less(i, j int) bool {\n\treturn slice[i] < slice[j]\n}\n\nfunc (slice Int64Slice) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\nfunc Int64s(a []int64) { sort.Sort(Int64Slice(a)) }\nfunc Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n\tINF = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tdi = []int64{-1, 0, 1, 0}\n\tdj = []int64{0, -1, 0, 1}\n\tdi8 = []int64{-1, -1, 0, 1, 1, 1, 0, -1}\n\tdj8 = []int64{0, -1, -1, -1, 0, 1, 1, 1}\n)\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tscanner.Buffer(buf, maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tS := readString()\n\tK := readInt()\n\t// 最初の同じ文字列を抽出、検査する文字列にくっつける\n\t//\tvar s string = string(S[0])\n\tvar prev = S[0]\n\tvar ans int64\n\t// for i := 1; i < len(S); i++ {\n\t// \tif prev != S[i] {\n\t// \t\tbreak\n\t// \t}\n\t// \tprev = S[i]\n\t// \ts += string(prev)\n\t// }\n\t// S += s\n\n\t// 連続する部分を数えて / 2 する\n\tprev = S[0]\n\tvar cont int64 = 1\n\tfor i := 1; i < len(S); i++ {\n\t\tif prev != S[i] {\n\t\t\tif cont > 1 {\n\t\t\t\tans += cont / 2 * K\n\t\t\t}\n\t\t\tcont = 0\n\t\t}\n\t\tprev = S[i]\n\t\tcont++\n\t}\n\tans += cont / 2 * K\n\tif cont == int64(len(S)) {\n\t\tans = cont * K / 2\n\t}\n\tfmt.Println(ans)\n}\n\n/*==========================================\n * Library\n *==========================================*/\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\nfunc doubleAry(h int64, w int64, init int64) (res [][]int64) {\n\tres = make([][]int64, h)\n\tfor i := int64(0); i < h; i++ {\n\t\tres[i] = make([]int64, w)\n\t\tfor j := int64(0); j < w; j++ {\n\t\t\tres[i][j] = init\n\t\t}\n\t}\n\treturn\n}\n\nfunc aryEq(a []int64, b []int64) bool {\n\treturn reflect.DeepEqual(a, b)\n}\n\nfunc clone(n []int64) (r []int64) {\n\tr = make([]int64, len(n))\n\tfor i := 0; i < len(n); i++ {\n\t\tr[i] = n[i]\n\t}\n\treturn\n}\nfunc write(s string) {\n\twriter.WriteString(s)\n}\n\nfunc print() {\n\twriter.Flush()\n}\n\n// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可\nfunc readLine() (s string) {\n\tif scanner.Scan() {\n\t\ts = scanner.Text()\n\t}\n\treturn s\n}\n\nfunc readInt() (read int64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseInt(scanner.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readFloat() (read float64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readRunes() (read []rune) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, v)\n\t}\n\treturn\n}\n\nfunc readString() (read string) {\n\tscanner.Scan()\n\tread = scanner.Text()\n\treturn\n}\n\nfunc readStrings() (read []string) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, string(v))\n\t}\n\treturn\n}\n\nfunc s2i(s string) int64 {\n\tvar intVal, e = strconv.ParseInt(s, 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int64) string {\n\tvar strVal = strconv.FormatInt(i, 10)\n\treturn strVal\n}\n\nfunc s2f(s string) float64 {\n\tvar floatVal, e = strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn floatVal\n}\n\nfunc abs(i int64) int64 {\n\treturn int64(math.Abs(float64(i)))\n}\n\nfunc max(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans < v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\nfunc min(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans > v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc sum(i []int64) int64 {\n\tsum := int64(0)\n\tfor _, val := range i {\n\t\tsum += val\n\t}\n\treturn sum\n}\n\nfunc split(s string) []string {\n\treturn strings.Fields(s)\n}\n\nfunc strAry2intAry(strs []string) []int64 {\n\tvar ret = make([]int64, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal = s2i(str)\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int64) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = i2s(num)\n\t\tret = append(ret, strVal)\n\t}\n\treturn ret\n}\n\nfunc ary2str(strs []string) string {\n\treturn strings.Join(strs, \" \")\n}\n\nfunc reverse(res []int64) []int64 {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\nfunc reverseStr(res []string) []string {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\n\nfunc ini(res []int, init int) {\n\tif len(res) == 0 {\n\t\treturn\n\t}\n\tres[0] = init\n\tfor i := 0; i < len(res); i++ {\n\t\tcopy(res[i:], res[:i])\n\t}\n}\n\n//\n// func regexpExample() {\n// // Your code here!\n// var str = \"13:20\"\n// r := regexp.MustCompile(`(\\d+):(\\d+)`)\n// fmt.Println(r.FindStringSubmatch(str))\n// }\n\n// type Country struct {\n// gold int\n// silver int\n// blonze int\n// }\n\n// // 複数ソートのサンプル\n// func stableSortExample() []Country{\n// var country = []Country {\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:3, blonze:2},\n// {gold:1, silver:3, blonze:3},\n// }\n// sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })\n// return country\n// }\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S. Let T be the concatenation of K copies of S.\nWe can repeatedly perform the following operation: choose a character in T and replace it with a different character.\nFind the minimum number of operations required to satisfy the following condition: any two adjacent characters in T are different.\n\nConstraints\n\n1 \\leq |S| \\leq 100\n\nS consists of lowercase English letters.\n\n1 \\leq K \\leq 10^9\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\nissii\n2\n\nSample Output 1\n\n4\n\nT is issiiissii. For example, we can rewrite it into ispiqisyhi, and now any two adjacent characters are different.\n\nSample Input 2\n\nqq\n81\n\nSample Output 2\n\n81\n\nSample Input 3\n\ncooooooooonteeeeeeeeeest\n999993333\n\nSample Output 3\n\n8999939997", "sample_input": "issii\n2\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02891", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S. Let T be the concatenation of K copies of S.\nWe can repeatedly perform the following operation: choose a character in T and replace it with a different character.\nFind the minimum number of operations required to satisfy the following condition: any two adjacent characters in T are different.\n\nConstraints\n\n1 \\leq |S| \\leq 100\n\nS consists of lowercase English letters.\n\n1 \\leq K \\leq 10^9\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\nissii\n2\n\nSample Output 1\n\n4\n\nT is issiiissii. For example, we can rewrite it into ispiqisyhi, and now any two adjacent characters are different.\n\nSample Input 2\n\nqq\n81\n\nSample Output 2\n\n81\n\nSample Input 3\n\ncooooooooonteeeeeeeeeest\n999993333\n\nSample Output 3\n\n8999939997", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6186, "cpu_time_ms": 4, "memory_kb": 1776}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s196369738", "group_id": "codeNet:p02891", "input_text": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n \"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc readInt() int { return readIntArray()[0] }\nfunc readInt2() (int, int) { a := readIntArray(); return a[0], a[1] }\nfunc readInt3() (int, int, int) { a := readIntArray(); return a[0], a[1], a[2] }\nfunc readIntArray() []int {\n a := make([]int, 0, 1000)\n sc.Scan()\n for _, v := range strings.Split(sc.Text(), \" \") {\n vv, _ := strconv.Atoi(v)\n a = append(a, vv)\n }\n return a\n}\nfunc readString() string { return readStringArray()[0] }\nfunc readStringArray() []string { sc.Scan(); return strings.Split(sc.Text(), \" \") }\n\nfunc count(s string) (int, bool) {\n prev := s[0]\n alleq := true\n var c int\n for i := 1; i < len(s); i++ {\n if prev == s[i] {\n c++\n prev = 0\n } else {\n prev = s[i]\n alleq = false\n }\n }\n return c, alleq\n}\n\nfunc main() {\n s := readString()\n k := readInt()\n\n c, eq := count(s)\n\n // a -> 0\n // aa -> 1\n // aaa -> 1\n // aaaa -> 2\n // aaaaa -> 2\n if eq {\n fmt.Println(len(s) * k / 2)\n return\n }\n\n if s[0] != s[len(s)-1] {\n fmt.Println(c * k)\n return\n }\n\n // aaabaaa -> 2\n // aaabaaa|aaabaaa|aaabaaa -> 8\n // | 3 | 3 |\n topcount := len(s) - len(strings.TrimLeft(s, string(s[0])))\n bottomcount := len(s) - len(strings.TrimRight(s, string(s[len(s)-1])))\n in := topcount + bottomcount\n\n front, _ := count(s[:len(s)-bottomcount])\n back, _ := count(s[topcount:])\n //fmt.Printf(\"[%s] [%d] [%s]\\n\", s[:len(s)-bottomcount], in, s[topcount:])\n\n fmt.Println(front/2 + (in/2)*(k-1) + back/2)\n}", "language": "Go", "metadata": {"date": 1577001881, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02891.html", "problem_id": "p02891", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02891/input.txt", "sample_output_relpath": "derived/input_output/data/p02891/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02891/Go/s196369738.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s196369738", "user_id": "u502098699"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n \"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc readInt() int { return readIntArray()[0] }\nfunc readInt2() (int, int) { a := readIntArray(); return a[0], a[1] }\nfunc readInt3() (int, int, int) { a := readIntArray(); return a[0], a[1], a[2] }\nfunc readIntArray() []int {\n a := make([]int, 0, 1000)\n sc.Scan()\n for _, v := range strings.Split(sc.Text(), \" \") {\n vv, _ := strconv.Atoi(v)\n a = append(a, vv)\n }\n return a\n}\nfunc readString() string { return readStringArray()[0] }\nfunc readStringArray() []string { sc.Scan(); return strings.Split(sc.Text(), \" \") }\n\nfunc count(s string) (int, bool) {\n prev := s[0]\n alleq := true\n var c int\n for i := 1; i < len(s); i++ {\n if prev == s[i] {\n c++\n prev = 0\n } else {\n prev = s[i]\n alleq = false\n }\n }\n return c, alleq\n}\n\nfunc main() {\n s := readString()\n k := readInt()\n\n c, eq := count(s)\n\n // a -> 0\n // aa -> 1\n // aaa -> 1\n // aaaa -> 2\n // aaaaa -> 2\n if eq {\n fmt.Println(len(s) * k / 2)\n return\n }\n\n if s[0] != s[len(s)-1] {\n fmt.Println(c * k)\n return\n }\n\n // aaabaaa -> 2\n // aaabaaa|aaabaaa|aaabaaa -> 8\n // | 3 | 3 |\n topcount := len(s) - len(strings.TrimLeft(s, string(s[0])))\n bottomcount := len(s) - len(strings.TrimRight(s, string(s[len(s)-1])))\n in := topcount + bottomcount\n\n front, _ := count(s[:len(s)-bottomcount])\n back, _ := count(s[topcount:])\n //fmt.Printf(\"[%s] [%d] [%s]\\n\", s[:len(s)-bottomcount], in, s[topcount:])\n\n fmt.Println(front/2 + (in/2)*(k-1) + back/2)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S. Let T be the concatenation of K copies of S.\nWe can repeatedly perform the following operation: choose a character in T and replace it with a different character.\nFind the minimum number of operations required to satisfy the following condition: any two adjacent characters in T are different.\n\nConstraints\n\n1 \\leq |S| \\leq 100\n\nS consists of lowercase English letters.\n\n1 \\leq K \\leq 10^9\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\nissii\n2\n\nSample Output 1\n\n4\n\nT is issiiissii. For example, we can rewrite it into ispiqisyhi, and now any two adjacent characters are different.\n\nSample Input 2\n\nqq\n81\n\nSample Output 2\n\n81\n\nSample Input 3\n\ncooooooooonteeeeeeeeeest\n999993333\n\nSample Output 3\n\n8999939997", "sample_input": "issii\n2\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02891", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S. Let T be the concatenation of K copies of S.\nWe can repeatedly perform the following operation: choose a character in T and replace it with a different character.\nFind the minimum number of operations required to satisfy the following condition: any two adjacent characters in T are different.\n\nConstraints\n\n1 \\leq |S| \\leq 100\n\nS consists of lowercase English letters.\n\n1 \\leq K \\leq 10^9\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\nissii\n2\n\nSample Output 1\n\n4\n\nT is issiiissii. For example, we can rewrite it into ispiqisyhi, and now any two adjacent characters are different.\n\nSample Input 2\n\nqq\n81\n\nSample Output 2\n\n81\n\nSample Input 3\n\ncooooooooonteeeeeeeeeest\n999993333\n\nSample Output 3\n\n8999939997", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2028, "cpu_time_ms": 3, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s714315393", "group_id": "codeNet:p02891", "input_text": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n \"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc readInt() int { return readIntArray()[0] }\nfunc readInt2() (int, int) { a := readIntArray(); return a[0], a[1] }\nfunc readInt3() (int, int, int) { a := readIntArray(); return a[0], a[1], a[2] }\nfunc readIntArray() []int {\n a := make([]int, 0, 1000)\n sc.Scan()\n for _, v := range strings.Split(sc.Text(), \" \") {\n vv, _ := strconv.Atoi(v)\n a = append(a, vv)\n }\n return a\n}\nfunc readString() string { return readStringArray()[0] }\nfunc readStringArray() []string { sc.Scan(); return strings.Split(sc.Text(), \" \") }\n\nfunc main() {\n s := readString()\n k := readInt()\n\n var count int\n var prev rune\n for _, r := range s {\n if prev == r {\n count++\n prev = 0\n } else {\n prev = r\n }\n }\n\n // a x3 -> aaa -> aba\n if len(s) == 1 {\n fmt.Println(k / 2)\n return\n }\n\n // aa x3 -> aaaaaa -> ababab\n if len(s) == 2 && s[0] == s[1] {\n fmt.Println(k)\n return\n }\n\n // aaa x3 -> aaaaaaaaa -> abcabcabc\n if len(s) == 3 && s[0] == s[1] && s[0] == s[2] {\n fmt.Println(2 * k)\n return\n }\n\n var joinChange int\n if s[0] == s[len(s)-1] && s[len(s)-1] != s[len(s)-2] {\n joinChange = 1\n }\n\n fmt.Println(count*k + joinChange*(k-1))\n}", "language": "Go", "metadata": {"date": 1576995892, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02891.html", "problem_id": "p02891", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02891/input.txt", "sample_output_relpath": "derived/input_output/data/p02891/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02891/Go/s714315393.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s714315393", "user_id": "u502098699"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n \"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc readInt() int { return readIntArray()[0] }\nfunc readInt2() (int, int) { a := readIntArray(); return a[0], a[1] }\nfunc readInt3() (int, int, int) { a := readIntArray(); return a[0], a[1], a[2] }\nfunc readIntArray() []int {\n a := make([]int, 0, 1000)\n sc.Scan()\n for _, v := range strings.Split(sc.Text(), \" \") {\n vv, _ := strconv.Atoi(v)\n a = append(a, vv)\n }\n return a\n}\nfunc readString() string { return readStringArray()[0] }\nfunc readStringArray() []string { sc.Scan(); return strings.Split(sc.Text(), \" \") }\n\nfunc main() {\n s := readString()\n k := readInt()\n\n var count int\n var prev rune\n for _, r := range s {\n if prev == r {\n count++\n prev = 0\n } else {\n prev = r\n }\n }\n\n // a x3 -> aaa -> aba\n if len(s) == 1 {\n fmt.Println(k / 2)\n return\n }\n\n // aa x3 -> aaaaaa -> ababab\n if len(s) == 2 && s[0] == s[1] {\n fmt.Println(k)\n return\n }\n\n // aaa x3 -> aaaaaaaaa -> abcabcabc\n if len(s) == 3 && s[0] == s[1] && s[0] == s[2] {\n fmt.Println(2 * k)\n return\n }\n\n var joinChange int\n if s[0] == s[len(s)-1] && s[len(s)-1] != s[len(s)-2] {\n joinChange = 1\n }\n\n fmt.Println(count*k + joinChange*(k-1))\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S. Let T be the concatenation of K copies of S.\nWe can repeatedly perform the following operation: choose a character in T and replace it with a different character.\nFind the minimum number of operations required to satisfy the following condition: any two adjacent characters in T are different.\n\nConstraints\n\n1 \\leq |S| \\leq 100\n\nS consists of lowercase English letters.\n\n1 \\leq K \\leq 10^9\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\nissii\n2\n\nSample Output 1\n\n4\n\nT is issiiissii. For example, we can rewrite it into ispiqisyhi, and now any two adjacent characters are different.\n\nSample Input 2\n\nqq\n81\n\nSample Output 2\n\n81\n\nSample Input 3\n\ncooooooooonteeeeeeeeeest\n999993333\n\nSample Output 3\n\n8999939997", "sample_input": "issii\n2\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02891", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S. Let T be the concatenation of K copies of S.\nWe can repeatedly perform the following operation: choose a character in T and replace it with a different character.\nFind the minimum number of operations required to satisfy the following condition: any two adjacent characters in T are different.\n\nConstraints\n\n1 \\leq |S| \\leq 100\n\nS consists of lowercase English letters.\n\n1 \\leq K \\leq 10^9\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\nissii\n2\n\nSample Output 1\n\n4\n\nT is issiiissii. For example, we can rewrite it into ispiqisyhi, and now any two adjacent characters are different.\n\nSample Input 2\n\nqq\n81\n\nSample Output 2\n\n81\n\nSample Input 3\n\ncooooooooonteeeeeeeeeest\n999993333\n\nSample Output 3\n\n8999939997", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1689, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s777995043", "group_id": "codeNet:p02891", "input_text": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n \"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc readInt() int { return readIntArray()[0] }\nfunc readInt2() (int, int) { a := readIntArray(); return a[0], a[1] }\nfunc readInt3() (int, int, int) { a := readIntArray(); return a[0], a[1], a[2] }\nfunc readIntArray() []int {\n a := make([]int, 0, 1000)\n sc.Scan()\n for _, v := range strings.Split(sc.Text(), \" \") {\n vv, _ := strconv.Atoi(v)\n a = append(a, vv)\n }\n return a\n}\nfunc readString() string { return readStringArray()[0] }\nfunc readStringArray() []string { sc.Scan(); return strings.Split(sc.Text(), \" \") }\n\nfunc main() {\n s := readString()\n k := readInt()\n\n var count int\n var prev rune\n for _, r := range s {\n if prev == r {\n count++\n prev = 0\n } else {\n prev = r\n }\n }\n\n var joinChange int\n if s[0] == s[len(s)-1] && s[len(s)-1] != s[len(s)-2] {\n joinChange = 1\n }\n\n fmt.Println(count*k + joinChange*(k-1))\n}", "language": "Go", "metadata": {"date": 1576995392, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02891.html", "problem_id": "p02891", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02891/input.txt", "sample_output_relpath": "derived/input_output/data/p02891/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02891/Go/s777995043.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s777995043", "user_id": "u502098699"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n \"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc readInt() int { return readIntArray()[0] }\nfunc readInt2() (int, int) { a := readIntArray(); return a[0], a[1] }\nfunc readInt3() (int, int, int) { a := readIntArray(); return a[0], a[1], a[2] }\nfunc readIntArray() []int {\n a := make([]int, 0, 1000)\n sc.Scan()\n for _, v := range strings.Split(sc.Text(), \" \") {\n vv, _ := strconv.Atoi(v)\n a = append(a, vv)\n }\n return a\n}\nfunc readString() string { return readStringArray()[0] }\nfunc readStringArray() []string { sc.Scan(); return strings.Split(sc.Text(), \" \") }\n\nfunc main() {\n s := readString()\n k := readInt()\n\n var count int\n var prev rune\n for _, r := range s {\n if prev == r {\n count++\n prev = 0\n } else {\n prev = r\n }\n }\n\n var joinChange int\n if s[0] == s[len(s)-1] && s[len(s)-1] != s[len(s)-2] {\n joinChange = 1\n }\n\n fmt.Println(count*k + joinChange*(k-1))\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S. Let T be the concatenation of K copies of S.\nWe can repeatedly perform the following operation: choose a character in T and replace it with a different character.\nFind the minimum number of operations required to satisfy the following condition: any two adjacent characters in T are different.\n\nConstraints\n\n1 \\leq |S| \\leq 100\n\nS consists of lowercase English letters.\n\n1 \\leq K \\leq 10^9\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\nissii\n2\n\nSample Output 1\n\n4\n\nT is issiiissii. For example, we can rewrite it into ispiqisyhi, and now any two adjacent characters are different.\n\nSample Input 2\n\nqq\n81\n\nSample Output 2\n\n81\n\nSample Input 3\n\ncooooooooonteeeeeeeeeest\n999993333\n\nSample Output 3\n\n8999939997", "sample_input": "issii\n2\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02891", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S. Let T be the concatenation of K copies of S.\nWe can repeatedly perform the following operation: choose a character in T and replace it with a different character.\nFind the minimum number of operations required to satisfy the following condition: any two adjacent characters in T are different.\n\nConstraints\n\n1 \\leq |S| \\leq 100\n\nS consists of lowercase English letters.\n\n1 \\leq K \\leq 10^9\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\nissii\n2\n\nSample Output 1\n\n4\n\nT is issiiissii. For example, we can rewrite it into ispiqisyhi, and now any two adjacent characters are different.\n\nSample Input 2\n\nqq\n81\n\nSample Output 2\n\n81\n\nSample Input 3\n\ncooooooooonteeeeeeeeeest\n999993333\n\nSample Output 3\n\n8999939997", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1252, "cpu_time_ms": 3, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s624885999", "group_id": "codeNet:p02891", "input_text": "package main\n\nimport \"fmt\"\n\nfunc countPair(S string) (pair int) {\n\tfor i := 0; i+1 < len(S); i++ {\n\t\tif S[i] == S[i+1] {\n\t\t\tpair++\n\t\t\ti++\n\t\t}\n\t}\n\treturn pair\n}\n\nfunc main() {\n\tvar s1, s2 string\n\tvar k, ans int\n\tfmt.Scan(&s1, &k)\n\tm := make(map[byte]int, 0)\n\tfor i := 0; i < len(s1); i++ {\n\t\tm[s1[i]]++\n\t}\n\tp1 := countPair(s1)\n\ts2 = s1 + s1\n\tp2 := countPair(s2)\n\tif len(m) == 1 {\n\t\tans = len(s1) * k / 2\n\t} else if p1*2 == p2 {\n\t\tans = p1 * k\n\t} else {\n\t\td := p2 - p1*2\n\t\tans = p1*k + (k-1)*d\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1571168679, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02891.html", "problem_id": "p02891", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02891/input.txt", "sample_output_relpath": "derived/input_output/data/p02891/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02891/Go/s624885999.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s624885999", "user_id": "u196030116"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc countPair(S string) (pair int) {\n\tfor i := 0; i+1 < len(S); i++ {\n\t\tif S[i] == S[i+1] {\n\t\t\tpair++\n\t\t\ti++\n\t\t}\n\t}\n\treturn pair\n}\n\nfunc main() {\n\tvar s1, s2 string\n\tvar k, ans int\n\tfmt.Scan(&s1, &k)\n\tm := make(map[byte]int, 0)\n\tfor i := 0; i < len(s1); i++ {\n\t\tm[s1[i]]++\n\t}\n\tp1 := countPair(s1)\n\ts2 = s1 + s1\n\tp2 := countPair(s2)\n\tif len(m) == 1 {\n\t\tans = len(s1) * k / 2\n\t} else if p1*2 == p2 {\n\t\tans = p1 * k\n\t} else {\n\t\td := p2 - p1*2\n\t\tans = p1*k + (k-1)*d\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S. Let T be the concatenation of K copies of S.\nWe can repeatedly perform the following operation: choose a character in T and replace it with a different character.\nFind the minimum number of operations required to satisfy the following condition: any two adjacent characters in T are different.\n\nConstraints\n\n1 \\leq |S| \\leq 100\n\nS consists of lowercase English letters.\n\n1 \\leq K \\leq 10^9\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\nissii\n2\n\nSample Output 1\n\n4\n\nT is issiiissii. For example, we can rewrite it into ispiqisyhi, and now any two adjacent characters are different.\n\nSample Input 2\n\nqq\n81\n\nSample Output 2\n\n81\n\nSample Input 3\n\ncooooooooonteeeeeeeeeest\n999993333\n\nSample Output 3\n\n8999939997", "sample_input": "issii\n2\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02891", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S. Let T be the concatenation of K copies of S.\nWe can repeatedly perform the following operation: choose a character in T and replace it with a different character.\nFind the minimum number of operations required to satisfy the following condition: any two adjacent characters in T are different.\n\nConstraints\n\n1 \\leq |S| \\leq 100\n\nS consists of lowercase English letters.\n\n1 \\leq K \\leq 10^9\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\nissii\n2\n\nSample Output 1\n\n4\n\nT is issiiissii. For example, we can rewrite it into ispiqisyhi, and now any two adjacent characters are different.\n\nSample Input 2\n\nqq\n81\n\nSample Output 2\n\n81\n\nSample Input 3\n\ncooooooooonteeeeeeeeeest\n999993333\n\nSample Output 3\n\n8999939997", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 515, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s559515892", "group_id": "codeNet:p02891", "input_text": "package main\n\nimport \"fmt\"\n\nfunc countPair(S string) (pair int) {\n\tfor i := 0; i+1 < len(S); i++ {\n\t\tif S[i] == S[i+1] {\n\t\t\tpair++\n\t\t\ti++\n\t\t}\n\t}\n\treturn pair\n}\n\nfunc main() {\n\tvar s1, s2 string\n\tvar k, ans int\n\tfmt.Scan(&s1, &k)\n\tp1 := countPair(s1)\n\ts2 = s1 + s1 // 繋げてpairが増えるか?\n\tp2 := countPair(s2)\n\tif p1*2 == p2 { // 繋げてもペアの数が増えない\n\t\tans = p1 * k\n\t} else { // 繋げるとペアの数が増える\n\t\td := p2 - p1*2\n\t\tans = p1*k + (k-1)*d\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1571159232, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02891.html", "problem_id": "p02891", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02891/input.txt", "sample_output_relpath": "derived/input_output/data/p02891/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02891/Go/s559515892.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s559515892", "user_id": "u196030116"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc countPair(S string) (pair int) {\n\tfor i := 0; i+1 < len(S); i++ {\n\t\tif S[i] == S[i+1] {\n\t\t\tpair++\n\t\t\ti++\n\t\t}\n\t}\n\treturn pair\n}\n\nfunc main() {\n\tvar s1, s2 string\n\tvar k, ans int\n\tfmt.Scan(&s1, &k)\n\tp1 := countPair(s1)\n\ts2 = s1 + s1 // 繋げてpairが増えるか?\n\tp2 := countPair(s2)\n\tif p1*2 == p2 { // 繋げてもペアの数が増えない\n\t\tans = p1 * k\n\t} else { // 繋げるとペアの数が増える\n\t\td := p2 - p1*2\n\t\tans = p1*k + (k-1)*d\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S. Let T be the concatenation of K copies of S.\nWe can repeatedly perform the following operation: choose a character in T and replace it with a different character.\nFind the minimum number of operations required to satisfy the following condition: any two adjacent characters in T are different.\n\nConstraints\n\n1 \\leq |S| \\leq 100\n\nS consists of lowercase English letters.\n\n1 \\leq K \\leq 10^9\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\nissii\n2\n\nSample Output 1\n\n4\n\nT is issiiissii. For example, we can rewrite it into ispiqisyhi, and now any two adjacent characters are different.\n\nSample Input 2\n\nqq\n81\n\nSample Output 2\n\n81\n\nSample Input 3\n\ncooooooooonteeeeeeeeeest\n999993333\n\nSample Output 3\n\n8999939997", "sample_input": "issii\n2\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02891", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S. Let T be the concatenation of K copies of S.\nWe can repeatedly perform the following operation: choose a character in T and replace it with a different character.\nFind the minimum number of operations required to satisfy the following condition: any two adjacent characters in T are different.\n\nConstraints\n\n1 \\leq |S| \\leq 100\n\nS consists of lowercase English letters.\n\n1 \\leq K \\leq 10^9\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\nissii\n2\n\nSample Output 1\n\n4\n\nT is issiiissii. For example, we can rewrite it into ispiqisyhi, and now any two adjacent characters are different.\n\nSample Input 2\n\nqq\n81\n\nSample Output 2\n\n81\n\nSample Input 3\n\ncooooooooonteeeeeeeeeest\n999993333\n\nSample Output 3\n\n8999939997", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 506, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s291139454", "group_id": "codeNet:p02891", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar (\n\t\ts string\n\t\tk int\n\t)\n\tfmt.Scan(&s, &k)\n\n\tcnt := 0\n\tfor i := 0; i < len(s); i++ {\n\t\tif i+1 < len(s) && s[i] == s[i+1] {\n\t\t\tcnt++\n\t\t\ti++\n\t\t}\n\t}\n\n\tif cnt == len(s)-1 {\n\t\tfmt.Println(len(s) * k / 2)\n\t\treturn\n\t}\n\n\tif s[0] != s[len(s)-1] {\n\t\tfmt.Println(k * cnt)\n\t\treturn\n\t}\n\n\ta := 1\n\tfor i := 1; i < len(s); i++ {\n\t\tif s[i] != s[0] {\n\t\t\tbreak\n\t\t}\n\t\ta++\n\t}\n\tb := 1\n\tfor i := len(s) - 2; i >= 0; i-- {\n\t\tif s[i] != s[len(s)-1] {\n\t\t\tbreak\n\t\t}\n\t\tb++\n\t}\n\tcnt = 0\n\tfor i := a; i < len(s)-b; i++ {\n\t\tif i+1 < len(s)-b && s[i] == s[i+1] {\n\t\t\tcnt++\n\t\t\ti++\n\t\t}\n\t}\n\tfmt.Println(k*cnt + (k-1)*((a+b)/2) + a/2 + b/2)\n}\n", "language": "Go", "metadata": {"date": 1570679874, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02891.html", "problem_id": "p02891", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02891/input.txt", "sample_output_relpath": "derived/input_output/data/p02891/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02891/Go/s291139454.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s291139454", "user_id": "u461993794"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar (\n\t\ts string\n\t\tk int\n\t)\n\tfmt.Scan(&s, &k)\n\n\tcnt := 0\n\tfor i := 0; i < len(s); i++ {\n\t\tif i+1 < len(s) && s[i] == s[i+1] {\n\t\t\tcnt++\n\t\t\ti++\n\t\t}\n\t}\n\n\tif cnt == len(s)-1 {\n\t\tfmt.Println(len(s) * k / 2)\n\t\treturn\n\t}\n\n\tif s[0] != s[len(s)-1] {\n\t\tfmt.Println(k * cnt)\n\t\treturn\n\t}\n\n\ta := 1\n\tfor i := 1; i < len(s); i++ {\n\t\tif s[i] != s[0] {\n\t\t\tbreak\n\t\t}\n\t\ta++\n\t}\n\tb := 1\n\tfor i := len(s) - 2; i >= 0; i-- {\n\t\tif s[i] != s[len(s)-1] {\n\t\t\tbreak\n\t\t}\n\t\tb++\n\t}\n\tcnt = 0\n\tfor i := a; i < len(s)-b; i++ {\n\t\tif i+1 < len(s)-b && s[i] == s[i+1] {\n\t\t\tcnt++\n\t\t\ti++\n\t\t}\n\t}\n\tfmt.Println(k*cnt + (k-1)*((a+b)/2) + a/2 + b/2)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S. Let T be the concatenation of K copies of S.\nWe can repeatedly perform the following operation: choose a character in T and replace it with a different character.\nFind the minimum number of operations required to satisfy the following condition: any two adjacent characters in T are different.\n\nConstraints\n\n1 \\leq |S| \\leq 100\n\nS consists of lowercase English letters.\n\n1 \\leq K \\leq 10^9\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\nissii\n2\n\nSample Output 1\n\n4\n\nT is issiiissii. For example, we can rewrite it into ispiqisyhi, and now any two adjacent characters are different.\n\nSample Input 2\n\nqq\n81\n\nSample Output 2\n\n81\n\nSample Input 3\n\ncooooooooonteeeeeeeeeest\n999993333\n\nSample Output 3\n\n8999939997", "sample_input": "issii\n2\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02891", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S. Let T be the concatenation of K copies of S.\nWe can repeatedly perform the following operation: choose a character in T and replace it with a different character.\nFind the minimum number of operations required to satisfy the following condition: any two adjacent characters in T are different.\n\nConstraints\n\n1 \\leq |S| \\leq 100\n\nS consists of lowercase English letters.\n\n1 \\leq K \\leq 10^9\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\nissii\n2\n\nSample Output 1\n\n4\n\nT is issiiissii. For example, we can rewrite it into ispiqisyhi, and now any two adjacent characters are different.\n\nSample Input 2\n\nqq\n81\n\nSample Output 2\n\n81\n\nSample Input 3\n\ncooooooooonteeeeeeeeeest\n999993333\n\nSample Output 3\n\n8999939997", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 651, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s355918467", "group_id": "codeNet:p02891", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar (\n\t\ts string\n\t\tk int\n\t)\n\tfmt.Scan(&s, &k)\n\n\tcnt := 0\n\tfor i := 0; i < len(s); i++ {\n\t\tif i+1 < len(s) && s[i] == s[i+1] {\n\t\t\tcnt++\n\t\t\ti++\n\t\t}\n\t}\n\n\tif cnt == len(s)-1 {\n\t\tfmt.Println(len(s) * k / 2)\n\t\treturn\n\t}\n\n\tif s[0] == s[len(s)-1] {\n\t\ta := 0\n\t\tfor i := 1; i < len(s); i++ {\n\t\t\tif s[0] == s[i] {\n\t\t\t\ta++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tb := 0\n\t\tfor i := len(s) - 2; i >= 0; i-- {\n\t\t\tif s[len(s)-1] == s[i] {\n\t\t\t\tb++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tfmt.Println(k*cnt + (k-1)*(a/2+b/2-(a+b)/2))\n\t\treturn\n\t}\n\n\tfmt.Println(k * cnt)\n}\n", "language": "Go", "metadata": {"date": 1570677123, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02891.html", "problem_id": "p02891", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02891/input.txt", "sample_output_relpath": "derived/input_output/data/p02891/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02891/Go/s355918467.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s355918467", "user_id": "u461993794"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar (\n\t\ts string\n\t\tk int\n\t)\n\tfmt.Scan(&s, &k)\n\n\tcnt := 0\n\tfor i := 0; i < len(s); i++ {\n\t\tif i+1 < len(s) && s[i] == s[i+1] {\n\t\t\tcnt++\n\t\t\ti++\n\t\t}\n\t}\n\n\tif cnt == len(s)-1 {\n\t\tfmt.Println(len(s) * k / 2)\n\t\treturn\n\t}\n\n\tif s[0] == s[len(s)-1] {\n\t\ta := 0\n\t\tfor i := 1; i < len(s); i++ {\n\t\t\tif s[0] == s[i] {\n\t\t\t\ta++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tb := 0\n\t\tfor i := len(s) - 2; i >= 0; i-- {\n\t\t\tif s[len(s)-1] == s[i] {\n\t\t\t\tb++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tfmt.Println(k*cnt + (k-1)*(a/2+b/2-(a+b)/2))\n\t\treturn\n\t}\n\n\tfmt.Println(k * cnt)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S. Let T be the concatenation of K copies of S.\nWe can repeatedly perform the following operation: choose a character in T and replace it with a different character.\nFind the minimum number of operations required to satisfy the following condition: any two adjacent characters in T are different.\n\nConstraints\n\n1 \\leq |S| \\leq 100\n\nS consists of lowercase English letters.\n\n1 \\leq K \\leq 10^9\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\nissii\n2\n\nSample Output 1\n\n4\n\nT is issiiissii. For example, we can rewrite it into ispiqisyhi, and now any two adjacent characters are different.\n\nSample Input 2\n\nqq\n81\n\nSample Output 2\n\n81\n\nSample Input 3\n\ncooooooooonteeeeeeeeeest\n999993333\n\nSample Output 3\n\n8999939997", "sample_input": "issii\n2\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02891", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S. Let T be the concatenation of K copies of S.\nWe can repeatedly perform the following operation: choose a character in T and replace it with a different character.\nFind the minimum number of operations required to satisfy the following condition: any two adjacent characters in T are different.\n\nConstraints\n\n1 \\leq |S| \\leq 100\n\nS consists of lowercase English letters.\n\n1 \\leq K \\leq 10^9\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\nissii\n2\n\nSample Output 1\n\n4\n\nT is issiiissii. For example, we can rewrite it into ispiqisyhi, and now any two adjacent characters are different.\n\nSample Input 2\n\nqq\n81\n\nSample Output 2\n\n81\n\nSample Input 3\n\ncooooooooonteeeeeeeeeest\n999993333\n\nSample Output 3\n\n8999939997", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 582, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s536193948", "group_id": "codeNet:p02891", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar (\n\t\ts string\n\t\tk int\n\t)\n\tfmt.Scan(&s, &k)\n\n\tcnt := 0\n\tfor i := 0; i < len(s); i++ {\n\t\tif i+1 < len(s) && s[i] == s[i+1] {\n\t\t\tcnt++\n\t\t\ti++\n\t\t}\n\t}\n\n\tif cnt == len(s)-1 {\n\t\tfmt.Println(len(s) * k / 2)\n\t\treturn\n\t}\n\n\tif s[0] == s[len(s)-1] {\n\t\tif len(s) == 3 {\n\t\t\tfmt.Println(k - 1)\n\t\t\treturn\n\t\t}\n\n\t\ta := 0\n\t\tfor i := 1; i < len(s); i++ {\n\t\t\tif s[0] == s[i] {\n\t\t\t\ta++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tb := 0\n\t\tfor i := 0; i < len(s)-1; i++ {\n\t\t\tif s[len(s)-1] == s[i] {\n\t\t\t\tb++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tfmt.Println(k*cnt - (a/2+b/2-(a+b)/2)*(k-1))\n\t\treturn\n\t}\n\n\tfmt.Println(k * cnt)\n}\n", "language": "Go", "metadata": {"date": 1570674300, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02891.html", "problem_id": "p02891", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02891/input.txt", "sample_output_relpath": "derived/input_output/data/p02891/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02891/Go/s536193948.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s536193948", "user_id": "u461993794"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar (\n\t\ts string\n\t\tk int\n\t)\n\tfmt.Scan(&s, &k)\n\n\tcnt := 0\n\tfor i := 0; i < len(s); i++ {\n\t\tif i+1 < len(s) && s[i] == s[i+1] {\n\t\t\tcnt++\n\t\t\ti++\n\t\t}\n\t}\n\n\tif cnt == len(s)-1 {\n\t\tfmt.Println(len(s) * k / 2)\n\t\treturn\n\t}\n\n\tif s[0] == s[len(s)-1] {\n\t\tif len(s) == 3 {\n\t\t\tfmt.Println(k - 1)\n\t\t\treturn\n\t\t}\n\n\t\ta := 0\n\t\tfor i := 1; i < len(s); i++ {\n\t\t\tif s[0] == s[i] {\n\t\t\t\ta++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tb := 0\n\t\tfor i := 0; i < len(s)-1; i++ {\n\t\t\tif s[len(s)-1] == s[i] {\n\t\t\t\tb++\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tfmt.Println(k*cnt - (a/2+b/2-(a+b)/2)*(k-1))\n\t\treturn\n\t}\n\n\tfmt.Println(k * cnt)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S. Let T be the concatenation of K copies of S.\nWe can repeatedly perform the following operation: choose a character in T and replace it with a different character.\nFind the minimum number of operations required to satisfy the following condition: any two adjacent characters in T are different.\n\nConstraints\n\n1 \\leq |S| \\leq 100\n\nS consists of lowercase English letters.\n\n1 \\leq K \\leq 10^9\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\nissii\n2\n\nSample Output 1\n\n4\n\nT is issiiissii. For example, we can rewrite it into ispiqisyhi, and now any two adjacent characters are different.\n\nSample Input 2\n\nqq\n81\n\nSample Output 2\n\n81\n\nSample Input 3\n\ncooooooooonteeeeeeeeeest\n999993333\n\nSample Output 3\n\n8999939997", "sample_input": "issii\n2\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02891", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S. Let T be the concatenation of K copies of S.\nWe can repeatedly perform the following operation: choose a character in T and replace it with a different character.\nFind the minimum number of operations required to satisfy the following condition: any two adjacent characters in T are different.\n\nConstraints\n\n1 \\leq |S| \\leq 100\n\nS consists of lowercase English letters.\n\n1 \\leq K \\leq 10^9\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\nissii\n2\n\nSample Output 1\n\n4\n\nT is issiiissii. For example, we can rewrite it into ispiqisyhi, and now any two adjacent characters are different.\n\nSample Input 2\n\nqq\n81\n\nSample Output 2\n\n81\n\nSample Input 3\n\ncooooooooonteeeeeeeeeest\n999993333\n\nSample Output 3\n\n8999939997", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 635, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s385013246", "group_id": "codeNet:p02891", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc *bufio.Scanner\n\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc culculate(s string) int {\n\trs := []rune(s)\n\tcnt := 0\n\tfor i := 1; i < len(rs); i++ {\n\t\tif rs[i] == rs[i-1] {\n\t\t\trs[i] = '*'\n\t\t\tcnt++\n\t\t}\n\t}\n\treturn cnt\n}\n\nfunc main() {\n\tsc = bufio.NewScanner(os.Stdin)\n\tsc.Buffer(make([]byte, 0), 1000000001*3)\n\tsc.Split(bufio.ScanWords)\n\ts, k := nextStr(), nextInt()\n\ts2 := strings.Join([]string{s, s}, \"\")\n\n\tans1 := culculate(s)\n\tans2 := culculate(s2)\n\tdiff := ans2 - ans1\n\tfmt.Println(ans1 + (diff * (k - 1)))\n}\n", "language": "Go", "metadata": {"date": 1570637350, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02891.html", "problem_id": "p02891", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02891/input.txt", "sample_output_relpath": "derived/input_output/data/p02891/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02891/Go/s385013246.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s385013246", "user_id": "u712822150"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc *bufio.Scanner\n\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc culculate(s string) int {\n\trs := []rune(s)\n\tcnt := 0\n\tfor i := 1; i < len(rs); i++ {\n\t\tif rs[i] == rs[i-1] {\n\t\t\trs[i] = '*'\n\t\t\tcnt++\n\t\t}\n\t}\n\treturn cnt\n}\n\nfunc main() {\n\tsc = bufio.NewScanner(os.Stdin)\n\tsc.Buffer(make([]byte, 0), 1000000001*3)\n\tsc.Split(bufio.ScanWords)\n\ts, k := nextStr(), nextInt()\n\ts2 := strings.Join([]string{s, s}, \"\")\n\n\tans1 := culculate(s)\n\tans2 := culculate(s2)\n\tdiff := ans2 - ans1\n\tfmt.Println(ans1 + (diff * (k - 1)))\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S. Let T be the concatenation of K copies of S.\nWe can repeatedly perform the following operation: choose a character in T and replace it with a different character.\nFind the minimum number of operations required to satisfy the following condition: any two adjacent characters in T are different.\n\nConstraints\n\n1 \\leq |S| \\leq 100\n\nS consists of lowercase English letters.\n\n1 \\leq K \\leq 10^9\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\nissii\n2\n\nSample Output 1\n\n4\n\nT is issiiissii. For example, we can rewrite it into ispiqisyhi, and now any two adjacent characters are different.\n\nSample Input 2\n\nqq\n81\n\nSample Output 2\n\n81\n\nSample Input 3\n\ncooooooooonteeeeeeeeeest\n999993333\n\nSample Output 3\n\n8999939997", "sample_input": "issii\n2\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02891", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S. Let T be the concatenation of K copies of S.\nWe can repeatedly perform the following operation: choose a character in T and replace it with a different character.\nFind the minimum number of operations required to satisfy the following condition: any two adjacent characters in T are different.\n\nConstraints\n\n1 \\leq |S| \\leq 100\n\nS consists of lowercase English letters.\n\n1 \\leq K \\leq 10^9\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\nissii\n2\n\nSample Output 1\n\n4\n\nT is issiiissii. For example, we can rewrite it into ispiqisyhi, and now any two adjacent characters are different.\n\nSample Input 2\n\nqq\n81\n\nSample Output 2\n\n81\n\nSample Input 3\n\ncooooooooonteeeeeeeeeest\n999993333\n\nSample Output 3\n\n8999939997", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 709, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s151884804", "group_id": "codeNet:p02891", "input_text": "// ProblemURL : https://atcoder.jp/contests/agc039/tasks/agc039_a\n// ---------------------------------------------\npackage main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc countAlphabet(s string) int {\n\tm := make(map[rune]int, 26)\n\tfor _, ss := range s {\n\t\tm[ss]++\n\t}\n\treturn len(m)\n}\n\nfunc calcCostNaive(s string) int {\n\tt := []byte(s)\n\tcost := 0\n\tfor i := 1; i < len(t); i++ {\n\t\tif t[i-1] == t[i] {\n\t\t\tt[i] = '#'\n\t\t\tcost++\n\t\t}\n\t}\n\treturn cost\n}\n\nfunc main() {\n\tvar s string\n\tvar k int\n\tfmt.Scan(&s, &k)\n\n\tif countAlphabet(s) == 1 {\n\t\tlength := len(s) * k\n\t\tcost := length / 2\n\t\tfmt.Println(cost)\n\t\treturn\n\t}\n\n\tif s[0] == s[len(s)-1] {\n\t\tt := string(s[0])\n\t\tctHead := len(s) - len(strings.TrimLeft(s, t))\n\t\tctTail := len(s) - len(strings.TrimRight(s, t))\n\t\tu := strings.Trim(s, t)\n\t\tcost := ctHead/2 + ctTail/2 + calcCostNaive(u)*k + (ctHead+ctTail)/2*(k-1)\n\t\tfmt.Println(cost)\n\t} else {\n\t\tcost := calcCostNaive(s)\n\t\tcost *= k\n\t\tfmt.Println(cost)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1570421794, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02891.html", "problem_id": "p02891", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02891/input.txt", "sample_output_relpath": "derived/input_output/data/p02891/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02891/Go/s151884804.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s151884804", "user_id": "u554269352"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "// ProblemURL : https://atcoder.jp/contests/agc039/tasks/agc039_a\n// ---------------------------------------------\npackage main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc countAlphabet(s string) int {\n\tm := make(map[rune]int, 26)\n\tfor _, ss := range s {\n\t\tm[ss]++\n\t}\n\treturn len(m)\n}\n\nfunc calcCostNaive(s string) int {\n\tt := []byte(s)\n\tcost := 0\n\tfor i := 1; i < len(t); i++ {\n\t\tif t[i-1] == t[i] {\n\t\t\tt[i] = '#'\n\t\t\tcost++\n\t\t}\n\t}\n\treturn cost\n}\n\nfunc main() {\n\tvar s string\n\tvar k int\n\tfmt.Scan(&s, &k)\n\n\tif countAlphabet(s) == 1 {\n\t\tlength := len(s) * k\n\t\tcost := length / 2\n\t\tfmt.Println(cost)\n\t\treturn\n\t}\n\n\tif s[0] == s[len(s)-1] {\n\t\tt := string(s[0])\n\t\tctHead := len(s) - len(strings.TrimLeft(s, t))\n\t\tctTail := len(s) - len(strings.TrimRight(s, t))\n\t\tu := strings.Trim(s, t)\n\t\tcost := ctHead/2 + ctTail/2 + calcCostNaive(u)*k + (ctHead+ctTail)/2*(k-1)\n\t\tfmt.Println(cost)\n\t} else {\n\t\tcost := calcCostNaive(s)\n\t\tcost *= k\n\t\tfmt.Println(cost)\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S. Let T be the concatenation of K copies of S.\nWe can repeatedly perform the following operation: choose a character in T and replace it with a different character.\nFind the minimum number of operations required to satisfy the following condition: any two adjacent characters in T are different.\n\nConstraints\n\n1 \\leq |S| \\leq 100\n\nS consists of lowercase English letters.\n\n1 \\leq K \\leq 10^9\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\nissii\n2\n\nSample Output 1\n\n4\n\nT is issiiissii. For example, we can rewrite it into ispiqisyhi, and now any two adjacent characters are different.\n\nSample Input 2\n\nqq\n81\n\nSample Output 2\n\n81\n\nSample Input 3\n\ncooooooooonteeeeeeeeeest\n999993333\n\nSample Output 3\n\n8999939997", "sample_input": "issii\n2\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02891", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S. Let T be the concatenation of K copies of S.\nWe can repeatedly perform the following operation: choose a character in T and replace it with a different character.\nFind the minimum number of operations required to satisfy the following condition: any two adjacent characters in T are different.\n\nConstraints\n\n1 \\leq |S| \\leq 100\n\nS consists of lowercase English letters.\n\n1 \\leq K \\leq 10^9\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\nissii\n2\n\nSample Output 1\n\n4\n\nT is issiiissii. For example, we can rewrite it into ispiqisyhi, and now any two adjacent characters are different.\n\nSample Input 2\n\nqq\n81\n\nSample Output 2\n\n81\n\nSample Input 3\n\ncooooooooonteeeeeeeeeest\n999993333\n\nSample Output 3\n\n8999939997", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 945, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s472765623", "group_id": "codeNet:p02891", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tsc = bufio.NewScanner(os.Stdin)\n\n\tinput1 := nextLine()\n\tinput2, _ := strconv.Atoi(nextLine())\n\n\tbaseStrRune := []rune(input1)\n\tidx := 1\n\tres := 0\n\n\tfor idx < len(baseStrRune) {\n\t\tleft := baseStrRune[idx-1]\n\t\ttarget := baseStrRune[idx]\n\n\t\tif left != target {\n\t\t\tidx = idx + 1\n\t\t\tcontinue\n\t\t}\n\t\tbaseStrRune[idx] = target + 1\n\t\tidx = idx + 1\n\t\tres++\n\t}\n\tres = res * input2\n\tif baseStrRune[0] == baseStrRune[len(baseStrRune)-1] {\n\t\tres = res + input2 - 1\n\t}\n\tfmt.Print(res)\n}\n", "language": "Go", "metadata": {"date": 1570332583, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02891.html", "problem_id": "p02891", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02891/input.txt", "sample_output_relpath": "derived/input_output/data/p02891/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02891/Go/s472765623.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s472765623", "user_id": "u644684698"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tsc = bufio.NewScanner(os.Stdin)\n\n\tinput1 := nextLine()\n\tinput2, _ := strconv.Atoi(nextLine())\n\n\tbaseStrRune := []rune(input1)\n\tidx := 1\n\tres := 0\n\n\tfor idx < len(baseStrRune) {\n\t\tleft := baseStrRune[idx-1]\n\t\ttarget := baseStrRune[idx]\n\n\t\tif left != target {\n\t\t\tidx = idx + 1\n\t\t\tcontinue\n\t\t}\n\t\tbaseStrRune[idx] = target + 1\n\t\tidx = idx + 1\n\t\tres++\n\t}\n\tres = res * input2\n\tif baseStrRune[0] == baseStrRune[len(baseStrRune)-1] {\n\t\tres = res + input2 - 1\n\t}\n\tfmt.Print(res)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S. Let T be the concatenation of K copies of S.\nWe can repeatedly perform the following operation: choose a character in T and replace it with a different character.\nFind the minimum number of operations required to satisfy the following condition: any two adjacent characters in T are different.\n\nConstraints\n\n1 \\leq |S| \\leq 100\n\nS consists of lowercase English letters.\n\n1 \\leq K \\leq 10^9\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\nissii\n2\n\nSample Output 1\n\n4\n\nT is issiiissii. For example, we can rewrite it into ispiqisyhi, and now any two adjacent characters are different.\n\nSample Input 2\n\nqq\n81\n\nSample Output 2\n\n81\n\nSample Input 3\n\ncooooooooonteeeeeeeeeest\n999993333\n\nSample Output 3\n\n8999939997", "sample_input": "issii\n2\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02891", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S. Let T be the concatenation of K copies of S.\nWe can repeatedly perform the following operation: choose a character in T and replace it with a different character.\nFind the minimum number of operations required to satisfy the following condition: any two adjacent characters in T are different.\n\nConstraints\n\n1 \\leq |S| \\leq 100\n\nS consists of lowercase English letters.\n\n1 \\leq K \\leq 10^9\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\nissii\n2\n\nSample Output 1\n\n4\n\nT is issiiissii. For example, we can rewrite it into ispiqisyhi, and now any two adjacent characters are different.\n\nSample Input 2\n\nqq\n81\n\nSample Output 2\n\n81\n\nSample Input 3\n\ncooooooooonteeeeeeeeeest\n999993333\n\nSample Output 3\n\n8999939997", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 626, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s574900736", "group_id": "codeNet:p02891", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\tmod int = 1e9 + 7\n)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc main() {\n\tS := getString()\n\tK := getInt()\n\n\toldS := []byte(S)\n\tnewS := []byte(S)\n\n\tchangeCnt := 0\n\n\tif len(newS) == 1 {\n\t\tchangeCnt = K / 2\n\t} else {\n\t\tfor i := 1; i < len(newS); i++ {\n\t\t\tif newS[i] == newS[i-1] {\n\t\t\t\tnewS[i] = '*'\n\t\t\t}\n\t\t}\n\n\t\tif len(newS) >= 3 {\n\t\t\tif newS[1] == '*' && newS[0] != newS[2] {\n\t\t\t\tnewS[1] = newS[0]\n\t\t\t\tnewS[0] = '*'\n\t\t\t}\n\t\t}\n\n\t\tcnt := 0\n\t\tfor i := 0; i < len(newS); i++ {\n\t\t\tif newS[i] == newS[0] || newS[i] == '*' {\n\t\t\t\tcnt++\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\t\n\t\tif cnt%2 == 0 {\n\t\t\tfor i := 0; i < cnt/2; i++ {\n\t\t\t\tnewS[2*i+1] = newS[2*i]\n\t\t\t\tnewS[2*i] = '*'\n\t\t\t}\n\t\t}\n\n\t\tif newS[0] == newS[len(newS)-1] {\n\t\t\tnewS[len(newS)-1] = '*'\n\t\t}\n\n\t\tfor _, c := range newS {\n\t\t\tif c == '*' {\n\t\t\t\tchangeCnt++\n\t\t\t}\n\t\t}\n\n\t\tchangeCnt = changeCnt * K\n\n\t\t// 末尾2つが*なら、1回減らす\n\t\tif newS[len(newS)-2] == '*' && newS[len(newS)-1] == '*' {\n\t\t\tchangeCnt--\n\t\t} else if newS[len(newS)-1] == '*' && oldS[len(oldS)-2] != oldS[len(oldS)-1] {\n\t\t\tchangeCnt--\n\t\t}\n\n\t\t//fmt.Println(string(newS), string(newS))\n\t}\n\n\tfmt.Println(changeCnt)\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\tstr := sc.Text()\n\tvalue, _ := strconv.Atoi(str)\n\treturn value\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n", "language": "Go", "metadata": {"date": 1570330719, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02891.html", "problem_id": "p02891", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02891/input.txt", "sample_output_relpath": "derived/input_output/data/p02891/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02891/Go/s574900736.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s574900736", "user_id": "u964273035"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\tmod int = 1e9 + 7\n)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc main() {\n\tS := getString()\n\tK := getInt()\n\n\toldS := []byte(S)\n\tnewS := []byte(S)\n\n\tchangeCnt := 0\n\n\tif len(newS) == 1 {\n\t\tchangeCnt = K / 2\n\t} else {\n\t\tfor i := 1; i < len(newS); i++ {\n\t\t\tif newS[i] == newS[i-1] {\n\t\t\t\tnewS[i] = '*'\n\t\t\t}\n\t\t}\n\n\t\tif len(newS) >= 3 {\n\t\t\tif newS[1] == '*' && newS[0] != newS[2] {\n\t\t\t\tnewS[1] = newS[0]\n\t\t\t\tnewS[0] = '*'\n\t\t\t}\n\t\t}\n\n\t\tcnt := 0\n\t\tfor i := 0; i < len(newS); i++ {\n\t\t\tif newS[i] == newS[0] || newS[i] == '*' {\n\t\t\t\tcnt++\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\t\n\t\tif cnt%2 == 0 {\n\t\t\tfor i := 0; i < cnt/2; i++ {\n\t\t\t\tnewS[2*i+1] = newS[2*i]\n\t\t\t\tnewS[2*i] = '*'\n\t\t\t}\n\t\t}\n\n\t\tif newS[0] == newS[len(newS)-1] {\n\t\t\tnewS[len(newS)-1] = '*'\n\t\t}\n\n\t\tfor _, c := range newS {\n\t\t\tif c == '*' {\n\t\t\t\tchangeCnt++\n\t\t\t}\n\t\t}\n\n\t\tchangeCnt = changeCnt * K\n\n\t\t// 末尾2つが*なら、1回減らす\n\t\tif newS[len(newS)-2] == '*' && newS[len(newS)-1] == '*' {\n\t\t\tchangeCnt--\n\t\t} else if newS[len(newS)-1] == '*' && oldS[len(oldS)-2] != oldS[len(oldS)-1] {\n\t\t\tchangeCnt--\n\t\t}\n\n\t\t//fmt.Println(string(newS), string(newS))\n\t}\n\n\tfmt.Println(changeCnt)\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\tstr := sc.Text()\n\tvalue, _ := strconv.Atoi(str)\n\treturn value\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S. Let T be the concatenation of K copies of S.\nWe can repeatedly perform the following operation: choose a character in T and replace it with a different character.\nFind the minimum number of operations required to satisfy the following condition: any two adjacent characters in T are different.\n\nConstraints\n\n1 \\leq |S| \\leq 100\n\nS consists of lowercase English letters.\n\n1 \\leq K \\leq 10^9\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\nissii\n2\n\nSample Output 1\n\n4\n\nT is issiiissii. For example, we can rewrite it into ispiqisyhi, and now any two adjacent characters are different.\n\nSample Input 2\n\nqq\n81\n\nSample Output 2\n\n81\n\nSample Input 3\n\ncooooooooonteeeeeeeeeest\n999993333\n\nSample Output 3\n\n8999939997", "sample_input": "issii\n2\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02891", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S. Let T be the concatenation of K copies of S.\nWe can repeatedly perform the following operation: choose a character in T and replace it with a different character.\nFind the minimum number of operations required to satisfy the following condition: any two adjacent characters in T are different.\n\nConstraints\n\n1 \\leq |S| \\leq 100\n\nS consists of lowercase English letters.\n\n1 \\leq K \\leq 10^9\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\nissii\n2\n\nSample Output 1\n\n4\n\nT is issiiissii. For example, we can rewrite it into ispiqisyhi, and now any two adjacent characters are different.\n\nSample Input 2\n\nqq\n81\n\nSample Output 2\n\n81\n\nSample Input 3\n\ncooooooooonteeeeeeeeeest\n999993333\n\nSample Output 3\n\n8999939997", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2283, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s908799826", "group_id": "codeNet:p02891", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\t// fmt.Println(8999939997 / 999993333)\n\tvar s string\n\tvar k int\n\tfmt.Scan(&s, &k)\n\tss := strings.Split(s, \"\")\n\tvar p string\n\tvar count int\n\t// var j int\n\tvar j = 1\n\tvar f bool\n\tvar fs string\n\tfor i, c := range ss {\n\t\tif c == p && i != 0 {\n\t\t\tcount++\n\t\t\tf = true\n\t\t} else {\n\t\t\tif f {\n\t\t\t\tj++\n\t\t\t}\n\t\t\tf = false\n\t\t}\n\t\tp = c\n\t\tif len(s)-1 == i {\n\t\t\tfs = c\n\t\t}\n\t}\n\t// fmt.Println(fs)\n\t// fmt.Println(count, j)\n\tvar r int\n\tif j == 0 {\n\t\tfmt.Println(k * count)\n\t\tos.Exit(0)\n\t}\n\tif s[0:1] == fs {\n\t\tr = count / (j - 1)\n\t} else {\n\t\tr = (count / (j - 1)) + 1\n\t}\n\tfmt.Println(k * r)\n}\n\n// cooooooooonteeeeeeeeeest\n", "language": "Go", "metadata": {"date": 1570329782, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02891.html", "problem_id": "p02891", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02891/input.txt", "sample_output_relpath": "derived/input_output/data/p02891/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02891/Go/s908799826.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s908799826", "user_id": "u262396543"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\t// fmt.Println(8999939997 / 999993333)\n\tvar s string\n\tvar k int\n\tfmt.Scan(&s, &k)\n\tss := strings.Split(s, \"\")\n\tvar p string\n\tvar count int\n\t// var j int\n\tvar j = 1\n\tvar f bool\n\tvar fs string\n\tfor i, c := range ss {\n\t\tif c == p && i != 0 {\n\t\t\tcount++\n\t\t\tf = true\n\t\t} else {\n\t\t\tif f {\n\t\t\t\tj++\n\t\t\t}\n\t\t\tf = false\n\t\t}\n\t\tp = c\n\t\tif len(s)-1 == i {\n\t\t\tfs = c\n\t\t}\n\t}\n\t// fmt.Println(fs)\n\t// fmt.Println(count, j)\n\tvar r int\n\tif j == 0 {\n\t\tfmt.Println(k * count)\n\t\tos.Exit(0)\n\t}\n\tif s[0:1] == fs {\n\t\tr = count / (j - 1)\n\t} else {\n\t\tr = (count / (j - 1)) + 1\n\t}\n\tfmt.Println(k * r)\n}\n\n// cooooooooonteeeeeeeeeest\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S. Let T be the concatenation of K copies of S.\nWe can repeatedly perform the following operation: choose a character in T and replace it with a different character.\nFind the minimum number of operations required to satisfy the following condition: any two adjacent characters in T are different.\n\nConstraints\n\n1 \\leq |S| \\leq 100\n\nS consists of lowercase English letters.\n\n1 \\leq K \\leq 10^9\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\nissii\n2\n\nSample Output 1\n\n4\n\nT is issiiissii. For example, we can rewrite it into ispiqisyhi, and now any two adjacent characters are different.\n\nSample Input 2\n\nqq\n81\n\nSample Output 2\n\n81\n\nSample Input 3\n\ncooooooooonteeeeeeeeeest\n999993333\n\nSample Output 3\n\n8999939997", "sample_input": "issii\n2\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02891", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S. Let T be the concatenation of K copies of S.\nWe can repeatedly perform the following operation: choose a character in T and replace it with a different character.\nFind the minimum number of operations required to satisfy the following condition: any two adjacent characters in T are different.\n\nConstraints\n\n1 \\leq |S| \\leq 100\n\nS consists of lowercase English letters.\n\n1 \\leq K \\leq 10^9\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\nissii\n2\n\nSample Output 1\n\n4\n\nT is issiiissii. For example, we can rewrite it into ispiqisyhi, and now any two adjacent characters are different.\n\nSample Input 2\n\nqq\n81\n\nSample Output 2\n\n81\n\nSample Input 3\n\ncooooooooonteeeeeeeeeest\n999993333\n\nSample Output 3\n\n8999939997", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 668, "cpu_time_ms": 3, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s829399006", "group_id": "codeNet:p02891", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scan *bufio.Scanner\nvar writer io.Writer\n\nfunc init() {\n\tscan = bufio.NewScanner(os.Stdin)\n\twriter = os.Stdout\n\tscan.Split(bufio.ScanWords)\n}\n\nfunc main() {\n\tsolve()\n}\n\nfunc solve() {\n\tvar s string\n\tfmt.Scan(&s)\n\tvar k int\n\tfmt.Scan(&k)\n\n\tres := 0\n\tc := 1\n\tcs := 1\n\tcsf := true\n\tfor i := 1; i < len(s); i++ {\n\t\tif s[i] == s[i-1] {\n\t\t\tc++\n\t\t\tif csf {\n\t\t\t\tcs++\n\t\t\t}\n\t\t} else {\n\t\t\tres += c / 2\n\t\t\tc = 1\n\t\t\tcsf = false\n\t\t}\n\t}\n\tres += c / 2\n\tres = res * k\n\tif s[0] == s[len(s)-1] && c%2 == 1 && cs%2 == 1 {\n\t\tres += k - 1\n\t}\n\tfmt.Fprint(writer, res)\n}\n\nfunc nextWord() string {\n\tscan.Scan()\n\tstr := scan.Text()\n\treturn str\n}\n\nfunc nextInt() int {\n\ti, e := strconv.Atoi(nextWord())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n", "language": "Go", "metadata": {"date": 1570325383, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02891.html", "problem_id": "p02891", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02891/input.txt", "sample_output_relpath": "derived/input_output/data/p02891/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02891/Go/s829399006.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s829399006", "user_id": "u693512270"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scan *bufio.Scanner\nvar writer io.Writer\n\nfunc init() {\n\tscan = bufio.NewScanner(os.Stdin)\n\twriter = os.Stdout\n\tscan.Split(bufio.ScanWords)\n}\n\nfunc main() {\n\tsolve()\n}\n\nfunc solve() {\n\tvar s string\n\tfmt.Scan(&s)\n\tvar k int\n\tfmt.Scan(&k)\n\n\tres := 0\n\tc := 1\n\tcs := 1\n\tcsf := true\n\tfor i := 1; i < len(s); i++ {\n\t\tif s[i] == s[i-1] {\n\t\t\tc++\n\t\t\tif csf {\n\t\t\t\tcs++\n\t\t\t}\n\t\t} else {\n\t\t\tres += c / 2\n\t\t\tc = 1\n\t\t\tcsf = false\n\t\t}\n\t}\n\tres += c / 2\n\tres = res * k\n\tif s[0] == s[len(s)-1] && c%2 == 1 && cs%2 == 1 {\n\t\tres += k - 1\n\t}\n\tfmt.Fprint(writer, res)\n}\n\nfunc nextWord() string {\n\tscan.Scan()\n\tstr := scan.Text()\n\treturn str\n}\n\nfunc nextInt() int {\n\ti, e := strconv.Atoi(nextWord())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S. Let T be the concatenation of K copies of S.\nWe can repeatedly perform the following operation: choose a character in T and replace it with a different character.\nFind the minimum number of operations required to satisfy the following condition: any two adjacent characters in T are different.\n\nConstraints\n\n1 \\leq |S| \\leq 100\n\nS consists of lowercase English letters.\n\n1 \\leq K \\leq 10^9\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\nissii\n2\n\nSample Output 1\n\n4\n\nT is issiiissii. For example, we can rewrite it into ispiqisyhi, and now any two adjacent characters are different.\n\nSample Input 2\n\nqq\n81\n\nSample Output 2\n\n81\n\nSample Input 3\n\ncooooooooonteeeeeeeeeest\n999993333\n\nSample Output 3\n\n8999939997", "sample_input": "issii\n2\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02891", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S. Let T be the concatenation of K copies of S.\nWe can repeatedly perform the following operation: choose a character in T and replace it with a different character.\nFind the minimum number of operations required to satisfy the following condition: any two adjacent characters in T are different.\n\nConstraints\n\n1 \\leq |S| \\leq 100\n\nS consists of lowercase English letters.\n\n1 \\leq K \\leq 10^9\n\nK is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nK\n\nOutput\n\nPrint the minimum number of operations required.\n\nSample Input 1\n\nissii\n2\n\nSample Output 1\n\n4\n\nT is issiiissii. For example, we can rewrite it into ispiqisyhi, and now any two adjacent characters are different.\n\nSample Input 2\n\nqq\n81\n\nSample Output 2\n\n81\n\nSample Input 3\n\ncooooooooonteeeeeeeeeest\n999993333\n\nSample Output 3\n\n8999939997", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s072802082", "group_id": "codeNet:p02912", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve(sc *scanner, wr *bufio.Writer) {\n\tn, m := sc.getInt2()\n\tpq := newIntPriorityQueue()\n\tfor i := 0; i < n; i++ {\n\t\ta := sc.getInt()\n\t\theap.Push(pq, a)\n\t}\n\n\tfor i := 0; i < m; i++ {\n\t\t(*pq)[0] /= 2\n\t\theap.Fix(pq, 0)\n\t}\n\n\tans := sum(*pq...)\n\tfmt.Fprintln(wr, ans)\n}\n\ntype intPriorityQueue []int\n\nfunc newIntPriorityQueue() *intPriorityQueue {\n\tpq := new(intPriorityQueue)\n\theap.Init(pq)\n\treturn pq\n}\n\nfunc (pq intPriorityQueue) Len() int { return len(pq) }\nfunc (pq intPriorityQueue) Less(i, j int) bool { return pq[i] > pq[j] }\nfunc (pq intPriorityQueue) Swap(i, j int) { pq[i], pq[j] = pq[j], pq[i] }\nfunc (pq *intPriorityQueue) Push(x interface{}) {\n\t*pq = append(*pq, x.(int))\n}\nfunc (pq *intPriorityQueue) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\tret := old[n-1]\n\t*pq = old[0 : n-1]\n\treturn ret\n}\n\nfunc main() {\n\tsc := newScanner()\n\twr := bufio.NewWriter(os.Stdout)\n\tmaxBufSize := int(1e8)\n\tsc.Buffer(make([]byte, 4096), maxBufSize)\n\tsc.Split(bufio.ScanWords)\n\n\tsolve(sc, wr)\n\twr.Flush()\n}\n\n// input ------------------------\ntype scanner struct {\n\t*bufio.Scanner\n}\n\nfunc newScanner() *scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\treturn &scanner{sc}\n}\nfunc (sc *scanner) getInt() int {\n\tsc.Scan()\n\tret, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ret\n}\nfunc (sc *scanner) getInt2() (int, int) {\n\treturn sc.getInt(), sc.getInt()\n}\nfunc (sc *scanner) getInt3() (int, int, int) {\n\treturn sc.getInt(), sc.getInt(), sc.getInt()\n}\nfunc (sc *scanner) getInt4() (int, int, int, int) {\n\treturn sc.getInt(), sc.getInt(), sc.getInt(), sc.getInt()\n}\nfunc (sc *scanner) getInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := range ret {\n\t\tret[i] = sc.getInt()\n\t}\n\treturn ret\n}\nfunc (sc *scanner) getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc (sc *scanner) getRunes() []rune {\n\treturn []rune(sc.getString())\n}\nfunc (sc *scanner) getFloat() float64 {\n\tsc.Scan()\n\tret, err := strconv.ParseFloat(sc.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ret\n}\nfunc (sc *scanner) getFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := range ret {\n\t\tret[i] = sc.getFloat()\n\t}\n\treturn ret\n}\n\n// math ----------------------------\nfunc sum(ns ...int) int {\n\tvar sum int\n\tfor _, n := range ns {\n\t\tsum += n\n\t}\n\treturn sum\n}\n\nfunc max(ns ...int) int {\n\tmax := ns[0]\n\tfor i := 1; i < len(ns); i++ {\n\t\tif max < ns[i] {\n\t\t\tmax = ns[i]\n\t\t}\n\t}\n\treturn max\n}\n\nfunc min(ns ...int) int {\n\tmin := ns[0]\n\tfor i := 1; i < len(ns); i++ {\n\t\tif min > ns[i] {\n\t\t\tmin = ns[i]\n\t\t}\n\t}\n\treturn min\n}\n\nfunc pow(a, b int) int {\n\tret := 1\n\tfor b > 0 {\n\t\tif b&1 > 0 {\n\t\t\tret = ret * a\n\t\t}\n\t\ta = a * a\n\t\tb >>= 1\n\t}\n\treturn ret\n}\n", "language": "Go", "metadata": {"date": 1595108389, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02912.html", "problem_id": "p02912", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02912/input.txt", "sample_output_relpath": "derived/input_output/data/p02912/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02912/Go/s072802082.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s072802082", "user_id": "u543933043"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve(sc *scanner, wr *bufio.Writer) {\n\tn, m := sc.getInt2()\n\tpq := newIntPriorityQueue()\n\tfor i := 0; i < n; i++ {\n\t\ta := sc.getInt()\n\t\theap.Push(pq, a)\n\t}\n\n\tfor i := 0; i < m; i++ {\n\t\t(*pq)[0] /= 2\n\t\theap.Fix(pq, 0)\n\t}\n\n\tans := sum(*pq...)\n\tfmt.Fprintln(wr, ans)\n}\n\ntype intPriorityQueue []int\n\nfunc newIntPriorityQueue() *intPriorityQueue {\n\tpq := new(intPriorityQueue)\n\theap.Init(pq)\n\treturn pq\n}\n\nfunc (pq intPriorityQueue) Len() int { return len(pq) }\nfunc (pq intPriorityQueue) Less(i, j int) bool { return pq[i] > pq[j] }\nfunc (pq intPriorityQueue) Swap(i, j int) { pq[i], pq[j] = pq[j], pq[i] }\nfunc (pq *intPriorityQueue) Push(x interface{}) {\n\t*pq = append(*pq, x.(int))\n}\nfunc (pq *intPriorityQueue) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\tret := old[n-1]\n\t*pq = old[0 : n-1]\n\treturn ret\n}\n\nfunc main() {\n\tsc := newScanner()\n\twr := bufio.NewWriter(os.Stdout)\n\tmaxBufSize := int(1e8)\n\tsc.Buffer(make([]byte, 4096), maxBufSize)\n\tsc.Split(bufio.ScanWords)\n\n\tsolve(sc, wr)\n\twr.Flush()\n}\n\n// input ------------------------\ntype scanner struct {\n\t*bufio.Scanner\n}\n\nfunc newScanner() *scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\treturn &scanner{sc}\n}\nfunc (sc *scanner) getInt() int {\n\tsc.Scan()\n\tret, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ret\n}\nfunc (sc *scanner) getInt2() (int, int) {\n\treturn sc.getInt(), sc.getInt()\n}\nfunc (sc *scanner) getInt3() (int, int, int) {\n\treturn sc.getInt(), sc.getInt(), sc.getInt()\n}\nfunc (sc *scanner) getInt4() (int, int, int, int) {\n\treturn sc.getInt(), sc.getInt(), sc.getInt(), sc.getInt()\n}\nfunc (sc *scanner) getInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := range ret {\n\t\tret[i] = sc.getInt()\n\t}\n\treturn ret\n}\nfunc (sc *scanner) getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc (sc *scanner) getRunes() []rune {\n\treturn []rune(sc.getString())\n}\nfunc (sc *scanner) getFloat() float64 {\n\tsc.Scan()\n\tret, err := strconv.ParseFloat(sc.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ret\n}\nfunc (sc *scanner) getFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := range ret {\n\t\tret[i] = sc.getFloat()\n\t}\n\treturn ret\n}\n\n// math ----------------------------\nfunc sum(ns ...int) int {\n\tvar sum int\n\tfor _, n := range ns {\n\t\tsum += n\n\t}\n\treturn sum\n}\n\nfunc max(ns ...int) int {\n\tmax := ns[0]\n\tfor i := 1; i < len(ns); i++ {\n\t\tif max < ns[i] {\n\t\t\tmax = ns[i]\n\t\t}\n\t}\n\treturn max\n}\n\nfunc min(ns ...int) int {\n\tmin := ns[0]\n\tfor i := 1; i < len(ns); i++ {\n\t\tif min > ns[i] {\n\t\t\tmin = ns[i]\n\t\t}\n\t}\n\treturn min\n}\n\nfunc pow(a, b int) int {\n\tret := 1\n\tfor b > 0 {\n\t\tif b&1 > 0 {\n\t\t\tret = ret * a\n\t\t}\n\t\ta = a * a\n\t\tb >>= 1\n\t}\n\treturn ret\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi is going to buy N items one by one.\n\nThe price of the i-th item he buys is A_i yen (the currency of Japan).\n\nHe has M discount tickets, and he can use any number of them when buying an item.\n\nIf Y tickets are used when buying an item priced X yen, he can get the item for \\frac{X}{2^Y} (rounded down to the nearest integer) yen.\n\nWhat is the minimum amount of money required to buy all the items?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\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 minimum amount of money required to buy all the items.\n\nSample Input 1\n\n3 3\n2 13 8\n\nSample Output 1\n\n9\n\nWe can buy all the items for 9 yen, as follows:\n\nBuy the 1-st item for 2 yen without tickets.\n\nBuy the 2-nd item for 3 yen with 2 tickets.\n\nBuy the 3-rd item for 4 yen with 1 ticket.\n\nSample Input 2\n\n4 4\n1 9 3 5\n\nSample Output 2\n\n6\n\nSample Input 3\n\n1 100000\n1000000000\n\nSample Output 3\n\n0\n\nWe can buy the item priced 1000000000 yen for 0 yen with 100000 tickets.\n\nSample Input 4\n\n10 1\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n\nSample Output 4\n\n9500000000", "sample_input": "3 3\n2 13 8\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02912", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi is going to buy N items one by one.\n\nThe price of the i-th item he buys is A_i yen (the currency of Japan).\n\nHe has M discount tickets, and he can use any number of them when buying an item.\n\nIf Y tickets are used when buying an item priced X yen, he can get the item for \\frac{X}{2^Y} (rounded down to the nearest integer) yen.\n\nWhat is the minimum amount of money required to buy all the items?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\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 minimum amount of money required to buy all the items.\n\nSample Input 1\n\n3 3\n2 13 8\n\nSample Output 1\n\n9\n\nWe can buy all the items for 9 yen, as follows:\n\nBuy the 1-st item for 2 yen without tickets.\n\nBuy the 2-nd item for 3 yen with 2 tickets.\n\nBuy the 3-rd item for 4 yen with 1 ticket.\n\nSample Input 2\n\n4 4\n1 9 3 5\n\nSample Output 2\n\n6\n\nSample Input 3\n\n1 100000\n1000000000\n\nSample Output 3\n\n0\n\nWe can buy the item priced 1000000000 yen for 0 yen with 100000 tickets.\n\nSample Input 4\n\n10 1\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n\nSample Output 4\n\n9500000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2739, "cpu_time_ms": 57, "memory_kb": 6772}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s346292844", "group_id": "codeNet:p02912", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\n/* sort */\ntype pair struct {\n\tindex int64\n\tp1, p2 interface{}\n}\ntype pairs []pair\n\nfunc (slice pairs) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice pairs) Less(i, j int) bool {\n\treturn slice[i].index < slice[j].index\n}\n\nfunc (slice pairs) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\n\n/* sort */\ntype Int64Slice []int64\n\nfunc (slice Int64Slice) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice Int64Slice) Less(i, j int) bool {\n\treturn slice[i] < slice[j]\n}\n\nfunc (slice Int64Slice) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\nfunc Int64s(a []int64) { sort.Sort(Int64Slice(a)) }\nfunc Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n\tINF = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tdi = []int64{-1, 0, 1, 0}\n\tdj = []int64{0, -1, 0, 1}\n\tdi8 = []int64{-1, -1, 0, 1, 1, 1, 0, -1}\n\tdj8 = []int64{0, -1, -1, -1, 0, 1, 1, 1}\n)\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tscanner.Buffer(buf, maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tN, M := readInt(), readInt()\n\tA := make([]int64, N)\n\tfor i := int64(0); i < N; i++ {\n\t\tA[i] = readInt()\n\t}\n\tInt64s(A)\n\ti := len(A) - 1\n\tfor M > 0 {\n\t\tInt64s(A)\n\t\tA[i] /= 2\n\t\tM--\n\t}\n\tfmt.Println(sum(A))\n}\n\n/*==========================================\n * Library\n *==========================================*/\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\nfunc doubleAry(h int64, w int64, init int64) (res [][]int64) {\n\tres = make([][]int64, h)\n\tfor i := int64(0); i < h; i++ {\n\t\tres[i] = make([]int64, w)\n\t\tfor j := int64(0); j < w; j++ {\n\t\t\tres[i][j] = init\n\t\t}\n\t}\n\treturn\n}\n\nfunc aryEq(a []int64, b []int64) bool {\n\treturn reflect.DeepEqual(a, b)\n}\n\nfunc clone(n []int64) (r []int64) {\n\tr = make([]int64, len(n))\n\tfor i := 0; i < len(n); i++ {\n\t\tr[i] = n[i]\n\t}\n\treturn\n}\nfunc write(s string) {\n\twriter.WriteString(s)\n}\n\nfunc print() {\n\twriter.Flush()\n}\n\n// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可\nfunc readLine() (s string) {\n\tif scanner.Scan() {\n\t\ts = scanner.Text()\n\t}\n\treturn s\n}\n\nfunc readInt() (read int64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseInt(scanner.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readFloat() (read float64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readRunes() (read []rune) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, v)\n\t}\n\treturn\n}\n\nfunc readString() (read string) {\n\tscanner.Scan()\n\tread = scanner.Text()\n\treturn\n}\n\nfunc readStrings() (read []string) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, string(v))\n\t}\n\treturn\n}\n\nfunc s2i(s string) int64 {\n\tvar intVal, e = strconv.ParseInt(s, 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int64) string {\n\tvar strVal = strconv.FormatInt(i, 10)\n\treturn strVal\n}\n\nfunc s2f(s string) float64 {\n\tvar floatVal, e = strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn floatVal\n}\n\nfunc abs(i int64) int64 {\n\treturn int64(math.Abs(float64(i)))\n}\n\nfunc max(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans < v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\nfunc min(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans > v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc sum(i []int64) int64 {\n\tsum := int64(0)\n\tfor _, val := range i {\n\t\tsum += val\n\t}\n\treturn sum\n}\n\nfunc split(s string) []string {\n\treturn strings.Fields(s)\n}\n\nfunc strAry2intAry(strs []string) []int64 {\n\tvar ret = make([]int64, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal = s2i(str)\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int64) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = i2s(num)\n\t\tret = append(ret, strVal)\n\t}\n\treturn ret\n}\n\nfunc ary2str(strs []string) string {\n\treturn strings.Join(strs, \" \")\n}\n\nfunc reverse(res []int64) []int64 {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\nfunc reverseStr(res []string) []string {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\n\nfunc ini(res []int, init int) {\n\tif len(res) == 0 {\n\t\treturn\n\t}\n\tres[0] = init\n\tfor i := 0; i < len(res); i++ {\n\t\tcopy(res[i:], res[:i])\n\t}\n}\n\n//\n// func regexpExample() {\n// // Your code here!\n// var str = \"13:20\"\n// r := regexp.MustCompile(`(\\d+):(\\d+)`)\n// fmt.Println(r.FindStringSubmatch(str))\n// }\n\n// type Country struct {\n// gold int\n// silver int\n// blonze int\n// }\n\n// // 複数ソートのサンプル\n// func stableSortExample() []Country{\n// var country = []Country {\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:3, blonze:2},\n// {gold:1, silver:3, blonze:3},\n// }\n// sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })\n// return country\n// }\n", "language": "Go", "metadata": {"date": 1592523913, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02912.html", "problem_id": "p02912", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02912/input.txt", "sample_output_relpath": "derived/input_output/data/p02912/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02912/Go/s346292844.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s346292844", "user_id": "u967669872"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\n/* sort */\ntype pair struct {\n\tindex int64\n\tp1, p2 interface{}\n}\ntype pairs []pair\n\nfunc (slice pairs) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice pairs) Less(i, j int) bool {\n\treturn slice[i].index < slice[j].index\n}\n\nfunc (slice pairs) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\n\n/* sort */\ntype Int64Slice []int64\n\nfunc (slice Int64Slice) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice Int64Slice) Less(i, j int) bool {\n\treturn slice[i] < slice[j]\n}\n\nfunc (slice Int64Slice) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\nfunc Int64s(a []int64) { sort.Sort(Int64Slice(a)) }\nfunc Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n\tINF = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tdi = []int64{-1, 0, 1, 0}\n\tdj = []int64{0, -1, 0, 1}\n\tdi8 = []int64{-1, -1, 0, 1, 1, 1, 0, -1}\n\tdj8 = []int64{0, -1, -1, -1, 0, 1, 1, 1}\n)\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tscanner.Buffer(buf, maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tN, M := readInt(), readInt()\n\tA := make([]int64, N)\n\tfor i := int64(0); i < N; i++ {\n\t\tA[i] = readInt()\n\t}\n\tInt64s(A)\n\ti := len(A) - 1\n\tfor M > 0 {\n\t\tInt64s(A)\n\t\tA[i] /= 2\n\t\tM--\n\t}\n\tfmt.Println(sum(A))\n}\n\n/*==========================================\n * Library\n *==========================================*/\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\nfunc doubleAry(h int64, w int64, init int64) (res [][]int64) {\n\tres = make([][]int64, h)\n\tfor i := int64(0); i < h; i++ {\n\t\tres[i] = make([]int64, w)\n\t\tfor j := int64(0); j < w; j++ {\n\t\t\tres[i][j] = init\n\t\t}\n\t}\n\treturn\n}\n\nfunc aryEq(a []int64, b []int64) bool {\n\treturn reflect.DeepEqual(a, b)\n}\n\nfunc clone(n []int64) (r []int64) {\n\tr = make([]int64, len(n))\n\tfor i := 0; i < len(n); i++ {\n\t\tr[i] = n[i]\n\t}\n\treturn\n}\nfunc write(s string) {\n\twriter.WriteString(s)\n}\n\nfunc print() {\n\twriter.Flush()\n}\n\n// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可\nfunc readLine() (s string) {\n\tif scanner.Scan() {\n\t\ts = scanner.Text()\n\t}\n\treturn s\n}\n\nfunc readInt() (read int64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseInt(scanner.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readFloat() (read float64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readRunes() (read []rune) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, v)\n\t}\n\treturn\n}\n\nfunc readString() (read string) {\n\tscanner.Scan()\n\tread = scanner.Text()\n\treturn\n}\n\nfunc readStrings() (read []string) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, string(v))\n\t}\n\treturn\n}\n\nfunc s2i(s string) int64 {\n\tvar intVal, e = strconv.ParseInt(s, 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int64) string {\n\tvar strVal = strconv.FormatInt(i, 10)\n\treturn strVal\n}\n\nfunc s2f(s string) float64 {\n\tvar floatVal, e = strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn floatVal\n}\n\nfunc abs(i int64) int64 {\n\treturn int64(math.Abs(float64(i)))\n}\n\nfunc max(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans < v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\nfunc min(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans > v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc sum(i []int64) int64 {\n\tsum := int64(0)\n\tfor _, val := range i {\n\t\tsum += val\n\t}\n\treturn sum\n}\n\nfunc split(s string) []string {\n\treturn strings.Fields(s)\n}\n\nfunc strAry2intAry(strs []string) []int64 {\n\tvar ret = make([]int64, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal = s2i(str)\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int64) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = i2s(num)\n\t\tret = append(ret, strVal)\n\t}\n\treturn ret\n}\n\nfunc ary2str(strs []string) string {\n\treturn strings.Join(strs, \" \")\n}\n\nfunc reverse(res []int64) []int64 {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\nfunc reverseStr(res []string) []string {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\n\nfunc ini(res []int, init int) {\n\tif len(res) == 0 {\n\t\treturn\n\t}\n\tres[0] = init\n\tfor i := 0; i < len(res); i++ {\n\t\tcopy(res[i:], res[:i])\n\t}\n}\n\n//\n// func regexpExample() {\n// // Your code here!\n// var str = \"13:20\"\n// r := regexp.MustCompile(`(\\d+):(\\d+)`)\n// fmt.Println(r.FindStringSubmatch(str))\n// }\n\n// type Country struct {\n// gold int\n// silver int\n// blonze int\n// }\n\n// // 複数ソートのサンプル\n// func stableSortExample() []Country{\n// var country = []Country {\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:3, blonze:2},\n// {gold:1, silver:3, blonze:3},\n// }\n// sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })\n// return country\n// }\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi is going to buy N items one by one.\n\nThe price of the i-th item he buys is A_i yen (the currency of Japan).\n\nHe has M discount tickets, and he can use any number of them when buying an item.\n\nIf Y tickets are used when buying an item priced X yen, he can get the item for \\frac{X}{2^Y} (rounded down to the nearest integer) yen.\n\nWhat is the minimum amount of money required to buy all the items?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\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 minimum amount of money required to buy all the items.\n\nSample Input 1\n\n3 3\n2 13 8\n\nSample Output 1\n\n9\n\nWe can buy all the items for 9 yen, as follows:\n\nBuy the 1-st item for 2 yen without tickets.\n\nBuy the 2-nd item for 3 yen with 2 tickets.\n\nBuy the 3-rd item for 4 yen with 1 ticket.\n\nSample Input 2\n\n4 4\n1 9 3 5\n\nSample Output 2\n\n6\n\nSample Input 3\n\n1 100000\n1000000000\n\nSample Output 3\n\n0\n\nWe can buy the item priced 1000000000 yen for 0 yen with 100000 tickets.\n\nSample Input 4\n\n10 1\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n\nSample Output 4\n\n9500000000", "sample_input": "3 3\n2 13 8\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02912", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi is going to buy N items one by one.\n\nThe price of the i-th item he buys is A_i yen (the currency of Japan).\n\nHe has M discount tickets, and he can use any number of them when buying an item.\n\nIf Y tickets are used when buying an item priced X yen, he can get the item for \\frac{X}{2^Y} (rounded down to the nearest integer) yen.\n\nWhat is the minimum amount of money required to buy all the items?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\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 minimum amount of money required to buy all the items.\n\nSample Input 1\n\n3 3\n2 13 8\n\nSample Output 1\n\n9\n\nWe can buy all the items for 9 yen, as follows:\n\nBuy the 1-st item for 2 yen without tickets.\n\nBuy the 2-nd item for 3 yen with 2 tickets.\n\nBuy the 3-rd item for 4 yen with 1 ticket.\n\nSample Input 2\n\n4 4\n1 9 3 5\n\nSample Output 2\n\n6\n\nSample Input 3\n\n1 100000\n1000000000\n\nSample Output 3\n\n0\n\nWe can buy the item priced 1000000000 yen for 0 yen with 100000 tickets.\n\nSample Input 4\n\n10 1\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n\nSample Output 4\n\n9500000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5766, "cpu_time_ms": 2205, "memory_kb": 5092}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s797715125", "group_id": "codeNet:p02912", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"sort\"\n)\n\nconst MOD = 1000000007\n\nfunc ModAdd(a, b int64) int64 {\n\treturn (a + b) % MOD\n}\n\nfunc ModMul(a, b int64) int64 {\n\treturn a * b % MOD\n}\n\nfunc ModSub(a, b int64) int64 {\n\tr := (a%MOD - b%MOD) % MOD\n\tif r < 0 {\n\t\tr += MOD\n\t}\n\treturn r\n}\n\nfunc ModDiv(a, b int64) int64 {\n\treturn a % MOD * ModInv(b) % MOD\n}\n\nfunc ModPow(a, n int64) int64 {\n\tvar r int64 = 1\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tr = r * a % MOD\n\t\t}\n\t\ta = a * a % MOD\n\t\tn >>= 1\n\t}\n\treturn r\n}\n\nfunc ModInv(a int64) int64 {\n\tvar b, u, v int64 = MOD, 1, 0\n\tfor b > 0 {\n\t\tt := a / b\n\t\ta -= t * b\n\t\ta, b = b, a\n\t\tu -= t * v\n\t\tu, v = v, u\n\t}\n\tu %= MOD\n\tif u < 0 {\n\t\tu += MOD\n\t}\n\treturn u\n}\n\ntype Q struct {\n\tidx, value int\n}\n\ntype QS []*Q\n\nfunc (p QS) Len() int { return len(p) }\nfunc (p QS) Less(i, j int) bool { return p[i].value > p[j].value }\nfunc (p QS) Swap(i, j int) { p[i], p[j] = p[j], p[i] }\n\nfunc main() {\n\tvar N, M int\n\tfmt.Scanf(\"%d %d\\n\", &N, &M)\n\n\tA := make(sort.IntSlice, N)\n\tfor i := 0; i < N; i++ {\n\t\tvar a int\n\t\tfmt.Scan(&a)\n\t\tA[i] = a\n\t}\n\tsort.Sort(sort.Reverse(A))\n\n\tq := make(QS, N)\n\tfor i, d := range A {\n\t\tq[i] = &Q{\n\t\t\tidx: i, value: d,\n\t\t}\n\t}\n\tif N == 1 {\n\t\tfmt.Println(A[0] / int(math.Pow(2, float64(M))))\n\t\treturn\n\t}\n\tfor M > 0 {\n\t\tqi := q[0]\n\t\tnext := q[1]\n\t\tq = q[1:]\n\t\tfor M > 0 && qi.value >= next.value {\n\t\t\tqi.value /= 2\n\t\t\tM--\n\t\t}\n\t\tA[qi.idx] = qi.value\n\t\tq = append(q, qi)\n\t\tsort.Sort(q)\n\n\t}\n\n\tsum := 0\n\n\tfor i := 0; i < N; i++ {\n\t\tsum += A[i]\n\t}\n\n\tfmt.Println(sum)\n\n}\n", "language": "Go", "metadata": {"date": 1586993725, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02912.html", "problem_id": "p02912", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02912/input.txt", "sample_output_relpath": "derived/input_output/data/p02912/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02912/Go/s797715125.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s797715125", "user_id": "u534481484"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"sort\"\n)\n\nconst MOD = 1000000007\n\nfunc ModAdd(a, b int64) int64 {\n\treturn (a + b) % MOD\n}\n\nfunc ModMul(a, b int64) int64 {\n\treturn a * b % MOD\n}\n\nfunc ModSub(a, b int64) int64 {\n\tr := (a%MOD - b%MOD) % MOD\n\tif r < 0 {\n\t\tr += MOD\n\t}\n\treturn r\n}\n\nfunc ModDiv(a, b int64) int64 {\n\treturn a % MOD * ModInv(b) % MOD\n}\n\nfunc ModPow(a, n int64) int64 {\n\tvar r int64 = 1\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tr = r * a % MOD\n\t\t}\n\t\ta = a * a % MOD\n\t\tn >>= 1\n\t}\n\treturn r\n}\n\nfunc ModInv(a int64) int64 {\n\tvar b, u, v int64 = MOD, 1, 0\n\tfor b > 0 {\n\t\tt := a / b\n\t\ta -= t * b\n\t\ta, b = b, a\n\t\tu -= t * v\n\t\tu, v = v, u\n\t}\n\tu %= MOD\n\tif u < 0 {\n\t\tu += MOD\n\t}\n\treturn u\n}\n\ntype Q struct {\n\tidx, value int\n}\n\ntype QS []*Q\n\nfunc (p QS) Len() int { return len(p) }\nfunc (p QS) Less(i, j int) bool { return p[i].value > p[j].value }\nfunc (p QS) Swap(i, j int) { p[i], p[j] = p[j], p[i] }\n\nfunc main() {\n\tvar N, M int\n\tfmt.Scanf(\"%d %d\\n\", &N, &M)\n\n\tA := make(sort.IntSlice, N)\n\tfor i := 0; i < N; i++ {\n\t\tvar a int\n\t\tfmt.Scan(&a)\n\t\tA[i] = a\n\t}\n\tsort.Sort(sort.Reverse(A))\n\n\tq := make(QS, N)\n\tfor i, d := range A {\n\t\tq[i] = &Q{\n\t\t\tidx: i, value: d,\n\t\t}\n\t}\n\tif N == 1 {\n\t\tfmt.Println(A[0] / int(math.Pow(2, float64(M))))\n\t\treturn\n\t}\n\tfor M > 0 {\n\t\tqi := q[0]\n\t\tnext := q[1]\n\t\tq = q[1:]\n\t\tfor M > 0 && qi.value >= next.value {\n\t\t\tqi.value /= 2\n\t\t\tM--\n\t\t}\n\t\tA[qi.idx] = qi.value\n\t\tq = append(q, qi)\n\t\tsort.Sort(q)\n\n\t}\n\n\tsum := 0\n\n\tfor i := 0; i < N; i++ {\n\t\tsum += A[i]\n\t}\n\n\tfmt.Println(sum)\n\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi is going to buy N items one by one.\n\nThe price of the i-th item he buys is A_i yen (the currency of Japan).\n\nHe has M discount tickets, and he can use any number of them when buying an item.\n\nIf Y tickets are used when buying an item priced X yen, he can get the item for \\frac{X}{2^Y} (rounded down to the nearest integer) yen.\n\nWhat is the minimum amount of money required to buy all the items?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\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 minimum amount of money required to buy all the items.\n\nSample Input 1\n\n3 3\n2 13 8\n\nSample Output 1\n\n9\n\nWe can buy all the items for 9 yen, as follows:\n\nBuy the 1-st item for 2 yen without tickets.\n\nBuy the 2-nd item for 3 yen with 2 tickets.\n\nBuy the 3-rd item for 4 yen with 1 ticket.\n\nSample Input 2\n\n4 4\n1 9 3 5\n\nSample Output 2\n\n6\n\nSample Input 3\n\n1 100000\n1000000000\n\nSample Output 3\n\n0\n\nWe can buy the item priced 1000000000 yen for 0 yen with 100000 tickets.\n\nSample Input 4\n\n10 1\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n\nSample Output 4\n\n9500000000", "sample_input": "3 3\n2 13 8\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02912", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi is going to buy N items one by one.\n\nThe price of the i-th item he buys is A_i yen (the currency of Japan).\n\nHe has M discount tickets, and he can use any number of them when buying an item.\n\nIf Y tickets are used when buying an item priced X yen, he can get the item for \\frac{X}{2^Y} (rounded down to the nearest integer) yen.\n\nWhat is the minimum amount of money required to buy all the items?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\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 minimum amount of money required to buy all the items.\n\nSample Input 1\n\n3 3\n2 13 8\n\nSample Output 1\n\n9\n\nWe can buy all the items for 9 yen, as follows:\n\nBuy the 1-st item for 2 yen without tickets.\n\nBuy the 2-nd item for 3 yen with 2 tickets.\n\nBuy the 3-rd item for 4 yen with 1 ticket.\n\nSample Input 2\n\n4 4\n1 9 3 5\n\nSample Output 2\n\n6\n\nSample Input 3\n\n1 100000\n1000000000\n\nSample Output 3\n\n0\n\nWe can buy the item priced 1000000000 yen for 0 yen with 100000 tickets.\n\nSample Input 4\n\n10 1\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n\nSample Output 4\n\n9500000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1519, "cpu_time_ms": 2108, "memory_kb": 7684}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s965231993", "group_id": "codeNet:p02912", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\t// sort.Sort(sort.Reverse(sort.IntSlice(a)))\n\n\t// a[0] /= 2\n\tfor i := 0; i < m; i++ {\n\t\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\t\ta[0] /= 2\n\n\t\t// index := 0\n\t\t// loop := i + 1\n\t\t// if loop > n {\n\t\t// \tloop = n\n\t\t// }\n\t\t// for j := 0; j < loop; j++ {\n\t\t// \tif a[j] > a[index] {\n\t\t// \t\tindex = j\n\t\t// \t}\n\t\t// }\n\t\t// a[index] /= 2\n\t}\n\n\tres := 0\n\tfor i := 0; i < n; i++ {\n\t\tres += a[i]\n\t}\n\tfmt.Println(res)\n}\n", "language": "Go", "metadata": {"date": 1580248758, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02912.html", "problem_id": "p02912", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02912/input.txt", "sample_output_relpath": "derived/input_output/data/p02912/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02912/Go/s965231993.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s965231993", "user_id": "u029587648"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, m int\n\tfmt.Scan(&n, &m)\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\t// sort.Sort(sort.Reverse(sort.IntSlice(a)))\n\n\t// a[0] /= 2\n\tfor i := 0; i < m; i++ {\n\t\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\t\ta[0] /= 2\n\n\t\t// index := 0\n\t\t// loop := i + 1\n\t\t// if loop > n {\n\t\t// \tloop = n\n\t\t// }\n\t\t// for j := 0; j < loop; j++ {\n\t\t// \tif a[j] > a[index] {\n\t\t// \t\tindex = j\n\t\t// \t}\n\t\t// }\n\t\t// a[index] /= 2\n\t}\n\n\tres := 0\n\tfor i := 0; i < n; i++ {\n\t\tres += a[i]\n\t}\n\tfmt.Println(res)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi is going to buy N items one by one.\n\nThe price of the i-th item he buys is A_i yen (the currency of Japan).\n\nHe has M discount tickets, and he can use any number of them when buying an item.\n\nIf Y tickets are used when buying an item priced X yen, he can get the item for \\frac{X}{2^Y} (rounded down to the nearest integer) yen.\n\nWhat is the minimum amount of money required to buy all the items?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\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 minimum amount of money required to buy all the items.\n\nSample Input 1\n\n3 3\n2 13 8\n\nSample Output 1\n\n9\n\nWe can buy all the items for 9 yen, as follows:\n\nBuy the 1-st item for 2 yen without tickets.\n\nBuy the 2-nd item for 3 yen with 2 tickets.\n\nBuy the 3-rd item for 4 yen with 1 ticket.\n\nSample Input 2\n\n4 4\n1 9 3 5\n\nSample Output 2\n\n6\n\nSample Input 3\n\n1 100000\n1000000000\n\nSample Output 3\n\n0\n\nWe can buy the item priced 1000000000 yen for 0 yen with 100000 tickets.\n\nSample Input 4\n\n10 1\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n\nSample Output 4\n\n9500000000", "sample_input": "3 3\n2 13 8\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02912", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi is going to buy N items one by one.\n\nThe price of the i-th item he buys is A_i yen (the currency of Japan).\n\nHe has M discount tickets, and he can use any number of them when buying an item.\n\nIf Y tickets are used when buying an item priced X yen, he can get the item for \\frac{X}{2^Y} (rounded down to the nearest integer) yen.\n\nWhat is the minimum amount of money required to buy all the items?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\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 minimum amount of money required to buy all the items.\n\nSample Input 1\n\n3 3\n2 13 8\n\nSample Output 1\n\n9\n\nWe can buy all the items for 9 yen, as follows:\n\nBuy the 1-st item for 2 yen without tickets.\n\nBuy the 2-nd item for 3 yen with 2 tickets.\n\nBuy the 3-rd item for 4 yen with 1 ticket.\n\nSample Input 2\n\n4 4\n1 9 3 5\n\nSample Output 2\n\n6\n\nSample Input 3\n\n1 100000\n1000000000\n\nSample Output 3\n\n0\n\nWe can buy the item priced 1000000000 yen for 0 yen with 100000 tickets.\n\nSample Input 4\n\n10 1\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n\nSample Output 4\n\n9500000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 563, "cpu_time_ms": 2108, "memory_kb": 6784}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s613796281", "group_id": "codeNet:p02912", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc nextFloat() float64 {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn float64(i)\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tm := nextInt()\n\tprices := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tprices[i] = nextFloat()\n\t}\n\tsort.Float64s(prices)\n\tfor i := 0; i < m; i++ {\n\t\thalf := prices[n-1] / 2.0\n\t\tfor i := 2; i <= n; i++ {\n\t\t\tif i == 2 && half > prices[n-2] {\n\t\t\t\tprices[n-1] = half\n\t\t\t\tbreak\n\t\t\t} else if half > prices[n-i] {\n\t\t\t\tprices = append(prices[:n-i+1], append([]float64{half}, prices[n-i+1:n-1]...)...)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tvar sum int\n\tfor i := 0; i < n; i++ {\n\t\tsum += int(prices[i])\n\t}\n\tfmt.Println(sum)\n}\n\n", "language": "Go", "metadata": {"date": 1570829189, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02912.html", "problem_id": "p02912", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02912/input.txt", "sample_output_relpath": "derived/input_output/data/p02912/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02912/Go/s613796281.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s613796281", "user_id": "u665224938"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc nextFloat() float64 {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn float64(i)\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tm := nextInt()\n\tprices := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tprices[i] = nextFloat()\n\t}\n\tsort.Float64s(prices)\n\tfor i := 0; i < m; i++ {\n\t\thalf := prices[n-1] / 2.0\n\t\tfor i := 2; i <= n; i++ {\n\t\t\tif i == 2 && half > prices[n-2] {\n\t\t\t\tprices[n-1] = half\n\t\t\t\tbreak\n\t\t\t} else if half > prices[n-i] {\n\t\t\t\tprices = append(prices[:n-i+1], append([]float64{half}, prices[n-i+1:n-1]...)...)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tvar sum int\n\tfor i := 0; i < n; i++ {\n\t\tsum += int(prices[i])\n\t}\n\tfmt.Println(sum)\n}\n\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi is going to buy N items one by one.\n\nThe price of the i-th item he buys is A_i yen (the currency of Japan).\n\nHe has M discount tickets, and he can use any number of them when buying an item.\n\nIf Y tickets are used when buying an item priced X yen, he can get the item for \\frac{X}{2^Y} (rounded down to the nearest integer) yen.\n\nWhat is the minimum amount of money required to buy all the items?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\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 minimum amount of money required to buy all the items.\n\nSample Input 1\n\n3 3\n2 13 8\n\nSample Output 1\n\n9\n\nWe can buy all the items for 9 yen, as follows:\n\nBuy the 1-st item for 2 yen without tickets.\n\nBuy the 2-nd item for 3 yen with 2 tickets.\n\nBuy the 3-rd item for 4 yen with 1 ticket.\n\nSample Input 2\n\n4 4\n1 9 3 5\n\nSample Output 2\n\n6\n\nSample Input 3\n\n1 100000\n1000000000\n\nSample Output 3\n\n0\n\nWe can buy the item priced 1000000000 yen for 0 yen with 100000 tickets.\n\nSample Input 4\n\n10 1\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n\nSample Output 4\n\n9500000000", "sample_input": "3 3\n2 13 8\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02912", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi is going to buy N items one by one.\n\nThe price of the i-th item he buys is A_i yen (the currency of Japan).\n\nHe has M discount tickets, and he can use any number of them when buying an item.\n\nIf Y tickets are used when buying an item priced X yen, he can get the item for \\frac{X}{2^Y} (rounded down to the nearest integer) yen.\n\nWhat is the minimum amount of money required to buy all the items?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\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 minimum amount of money required to buy all the items.\n\nSample Input 1\n\n3 3\n2 13 8\n\nSample Output 1\n\n9\n\nWe can buy all the items for 9 yen, as follows:\n\nBuy the 1-st item for 2 yen without tickets.\n\nBuy the 2-nd item for 3 yen with 2 tickets.\n\nBuy the 3-rd item for 4 yen with 1 ticket.\n\nSample Input 2\n\n4 4\n1 9 3 5\n\nSample Output 2\n\n6\n\nSample Input 3\n\n1 100000\n1000000000\n\nSample Output 3\n\n0\n\nWe can buy the item priced 1000000000 yen for 0 yen with 100000 tickets.\n\nSample Input 4\n\n10 1\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n\nSample Output 4\n\n9500000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 895, "cpu_time_ms": 2108, "memory_kb": 18944}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s449581353", "group_id": "codeNet:p02912", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar (\n\tN, M int\n)\n\n// PriorityQueue is something.\ntype PriorityQueue struct {\n\tHeapSize int\n\theap []int\n\tsize int\n\tReverse bool\n}\n\n// Push pushs a number to queue\nfunc (p *PriorityQueue) Push(x int) {\n\n\t// initialization\n\tif p.HeapSize == 0 {\n\t\tp.HeapSize = 100\n\t}\n\tif len(p.heap) == 0 && p.HeapSize > 0 {\n\t\tp.heap = make([]int, p.HeapSize)\n\t}\n\ti := p.size\n\tp.size++\n\tfor i > 0 {\n\t\tn := (i - 1) / 2\n\t\tif p.Reverse {\n\t\t\tif p.heap[n] > x {\n\t\t\t\tbreak\n\t\t\t}\n\t\t} else {\n\t\t\tif p.heap[n] <= x {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tp.heap[i] = p.heap[n]\n\t\ti = n\n\t}\n\tp.heap[i] = x\n}\n\n// Pop pops a number\nfunc (p *PriorityQueue) Pop() int {\n\tret := p.heap[0]\n\tp.size--\n\tx := p.heap[p.size]\n\ti := 0\n\tfor (i*2 + 1) < p.size {\n\t\ta := i*2 + 1\n\t\tb := i*2 + 2\n\t\tif p.Reverse {\n\t\t\tif b < p.size && p.heap[b] >= p.heap[a] {\n\t\t\t\ta = b\n\t\t\t}\n\t\t\tif p.heap[a] < x {\n\t\t\t\tbreak\n\t\t\t}\n\t\t} else {\n\t\t\tif b < p.size && p.heap[b] < p.heap[a] {\n\t\t\t\ta = b\n\t\t\t}\n\t\t\tif p.heap[a] >= x {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tp.heap[i] = p.heap[a]\n\t\ti = a\n\t}\n\tp.heap[i] = x\n\treturn ret\n}\n\nfunc main() {\n\n\tfmt.Scan(&N, &M)\n\tpq := PriorityQueue{\n\t\tHeapSize: 1000*100 + 10,\n\t\tReverse: true,\n\t}\n\n\tvar a int\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&a)\n\t\tpq.Push(a)\n\t}\n\tfor i := 0; i < M; i++ {\n\t\tmax := pq.Pop() / 2\n\t\tpq.Push(max)\n\t}\n\n\tans := uint64(0)\n\tfor i := 0; i < N; i++ {\n\t\tans += uint64(pq.Pop())\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1568695512, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02912.html", "problem_id": "p02912", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02912/input.txt", "sample_output_relpath": "derived/input_output/data/p02912/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02912/Go/s449581353.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s449581353", "user_id": "u061804469"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar (\n\tN, M int\n)\n\n// PriorityQueue is something.\ntype PriorityQueue struct {\n\tHeapSize int\n\theap []int\n\tsize int\n\tReverse bool\n}\n\n// Push pushs a number to queue\nfunc (p *PriorityQueue) Push(x int) {\n\n\t// initialization\n\tif p.HeapSize == 0 {\n\t\tp.HeapSize = 100\n\t}\n\tif len(p.heap) == 0 && p.HeapSize > 0 {\n\t\tp.heap = make([]int, p.HeapSize)\n\t}\n\ti := p.size\n\tp.size++\n\tfor i > 0 {\n\t\tn := (i - 1) / 2\n\t\tif p.Reverse {\n\t\t\tif p.heap[n] > x {\n\t\t\t\tbreak\n\t\t\t}\n\t\t} else {\n\t\t\tif p.heap[n] <= x {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tp.heap[i] = p.heap[n]\n\t\ti = n\n\t}\n\tp.heap[i] = x\n}\n\n// Pop pops a number\nfunc (p *PriorityQueue) Pop() int {\n\tret := p.heap[0]\n\tp.size--\n\tx := p.heap[p.size]\n\ti := 0\n\tfor (i*2 + 1) < p.size {\n\t\ta := i*2 + 1\n\t\tb := i*2 + 2\n\t\tif p.Reverse {\n\t\t\tif b < p.size && p.heap[b] >= p.heap[a] {\n\t\t\t\ta = b\n\t\t\t}\n\t\t\tif p.heap[a] < x {\n\t\t\t\tbreak\n\t\t\t}\n\t\t} else {\n\t\t\tif b < p.size && p.heap[b] < p.heap[a] {\n\t\t\t\ta = b\n\t\t\t}\n\t\t\tif p.heap[a] >= x {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tp.heap[i] = p.heap[a]\n\t\ti = a\n\t}\n\tp.heap[i] = x\n\treturn ret\n}\n\nfunc main() {\n\n\tfmt.Scan(&N, &M)\n\tpq := PriorityQueue{\n\t\tHeapSize: 1000*100 + 10,\n\t\tReverse: true,\n\t}\n\n\tvar a int\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&a)\n\t\tpq.Push(a)\n\t}\n\tfor i := 0; i < M; i++ {\n\t\tmax := pq.Pop() / 2\n\t\tpq.Push(max)\n\t}\n\n\tans := uint64(0)\n\tfor i := 0; i < N; i++ {\n\t\tans += uint64(pq.Pop())\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi is going to buy N items one by one.\n\nThe price of the i-th item he buys is A_i yen (the currency of Japan).\n\nHe has M discount tickets, and he can use any number of them when buying an item.\n\nIf Y tickets are used when buying an item priced X yen, he can get the item for \\frac{X}{2^Y} (rounded down to the nearest integer) yen.\n\nWhat is the minimum amount of money required to buy all the items?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\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 minimum amount of money required to buy all the items.\n\nSample Input 1\n\n3 3\n2 13 8\n\nSample Output 1\n\n9\n\nWe can buy all the items for 9 yen, as follows:\n\nBuy the 1-st item for 2 yen without tickets.\n\nBuy the 2-nd item for 3 yen with 2 tickets.\n\nBuy the 3-rd item for 4 yen with 1 ticket.\n\nSample Input 2\n\n4 4\n1 9 3 5\n\nSample Output 2\n\n6\n\nSample Input 3\n\n1 100000\n1000000000\n\nSample Output 3\n\n0\n\nWe can buy the item priced 1000000000 yen for 0 yen with 100000 tickets.\n\nSample Input 4\n\n10 1\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n\nSample Output 4\n\n9500000000", "sample_input": "3 3\n2 13 8\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02912", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi is going to buy N items one by one.\n\nThe price of the i-th item he buys is A_i yen (the currency of Japan).\n\nHe has M discount tickets, and he can use any number of them when buying an item.\n\nIf Y tickets are used when buying an item priced X yen, he can get the item for \\frac{X}{2^Y} (rounded down to the nearest integer) yen.\n\nWhat is the minimum amount of money required to buy all the items?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\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 minimum amount of money required to buy all the items.\n\nSample Input 1\n\n3 3\n2 13 8\n\nSample Output 1\n\n9\n\nWe can buy all the items for 9 yen, as follows:\n\nBuy the 1-st item for 2 yen without tickets.\n\nBuy the 2-nd item for 3 yen with 2 tickets.\n\nBuy the 3-rd item for 4 yen with 1 ticket.\n\nSample Input 2\n\n4 4\n1 9 3 5\n\nSample Output 2\n\n6\n\nSample Input 3\n\n1 100000\n1000000000\n\nSample Output 3\n\n0\n\nWe can buy the item priced 1000000000 yen for 0 yen with 100000 tickets.\n\nSample Input 4\n\n10 1\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n\nSample Output 4\n\n9500000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1396, "cpu_time_ms": 759, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s042275666", "group_id": "codeNet:p02912", "input_text": "package main\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n \nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n \nfunc nextInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n \nfunc nextInt64() int64 {\n\tsc.Scan()\n\ti, _ := strconv.ParseInt(sc.Text(), 10, 64)\n\treturn i\n}\n\ntype Item struct {\n Price int\n}\n\ntype PriorityQueue []*Item\n\nfunc (pq PriorityQueue) Len() int {\n return len(pq)\n}\n\nfunc (pq PriorityQueue) Less(i, j int) bool {\n return pq[j].Price < pq[i].Price\n}\n\nfunc (pq PriorityQueue) Swap(i, j int) {\n pq[i], pq[j] = pq[j], pq[i]\n}\n\nfunc (pq *PriorityQueue) Pop() interface{} {\n old := *pq\n n := len(old)\n item := old[n-1]\n *pq = old[0:n-1]\n return item\n}\n\nfunc (pq *PriorityQueue) Push(x interface{}) {\n item := x.(*Item)\n *pq = append(*pq, item)\n}\n\nfunc main() {\n sc.Buffer(make([]byte, 500000), 500000)\n sc.Split(bufio.ScanWords)\n \n n := nextInt()\n m := nextInt()\n \n as := make([]int, n)\n for i := 0; i < n; i++ {\n as[i] = nextInt()\n }\n priorityQueue := make(PriorityQueue, n, 1000*n)\n result := 0\n for i, a := range as {\n item := Item{}\n item.Price = a\n priorityQueue[i] = &item \n result += a\n }\n heap.Init(&priorityQueue)\n \n for i := 0; i < m; i++ {\n item := heap.Pop(&priorityQueue).(*Item)\n newPrice := item.Price/2\n discountedPrice := item.Price - newPrice\n result -= discountedPrice\n newItem := Item{}\n newItem.Price = newPrice\n heap.Push(&priorityQueue, &newItem)\n }\n fmt.Println(result)\n \n \n}", "language": "Go", "metadata": {"date": 1568683151, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02912.html", "problem_id": "p02912", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02912/input.txt", "sample_output_relpath": "derived/input_output/data/p02912/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02912/Go/s042275666.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s042275666", "user_id": "u142082997"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n \nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n \nfunc nextInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n \nfunc nextInt64() int64 {\n\tsc.Scan()\n\ti, _ := strconv.ParseInt(sc.Text(), 10, 64)\n\treturn i\n}\n\ntype Item struct {\n Price int\n}\n\ntype PriorityQueue []*Item\n\nfunc (pq PriorityQueue) Len() int {\n return len(pq)\n}\n\nfunc (pq PriorityQueue) Less(i, j int) bool {\n return pq[j].Price < pq[i].Price\n}\n\nfunc (pq PriorityQueue) Swap(i, j int) {\n pq[i], pq[j] = pq[j], pq[i]\n}\n\nfunc (pq *PriorityQueue) Pop() interface{} {\n old := *pq\n n := len(old)\n item := old[n-1]\n *pq = old[0:n-1]\n return item\n}\n\nfunc (pq *PriorityQueue) Push(x interface{}) {\n item := x.(*Item)\n *pq = append(*pq, item)\n}\n\nfunc main() {\n sc.Buffer(make([]byte, 500000), 500000)\n sc.Split(bufio.ScanWords)\n \n n := nextInt()\n m := nextInt()\n \n as := make([]int, n)\n for i := 0; i < n; i++ {\n as[i] = nextInt()\n }\n priorityQueue := make(PriorityQueue, n, 1000*n)\n result := 0\n for i, a := range as {\n item := Item{}\n item.Price = a\n priorityQueue[i] = &item \n result += a\n }\n heap.Init(&priorityQueue)\n \n for i := 0; i < m; i++ {\n item := heap.Pop(&priorityQueue).(*Item)\n newPrice := item.Price/2\n discountedPrice := item.Price - newPrice\n result -= discountedPrice\n newItem := Item{}\n newItem.Price = newPrice\n heap.Push(&priorityQueue, &newItem)\n }\n fmt.Println(result)\n \n \n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi is going to buy N items one by one.\n\nThe price of the i-th item he buys is A_i yen (the currency of Japan).\n\nHe has M discount tickets, and he can use any number of them when buying an item.\n\nIf Y tickets are used when buying an item priced X yen, he can get the item for \\frac{X}{2^Y} (rounded down to the nearest integer) yen.\n\nWhat is the minimum amount of money required to buy all the items?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\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 minimum amount of money required to buy all the items.\n\nSample Input 1\n\n3 3\n2 13 8\n\nSample Output 1\n\n9\n\nWe can buy all the items for 9 yen, as follows:\n\nBuy the 1-st item for 2 yen without tickets.\n\nBuy the 2-nd item for 3 yen with 2 tickets.\n\nBuy the 3-rd item for 4 yen with 1 ticket.\n\nSample Input 2\n\n4 4\n1 9 3 5\n\nSample Output 2\n\n6\n\nSample Input 3\n\n1 100000\n1000000000\n\nSample Output 3\n\n0\n\nWe can buy the item priced 1000000000 yen for 0 yen with 100000 tickets.\n\nSample Input 4\n\n10 1\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n\nSample Output 4\n\n9500000000", "sample_input": "3 3\n2 13 8\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02912", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi is going to buy N items one by one.\n\nThe price of the i-th item he buys is A_i yen (the currency of Japan).\n\nHe has M discount tickets, and he can use any number of them when buying an item.\n\nIf Y tickets are used when buying an item priced X yen, he can get the item for \\frac{X}{2^Y} (rounded down to the nearest integer) yen.\n\nWhat is the minimum amount of money required to buy all the items?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\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 minimum amount of money required to buy all the items.\n\nSample Input 1\n\n3 3\n2 13 8\n\nSample Output 1\n\n9\n\nWe can buy all the items for 9 yen, as follows:\n\nBuy the 1-st item for 2 yen without tickets.\n\nBuy the 2-nd item for 3 yen with 2 tickets.\n\nBuy the 3-rd item for 4 yen with 1 ticket.\n\nSample Input 2\n\n4 4\n1 9 3 5\n\nSample Output 2\n\n6\n\nSample Input 3\n\n1 100000\n1000000000\n\nSample Output 3\n\n0\n\nWe can buy the item priced 1000000000 yen for 0 yen with 100000 tickets.\n\nSample Input 4\n\n10 1\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n\nSample Output 4\n\n9500000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1549, "cpu_time_ms": 1861, "memory_kb": 32000}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s975862152", "group_id": "codeNet:p02912", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextUint64(scanner *bufio.Scanner) uint64 {\n\ti, _ := strconv.ParseUint(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextFloat64(scanner *bufio.Scanner) float64 {\n\ti, _ := strconv.ParseFloat(getNextString(scanner), 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\tif len(os.Args) > 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t}\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(os.Stdout)\n\n\tn := getNextInt(scanner)\n\tm := getNextInt(scanner)\n\tseg := Segment{}\n\tseg.init(n)\n\tfor i := 0; i < n; i++ {\n\t\tseg.maximize(i, getNextInt(scanner))\n\t}\n\tfor i := 0; i < m; i++ {\n\t\tseg.maximize(seg.top(), seg.bucket[seg.h-1][0]>>1)\n\t}\n\n\tvar ans int64\n\tfor i := 0; i < n; i++ {\n\t\tans += int64(seg.bucket[0][i])\n\t}\n\n\tfmt.Fprintln(writer, ans)\n\twriter.Flush()\n}\n\n// Segment ...\ntype Segment struct {\n\tn, h, i, chunk int\n\tunit []int\n\tbucket [][]int\n}\n\nfunc (seg *Segment) init(n int) {\n\tseg.n = n\n\tseg.unit = make([]int, 1)\n\tseg.unit[0] = 1\n\tseg.bucket = make([][]int, 1)\n\tseg.bucket[0] = make([]int, n)\n\n\tchunk := 2\n\tfor i := 0; n > 1; i++ {\n\t\tn = (n-1)/chunk + 1\n\t\tseg.bucket = append(seg.bucket, make([]int, n))\n\t\tseg.unit = append(seg.unit, seg.unit[i]*chunk)\n\t}\n\tseg.h = len(seg.unit)\n\tseg.chunk = chunk\n}\n\nfunc (seg *Segment) maximize(index, value int) {\n\tseg.bucket[0][index] = value\n\tfor seg.i = 0; seg.i < seg.h-1; seg.i++ {\n\t\ts := index - index%seg.chunk\n\t\tt := s + seg.chunk\n\t\tif t > len(seg.bucket[seg.i]) {\n\t\t\tt = len(seg.bucket[seg.i])\n\t\t}\n\t\tparent := index / seg.chunk\n\t\tmax := 0\n\t\tfor i := s; i < t; i++ {\n\t\t\tif max < seg.bucket[seg.i][i] {\n\t\t\t\tmax = seg.bucket[seg.i][i]\n\t\t\t}\n\t\t}\n\t\tseg.bucket[seg.i+1][parent] = max\n\t\tindex /= seg.chunk\n\t}\n}\n\nfunc (seg *Segment) top() int {\n\tindex := 0\n\tfor seg.i = seg.h - 2; seg.i >= 0; seg.i-- {\n\t\ts := index * seg.chunk\n\t\tt := s + seg.chunk\n\t\tif t > len(seg.bucket[seg.i]) {\n\t\t\tt = len(seg.bucket[seg.i])\n\t\t}\n\t\tfor i := s; i < t; i++ {\n\t\t\tif seg.bucket[seg.i][i] == seg.bucket[seg.i+1][index] {\n\t\t\t\tindex = i\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\treturn index\n}\n", "language": "Go", "metadata": {"date": 1568663342, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02912.html", "problem_id": "p02912", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02912/input.txt", "sample_output_relpath": "derived/input_output/data/p02912/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02912/Go/s975862152.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s975862152", "user_id": "u150542210"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextUint64(scanner *bufio.Scanner) uint64 {\n\ti, _ := strconv.ParseUint(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextFloat64(scanner *bufio.Scanner) float64 {\n\ti, _ := strconv.ParseFloat(getNextString(scanner), 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\tif len(os.Args) > 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t}\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(os.Stdout)\n\n\tn := getNextInt(scanner)\n\tm := getNextInt(scanner)\n\tseg := Segment{}\n\tseg.init(n)\n\tfor i := 0; i < n; i++ {\n\t\tseg.maximize(i, getNextInt(scanner))\n\t}\n\tfor i := 0; i < m; i++ {\n\t\tseg.maximize(seg.top(), seg.bucket[seg.h-1][0]>>1)\n\t}\n\n\tvar ans int64\n\tfor i := 0; i < n; i++ {\n\t\tans += int64(seg.bucket[0][i])\n\t}\n\n\tfmt.Fprintln(writer, ans)\n\twriter.Flush()\n}\n\n// Segment ...\ntype Segment struct {\n\tn, h, i, chunk int\n\tunit []int\n\tbucket [][]int\n}\n\nfunc (seg *Segment) init(n int) {\n\tseg.n = n\n\tseg.unit = make([]int, 1)\n\tseg.unit[0] = 1\n\tseg.bucket = make([][]int, 1)\n\tseg.bucket[0] = make([]int, n)\n\n\tchunk := 2\n\tfor i := 0; n > 1; i++ {\n\t\tn = (n-1)/chunk + 1\n\t\tseg.bucket = append(seg.bucket, make([]int, n))\n\t\tseg.unit = append(seg.unit, seg.unit[i]*chunk)\n\t}\n\tseg.h = len(seg.unit)\n\tseg.chunk = chunk\n}\n\nfunc (seg *Segment) maximize(index, value int) {\n\tseg.bucket[0][index] = value\n\tfor seg.i = 0; seg.i < seg.h-1; seg.i++ {\n\t\ts := index - index%seg.chunk\n\t\tt := s + seg.chunk\n\t\tif t > len(seg.bucket[seg.i]) {\n\t\t\tt = len(seg.bucket[seg.i])\n\t\t}\n\t\tparent := index / seg.chunk\n\t\tmax := 0\n\t\tfor i := s; i < t; i++ {\n\t\t\tif max < seg.bucket[seg.i][i] {\n\t\t\t\tmax = seg.bucket[seg.i][i]\n\t\t\t}\n\t\t}\n\t\tseg.bucket[seg.i+1][parent] = max\n\t\tindex /= seg.chunk\n\t}\n}\n\nfunc (seg *Segment) top() int {\n\tindex := 0\n\tfor seg.i = seg.h - 2; seg.i >= 0; seg.i-- {\n\t\ts := index * seg.chunk\n\t\tt := s + seg.chunk\n\t\tif t > len(seg.bucket[seg.i]) {\n\t\t\tt = len(seg.bucket[seg.i])\n\t\t}\n\t\tfor i := s; i < t; i++ {\n\t\t\tif seg.bucket[seg.i][i] == seg.bucket[seg.i+1][index] {\n\t\t\t\tindex = i\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\treturn index\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi is going to buy N items one by one.\n\nThe price of the i-th item he buys is A_i yen (the currency of Japan).\n\nHe has M discount tickets, and he can use any number of them when buying an item.\n\nIf Y tickets are used when buying an item priced X yen, he can get the item for \\frac{X}{2^Y} (rounded down to the nearest integer) yen.\n\nWhat is the minimum amount of money required to buy all the items?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\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 minimum amount of money required to buy all the items.\n\nSample Input 1\n\n3 3\n2 13 8\n\nSample Output 1\n\n9\n\nWe can buy all the items for 9 yen, as follows:\n\nBuy the 1-st item for 2 yen without tickets.\n\nBuy the 2-nd item for 3 yen with 2 tickets.\n\nBuy the 3-rd item for 4 yen with 1 ticket.\n\nSample Input 2\n\n4 4\n1 9 3 5\n\nSample Output 2\n\n6\n\nSample Input 3\n\n1 100000\n1000000000\n\nSample Output 3\n\n0\n\nWe can buy the item priced 1000000000 yen for 0 yen with 100000 tickets.\n\nSample Input 4\n\n10 1\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n\nSample Output 4\n\n9500000000", "sample_input": "3 3\n2 13 8\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02912", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi is going to buy N items one by one.\n\nThe price of the i-th item he buys is A_i yen (the currency of Japan).\n\nHe has M discount tickets, and he can use any number of them when buying an item.\n\nIf Y tickets are used when buying an item priced X yen, he can get the item for \\frac{X}{2^Y} (rounded down to the nearest integer) yen.\n\nWhat is the minimum amount of money required to buy all the items?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\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 minimum amount of money required to buy all the items.\n\nSample Input 1\n\n3 3\n2 13 8\n\nSample Output 1\n\n9\n\nWe can buy all the items for 9 yen, as follows:\n\nBuy the 1-st item for 2 yen without tickets.\n\nBuy the 2-nd item for 3 yen with 2 tickets.\n\nBuy the 3-rd item for 4 yen with 1 ticket.\n\nSample Input 2\n\n4 4\n1 9 3 5\n\nSample Output 2\n\n6\n\nSample Input 3\n\n1 100000\n1000000000\n\nSample Output 3\n\n0\n\nWe can buy the item priced 1000000000 yen for 0 yen with 100000 tickets.\n\nSample Input 4\n\n10 1\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n\nSample Output 4\n\n9500000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2569, "cpu_time_ms": 196, "memory_kb": 4480}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s684269441", "group_id": "codeNet:p02912", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\ntype Diff struct {\n\tNum int\n}\n\ntype Diffs []Diff\n\nfunc (d Diffs) Len() int {\n\treturn len(d)\n}\n\nfunc (d Diffs) Swap(i, j int) {\n\td[i], d[j] = d[j], d[i]\n}\n\nfunc (d Diffs) Less(i, j int) bool {\n\treturn d[i].Num > d[j].Num\n}\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\tmod int = 1e9 + 7\n)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc main() {\n\tN := getInt()\n\tM := getInt()\n\n\tsum := 0\n\tvar diffs Diffs\n\tfor i := 0; i < N; i++ {\n\t\tinput := getInt()\n\t\tsum += input\n\n\t\tfor i := 0; i < M; i++ {\n\t\t\tbefore := input / pow(2, i)\n\t\t\tafter := input / pow(2, i+1)\n\t\t\tdiff := before - after\n\t\t\t\n\t\t\tif diff != 0 {\n\t\t\t\tdiffs = append(diffs, Diff{Num: diff})\n\t\t\t}\n\t\t}\n\t}\n\n\tsort.Sort(diffs)\n\n\tdiffSum := 0\n\tfor i := 0; i < M; i++ {\n\t\tdiffSum += diffs[i].Num\n\t}\n\n\tfmt.Println(sum - diffSum)\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\tstr := sc.Text()\n\tvalue, _ := strconv.Atoi(str)\n\treturn value\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray) - 1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n", "language": "Go", "metadata": {"date": 1568601206, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02912.html", "problem_id": "p02912", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02912/input.txt", "sample_output_relpath": "derived/input_output/data/p02912/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02912/Go/s684269441.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s684269441", "user_id": "u964273035"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\ntype Diff struct {\n\tNum int\n}\n\ntype Diffs []Diff\n\nfunc (d Diffs) Len() int {\n\treturn len(d)\n}\n\nfunc (d Diffs) Swap(i, j int) {\n\td[i], d[j] = d[j], d[i]\n}\n\nfunc (d Diffs) Less(i, j int) bool {\n\treturn d[i].Num > d[j].Num\n}\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\tmod int = 1e9 + 7\n)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc main() {\n\tN := getInt()\n\tM := getInt()\n\n\tsum := 0\n\tvar diffs Diffs\n\tfor i := 0; i < N; i++ {\n\t\tinput := getInt()\n\t\tsum += input\n\n\t\tfor i := 0; i < M; i++ {\n\t\t\tbefore := input / pow(2, i)\n\t\t\tafter := input / pow(2, i+1)\n\t\t\tdiff := before - after\n\t\t\t\n\t\t\tif diff != 0 {\n\t\t\t\tdiffs = append(diffs, Diff{Num: diff})\n\t\t\t}\n\t\t}\n\t}\n\n\tsort.Sort(diffs)\n\n\tdiffSum := 0\n\tfor i := 0; i < M; i++ {\n\t\tdiffSum += diffs[i].Num\n\t}\n\n\tfmt.Println(sum - diffSum)\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\tstr := sc.Text()\n\tvalue, _ := strconv.Atoi(str)\n\treturn value\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray) - 1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi is going to buy N items one by one.\n\nThe price of the i-th item he buys is A_i yen (the currency of Japan).\n\nHe has M discount tickets, and he can use any number of them when buying an item.\n\nIf Y tickets are used when buying an item priced X yen, he can get the item for \\frac{X}{2^Y} (rounded down to the nearest integer) yen.\n\nWhat is the minimum amount of money required to buy all the items?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\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 minimum amount of money required to buy all the items.\n\nSample Input 1\n\n3 3\n2 13 8\n\nSample Output 1\n\n9\n\nWe can buy all the items for 9 yen, as follows:\n\nBuy the 1-st item for 2 yen without tickets.\n\nBuy the 2-nd item for 3 yen with 2 tickets.\n\nBuy the 3-rd item for 4 yen with 1 ticket.\n\nSample Input 2\n\n4 4\n1 9 3 5\n\nSample Output 2\n\n6\n\nSample Input 3\n\n1 100000\n1000000000\n\nSample Output 3\n\n0\n\nWe can buy the item priced 1000000000 yen for 0 yen with 100000 tickets.\n\nSample Input 4\n\n10 1\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n\nSample Output 4\n\n9500000000", "sample_input": "3 3\n2 13 8\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02912", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi is going to buy N items one by one.\n\nThe price of the i-th item he buys is A_i yen (the currency of Japan).\n\nHe has M discount tickets, and he can use any number of them when buying an item.\n\nIf Y tickets are used when buying an item priced X yen, he can get the item for \\frac{X}{2^Y} (rounded down to the nearest integer) yen.\n\nWhat is the minimum amount of money required to buy all the items?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\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 minimum amount of money required to buy all the items.\n\nSample Input 1\n\n3 3\n2 13 8\n\nSample Output 1\n\n9\n\nWe can buy all the items for 9 yen, as follows:\n\nBuy the 1-st item for 2 yen without tickets.\n\nBuy the 2-nd item for 3 yen with 2 tickets.\n\nBuy the 3-rd item for 4 yen with 1 ticket.\n\nSample Input 2\n\n4 4\n1 9 3 5\n\nSample Output 2\n\n6\n\nSample Input 3\n\n1 100000\n1000000000\n\nSample Output 3\n\n0\n\nWe can buy the item priced 1000000000 yen for 0 yen with 100000 tickets.\n\nSample Input 4\n\n10 1\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n\nSample Output 4\n\n9500000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1892, "cpu_time_ms": 2107, "memory_kb": 19200}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s841383594", "group_id": "codeNet:p02912", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextUint64(scanner *bufio.Scanner) uint64 {\n\ti, _ := strconv.ParseUint(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextFloat64(scanner *bufio.Scanner) float64 {\n\ti, _ := strconv.ParseFloat(getNextString(scanner), 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\tif len(os.Args) > 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t}\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(os.Stdout)\n\n\tn := getNextInt(scanner)\n\tm := getNextInt(scanner)\n\tbits := make([]int, 32)\n\taa := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\taa[i] = getNextInt(scanner)\n\t\tfor ii := 31; ii >= 0; ii-- {\n\t\t\ton := 1 & (aa[i] >> uint(ii))\n\t\t\tbits[ii] += on\n\t\t\tif on == 1 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tsort.Ints(aa)\n\tvar ans int64\n\tfor i := 31; i >= 0; i-- {\n\t\tminus := minint(bits[i], m)\n\t\tif bits[i] >= m {\n\t\t\tsort.Ints(aa)\n\t\t}\n\t\tbits[i] -= minus\n\t\tif i > 0 {\n\t\t\tbits[i-1] += minus\n\t\t}\n\t\tfor ii := 0; ii < minus; ii++ {\n\t\t\taa[n-1-ii] >>= 1\n\t\t}\n\t\tm -= minus\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tans += int64(aa[i])\n\t}\n\tfmt.Fprintln(writer, ans)\n\twriter.Flush()\n}\n\nfunc minint(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n", "language": "Go", "metadata": {"date": 1568598207, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02912.html", "problem_id": "p02912", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02912/input.txt", "sample_output_relpath": "derived/input_output/data/p02912/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02912/Go/s841383594.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s841383594", "user_id": "u150542210"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextUint64(scanner *bufio.Scanner) uint64 {\n\ti, _ := strconv.ParseUint(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextFloat64(scanner *bufio.Scanner) float64 {\n\ti, _ := strconv.ParseFloat(getNextString(scanner), 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\tif len(os.Args) > 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t}\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(os.Stdout)\n\n\tn := getNextInt(scanner)\n\tm := getNextInt(scanner)\n\tbits := make([]int, 32)\n\taa := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\taa[i] = getNextInt(scanner)\n\t\tfor ii := 31; ii >= 0; ii-- {\n\t\t\ton := 1 & (aa[i] >> uint(ii))\n\t\t\tbits[ii] += on\n\t\t\tif on == 1 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tsort.Ints(aa)\n\tvar ans int64\n\tfor i := 31; i >= 0; i-- {\n\t\tminus := minint(bits[i], m)\n\t\tif bits[i] >= m {\n\t\t\tsort.Ints(aa)\n\t\t}\n\t\tbits[i] -= minus\n\t\tif i > 0 {\n\t\t\tbits[i-1] += minus\n\t\t}\n\t\tfor ii := 0; ii < minus; ii++ {\n\t\t\taa[n-1-ii] >>= 1\n\t\t}\n\t\tm -= minus\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tans += int64(aa[i])\n\t}\n\tfmt.Fprintln(writer, ans)\n\twriter.Flush()\n}\n\nfunc minint(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi is going to buy N items one by one.\n\nThe price of the i-th item he buys is A_i yen (the currency of Japan).\n\nHe has M discount tickets, and he can use any number of them when buying an item.\n\nIf Y tickets are used when buying an item priced X yen, he can get the item for \\frac{X}{2^Y} (rounded down to the nearest integer) yen.\n\nWhat is the minimum amount of money required to buy all the items?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\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 minimum amount of money required to buy all the items.\n\nSample Input 1\n\n3 3\n2 13 8\n\nSample Output 1\n\n9\n\nWe can buy all the items for 9 yen, as follows:\n\nBuy the 1-st item for 2 yen without tickets.\n\nBuy the 2-nd item for 3 yen with 2 tickets.\n\nBuy the 3-rd item for 4 yen with 1 ticket.\n\nSample Input 2\n\n4 4\n1 9 3 5\n\nSample Output 2\n\n6\n\nSample Input 3\n\n1 100000\n1000000000\n\nSample Output 3\n\n0\n\nWe can buy the item priced 1000000000 yen for 0 yen with 100000 tickets.\n\nSample Input 4\n\n10 1\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n\nSample Output 4\n\n9500000000", "sample_input": "3 3\n2 13 8\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02912", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi is going to buy N items one by one.\n\nThe price of the i-th item he buys is A_i yen (the currency of Japan).\n\nHe has M discount tickets, and he can use any number of them when buying an item.\n\nIf Y tickets are used when buying an item priced X yen, he can get the item for \\frac{X}{2^Y} (rounded down to the nearest integer) yen.\n\nWhat is the minimum amount of money required to buy all the items?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\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 minimum amount of money required to buy all the items.\n\nSample Input 1\n\n3 3\n2 13 8\n\nSample Output 1\n\n9\n\nWe can buy all the items for 9 yen, as follows:\n\nBuy the 1-st item for 2 yen without tickets.\n\nBuy the 2-nd item for 3 yen with 2 tickets.\n\nBuy the 3-rd item for 4 yen with 1 ticket.\n\nSample Input 2\n\n4 4\n1 9 3 5\n\nSample Output 2\n\n6\n\nSample Input 3\n\n1 100000\n1000000000\n\nSample Output 3\n\n0\n\nWe can buy the item priced 1000000000 yen for 0 yen with 100000 tickets.\n\nSample Input 4\n\n10 1\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n\nSample Output 4\n\n9500000000", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1666, "cpu_time_ms": 338, "memory_kb": 3584}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s724405754", "group_id": "codeNet:p02913", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t_ \"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t_ \"sort\"\n\t\"strconv\"\n)\n\n// I/O\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextFloat() float64 {\n\tf, e := strconv.ParseFloat(s.nextStr(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc (s *Scanner) nextFloatSlice(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextFloat()\n\t}\n\treturn res\n}\n\n// Arithmetic\nfunc max(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m < i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m > i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc pow(x, y int) int {\n\tres := 1\n\tfor i := 0; i < y; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\nfunc ceil(a, b int) int {\n\tif a%b == 0 {\n\t\treturn a / b\n\t} else {\n\t\treturn a/b + 1\n\t}\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\treturn a / gcd(a, b) * b\n}\n\n// Sort\ntype RuneSlice []rune\n\nfunc (a RuneSlice) Len() int { return len(a) }\nfunc (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }\nfunc (a RuneSlice) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\n\n// Main\nconst MOD = int(1e+9) + 7\nconst INF = 1 << 60\n\nfunc main() {\n\tsc := NewScanner()\n\twtr := bufio.NewWriter(os.Stdout)\n\tdefer wtr.Flush()\n\tN := sc.nextInt()\n\tS := sc.nextStr()\n\tl := 0\n\tr := N/2 + 1\n\tfor (r - l) > 1 {\n\t\tmid := (r + l) / 2\n\t\tif f(mid, S) {\n\t\t\tl = mid\n\t\t} else {\n\t\t\tr = mid\n\t\t}\n\t}\n\n\tfmt.Fprintln(wtr, l)\n}\n\nfunc f(m int, S string) bool {\n\tres := false\n\tfor i := 0; i <= len(S)-2*m; i++ {\n\t\tstr := S[i : i+m]\n\t\tfor j := i + m; j <= len(S)-m; j++ {\n\t\t\tif str == S[j:j+m] {\n\t\t\t\tres = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn res\n}\n", "language": "Go", "metadata": {"date": 1587431306, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02913.html", "problem_id": "p02913", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02913/input.txt", "sample_output_relpath": "derived/input_output/data/p02913/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02913/Go/s724405754.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s724405754", "user_id": "u924691798"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t_ \"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t_ \"sort\"\n\t\"strconv\"\n)\n\n// I/O\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextFloat() float64 {\n\tf, e := strconv.ParseFloat(s.nextStr(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc (s *Scanner) nextFloatSlice(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextFloat()\n\t}\n\treturn res\n}\n\n// Arithmetic\nfunc max(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m < i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m > i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc pow(x, y int) int {\n\tres := 1\n\tfor i := 0; i < y; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\nfunc ceil(a, b int) int {\n\tif a%b == 0 {\n\t\treturn a / b\n\t} else {\n\t\treturn a/b + 1\n\t}\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\treturn a / gcd(a, b) * b\n}\n\n// Sort\ntype RuneSlice []rune\n\nfunc (a RuneSlice) Len() int { return len(a) }\nfunc (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }\nfunc (a RuneSlice) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\n\n// Main\nconst MOD = int(1e+9) + 7\nconst INF = 1 << 60\n\nfunc main() {\n\tsc := NewScanner()\n\twtr := bufio.NewWriter(os.Stdout)\n\tdefer wtr.Flush()\n\tN := sc.nextInt()\n\tS := sc.nextStr()\n\tl := 0\n\tr := N/2 + 1\n\tfor (r - l) > 1 {\n\t\tmid := (r + l) / 2\n\t\tif f(mid, S) {\n\t\t\tl = mid\n\t\t} else {\n\t\t\tr = mid\n\t\t}\n\t}\n\n\tfmt.Fprintln(wtr, l)\n}\n\nfunc f(m int, S string) bool {\n\tres := false\n\tfor i := 0; i <= len(S)-2*m; i++ {\n\t\tstr := S[i : i+m]\n\t\tfor j := i + m; j <= len(S)-m; j++ {\n\t\t\tif str == S[j:j+m] {\n\t\t\t\tres = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\treturn res\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nGiven is a string S of length N.\n\nFind the maximum length of a non-empty string that occurs twice or more in S as contiguous substrings without overlapping.\n\nMore formally, find the maximum positive integer len such that there exist integers l_1 and l_2 ( 1 \\leq l_1, l_2 \\leq N - len + 1 ) that satisfy the following:\n\nl_1 + len \\leq l_2\n\nS[l_1+i] = S[l_2+i] (i = 0, 1, ..., len - 1)\n\nIf there is no such integer len, print 0.\n\nConstraints\n\n2 \\leq N \\leq 5 \\times 10^3\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 maximum length of a non-empty string that occurs twice or more in S as contiguous substrings without overlapping. If there is no such non-empty string, print 0 instead.\n\nSample Input 1\n\n5\nababa\n\nSample Output 1\n\n2\n\nThe strings satisfying the conditions are: a, b, ab, and ba. The maximum length among them is 2, which is the answer.\nNote that aba occurs twice in S as contiguous substrings, but there is no pair of integers l_1 and l_2 mentioned in the statement such that l_1 + len \\leq l_2.\n\nSample Input 2\n\n2\nxy\n\nSample Output 2\n\n0\n\nNo non-empty string satisfies the conditions.\n\nSample Input 3\n\n13\nstrangeorange\n\nSample Output 3\n\n5", "sample_input": "5\nababa\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02913", "source_text": "Score : 500 points\n\nProblem Statement\n\nGiven is a string S of length N.\n\nFind the maximum length of a non-empty string that occurs twice or more in S as contiguous substrings without overlapping.\n\nMore formally, find the maximum positive integer len such that there exist integers l_1 and l_2 ( 1 \\leq l_1, l_2 \\leq N - len + 1 ) that satisfy the following:\n\nl_1 + len \\leq l_2\n\nS[l_1+i] = S[l_2+i] (i = 0, 1, ..., len - 1)\n\nIf there is no such integer len, print 0.\n\nConstraints\n\n2 \\leq N \\leq 5 \\times 10^3\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 maximum length of a non-empty string that occurs twice or more in S as contiguous substrings without overlapping. If there is no such non-empty string, print 0 instead.\n\nSample Input 1\n\n5\nababa\n\nSample Output 1\n\n2\n\nThe strings satisfying the conditions are: a, b, ab, and ba. The maximum length among them is 2, which is the answer.\nNote that aba occurs twice in S as contiguous substrings, but there is no pair of integers l_1 and l_2 mentioned in the statement such that l_1 + len \\leq l_2.\n\nSample Input 2\n\n2\nxy\n\nSample Output 2\n\n0\n\nNo non-empty string satisfies the conditions.\n\nSample Input 3\n\n13\nstrangeorange\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2328, "cpu_time_ms": 929, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s690648938", "group_id": "codeNet:p02913", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextUint64(scanner *bufio.Scanner) uint64 {\n\ti, _ := strconv.ParseUint(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextFloat64(scanner *bufio.Scanner) float64 {\n\ti, _ := strconv.ParseFloat(getNextString(scanner), 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\twfp := os.Stdout\n\n\tif os.Getenv(\"MASPY\") == \"ますピ\" {\n\t\tfp, _ = os.Open(os.Getenv(\"BEET_THE_HARMONY_OF_PERFECT\"))\n\t}\n\tif os.Getenv(\"MASPYPY\") == \"ますピッピ\" {\n\t\twfp, _ = os.Create(os.Getenv(\"NGTKANA_IS_GENIUS10\"))\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(wfp)\n\n\tn := getNextInt(scanner)\n\ts := getNextString(scanner)\n\n\tmp := MP{}\n\tfor l := n >> 1; l > 0; l-- {\n\t\tfor i := 0; i < n-l*2; i++ {\n\t\t\tss := s[i : i+l]\n\t\t\tmp.init(ss)\n\t\t\tj := 0\n\t\t\tfor k := i + l; j < l && k < n; k++ {\n\t\t\t\tif ss[j] != s[k] {\n\t\t\t\t\tfor j >= 0 && ss[j] != s[k] {\n\t\t\t\t\t\tj = mp.table[j]\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tj++\n\t\t\t}\n\t\t\tif j == l {\n\t\t\t\tfmt.Println(l)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t}\n\t}\n\tfmt.Println(0)\n\n\twriter.Flush()\n}\n\n// MP ...\ntype MP struct {\n\ts string\n\ttable []int\n}\n\nfunc (mp *MP) init(s string) {\n\tmp.s = s\n\tn := len(s)\n\ttable := make([]int, n+1)\n\ttable[0] = -1\n\tj := -1\n\tfor i := 0; i < n; i++ {\n\t\tfor j >= 0 && s[i] != s[j] {\n\t\t\tj = table[j]\n\t\t}\n\t\tj++\n\t\ttable[i+1] = j\n\t}\n\tmp.table = table\n}\n", "language": "Go", "metadata": {"date": 1576637639, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02913.html", "problem_id": "p02913", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02913/input.txt", "sample_output_relpath": "derived/input_output/data/p02913/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02913/Go/s690648938.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s690648938", "user_id": "u150542210"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextUint64(scanner *bufio.Scanner) uint64 {\n\ti, _ := strconv.ParseUint(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc getNextFloat64(scanner *bufio.Scanner) float64 {\n\ti, _ := strconv.ParseFloat(getNextString(scanner), 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\twfp := os.Stdout\n\n\tif os.Getenv(\"MASPY\") == \"ますピ\" {\n\t\tfp, _ = os.Open(os.Getenv(\"BEET_THE_HARMONY_OF_PERFECT\"))\n\t}\n\tif os.Getenv(\"MASPYPY\") == \"ますピッピ\" {\n\t\twfp, _ = os.Create(os.Getenv(\"NGTKANA_IS_GENIUS10\"))\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(wfp)\n\n\tn := getNextInt(scanner)\n\ts := getNextString(scanner)\n\n\tmp := MP{}\n\tfor l := n >> 1; l > 0; l-- {\n\t\tfor i := 0; i < n-l*2; i++ {\n\t\t\tss := s[i : i+l]\n\t\t\tmp.init(ss)\n\t\t\tj := 0\n\t\t\tfor k := i + l; j < l && k < n; k++ {\n\t\t\t\tif ss[j] != s[k] {\n\t\t\t\t\tfor j >= 0 && ss[j] != s[k] {\n\t\t\t\t\t\tj = mp.table[j]\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tj++\n\t\t\t}\n\t\t\tif j == l {\n\t\t\t\tfmt.Println(l)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t}\n\t}\n\tfmt.Println(0)\n\n\twriter.Flush()\n}\n\n// MP ...\ntype MP struct {\n\ts string\n\ttable []int\n}\n\nfunc (mp *MP) init(s string) {\n\tmp.s = s\n\tn := len(s)\n\ttable := make([]int, n+1)\n\ttable[0] = -1\n\tj := -1\n\tfor i := 0; i < n; i++ {\n\t\tfor j >= 0 && s[i] != s[j] {\n\t\t\tj = table[j]\n\t\t}\n\t\tj++\n\t\ttable[i+1] = j\n\t}\n\tmp.table = table\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nGiven is a string S of length N.\n\nFind the maximum length of a non-empty string that occurs twice or more in S as contiguous substrings without overlapping.\n\nMore formally, find the maximum positive integer len such that there exist integers l_1 and l_2 ( 1 \\leq l_1, l_2 \\leq N - len + 1 ) that satisfy the following:\n\nl_1 + len \\leq l_2\n\nS[l_1+i] = S[l_2+i] (i = 0, 1, ..., len - 1)\n\nIf there is no such integer len, print 0.\n\nConstraints\n\n2 \\leq N \\leq 5 \\times 10^3\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 maximum length of a non-empty string that occurs twice or more in S as contiguous substrings without overlapping. If there is no such non-empty string, print 0 instead.\n\nSample Input 1\n\n5\nababa\n\nSample Output 1\n\n2\n\nThe strings satisfying the conditions are: a, b, ab, and ba. The maximum length among them is 2, which is the answer.\nNote that aba occurs twice in S as contiguous substrings, but there is no pair of integers l_1 and l_2 mentioned in the statement such that l_1 + len \\leq l_2.\n\nSample Input 2\n\n2\nxy\n\nSample Output 2\n\n0\n\nNo non-empty string satisfies the conditions.\n\nSample Input 3\n\n13\nstrangeorange\n\nSample Output 3\n\n5", "sample_input": "5\nababa\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02913", "source_text": "Score : 500 points\n\nProblem Statement\n\nGiven is a string S of length N.\n\nFind the maximum length of a non-empty string that occurs twice or more in S as contiguous substrings without overlapping.\n\nMore formally, find the maximum positive integer len such that there exist integers l_1 and l_2 ( 1 \\leq l_1, l_2 \\leq N - len + 1 ) that satisfy the following:\n\nl_1 + len \\leq l_2\n\nS[l_1+i] = S[l_2+i] (i = 0, 1, ..., len - 1)\n\nIf there is no such integer len, print 0.\n\nConstraints\n\n2 \\leq N \\leq 5 \\times 10^3\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 maximum length of a non-empty string that occurs twice or more in S as contiguous substrings without overlapping. If there is no such non-empty string, print 0 instead.\n\nSample Input 1\n\n5\nababa\n\nSample Output 1\n\n2\n\nThe strings satisfying the conditions are: a, b, ab, and ba. The maximum length among them is 2, which is the answer.\nNote that aba occurs twice in S as contiguous substrings, but there is no pair of integers l_1 and l_2 mentioned in the statement such that l_1 + len \\leq l_2.\n\nSample Input 2\n\n2\nxy\n\nSample Output 2\n\n0\n\nNo non-empty string satisfies the conditions.\n\nSample Input 3\n\n13\nstrangeorange\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1822, "cpu_time_ms": 2108, "memory_kb": 11776}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s141717483", "group_id": "codeNet:p02913", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tB = 100000007\n)\n\n\nfunc main() {\n\tN := readInt()\n\tS := readString()\n\tms := 0\n\tfor i := 1; i < N; i++ {\n\t\tts := 0\n\t\tfor j := 0; j < N - i; j++ {\n\t\t\tif S[j] == S[j + i] {\n\t\t\t\tts++\n\t\t\t\tif ts > ms {\n\t\t\t\t\tms = ts\n\t\t\t\t}\n\t\t\t\tif ts == i {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tts = 0\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ms)\n}\n \n\nconst (\n\tioBufferSize = 1 * 1024 * 1024 // 1 MB\n)\n\nvar stdinScanner = func() *bufio.Scanner {\n\tresult := bufio.NewScanner(os.Stdin)\n\tresult.Buffer(make([]byte, ioBufferSize), ioBufferSize)\n\tresult.Split(bufio.ScanWords)\n\treturn result\n}()\n\nfunc readString() string {\n\tstdinScanner.Scan()\n\treturn stdinScanner.Text()\n}\n\nfunc readInt() int {\n\tresult, err := strconv.Atoi(readString())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn result\n}\n", "language": "Go", "metadata": {"date": 1568769835, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02913.html", "problem_id": "p02913", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02913/input.txt", "sample_output_relpath": "derived/input_output/data/p02913/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02913/Go/s141717483.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s141717483", "user_id": "u347640436"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tB = 100000007\n)\n\n\nfunc main() {\n\tN := readInt()\n\tS := readString()\n\tms := 0\n\tfor i := 1; i < N; i++ {\n\t\tts := 0\n\t\tfor j := 0; j < N - i; j++ {\n\t\t\tif S[j] == S[j + i] {\n\t\t\t\tts++\n\t\t\t\tif ts > ms {\n\t\t\t\t\tms = ts\n\t\t\t\t}\n\t\t\t\tif ts == i {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tts = 0\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ms)\n}\n \n\nconst (\n\tioBufferSize = 1 * 1024 * 1024 // 1 MB\n)\n\nvar stdinScanner = func() *bufio.Scanner {\n\tresult := bufio.NewScanner(os.Stdin)\n\tresult.Buffer(make([]byte, ioBufferSize), ioBufferSize)\n\tresult.Split(bufio.ScanWords)\n\treturn result\n}()\n\nfunc readString() string {\n\tstdinScanner.Scan()\n\treturn stdinScanner.Text()\n}\n\nfunc readInt() int {\n\tresult, err := strconv.Atoi(readString())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn result\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nGiven is a string S of length N.\n\nFind the maximum length of a non-empty string that occurs twice or more in S as contiguous substrings without overlapping.\n\nMore formally, find the maximum positive integer len such that there exist integers l_1 and l_2 ( 1 \\leq l_1, l_2 \\leq N - len + 1 ) that satisfy the following:\n\nl_1 + len \\leq l_2\n\nS[l_1+i] = S[l_2+i] (i = 0, 1, ..., len - 1)\n\nIf there is no such integer len, print 0.\n\nConstraints\n\n2 \\leq N \\leq 5 \\times 10^3\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 maximum length of a non-empty string that occurs twice or more in S as contiguous substrings without overlapping. If there is no such non-empty string, print 0 instead.\n\nSample Input 1\n\n5\nababa\n\nSample Output 1\n\n2\n\nThe strings satisfying the conditions are: a, b, ab, and ba. The maximum length among them is 2, which is the answer.\nNote that aba occurs twice in S as contiguous substrings, but there is no pair of integers l_1 and l_2 mentioned in the statement such that l_1 + len \\leq l_2.\n\nSample Input 2\n\n2\nxy\n\nSample Output 2\n\n0\n\nNo non-empty string satisfies the conditions.\n\nSample Input 3\n\n13\nstrangeorange\n\nSample Output 3\n\n5", "sample_input": "5\nababa\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02913", "source_text": "Score : 500 points\n\nProblem Statement\n\nGiven is a string S of length N.\n\nFind the maximum length of a non-empty string that occurs twice or more in S as contiguous substrings without overlapping.\n\nMore formally, find the maximum positive integer len such that there exist integers l_1 and l_2 ( 1 \\leq l_1, l_2 \\leq N - len + 1 ) that satisfy the following:\n\nl_1 + len \\leq l_2\n\nS[l_1+i] = S[l_2+i] (i = 0, 1, ..., len - 1)\n\nIf there is no such integer len, print 0.\n\nConstraints\n\n2 \\leq N \\leq 5 \\times 10^3\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 maximum length of a non-empty string that occurs twice or more in S as contiguous substrings without overlapping. If there is no such non-empty string, print 0 instead.\n\nSample Input 1\n\n5\nababa\n\nSample Output 1\n\n2\n\nThe strings satisfying the conditions are: a, b, ab, and ba. The maximum length among them is 2, which is the answer.\nNote that aba occurs twice in S as contiguous substrings, but there is no pair of integers l_1 and l_2 mentioned in the statement such that l_1 + len \\leq l_2.\n\nSample Input 2\n\n2\nxy\n\nSample Output 2\n\n0\n\nNo non-empty string satisfies the conditions.\n\nSample Input 3\n\n13\nstrangeorange\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 806, "cpu_time_ms": 70, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s305373856", "group_id": "codeNet:p02913", "input_text": "package main\n\nimport \"fmt\"\nimport \"bufio\"\nimport \"os\"\nimport \"strconv\"\nimport \"sort\"\n\nvar _sw = bufio.NewScanner(os.Stdin)\n\ntype node struct {\n\tnext [26]*node\n\tlen int\n\tdebug string\n\tstart int\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar s string\n\tfmt.Scan(&s)\n\n\tmkNode := func(len int, debug string, start int) *node {\n\t\treturn &node{\n\t\t\tnext: [26]*node{},\n\t\t\tlen: len,\n\t\t\tdebug: debug,\n\t\t\tstart: start,\n\t\t}\n\t}\n\n\troot := mkNode(0, \"\", 0)\n\tset := []*node{\n\t\troot,\n\t}\n\tmax := 0\n\tfor i := range s {\n\t\tc := s[i]\n\t\tfor j, n := range set {\n\t\t\tif n.next[c-'a'] == nil {\n\t\t\t\tn.next[c-'a'] = mkNode(n.len+1, \"\", i)\n\t\t\t} else {\n\t\t\t\tif n.start < i-(n.len+1) {\n\t\t\t\t\tmax = Max(n.len+1, max)\n\t\t\t\t}\n\t\t\t}\n\t\t\tset[j] = n.next[c-'a']\n\t\t}\n\t\tset = append(set, root)\n\t}\n\tfmt.Println(max)\n}\n\nfunc init() {\n\t_sw.Split(bufio.ScanWords)\n}\n\nfunc NextInt() int {\n\tif _sw.Scan() == false {\n\t\tpanic(_sw.Err())\n\t}\n\ti, e := strconv.Atoi(_sw.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc NextInts(n int) []int {\n\ta := make([]int, n)\n\tfor i := range a {\n\t\ta[i] = NextInt()\n\t}\n\treturn a\n}\n\nfunc NextString() string {\n\tif _sw.Scan() == false {\n\t\tpanic(_sw.Err())\n\t}\n\treturn _sw.Text()\n}\n\nfunc Max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc Min(x, y int) int {\n\tif x > y {\n\t\treturn y\n\t}\n\treturn x\n}\n\nfunc Bounded(lower, n, upper int) int {\n\treturn Min(upper, Max(lower, n))\n}\n\nfunc SortInts(xs []int) {\n\tsort.Sort(sort.IntSlice(xs))\n}\n\nfunc ReverseSortInts(xs []int) {\n\tsort.Sort(sort.Reverse(sort.IntSlice(xs)))\n}\n", "language": "Go", "metadata": {"date": 1568600353, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02913.html", "problem_id": "p02913", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02913/input.txt", "sample_output_relpath": "derived/input_output/data/p02913/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02913/Go/s305373856.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s305373856", "user_id": "u764320774"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\nimport \"bufio\"\nimport \"os\"\nimport \"strconv\"\nimport \"sort\"\n\nvar _sw = bufio.NewScanner(os.Stdin)\n\ntype node struct {\n\tnext [26]*node\n\tlen int\n\tdebug string\n\tstart int\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar s string\n\tfmt.Scan(&s)\n\n\tmkNode := func(len int, debug string, start int) *node {\n\t\treturn &node{\n\t\t\tnext: [26]*node{},\n\t\t\tlen: len,\n\t\t\tdebug: debug,\n\t\t\tstart: start,\n\t\t}\n\t}\n\n\troot := mkNode(0, \"\", 0)\n\tset := []*node{\n\t\troot,\n\t}\n\tmax := 0\n\tfor i := range s {\n\t\tc := s[i]\n\t\tfor j, n := range set {\n\t\t\tif n.next[c-'a'] == nil {\n\t\t\t\tn.next[c-'a'] = mkNode(n.len+1, \"\", i)\n\t\t\t} else {\n\t\t\t\tif n.start < i-(n.len+1) {\n\t\t\t\t\tmax = Max(n.len+1, max)\n\t\t\t\t}\n\t\t\t}\n\t\t\tset[j] = n.next[c-'a']\n\t\t}\n\t\tset = append(set, root)\n\t}\n\tfmt.Println(max)\n}\n\nfunc init() {\n\t_sw.Split(bufio.ScanWords)\n}\n\nfunc NextInt() int {\n\tif _sw.Scan() == false {\n\t\tpanic(_sw.Err())\n\t}\n\ti, e := strconv.Atoi(_sw.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc NextInts(n int) []int {\n\ta := make([]int, n)\n\tfor i := range a {\n\t\ta[i] = NextInt()\n\t}\n\treturn a\n}\n\nfunc NextString() string {\n\tif _sw.Scan() == false {\n\t\tpanic(_sw.Err())\n\t}\n\treturn _sw.Text()\n}\n\nfunc Max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc Min(x, y int) int {\n\tif x > y {\n\t\treturn y\n\t}\n\treturn x\n}\n\nfunc Bounded(lower, n, upper int) int {\n\treturn Min(upper, Max(lower, n))\n}\n\nfunc SortInts(xs []int) {\n\tsort.Sort(sort.IntSlice(xs))\n}\n\nfunc ReverseSortInts(xs []int) {\n\tsort.Sort(sort.Reverse(sort.IntSlice(xs)))\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nGiven is a string S of length N.\n\nFind the maximum length of a non-empty string that occurs twice or more in S as contiguous substrings without overlapping.\n\nMore formally, find the maximum positive integer len such that there exist integers l_1 and l_2 ( 1 \\leq l_1, l_2 \\leq N - len + 1 ) that satisfy the following:\n\nl_1 + len \\leq l_2\n\nS[l_1+i] = S[l_2+i] (i = 0, 1, ..., len - 1)\n\nIf there is no such integer len, print 0.\n\nConstraints\n\n2 \\leq N \\leq 5 \\times 10^3\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 maximum length of a non-empty string that occurs twice or more in S as contiguous substrings without overlapping. If there is no such non-empty string, print 0 instead.\n\nSample Input 1\n\n5\nababa\n\nSample Output 1\n\n2\n\nThe strings satisfying the conditions are: a, b, ab, and ba. The maximum length among them is 2, which is the answer.\nNote that aba occurs twice in S as contiguous substrings, but there is no pair of integers l_1 and l_2 mentioned in the statement such that l_1 + len \\leq l_2.\n\nSample Input 2\n\n2\nxy\n\nSample Output 2\n\n0\n\nNo non-empty string satisfies the conditions.\n\nSample Input 3\n\n13\nstrangeorange\n\nSample Output 3\n\n5", "sample_input": "5\nababa\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02913", "source_text": "Score : 500 points\n\nProblem Statement\n\nGiven is a string S of length N.\n\nFind the maximum length of a non-empty string that occurs twice or more in S as contiguous substrings without overlapping.\n\nMore formally, find the maximum positive integer len such that there exist integers l_1 and l_2 ( 1 \\leq l_1, l_2 \\leq N - len + 1 ) that satisfy the following:\n\nl_1 + len \\leq l_2\n\nS[l_1+i] = S[l_2+i] (i = 0, 1, ..., len - 1)\n\nIf there is no such integer len, print 0.\n\nConstraints\n\n2 \\leq N \\leq 5 \\times 10^3\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 maximum length of a non-empty string that occurs twice or more in S as contiguous substrings without overlapping. If there is no such non-empty string, print 0 instead.\n\nSample Input 1\n\n5\nababa\n\nSample Output 1\n\n2\n\nThe strings satisfying the conditions are: a, b, ab, and ba. The maximum length among them is 2, which is the answer.\nNote that aba occurs twice in S as contiguous substrings, but there is no pair of integers l_1 and l_2 mentioned in the statement such that l_1 + len \\leq l_2.\n\nSample Input 2\n\n2\nxy\n\nSample Output 2\n\n0\n\nNo non-empty string satisfies the conditions.\n\nSample Input 3\n\n13\nstrangeorange\n\nSample Output 3\n\n5", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1513, "cpu_time_ms": 2186, "memory_kb": 1205784}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s197616883", "group_id": "codeNet:p02933", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\tnum, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn num\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\ta := nextInt()\n\ts := nextString()\n\n\tif a >= 3200 {\n\t\tfmt.Println(s)\n\t} else {\n\t\tfmt.Println(\"red\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1590271099, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02933.html", "problem_id": "p02933", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02933/input.txt", "sample_output_relpath": "derived/input_output/data/p02933/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02933/Go/s197616883.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s197616883", "user_id": "u481836184"}, "prompt_components": {"gold_output": "pink\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\tnum, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn num\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\ta := nextInt()\n\ts := nextString()\n\n\tif a >= 3200 {\n\t\tfmt.Println(s)\n\t} else {\n\t\tfmt.Println(\"red\")\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou will be given an integer a and a string s consisting of lowercase English letters as input.\n\nWrite a program that prints s if a is not less than 3200 and prints red if a is less than 3200.\n\nConstraints\n\n2800 \\leq a < 5000\n\ns is a string of length between 1 and 10 (inclusive).\n\nEach character of s is a lowercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\ns\n\nOutput\n\nIf a is not less than 3200, print s; if a is less than 3200, print red.\n\nSample Input 1\n\n3200\npink\n\nSample Output 1\n\npink\n\na = 3200 is not less than 3200, so we print s = pink.\n\nSample Input 2\n\n3199\npink\n\nSample Output 2\n\nred\n\na = 3199 is less than 3200, so we print red.\n\nSample Input 3\n\n4049\nred\n\nSample Output 3\n\nred\n\na = 4049 is not less than 3200, so we print s = red.", "sample_input": "3200\npink\n"}, "reference_outputs": ["pink\n"], "source_document_id": "p02933", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou will be given an integer a and a string s consisting of lowercase English letters as input.\n\nWrite a program that prints s if a is not less than 3200 and prints red if a is less than 3200.\n\nConstraints\n\n2800 \\leq a < 5000\n\ns is a string of length between 1 and 10 (inclusive).\n\nEach character of s is a lowercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\ns\n\nOutput\n\nIf a is not less than 3200, print s; if a is less than 3200, print red.\n\nSample Input 1\n\n3200\npink\n\nSample Output 1\n\npink\n\na = 3200 is not less than 3200, so we print s = pink.\n\nSample Input 2\n\n3199\npink\n\nSample Output 2\n\nred\n\na = 3199 is less than 3200, so we print red.\n\nSample Input 3\n\n4049\nred\n\nSample Output 3\n\nred\n\na = 4049 is not less than 3200, so we print s = red.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 419, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s100279538", "group_id": "codeNet:p02933", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\ta, s := nextInt(), nextLine()\n\tif a > 3200 {\n\t\tfmt.Println(s)\n\t} else {\n\t\tfmt.Println(\"red\")\n\t}\n}", "language": "Go", "metadata": {"date": 1583784537, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02933.html", "problem_id": "p02933", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02933/input.txt", "sample_output_relpath": "derived/input_output/data/p02933/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02933/Go/s100279538.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s100279538", "user_id": "u394919721"}, "prompt_components": {"gold_output": "pink\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\ta, s := nextInt(), nextLine()\n\tif a > 3200 {\n\t\tfmt.Println(s)\n\t} else {\n\t\tfmt.Println(\"red\")\n\t}\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou will be given an integer a and a string s consisting of lowercase English letters as input.\n\nWrite a program that prints s if a is not less than 3200 and prints red if a is less than 3200.\n\nConstraints\n\n2800 \\leq a < 5000\n\ns is a string of length between 1 and 10 (inclusive).\n\nEach character of s is a lowercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\ns\n\nOutput\n\nIf a is not less than 3200, print s; if a is less than 3200, print red.\n\nSample Input 1\n\n3200\npink\n\nSample Output 1\n\npink\n\na = 3200 is not less than 3200, so we print s = pink.\n\nSample Input 2\n\n3199\npink\n\nSample Output 2\n\nred\n\na = 3199 is less than 3200, so we print red.\n\nSample Input 3\n\n4049\nred\n\nSample Output 3\n\nred\n\na = 4049 is not less than 3200, so we print s = red.", "sample_input": "3200\npink\n"}, "reference_outputs": ["pink\n"], "source_document_id": "p02933", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou will be given an integer a and a string s consisting of lowercase English letters as input.\n\nWrite a program that prints s if a is not less than 3200 and prints red if a is less than 3200.\n\nConstraints\n\n2800 \\leq a < 5000\n\ns is a string of length between 1 and 10 (inclusive).\n\nEach character of s is a lowercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\ns\n\nOutput\n\nIf a is not less than 3200, print s; if a is less than 3200, print red.\n\nSample Input 1\n\n3200\npink\n\nSample Output 1\n\npink\n\na = 3200 is not less than 3200, so we print s = pink.\n\nSample Input 2\n\n3199\npink\n\nSample Output 2\n\nred\n\na = 3199 is less than 3200, so we print red.\n\nSample Input 3\n\n4049\nred\n\nSample Output 3\n\nred\n\na = 4049 is not less than 3200, so we print s = red.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 405, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s724202540", "group_id": "codeNet:p02933", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a int\n\tvar s string\n\tfmt.Scan(&a, &s)\n\n\tif a >= 3200 {\n\t\tfmt.Println(s)\n\t} else {\n\t\tfmt.Println(\"red\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1567734995, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02933.html", "problem_id": "p02933", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02933/input.txt", "sample_output_relpath": "derived/input_output/data/p02933/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02933/Go/s724202540.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s724202540", "user_id": "u889640107"}, "prompt_components": {"gold_output": "pink\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a int\n\tvar s string\n\tfmt.Scan(&a, &s)\n\n\tif a >= 3200 {\n\t\tfmt.Println(s)\n\t} else {\n\t\tfmt.Println(\"red\")\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou will be given an integer a and a string s consisting of lowercase English letters as input.\n\nWrite a program that prints s if a is not less than 3200 and prints red if a is less than 3200.\n\nConstraints\n\n2800 \\leq a < 5000\n\ns is a string of length between 1 and 10 (inclusive).\n\nEach character of s is a lowercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\ns\n\nOutput\n\nIf a is not less than 3200, print s; if a is less than 3200, print red.\n\nSample Input 1\n\n3200\npink\n\nSample Output 1\n\npink\n\na = 3200 is not less than 3200, so we print s = pink.\n\nSample Input 2\n\n3199\npink\n\nSample Output 2\n\nred\n\na = 3199 is less than 3200, so we print red.\n\nSample Input 3\n\n4049\nred\n\nSample Output 3\n\nred\n\na = 4049 is not less than 3200, so we print s = red.", "sample_input": "3200\npink\n"}, "reference_outputs": ["pink\n"], "source_document_id": "p02933", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou will be given an integer a and a string s consisting of lowercase English letters as input.\n\nWrite a program that prints s if a is not less than 3200 and prints red if a is less than 3200.\n\nConstraints\n\n2800 \\leq a < 5000\n\ns is a string of length between 1 and 10 (inclusive).\n\nEach character of s is a lowercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\ns\n\nOutput\n\nIf a is not less than 3200, print s; if a is less than 3200, print red.\n\nSample Input 1\n\n3200\npink\n\nSample Output 1\n\npink\n\na = 3200 is not less than 3200, so we print s = pink.\n\nSample Input 2\n\n3199\npink\n\nSample Output 2\n\nred\n\na = 3199 is less than 3200, so we print red.\n\nSample Input 3\n\n4049\nred\n\nSample Output 3\n\nred\n\na = 4049 is not less than 3200, so we print s = red.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s036509240", "group_id": "codeNet:p02933", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a int\n\tvar s string\n\tfmt.Scan(&a, &s)\n\tif a>=3200 {\n\t\tfmt.Println(s)\n\t\treturn\n\t}\n\tfmt.Println(\"red\")\t\n}\n", "language": "Go", "metadata": {"date": 1566959590, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02933.html", "problem_id": "p02933", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02933/input.txt", "sample_output_relpath": "derived/input_output/data/p02933/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02933/Go/s036509240.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s036509240", "user_id": "u721671445"}, "prompt_components": {"gold_output": "pink\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a int\n\tvar s string\n\tfmt.Scan(&a, &s)\n\tif a>=3200 {\n\t\tfmt.Println(s)\n\t\treturn\n\t}\n\tfmt.Println(\"red\")\t\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou will be given an integer a and a string s consisting of lowercase English letters as input.\n\nWrite a program that prints s if a is not less than 3200 and prints red if a is less than 3200.\n\nConstraints\n\n2800 \\leq a < 5000\n\ns is a string of length between 1 and 10 (inclusive).\n\nEach character of s is a lowercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\ns\n\nOutput\n\nIf a is not less than 3200, print s; if a is less than 3200, print red.\n\nSample Input 1\n\n3200\npink\n\nSample Output 1\n\npink\n\na = 3200 is not less than 3200, so we print s = pink.\n\nSample Input 2\n\n3199\npink\n\nSample Output 2\n\nred\n\na = 3199 is less than 3200, so we print red.\n\nSample Input 3\n\n4049\nred\n\nSample Output 3\n\nred\n\na = 4049 is not less than 3200, so we print s = red.", "sample_input": "3200\npink\n"}, "reference_outputs": ["pink\n"], "source_document_id": "p02933", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou will be given an integer a and a string s consisting of lowercase English letters as input.\n\nWrite a program that prints s if a is not less than 3200 and prints red if a is less than 3200.\n\nConstraints\n\n2800 \\leq a < 5000\n\ns is a string of length between 1 and 10 (inclusive).\n\nEach character of s is a lowercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\ns\n\nOutput\n\nIf a is not less than 3200, print s; if a is less than 3200, print red.\n\nSample Input 1\n\n3200\npink\n\nSample Output 1\n\npink\n\na = 3200 is not less than 3200, so we print s = pink.\n\nSample Input 2\n\n3199\npink\n\nSample Output 2\n\nred\n\na = 3199 is less than 3200, so we print red.\n\nSample Input 3\n\n4049\nred\n\nSample Output 3\n\nred\n\na = 4049 is not less than 3200, so we print s = red.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 156, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s894504186", "group_id": "codeNet:p02933", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar number int\n\tvar str string\n\tfmt.Scanf(\"%d\", &number)\n\tfmt.Scanf(\"%s\", &str)\n\tif number >= 3200 {\n\t\tfmt.Println(str)\n\t} else {\n\t\tfmt.Println(\"red\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1566360188, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02933.html", "problem_id": "p02933", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02933/input.txt", "sample_output_relpath": "derived/input_output/data/p02933/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02933/Go/s894504186.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s894504186", "user_id": "u934962410"}, "prompt_components": {"gold_output": "pink\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar number int\n\tvar str string\n\tfmt.Scanf(\"%d\", &number)\n\tfmt.Scanf(\"%s\", &str)\n\tif number >= 3200 {\n\t\tfmt.Println(str)\n\t} else {\n\t\tfmt.Println(\"red\")\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou will be given an integer a and a string s consisting of lowercase English letters as input.\n\nWrite a program that prints s if a is not less than 3200 and prints red if a is less than 3200.\n\nConstraints\n\n2800 \\leq a < 5000\n\ns is a string of length between 1 and 10 (inclusive).\n\nEach character of s is a lowercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\ns\n\nOutput\n\nIf a is not less than 3200, print s; if a is less than 3200, print red.\n\nSample Input 1\n\n3200\npink\n\nSample Output 1\n\npink\n\na = 3200 is not less than 3200, so we print s = pink.\n\nSample Input 2\n\n3199\npink\n\nSample Output 2\n\nred\n\na = 3199 is less than 3200, so we print red.\n\nSample Input 3\n\n4049\nred\n\nSample Output 3\n\nred\n\na = 4049 is not less than 3200, so we print s = red.", "sample_input": "3200\npink\n"}, "reference_outputs": ["pink\n"], "source_document_id": "p02933", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou will be given an integer a and a string s consisting of lowercase English letters as input.\n\nWrite a program that prints s if a is not less than 3200 and prints red if a is less than 3200.\n\nConstraints\n\n2800 \\leq a < 5000\n\ns is a string of length between 1 and 10 (inclusive).\n\nEach character of s is a lowercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\ns\n\nOutput\n\nIf a is not less than 3200, print s; if a is less than 3200, print red.\n\nSample Input 1\n\n3200\npink\n\nSample Output 1\n\npink\n\na = 3200 is not less than 3200, so we print s = pink.\n\nSample Input 2\n\n3199\npink\n\nSample Output 2\n\nred\n\na = 3199 is less than 3200, so we print red.\n\nSample Input 3\n\n4049\nred\n\nSample Output 3\n\nred\n\na = 4049 is not less than 3200, so we print s = red.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 204, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s869687953", "group_id": "codeNet:p02933", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var a int\n var s string\n fmt.Scan(&a)\n fmt.Scan(&s)\n \n if (a >= 3200 ) {\n fmt.Println(s)\n } else {\n fmt.Println(\"red\")\n }\n}\n", "language": "Go", "metadata": {"date": 1566277401, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02933.html", "problem_id": "p02933", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02933/input.txt", "sample_output_relpath": "derived/input_output/data/p02933/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02933/Go/s869687953.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s869687953", "user_id": "u887595364"}, "prompt_components": {"gold_output": "pink\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var a int\n var s string\n fmt.Scan(&a)\n fmt.Scan(&s)\n \n if (a >= 3200 ) {\n fmt.Println(s)\n } else {\n fmt.Println(\"red\")\n }\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou will be given an integer a and a string s consisting of lowercase English letters as input.\n\nWrite a program that prints s if a is not less than 3200 and prints red if a is less than 3200.\n\nConstraints\n\n2800 \\leq a < 5000\n\ns is a string of length between 1 and 10 (inclusive).\n\nEach character of s is a lowercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\ns\n\nOutput\n\nIf a is not less than 3200, print s; if a is less than 3200, print red.\n\nSample Input 1\n\n3200\npink\n\nSample Output 1\n\npink\n\na = 3200 is not less than 3200, so we print s = pink.\n\nSample Input 2\n\n3199\npink\n\nSample Output 2\n\nred\n\na = 3199 is less than 3200, so we print red.\n\nSample Input 3\n\n4049\nred\n\nSample Output 3\n\nred\n\na = 4049 is not less than 3200, so we print s = red.", "sample_input": "3200\npink\n"}, "reference_outputs": ["pink\n"], "source_document_id": "p02933", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou will be given an integer a and a string s consisting of lowercase English letters as input.\n\nWrite a program that prints s if a is not less than 3200 and prints red if a is less than 3200.\n\nConstraints\n\n2800 \\leq a < 5000\n\ns is a string of length between 1 and 10 (inclusive).\n\nEach character of s is a lowercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\ns\n\nOutput\n\nIf a is not less than 3200, print s; if a is less than 3200, print red.\n\nSample Input 1\n\n3200\npink\n\nSample Output 1\n\npink\n\na = 3200 is not less than 3200, so we print s = pink.\n\nSample Input 2\n\n3199\npink\n\nSample Output 2\n\nred\n\na = 3199 is less than 3200, so we print red.\n\nSample Input 3\n\n4049\nred\n\nSample Output 3\n\nred\n\na = 4049 is not less than 3200, so we print s = red.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s535068625", "group_id": "codeNet:p02936", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst (\n\tmaxBufSize = 1024 * 1024\n)\n\nvar (\n\tsc = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, 1)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n\tout = bufio.NewWriter(os.Stdout)\n)\n\ntype edge struct {\n\ta int64\n\tb int64\n}\n\ntype operation struct {\n\tp int64\n\tq int64\n}\n\nfunc solve(n int64, q int64, es []edge, os []operation) []int64 {\n\tret := make([]int64, n)\n\tsort.Slice(es, func(i, j int) bool {\n\t\treturn es[i].a < es[j].a\n\t})\n\tfor _, o := range os {\n\t\tret[o.p] += o.q\n\t}\n\tfor _, e := range es {\n\t\tret[e.b] += ret[e.a]\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tdefer out.Flush()\n\n\tn := nextInt()\n\tq := nextInt()\n\n\tes := make([]edge, n-1)\n\tfor i, _ := range es {\n\t\tes[i].a = nextInt() - 1\n\t\tes[i].b = nextInt() - 1\n\t}\n\tos := make([]operation, q)\n\tfor i, _ := range os {\n\t\tos[i].p = nextInt() - 1\n\t\tos[i].q = nextInt()\n\t}\n\tres := solve(n, q, es, os)\n\tfor i, r := range res {\n\t\tfmt.Fprint(out, r)\n\t\tif int64(i) < n - 1 {\n\t\t\tfmt.Fprint(out, \" \")\n\t\t} else {\n\t\t\tfmt.Fprintln(out)\n\t\t}\n\t}\n}\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextStringAsBytes() []byte {\n\tsc.Scan()\n\treturn []byte(sc.Text())\n}\n\nfunc nextInt() int64 {\n\ta, _ := strconv.ParseInt(next(), 10, 64)\n\treturn a\n}\n\nfunc nextFloat() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int64) []int64 {\n\tret := make([]int64, n)\n\tfor i := int64(0); i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\n\nfunc nextFloats(n int64) []float64 {\n\tret := make([]float64, n)\n\tfor i := int64(0); i < n; i++ {\n\t\tret[i] = nextFloat()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int64) []string {\n\tret := make([]string, n)\n\tfor i := int64(0); i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\nfunc containStr(arr []string, target string) bool {\n\tfor _, v := range arr {\n\t\tif v == target {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc PrintOut(src interface{}, joinner string) {\n\tswitch reflect.TypeOf(src).Kind() {\n\tcase reflect.Slice:\n\t\ts := reflect.ValueOf(src)\n\t\tfor idx := 0; idx < s.Len(); idx++ {\n\t\t\tfmt.Fprintf(out, \"%v\", s.Index(idx))\n\t\t\tif idx < s.Len()-1 {\n\t\t\t\tfmt.Fprintf(out, \"%s\", joinner)\n\t\t\t} else {\n\t\t\t\tfmt.Fprintln(out)\n\t\t\t}\n\t\t}\n\tdefault:\n\t\tfmt.Fprintln(out, \"orz\")\n\t}\n}\n\n// mapからkeysとvaluesを返す\nfunc splitKeyValue(m map[interface{}]interface{}) (keys, values []interface{}) {\n\tswitch reflect.TypeOf(m).Kind() {\n\tcase reflect.Map:\n\t\ts := reflect.ValueOf(m)\n\t\tfor _, v := range s.MapKeys() {\n\t\t\tkeys = append(keys, v)\n\t\t\tvalues = append(values, s.MapIndex(v))\n\t\t}\n\tdefault:\n\t\tfmt.Fprintln(out, \"orz\")\n\t}\n\treturn\n}\n", "language": "Go", "metadata": {"date": 1597283926, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02936.html", "problem_id": "p02936", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02936/input.txt", "sample_output_relpath": "derived/input_output/data/p02936/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02936/Go/s535068625.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s535068625", "user_id": "u478530879"}, "prompt_components": {"gold_output": "100 110 111 110\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst (\n\tmaxBufSize = 1024 * 1024\n)\n\nvar (\n\tsc = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, 1)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n\tout = bufio.NewWriter(os.Stdout)\n)\n\ntype edge struct {\n\ta int64\n\tb int64\n}\n\ntype operation struct {\n\tp int64\n\tq int64\n}\n\nfunc solve(n int64, q int64, es []edge, os []operation) []int64 {\n\tret := make([]int64, n)\n\tsort.Slice(es, func(i, j int) bool {\n\t\treturn es[i].a < es[j].a\n\t})\n\tfor _, o := range os {\n\t\tret[o.p] += o.q\n\t}\n\tfor _, e := range es {\n\t\tret[e.b] += ret[e.a]\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tdefer out.Flush()\n\n\tn := nextInt()\n\tq := nextInt()\n\n\tes := make([]edge, n-1)\n\tfor i, _ := range es {\n\t\tes[i].a = nextInt() - 1\n\t\tes[i].b = nextInt() - 1\n\t}\n\tos := make([]operation, q)\n\tfor i, _ := range os {\n\t\tos[i].p = nextInt() - 1\n\t\tos[i].q = nextInt()\n\t}\n\tres := solve(n, q, es, os)\n\tfor i, r := range res {\n\t\tfmt.Fprint(out, r)\n\t\tif int64(i) < n - 1 {\n\t\t\tfmt.Fprint(out, \" \")\n\t\t} else {\n\t\t\tfmt.Fprintln(out)\n\t\t}\n\t}\n}\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextStringAsBytes() []byte {\n\tsc.Scan()\n\treturn []byte(sc.Text())\n}\n\nfunc nextInt() int64 {\n\ta, _ := strconv.ParseInt(next(), 10, 64)\n\treturn a\n}\n\nfunc nextFloat() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int64) []int64 {\n\tret := make([]int64, n)\n\tfor i := int64(0); i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\n\nfunc nextFloats(n int64) []float64 {\n\tret := make([]float64, n)\n\tfor i := int64(0); i < n; i++ {\n\t\tret[i] = nextFloat()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int64) []string {\n\tret := make([]string, n)\n\tfor i := int64(0); i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\nfunc containStr(arr []string, target string) bool {\n\tfor _, v := range arr {\n\t\tif v == target {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc PrintOut(src interface{}, joinner string) {\n\tswitch reflect.TypeOf(src).Kind() {\n\tcase reflect.Slice:\n\t\ts := reflect.ValueOf(src)\n\t\tfor idx := 0; idx < s.Len(); idx++ {\n\t\t\tfmt.Fprintf(out, \"%v\", s.Index(idx))\n\t\t\tif idx < s.Len()-1 {\n\t\t\t\tfmt.Fprintf(out, \"%s\", joinner)\n\t\t\t} else {\n\t\t\t\tfmt.Fprintln(out)\n\t\t\t}\n\t\t}\n\tdefault:\n\t\tfmt.Fprintln(out, \"orz\")\n\t}\n}\n\n// mapからkeysとvaluesを返す\nfunc splitKeyValue(m map[interface{}]interface{}) (keys, values []interface{}) {\n\tswitch reflect.TypeOf(m).Kind() {\n\tcase reflect.Map:\n\t\ts := reflect.ValueOf(m)\n\t\tfor _, v := range s.MapKeys() {\n\t\t\tkeys = append(keys, v)\n\t\t\tvalues = append(values, s.MapIndex(v))\n\t\t}\n\tdefault:\n\t\tfmt.Fprintln(out, \"orz\")\n\t}\n\treturn\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "sample_input": "4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n"}, "reference_outputs": ["100 110 111 110\n"], "source_document_id": "p02936", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2646, "cpu_time_ms": 783, "memory_kb": 14068}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s856132278", "group_id": "codeNet:p02936", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar (\n\tN, Q int\n\tto\t[][]int\n)\n\nfunc dfs(v, p int, ans []int) {\n\tfor _, u := range to[v] {\n\t\tif u == p {\n\t\t\tcontinue\n\t\t}\n\t\tans[u] += ans[v]\n\t\tdfs(u, v, ans)\n\t}\n}\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\n\tN, Q = io.readInt(), io.readInt()\n\tto = make([][]int, N+5)\n\tfor i := 0; i < N-1; i++ {\n\t\tvar a, b int\n\t\tfmt.Scan(&a, &b)\n\t\ta--; b--\n\t\tto[a] = append(to[a], b)\n\t\tto[b] = append(to[b], a)\n\t}\n\n\tans := make([]int, N)\n\tfor i := 0; i < Q; i++ {\n\t\tp, x := io.readInt(), io.readInt()\n\t\tans[p-1] += x\n\t}\n\tdfs(0, -1, ans)\n\tio.printIntSlice(ans)\n}\n\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\nfunc (io *Io) readStringLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\nfunc (io *Io) readString() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.readStringLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\nfunc (io *Io) readInt() int {\n\ti, err := strconv.Atoi(io.readString())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) println(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\nfunc (io *Io) printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\nfunc (io *Io) printStringSlice(a []string) {\n\tvar b []interface{}\n\tfor _, v := range a {\n\t\tb = append(b, v)\n\t}\n\tio.println(b...)\n}\n\nfunc (io *Io) printIntSlice(a []int) {\n\tvar b []interface{}\n\tfor _, v := range a {\n\t\tb = append(b, v)\n\t}\n\tio.println(b...)\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1593476125, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02936.html", "problem_id": "p02936", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02936/input.txt", "sample_output_relpath": "derived/input_output/data/p02936/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02936/Go/s856132278.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s856132278", "user_id": "u323255029"}, "prompt_components": {"gold_output": "100 110 111 110\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar (\n\tN, Q int\n\tto\t[][]int\n)\n\nfunc dfs(v, p int, ans []int) {\n\tfor _, u := range to[v] {\n\t\tif u == p {\n\t\t\tcontinue\n\t\t}\n\t\tans[u] += ans[v]\n\t\tdfs(u, v, ans)\n\t}\n}\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\n\tN, Q = io.readInt(), io.readInt()\n\tto = make([][]int, N+5)\n\tfor i := 0; i < N-1; i++ {\n\t\tvar a, b int\n\t\tfmt.Scan(&a, &b)\n\t\ta--; b--\n\t\tto[a] = append(to[a], b)\n\t\tto[b] = append(to[b], a)\n\t}\n\n\tans := make([]int, N)\n\tfor i := 0; i < Q; i++ {\n\t\tp, x := io.readInt(), io.readInt()\n\t\tans[p-1] += x\n\t}\n\tdfs(0, -1, ans)\n\tio.printIntSlice(ans)\n}\n\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\nfunc (io *Io) readStringLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\nfunc (io *Io) readString() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.readStringLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\nfunc (io *Io) readInt() int {\n\ti, err := strconv.Atoi(io.readString())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) println(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\nfunc (io *Io) printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\nfunc (io *Io) printStringSlice(a []string) {\n\tvar b []interface{}\n\tfor _, v := range a {\n\t\tb = append(b, v)\n\t}\n\tio.println(b...)\n}\n\nfunc (io *Io) printIntSlice(a []int) {\n\tvar b []interface{}\n\tfor _, v := range a {\n\t\tb = append(b, v)\n\t}\n\tio.println(b...)\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "sample_input": "4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n"}, "reference_outputs": ["100 110 111 110\n"], "source_document_id": "p02936", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2053, "cpu_time_ms": 2223, "memory_kb": 709124}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s933230662", "group_id": "codeNet:p02936", "input_text": "package main\n\nimport \"fmt\"\n\nvar (\n\tN, Q int\n\tto\t[][]int\n)\n\nfunc dfs(v, p int, ans []int) {\n\tfor _, u := range to[v] {\n\t\tif u == p {\n\t\t\tcontinue\n\t\t}\n\t\tans[u] += ans[v]\n\t\tdfs(u, v, ans)\n\t}\n}\n\nfunc main() {\n\tfmt.Scan(&N, &Q)\n\tto = make([][]int, N+5)\n\tfor i := 0; i < N-1; i++ {\n\t\tvar a, b int\n\t\tfmt.Scan(&a, &b)\n\t\ta--; b--\n\t\tto[a] = append(to[a], b)\n\t\tto[b] = append(to[b], a)\n\t}\n\n\tans := make([]int, N)\n\tfor i := 0; i < Q; i++ {\n\t\tvar p, x int\n\t\tfmt.Scan(&p, &x)\n\t\tans[p-1] += x\n\t}\n\tdfs(0, -1, ans)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Println(ans[i])\n\t}\n}\n", "language": "Go", "metadata": {"date": 1593467490, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02936.html", "problem_id": "p02936", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02936/input.txt", "sample_output_relpath": "derived/input_output/data/p02936/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02936/Go/s933230662.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s933230662", "user_id": "u323255029"}, "prompt_components": {"gold_output": "100 110 111 110\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nvar (\n\tN, Q int\n\tto\t[][]int\n)\n\nfunc dfs(v, p int, ans []int) {\n\tfor _, u := range to[v] {\n\t\tif u == p {\n\t\t\tcontinue\n\t\t}\n\t\tans[u] += ans[v]\n\t\tdfs(u, v, ans)\n\t}\n}\n\nfunc main() {\n\tfmt.Scan(&N, &Q)\n\tto = make([][]int, N+5)\n\tfor i := 0; i < N-1; i++ {\n\t\tvar a, b int\n\t\tfmt.Scan(&a, &b)\n\t\ta--; b--\n\t\tto[a] = append(to[a], b)\n\t\tto[b] = append(to[b], a)\n\t}\n\n\tans := make([]int, N)\n\tfor i := 0; i < Q; i++ {\n\t\tvar p, x int\n\t\tfmt.Scan(&p, &x)\n\t\tans[p-1] += x\n\t}\n\tdfs(0, -1, ans)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Println(ans[i])\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "sample_input": "4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n"}, "reference_outputs": ["100 110 111 110\n"], "source_document_id": "p02936", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 551, "cpu_time_ms": 2206, "memory_kb": 21748}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s117785794", "group_id": "codeNet:p02936", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\n/* sort */\ntype pair struct {\n\tindex int64\n\tp1, p2 interface{}\n}\ntype pairs []pair\n\nfunc (slice pairs) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice pairs) Less(i, j int) bool {\n\treturn slice[i].index < slice[j].index\n}\n\nfunc (slice pairs) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\n\n/* sort */\ntype Int64Slice []int64\n\nfunc (slice Int64Slice) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice Int64Slice) Less(i, j int) bool {\n\treturn slice[i] < slice[j]\n}\n\nfunc (slice Int64Slice) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\nfunc Int64s(a []int64) { sort.Sort(Int64Slice(a)) }\nfunc Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n\tINF = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tdi = []int64{-1, 0, 1, 0}\n\tdj = []int64{0, -1, 0, 1}\n\tdi8 = []int64{-1, -1, 0, 1, 1, 1, 0, -1}\n\tdj8 = []int64{0, -1, -1, -1, 0, 1, 1, 1}\n\tcnt []int64\n\tN, Q int64\n\tm map[int64][]int64\n\tmpq map[int64]int64\n)\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tscanner.Buffer(buf, maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tN, Q = readInt(), readInt()\n\tm = make(map[int64][]int64, N)\n\tcnt = make([]int64, N+1)\n\tfor i := int64(0); i < N-1; i++ {\n\t\ta, b := readInt(), readInt()\n\t\tm[a] = append(m[a], b)\n\t\tm[b] = append(m[b], a)\n\t}\n\tfor i := int64(0); i < Q; i++ {\n\t\tp, q := readInt(), readInt()\n\t\tcnt[p] += q\n\t}\n\tdfsCnt(1, -1)\n\ts2 := intAry2strAry(cnt)\n\ts := strings.Join(s2[1:], \" \")\n\tfmt.Println(s)\n}\n\nfunc dfsCnt(n int64, p int64) {\n\tfor i := int64(0); i < int64(len(m[n])); i++ {\n\t\tif m[n][i] != p {\n\t\t\tcnt[m[n][i]] += cnt[n]\n\t\t\tdfsCnt(m[n][i], n)\n\t\t}\n\t}\n}\n\n/*==========================================\n * Library\n *==========================================*/\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\nfunc doubleAry(h int64, w int64, init int64) (res [][]int64) {\n\tres = make([][]int64, h)\n\tfor i := int64(0); i < h; i++ {\n\t\tres[i] = make([]int64, w)\n\t\tfor j := int64(0); j < w; j++ {\n\t\t\tres[i][j] = init\n\t\t}\n\t}\n\treturn\n}\n\nfunc aryEq(a []int64, b []int64) bool {\n\treturn reflect.DeepEqual(a, b)\n}\n\nfunc clone(n []int64) (r []int64) {\n\tr = make([]int64, len(n))\n\tfor i := 0; i < len(n); i++ {\n\t\tr[i] = n[i]\n\t}\n\treturn\n}\nfunc write(s string) {\n\twriter.WriteString(s)\n}\n\nfunc print() {\n\twriter.Flush()\n}\n\n// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可\nfunc readLine() (s string) {\n\tif scanner.Scan() {\n\t\ts = scanner.Text()\n\t}\n\treturn s\n}\n\nfunc readInt() (read int64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseInt(scanner.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readFloat() (read float64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readRunes() (read []rune) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, v)\n\t}\n\treturn\n}\n\nfunc readString() (read string) {\n\tscanner.Scan()\n\tread = scanner.Text()\n\treturn\n}\n\nfunc readStrings() (read []string) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, string(v))\n\t}\n\treturn\n}\n\nfunc s2i(s string) int64 {\n\tvar intVal, e = strconv.ParseInt(s, 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int64) string {\n\tvar strVal = strconv.FormatInt(i, 10)\n\treturn strVal\n}\n\nfunc s2f(s string) float64 {\n\tvar floatVal, e = strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn floatVal\n}\n\nfunc abs(i int64) int64 {\n\treturn int64(math.Abs(float64(i)))\n}\n\nfunc max(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans < v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\nfunc min(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans > v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc sum(i []int64) int64 {\n\tsum := int64(0)\n\tfor _, val := range i {\n\t\tsum += val\n\t}\n\treturn sum\n}\n\nfunc split(s string) []string {\n\treturn strings.Fields(s)\n}\n\nfunc strAry2intAry(strs []string) []int64 {\n\tvar ret = make([]int64, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal = s2i(str)\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int64) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = i2s(num)\n\t\tret = append(ret, strVal)\n\t}\n\treturn ret\n}\n\nfunc ary2str(strs []string) string {\n\treturn strings.Join(strs, \" \")\n}\n\nfunc reverse(res []int64) []int64 {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\nfunc reverseStr(res []string) []string {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\n\nfunc ini(res []int, init int) {\n\tif len(res) == 0 {\n\t\treturn\n\t}\n\tres[0] = init\n\tfor i := 0; i < len(res); i++ {\n\t\tcopy(res[i:], res[:i])\n\t}\n}\n\n//\n// func regexpExample() {\n// // Your code here!\n// var str = \"13:20\"\n// r := regexp.MustCompile(`(\\d+):(\\d+)`)\n// fmt.Println(r.FindStringSubmatch(str))\n// }\n\n// type Country struct {\n// gold int\n// silver int\n// blonze int\n// }\n\n// // 複数ソートのサンプル\n// func stableSortExample() []Country{\n// var country = []Country {\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:3, blonze:2},\n// {gold:1, silver:3, blonze:3},\n// }\n// sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })\n// return country\n// }\n", "language": "Go", "metadata": {"date": 1592353265, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02936.html", "problem_id": "p02936", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02936/input.txt", "sample_output_relpath": "derived/input_output/data/p02936/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02936/Go/s117785794.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s117785794", "user_id": "u967669872"}, "prompt_components": {"gold_output": "100 110 111 110\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"reflect\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\n/* sort */\ntype pair struct {\n\tindex int64\n\tp1, p2 interface{}\n}\ntype pairs []pair\n\nfunc (slice pairs) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice pairs) Less(i, j int) bool {\n\treturn slice[i].index < slice[j].index\n}\n\nfunc (slice pairs) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\n\n/* sort */\ntype Int64Slice []int64\n\nfunc (slice Int64Slice) Len() int {\n\treturn len(slice)\n}\n\nfunc (slice Int64Slice) Less(i, j int) bool {\n\treturn slice[i] < slice[j]\n}\n\nfunc (slice Int64Slice) Swap(i, j int) {\n\tslice[i], slice[j] = slice[j], slice[i]\n}\nfunc Int64s(a []int64) { sort.Sort(Int64Slice(a)) }\nfunc Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n\tINF = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n\tdi = []int64{-1, 0, 1, 0}\n\tdj = []int64{0, -1, 0, 1}\n\tdi8 = []int64{-1, -1, 0, 1, 1, 1, 0, -1}\n\tdj8 = []int64{0, -1, -1, -1, 0, 1, 1, 1}\n\tcnt []int64\n\tN, Q int64\n\tm map[int64][]int64\n\tmpq map[int64]int64\n)\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tscanner.Buffer(buf, maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tN, Q = readInt(), readInt()\n\tm = make(map[int64][]int64, N)\n\tcnt = make([]int64, N+1)\n\tfor i := int64(0); i < N-1; i++ {\n\t\ta, b := readInt(), readInt()\n\t\tm[a] = append(m[a], b)\n\t\tm[b] = append(m[b], a)\n\t}\n\tfor i := int64(0); i < Q; i++ {\n\t\tp, q := readInt(), readInt()\n\t\tcnt[p] += q\n\t}\n\tdfsCnt(1, -1)\n\ts2 := intAry2strAry(cnt)\n\ts := strings.Join(s2[1:], \" \")\n\tfmt.Println(s)\n}\n\nfunc dfsCnt(n int64, p int64) {\n\tfor i := int64(0); i < int64(len(m[n])); i++ {\n\t\tif m[n][i] != p {\n\t\t\tcnt[m[n][i]] += cnt[n]\n\t\t\tdfsCnt(m[n][i], n)\n\t\t}\n\t}\n}\n\n/*==========================================\n * Library\n *==========================================*/\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\nfunc doubleAry(h int64, w int64, init int64) (res [][]int64) {\n\tres = make([][]int64, h)\n\tfor i := int64(0); i < h; i++ {\n\t\tres[i] = make([]int64, w)\n\t\tfor j := int64(0); j < w; j++ {\n\t\t\tres[i][j] = init\n\t\t}\n\t}\n\treturn\n}\n\nfunc aryEq(a []int64, b []int64) bool {\n\treturn reflect.DeepEqual(a, b)\n}\n\nfunc clone(n []int64) (r []int64) {\n\tr = make([]int64, len(n))\n\tfor i := 0; i < len(n); i++ {\n\t\tr[i] = n[i]\n\t}\n\treturn\n}\nfunc write(s string) {\n\twriter.WriteString(s)\n}\n\nfunc print() {\n\twriter.Flush()\n}\n\n// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可\nfunc readLine() (s string) {\n\tif scanner.Scan() {\n\t\ts = scanner.Text()\n\t}\n\treturn s\n}\n\nfunc readInt() (read int64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseInt(scanner.Text(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readFloat() (read float64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readRunes() (read []rune) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, v)\n\t}\n\treturn\n}\n\nfunc readString() (read string) {\n\tscanner.Scan()\n\tread = scanner.Text()\n\treturn\n}\n\nfunc readStrings() (read []string) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, string(v))\n\t}\n\treturn\n}\n\nfunc s2i(s string) int64 {\n\tvar intVal, e = strconv.ParseInt(s, 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int64) string {\n\tvar strVal = strconv.FormatInt(i, 10)\n\treturn strVal\n}\n\nfunc s2f(s string) float64 {\n\tvar floatVal, e = strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn floatVal\n}\n\nfunc abs(i int64) int64 {\n\treturn int64(math.Abs(float64(i)))\n}\n\nfunc max(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans < v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\nfunc min(a ...int64) int64 {\n\tans := int64(0)\n\tfor i, v := range a {\n\t\tif i == 0 {\n\t\t\tans = v\n\t\t}\n\t\tif ans > v {\n\t\t\tans = v\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc sum(i []int64) int64 {\n\tsum := int64(0)\n\tfor _, val := range i {\n\t\tsum += val\n\t}\n\treturn sum\n}\n\nfunc split(s string) []string {\n\treturn strings.Fields(s)\n}\n\nfunc strAry2intAry(strs []string) []int64 {\n\tvar ret = make([]int64, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal = s2i(str)\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int64) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = i2s(num)\n\t\tret = append(ret, strVal)\n\t}\n\treturn ret\n}\n\nfunc ary2str(strs []string) string {\n\treturn strings.Join(strs, \" \")\n}\n\nfunc reverse(res []int64) []int64 {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\nfunc reverseStr(res []string) []string {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\n\nfunc ini(res []int, init int) {\n\tif len(res) == 0 {\n\t\treturn\n\t}\n\tres[0] = init\n\tfor i := 0; i < len(res); i++ {\n\t\tcopy(res[i:], res[:i])\n\t}\n}\n\n//\n// func regexpExample() {\n// // Your code here!\n// var str = \"13:20\"\n// r := regexp.MustCompile(`(\\d+):(\\d+)`)\n// fmt.Println(r.FindStringSubmatch(str))\n// }\n\n// type Country struct {\n// gold int\n// silver int\n// blonze int\n// }\n\n// // 複数ソートのサンプル\n// func stableSortExample() []Country{\n// var country = []Country {\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:3, blonze:2},\n// {gold:1, silver:3, blonze:3},\n// }\n// sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })\n// return country\n// }\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "sample_input": "4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n"}, "reference_outputs": ["100 110 111 110\n"], "source_document_id": "p02936", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6181, "cpu_time_ms": 433, "memory_kb": 56448}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s424707869", "group_id": "codeNet:p02936", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar G map[int][]int\nvar X []int\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc dfs(v, p int) {\n\tfor _, r := range G[v] {\n\t\tif r == p {\n\t\t\tcontinue\n\t\t}\n\t\tX[r-1] += X[v-1]\n\t\tdfs(r, v)\n\t}\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tq := nextInt()\n\tG = make(map[int][]int)\n\tfor i := 1; i < n; i++ {\n\t\ta, b := nextInt(), nextInt()\n\t\tG[a] = append(G[a], b)\n\t\tG[b] = append(G[b], a)\n\t}\n\tX = make([]int, n)\n\tfor i := 0; i < q; i++ {\n\t\tX[nextInt()-1] += nextInt()\n\t}\n\tdfs(1, -1)\n\tfor _, x := range X {\n\t\tfmt.Printf(\"%d \", x)\n\t}\n\tfmt.Println()\n}\n", "language": "Go", "metadata": {"date": 1592274186, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02936.html", "problem_id": "p02936", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02936/input.txt", "sample_output_relpath": "derived/input_output/data/p02936/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02936/Go/s424707869.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s424707869", "user_id": "u688522869"}, "prompt_components": {"gold_output": "100 110 111 110\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar G map[int][]int\nvar X []int\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc dfs(v, p int) {\n\tfor _, r := range G[v] {\n\t\tif r == p {\n\t\t\tcontinue\n\t\t}\n\t\tX[r-1] += X[v-1]\n\t\tdfs(r, v)\n\t}\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tq := nextInt()\n\tG = make(map[int][]int)\n\tfor i := 1; i < n; i++ {\n\t\ta, b := nextInt(), nextInt()\n\t\tG[a] = append(G[a], b)\n\t\tG[b] = append(G[b], a)\n\t}\n\tX = make([]int, n)\n\tfor i := 0; i < q; i++ {\n\t\tX[nextInt()-1] += nextInt()\n\t}\n\tdfs(1, -1)\n\tfor _, x := range X {\n\t\tfmt.Printf(\"%d \", x)\n\t}\n\tfmt.Println()\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "sample_input": "4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n"}, "reference_outputs": ["100 110 111 110\n"], "source_document_id": "p02936", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 829, "memory_kb": 78464}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s428311143", "group_id": "codeNet:p02936", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc newScanner() *bufio.Scanner {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\treturn scanner\n}\n\nvar sc = newScanner()\n\nfunc scanInt() int {\n\tsc.Scan()\n\tv, _ := strconv.Atoi(sc.Text())\n\treturn v\n}\n\nfunc scanInts(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = scanInt()\n\t}\n\treturn a\n}\n\nfunc scanString() string {\n\tif sc.Scan() {\n\t\treturn sc.Text()\n\t}\n\tpanic(sc.Err())\n}\n\nfunc main() {\n\tn, q := scanInt(), scanInt()\n\ttree := newTree(n)\n\tfor i := 0; i < q; i++ {\n\t\tp, x := scanInt()-1, scanInt()\n\t\tdebug(\"p\", p, \"x\", x)\n\t\tsetCounters(tree, p, x)\n\t}\n\tupdateCounters(tree)\n\tfor i := 0; i < n; i++ {\n\t\tseparator := \" \"\n\t\tif i == n-1 {\n\t\t\tseparator = \"\\n\"\n\t\t}\n\t\tfmt.Print(tree[i].counter, separator)\n\t}\n}\n\nfunc debug(a ...interface{}) {\n\t// fmt.Println(a...)\n}\n\ntype Node struct {\n\tid int\n\tchildren []Node\n\tcounter int\n}\n\nfunc newTree(n int) map[int]*Node {\n\ttree := make(map[int]*Node)\n\tpath := make(map[int][]int)\n\tfor i := 0; i < n; i++ {\n\t\ttree[i] = &Node{id: i, counter: 0, children: []Node{}}\n\t\tdebug(i, n, tree[i])\n\t}\n\n\tfor i := 0; i < n-1; i++ {\n\t\ta, b := scanInt()-1, scanInt()-1\n\t\tpath[a] = append(path[a], b)\n\t\tpath[b] = append(path[b], a)\n\t}\n\tprocessed := make(map[int]bool)\n\tprocessed[0] = true\n\tfor parentList := []int{0}; len(parentList) > 0; {\n\t\tnextParentList := []int{}\n\t\tfor _, parent := range parentList {\n\t\t\tfor _, v := range path[parent] {\n\t\t\t\tif _, exists := processed[v]; !exists {\n\t\t\t\t\ttree[parent].children = append(tree[parent].children, *tree[v])\n\t\t\t\t\tnextParentList = append(nextParentList, v)\n\t\t\t\t\tprocessed[v] = true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tparentList = nextParentList\n\t}\n\n\tfor i := 0; i < len(tree); i++ {\n\t\tdebug(i, tree[i])\n\t}\n\treturn tree\n}\n\nfunc setCounters(tree map[int]*Node, p, x int) {\n\tdebug(\"p\", p, \"x\", x)\n\ttree[p].counter += x\n}\n\ntype PrevCurrentNode struct {\n\tprev int\n\tcurrent int\n}\n\nfunc updateCounters(tree map[int]*Node) {\n\tfor targetLayer := []PrevCurrentNode{{0, 0}}; len(targetLayer) > 0; {\n\t\tnextLayer := []PrevCurrentNode{}\n\t\tfor _, v := range targetLayer {\n\t\t\tprevNode := v.prev\n\t\t\tnode := v.current\n\t\t\tif node != 0 {\n\t\t\t\ttree[node].counter += tree[prevNode].counter\n\t\t\t}\n\t\t\tfor _, child := range tree[node].children {\n\t\t\t\tnextLayer = append(nextLayer, PrevCurrentNode{node, child.id})\n\t\t\t}\n\t\t}\n\t\ttargetLayer = nextLayer\n\t\tdebug(targetLayer)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1591272832, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02936.html", "problem_id": "p02936", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02936/input.txt", "sample_output_relpath": "derived/input_output/data/p02936/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02936/Go/s428311143.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s428311143", "user_id": "u238461782"}, "prompt_components": {"gold_output": "100 110 111 110\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc newScanner() *bufio.Scanner {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\treturn scanner\n}\n\nvar sc = newScanner()\n\nfunc scanInt() int {\n\tsc.Scan()\n\tv, _ := strconv.Atoi(sc.Text())\n\treturn v\n}\n\nfunc scanInts(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = scanInt()\n\t}\n\treturn a\n}\n\nfunc scanString() string {\n\tif sc.Scan() {\n\t\treturn sc.Text()\n\t}\n\tpanic(sc.Err())\n}\n\nfunc main() {\n\tn, q := scanInt(), scanInt()\n\ttree := newTree(n)\n\tfor i := 0; i < q; i++ {\n\t\tp, x := scanInt()-1, scanInt()\n\t\tdebug(\"p\", p, \"x\", x)\n\t\tsetCounters(tree, p, x)\n\t}\n\tupdateCounters(tree)\n\tfor i := 0; i < n; i++ {\n\t\tseparator := \" \"\n\t\tif i == n-1 {\n\t\t\tseparator = \"\\n\"\n\t\t}\n\t\tfmt.Print(tree[i].counter, separator)\n\t}\n}\n\nfunc debug(a ...interface{}) {\n\t// fmt.Println(a...)\n}\n\ntype Node struct {\n\tid int\n\tchildren []Node\n\tcounter int\n}\n\nfunc newTree(n int) map[int]*Node {\n\ttree := make(map[int]*Node)\n\tpath := make(map[int][]int)\n\tfor i := 0; i < n; i++ {\n\t\ttree[i] = &Node{id: i, counter: 0, children: []Node{}}\n\t\tdebug(i, n, tree[i])\n\t}\n\n\tfor i := 0; i < n-1; i++ {\n\t\ta, b := scanInt()-1, scanInt()-1\n\t\tpath[a] = append(path[a], b)\n\t\tpath[b] = append(path[b], a)\n\t}\n\tprocessed := make(map[int]bool)\n\tprocessed[0] = true\n\tfor parentList := []int{0}; len(parentList) > 0; {\n\t\tnextParentList := []int{}\n\t\tfor _, parent := range parentList {\n\t\t\tfor _, v := range path[parent] {\n\t\t\t\tif _, exists := processed[v]; !exists {\n\t\t\t\t\ttree[parent].children = append(tree[parent].children, *tree[v])\n\t\t\t\t\tnextParentList = append(nextParentList, v)\n\t\t\t\t\tprocessed[v] = true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tparentList = nextParentList\n\t}\n\n\tfor i := 0; i < len(tree); i++ {\n\t\tdebug(i, tree[i])\n\t}\n\treturn tree\n}\n\nfunc setCounters(tree map[int]*Node, p, x int) {\n\tdebug(\"p\", p, \"x\", x)\n\ttree[p].counter += x\n}\n\ntype PrevCurrentNode struct {\n\tprev int\n\tcurrent int\n}\n\nfunc updateCounters(tree map[int]*Node) {\n\tfor targetLayer := []PrevCurrentNode{{0, 0}}; len(targetLayer) > 0; {\n\t\tnextLayer := []PrevCurrentNode{}\n\t\tfor _, v := range targetLayer {\n\t\t\tprevNode := v.prev\n\t\t\tnode := v.current\n\t\t\tif node != 0 {\n\t\t\t\ttree[node].counter += tree[prevNode].counter\n\t\t\t}\n\t\t\tfor _, child := range tree[node].children {\n\t\t\t\tnextLayer = append(nextLayer, PrevCurrentNode{node, child.id})\n\t\t\t}\n\t\t}\n\t\ttargetLayer = nextLayer\n\t\tdebug(targetLayer)\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "sample_input": "4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n"}, "reference_outputs": ["100 110 111 110\n"], "source_document_id": "p02936", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2409, "cpu_time_ms": 1333, "memory_kb": 87040}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s417240975", "group_id": "codeNet:p02936", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc newScanner() *bufio.Scanner {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\treturn scanner\n}\n\nvar sc = newScanner()\n\nfunc scanInt() int {\n\tsc.Scan()\n\tv, _ := strconv.Atoi(sc.Text())\n\treturn v\n}\n\nfunc scanInts(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = scanInt()\n\t}\n\treturn a\n}\n\nfunc scanString() string {\n\tif sc.Scan() {\n\t\treturn sc.Text()\n\t}\n\tpanic(sc.Err())\n}\n\nfunc main() {\n\tn, q := scanInt(), scanInt()\n\ttree := newTree(n)\n\tfor i := 0; i < q; i++ {\n\t\tp, x := scanInt()-1, scanInt()\n\t\taddCounters(tree, p, x)\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tseparator := \" \"\n\t\tif i == n-1 {\n\t\t\tseparator = \"\\n\"\n\t\t}\n\t\tfmt.Print(tree[i].counter, separator)\n\t}\n}\n\nfunc debug(a ...interface{}) {\n\t// fmt.Println(a...)\n}\n\ntype Node struct {\n\tid int\n\tchildren []Node\n\tcounter int\n}\n\nfunc newTree(n int) map[int]*Node {\n\ttree := make(map[int]*Node)\n\tpath := make(map[int][]int)\n\tfor i := 0; i < n; i++ {\n\t\ttree[i] = &Node{id: i, counter: 0, children: []Node{}}\n\t}\n\n\tfor i := 0; i < n-1; i++ {\n\t\ta, b := scanInt()-1, scanInt()-1\n\t\tpath[a] = append(path[a], b)\n\t\tpath[b] = append(path[b], a)\n\t}\n\tprocessed := make(map[int]bool)\n\tprocessed[0] = true\n\tfor parentList := []int{0}; len(parentList) > 0; {\n\t\tnextParentList := []int{}\n\t\tfor _, parent := range parentList {\n\t\t\tfor _, v := range path[parent] {\n\t\t\t\tif _, exists := processed[v]; !exists {\n\t\t\t\t\ttree[parent].children = append(tree[parent].children, *tree[v])\n\t\t\t\t\tnextParentList = append(nextParentList, v)\n\t\t\t\t\tprocessed[v] = true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tparentList = nextParentList\n\t}\n\n\tfor i := 0; i < len(tree); i++ {\n\t\tdebug(tree[i])\n\t}\n\treturn tree\n}\n\nfunc addCounters(tree map[int]*Node, p, x int) {\n\tsubtreeRoot := tree[p]\n\tdebug(\"subtree root\", subtreeRoot, \"add\", x)\n\tsubtreeRoot.counter += x\n\tfor _, node := range subtreeRoot.children {\n\t\taddCounters(tree, node.id, x)\n\t}\n}\n\nfunc sumCounters(tree map[int]*Node) int {\n\tsum := 0\n\tfor i := 0; i < len(tree); i++ {\n\t\tsum += tree[i].counter\n\t}\n\treturn sum\n}\n", "language": "Go", "metadata": {"date": 1591192543, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02936.html", "problem_id": "p02936", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02936/input.txt", "sample_output_relpath": "derived/input_output/data/p02936/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02936/Go/s417240975.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s417240975", "user_id": "u238461782"}, "prompt_components": {"gold_output": "100 110 111 110\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc newScanner() *bufio.Scanner {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Split(bufio.ScanWords)\n\treturn scanner\n}\n\nvar sc = newScanner()\n\nfunc scanInt() int {\n\tsc.Scan()\n\tv, _ := strconv.Atoi(sc.Text())\n\treturn v\n}\n\nfunc scanInts(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = scanInt()\n\t}\n\treturn a\n}\n\nfunc scanString() string {\n\tif sc.Scan() {\n\t\treturn sc.Text()\n\t}\n\tpanic(sc.Err())\n}\n\nfunc main() {\n\tn, q := scanInt(), scanInt()\n\ttree := newTree(n)\n\tfor i := 0; i < q; i++ {\n\t\tp, x := scanInt()-1, scanInt()\n\t\taddCounters(tree, p, x)\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tseparator := \" \"\n\t\tif i == n-1 {\n\t\t\tseparator = \"\\n\"\n\t\t}\n\t\tfmt.Print(tree[i].counter, separator)\n\t}\n}\n\nfunc debug(a ...interface{}) {\n\t// fmt.Println(a...)\n}\n\ntype Node struct {\n\tid int\n\tchildren []Node\n\tcounter int\n}\n\nfunc newTree(n int) map[int]*Node {\n\ttree := make(map[int]*Node)\n\tpath := make(map[int][]int)\n\tfor i := 0; i < n; i++ {\n\t\ttree[i] = &Node{id: i, counter: 0, children: []Node{}}\n\t}\n\n\tfor i := 0; i < n-1; i++ {\n\t\ta, b := scanInt()-1, scanInt()-1\n\t\tpath[a] = append(path[a], b)\n\t\tpath[b] = append(path[b], a)\n\t}\n\tprocessed := make(map[int]bool)\n\tprocessed[0] = true\n\tfor parentList := []int{0}; len(parentList) > 0; {\n\t\tnextParentList := []int{}\n\t\tfor _, parent := range parentList {\n\t\t\tfor _, v := range path[parent] {\n\t\t\t\tif _, exists := processed[v]; !exists {\n\t\t\t\t\ttree[parent].children = append(tree[parent].children, *tree[v])\n\t\t\t\t\tnextParentList = append(nextParentList, v)\n\t\t\t\t\tprocessed[v] = true\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tparentList = nextParentList\n\t}\n\n\tfor i := 0; i < len(tree); i++ {\n\t\tdebug(tree[i])\n\t}\n\treturn tree\n}\n\nfunc addCounters(tree map[int]*Node, p, x int) {\n\tsubtreeRoot := tree[p]\n\tdebug(\"subtree root\", subtreeRoot, \"add\", x)\n\tsubtreeRoot.counter += x\n\tfor _, node := range subtreeRoot.children {\n\t\taddCounters(tree, node.id, x)\n\t}\n}\n\nfunc sumCounters(tree map[int]*Node) int {\n\tsum := 0\n\tfor i := 0; i < len(tree); i++ {\n\t\tsum += tree[i].counter\n\t}\n\treturn sum\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "sample_input": "4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n"}, "reference_outputs": ["100 110 111 110\n"], "source_document_id": "p02936", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2066, "cpu_time_ms": 2112, "memory_kb": 258816}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s360756910", "group_id": "codeNet:p02936", "input_text": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n \"strings\"\n)\n\nvar si = bufio.NewScanner(os.Stdin)\n\ntype Node struct {\n Id int\n Parent int\n Count int\n Child []int\n}\n\nfunc readInt() int {\n si.Scan()\n ret, _ := strconv.Atoi(si.Text())\n return ret\n}\nfunc main() {\n si.Split(bufio.ScanWords)\n N, Q := readInt(), readInt()\n Parent := make([]int, N+1, N+1)\n Count := make([]int, N+1, N+1)\n Child := make([][]int, N+1, N+1)\n for i := 0; i < N-1; i++ {\n a, b := readInt(), readInt()\n Child[a] = append(Child[a], b)\n Child[b] = append(Child[b], a)\n\n }\n for i := 0; i < Q; i++ {\n p, x := readInt(), readInt()\n Count[p] += x\n }\n ret := make([]int, N+1, N+1)\n stack := []int{1}\n for len(stack) > 0 {\n t := stack[len(stack)-1]\n for i := range Child[t] {\n if Parent[Child[t][i]] == 0 {\n Parent[Child[t][i]] = t\n }\n }\n stack = stack[:len(stack)-1]\n ret[t] = Count[t] + ret[Parent[t]]\n for _, v := range Child[t] {\n if v != Parent[t] {\n stack = append(stack, v)\n }\n }\n }\n fmt.Println(strings.Trim(fmt.Sprint(ret[1:]), \"[]\"))\n\n}", "language": "Go", "metadata": {"date": 1583338142, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02936.html", "problem_id": "p02936", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02936/input.txt", "sample_output_relpath": "derived/input_output/data/p02936/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02936/Go/s360756910.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s360756910", "user_id": "u657357805"}, "prompt_components": {"gold_output": "100 110 111 110\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n \"strings\"\n)\n\nvar si = bufio.NewScanner(os.Stdin)\n\ntype Node struct {\n Id int\n Parent int\n Count int\n Child []int\n}\n\nfunc readInt() int {\n si.Scan()\n ret, _ := strconv.Atoi(si.Text())\n return ret\n}\nfunc main() {\n si.Split(bufio.ScanWords)\n N, Q := readInt(), readInt()\n Parent := make([]int, N+1, N+1)\n Count := make([]int, N+1, N+1)\n Child := make([][]int, N+1, N+1)\n for i := 0; i < N-1; i++ {\n a, b := readInt(), readInt()\n Child[a] = append(Child[a], b)\n Child[b] = append(Child[b], a)\n\n }\n for i := 0; i < Q; i++ {\n p, x := readInt(), readInt()\n Count[p] += x\n }\n ret := make([]int, N+1, N+1)\n stack := []int{1}\n for len(stack) > 0 {\n t := stack[len(stack)-1]\n for i := range Child[t] {\n if Parent[Child[t][i]] == 0 {\n Parent[Child[t][i]] = t\n }\n }\n stack = stack[:len(stack)-1]\n ret[t] = Count[t] + ret[Parent[t]]\n for _, v := range Child[t] {\n if v != Parent[t] {\n stack = append(stack, v)\n }\n }\n }\n fmt.Println(strings.Trim(fmt.Sprint(ret[1:]), \"[]\"))\n\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "sample_input": "4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n"}, "reference_outputs": ["100 110 111 110\n"], "source_document_id": "p02936", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1540, "cpu_time_ms": 287, "memory_kb": 31232}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s452253585", "group_id": "codeNet:p02936", "input_text": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n \"strings\"\n)\n\nvar si = bufio.NewScanner(os.Stdin)\n\ntype Node struct {\n Id int\n Parent int\n Count int\n Child []int\n}\n\nfunc readInt() int {\n si.Scan()\n ret, _ := strconv.Atoi(si.Text())\n return ret\n}\nfunc main() {\n si.Split(bufio.ScanWords)\n N, Q := readInt(), readInt()\n Parent := make([]int, N+1, N+1)\n Count := make([]int, N+1, N+1)\n Child := make([][]int, N+1, N+1)\n for i := 0; i < N-1; i++ {\n a, b := readInt(), readInt()\n Parent[b] = a\n Child[a] = append(Child[a], b)\n\n }\n for i := 0; i < Q; i++ {\n p, x := readInt(), readInt()\n Count[p] += x\n }\n ret := make([]int, N+1, N+1)\n stack := []int{1}\n for len(stack) > 0 {\n t := stack[len(stack)-1]\n stack = stack[:len(stack)-1]\n ret[t] = Count[t] + ret[Parent[t]]\n stack = append(stack, Child[t]...)\n }\n fmt.Println(strings.Trim(strings.Join(strings.Fields(fmt.Sprint(ret[1:])), \" \"), \"[]\"))\n\n}", "language": "Go", "metadata": {"date": 1583335167, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02936.html", "problem_id": "p02936", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02936/input.txt", "sample_output_relpath": "derived/input_output/data/p02936/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02936/Go/s452253585.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s452253585", "user_id": "u657357805"}, "prompt_components": {"gold_output": "100 110 111 110\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"os\"\n \"strconv\"\n \"strings\"\n)\n\nvar si = bufio.NewScanner(os.Stdin)\n\ntype Node struct {\n Id int\n Parent int\n Count int\n Child []int\n}\n\nfunc readInt() int {\n si.Scan()\n ret, _ := strconv.Atoi(si.Text())\n return ret\n}\nfunc main() {\n si.Split(bufio.ScanWords)\n N, Q := readInt(), readInt()\n Parent := make([]int, N+1, N+1)\n Count := make([]int, N+1, N+1)\n Child := make([][]int, N+1, N+1)\n for i := 0; i < N-1; i++ {\n a, b := readInt(), readInt()\n Parent[b] = a\n Child[a] = append(Child[a], b)\n\n }\n for i := 0; i < Q; i++ {\n p, x := readInt(), readInt()\n Count[p] += x\n }\n ret := make([]int, N+1, N+1)\n stack := []int{1}\n for len(stack) > 0 {\n t := stack[len(stack)-1]\n stack = stack[:len(stack)-1]\n ret[t] = Count[t] + ret[Parent[t]]\n stack = append(stack, Child[t]...)\n }\n fmt.Println(strings.Trim(strings.Join(strings.Fields(fmt.Sprint(ret[1:])), \" \"), \"[]\"))\n\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "sample_input": "4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n"}, "reference_outputs": ["100 110 111 110\n"], "source_document_id": "p02936", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1223, "cpu_time_ms": 280, "memory_kb": 23296}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s158967015", "group_id": "codeNet:p02936", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc scanString() string { sc.Scan(); return sc.Text() }\nfunc scanInt() int { a,_ := strconv.Atoi(scanString()); return a }\nfunc scanInt64() int64 { a,_ := strconv.ParseInt(scanString(),10,64); return a }\nfunc scanFloat64() float64 { a,_ := strconv.ParseFloat(scanString(),64); return a }\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n); for i := 0; i < n; i++ { res[i] = scanInt() }; return res\n}\n\nfunc abs(a int) int { if a<0 { return -a }; return a }\nfunc min(a,b int) int { if ab { return a }; return b }\n\n//•*¨*•.¸¸♪Main•*¨*•.¸¸♪( -ω-)ノ ( ・ω・)\n\nfunc main() {\n\tdefer wr.Flush()\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1001001)\n\n\tn := scanInt()\n\tq := scanInt()\n\n\tg := make([][]int, n)\n\tdone := make([]bool, n)\n\tcnt := make([]int, n)\n\n\tfor i := 0; i < n-1; i++ {\n\t\ta,b := scanInt()-1, scanInt()-1\n\t\tg[a] = append(g[a], b)\n\t\tg[b] = append(g[b], a)\n\t}\n\n\tfor i := 0; i < q; i++ {\n\t\tp := scanInt()-1\n\t\tx := scanInt()\n\t\tcnt[p] += x\n\t}\n\n\tvar fn func(next, sum int)\n\tfn = func(next, sum int) {\n\t\tdone[next] = true\n\t\tcnt[next] += sum\n\t\tfor _, v := range g[next] {\n\t\t\tif done[v] {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tfn(v, cnt[next])\n\t\t}\n\t}\n\n\tfn(0,0)\n\n\tfor _, e := range cnt {\n\t\tfmt.Fprintf(wr, \"%d \", e)\n\t}\n\n\tfmt.Fprintln(wr)\n\n}\n", "language": "Go", "metadata": {"date": 1582605908, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02936.html", "problem_id": "p02936", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02936/input.txt", "sample_output_relpath": "derived/input_output/data/p02936/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02936/Go/s158967015.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s158967015", "user_id": "u548992197"}, "prompt_components": {"gold_output": "100 110 111 110\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)\n\nfunc scanString() string { sc.Scan(); return sc.Text() }\nfunc scanInt() int { a,_ := strconv.Atoi(scanString()); return a }\nfunc scanInt64() int64 { a,_ := strconv.ParseInt(scanString(),10,64); return a }\nfunc scanFloat64() float64 { a,_ := strconv.ParseFloat(scanString(),64); return a }\n\nfunc scanInts(n int) []int {\n\tres := make([]int, n); for i := 0; i < n; i++ { res[i] = scanInt() }; return res\n}\n\nfunc abs(a int) int { if a<0 { return -a }; return a }\nfunc min(a,b int) int { if ab { return a }; return b }\n\n//•*¨*•.¸¸♪Main•*¨*•.¸¸♪( -ω-)ノ ( ・ω・)\n\nfunc main() {\n\tdefer wr.Flush()\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1001001)\n\n\tn := scanInt()\n\tq := scanInt()\n\n\tg := make([][]int, n)\n\tdone := make([]bool, n)\n\tcnt := make([]int, n)\n\n\tfor i := 0; i < n-1; i++ {\n\t\ta,b := scanInt()-1, scanInt()-1\n\t\tg[a] = append(g[a], b)\n\t\tg[b] = append(g[b], a)\n\t}\n\n\tfor i := 0; i < q; i++ {\n\t\tp := scanInt()-1\n\t\tx := scanInt()\n\t\tcnt[p] += x\n\t}\n\n\tvar fn func(next, sum int)\n\tfn = func(next, sum int) {\n\t\tdone[next] = true\n\t\tcnt[next] += sum\n\t\tfor _, v := range g[next] {\n\t\t\tif done[v] {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tfn(v, cnt[next])\n\t\t}\n\t}\n\n\tfn(0,0)\n\n\tfor _, e := range cnt {\n\t\tfmt.Fprintf(wr, \"%d \", e)\n\t}\n\n\tfmt.Fprintln(wr)\n\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "sample_input": "4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n"}, "reference_outputs": ["100 110 111 110\n"], "source_document_id": "p02936", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1450, "cpu_time_ms": 375, "memory_kb": 117632}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s678538677", "group_id": "codeNet:p02936", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tio := newIo()\n\tdefer io.Flush()\n\tN, Q := io.NextInt(), io.NextInt()\n\tpoints := map[int]int{}\n\tedges := map[int][]int{}\n\tfor i := 0; i < N-1; i++ {\n\t\ta, b := io.NextInt(), io.NextInt()\n\t\tedges[a] = append(edges[a], b)\n\t\tedges[b] = append(edges[b], a)\n\t}\n\tfor i := 0; i < Q; i++ {\n\t\ta, point := io.NextInt(), io.NextInt()\n\t\tpoints[a] = points[a] + point\n\t}\n\tvisits := map[int]bool{}\n\tvisits[1] = true\n\ttotalPoints := make([]int, N+1)\n\ttotalPoints[1] = points[1]\n\tq := []int{1}\n\tfor len(q) > 0 {\n\t\tqq := q[0]\n\t\tq = q[1:]\n\t\tcurrentPoint := totalPoints[qq]\n\t\tfor _, edge := range edges[qq] {\n\t\t\t_, exists := visits[edge]\n\t\t\tif exists {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tvisits[edge] = true\n\t\t\ttotalPoints[edge] = currentPoint + points[edge]\n\t\t\tq = append(q, edge)\n\t\t}\n\t}\n\tio.PrintIntLn(totalPoints[1:])\n}\n\ntype io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\nfunc newIo() *io {\n\treturn &io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\nfunc (io *io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc (io *io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\nfunc (io *io) Next() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\nfunc (io *io) NextInt() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *io) NextFloat() float64 {\n\ti, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *io) PrintLn(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\nfunc (io *io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\nfunc (io *io) PrintIntLn(a []int) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc (io *io) PrintStringLn(a []string) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc log(name string, value interface{}) {\n\tfmt.Fprintf(os.Stderr, \"%s=%+v\\n\", name, value)\n}\n", "language": "Go", "metadata": {"date": 1578171522, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02936.html", "problem_id": "p02936", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02936/input.txt", "sample_output_relpath": "derived/input_output/data/p02936/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02936/Go/s678538677.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s678538677", "user_id": "u299761130"}, "prompt_components": {"gold_output": "100 110 111 110\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tio := newIo()\n\tdefer io.Flush()\n\tN, Q := io.NextInt(), io.NextInt()\n\tpoints := map[int]int{}\n\tedges := map[int][]int{}\n\tfor i := 0; i < N-1; i++ {\n\t\ta, b := io.NextInt(), io.NextInt()\n\t\tedges[a] = append(edges[a], b)\n\t\tedges[b] = append(edges[b], a)\n\t}\n\tfor i := 0; i < Q; i++ {\n\t\ta, point := io.NextInt(), io.NextInt()\n\t\tpoints[a] = points[a] + point\n\t}\n\tvisits := map[int]bool{}\n\tvisits[1] = true\n\ttotalPoints := make([]int, N+1)\n\ttotalPoints[1] = points[1]\n\tq := []int{1}\n\tfor len(q) > 0 {\n\t\tqq := q[0]\n\t\tq = q[1:]\n\t\tcurrentPoint := totalPoints[qq]\n\t\tfor _, edge := range edges[qq] {\n\t\t\t_, exists := visits[edge]\n\t\t\tif exists {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tvisits[edge] = true\n\t\t\ttotalPoints[edge] = currentPoint + points[edge]\n\t\t\tq = append(q, edge)\n\t\t}\n\t}\n\tio.PrintIntLn(totalPoints[1:])\n}\n\ntype io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\nfunc newIo() *io {\n\treturn &io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\nfunc (io *io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc (io *io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\nfunc (io *io) Next() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\nfunc (io *io) NextInt() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *io) NextFloat() float64 {\n\ti, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *io) PrintLn(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\nfunc (io *io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\nfunc (io *io) PrintIntLn(a []int) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc (io *io) PrintStringLn(a []string) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc log(name string, value interface{}) {\n\tfmt.Fprintf(os.Stderr, \"%s=%+v\\n\", name, value)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "sample_input": "4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n"}, "reference_outputs": ["100 110 111 110\n"], "source_document_id": "p02936", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2380, "cpu_time_ms": 704, "memory_kb": 55424}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s360247552", "group_id": "codeNet:p02936", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\n// Node is tree\ntype Node struct {\n\tCount int\n\tValue int\n\tRight *Node\n\tLeft *Node\n}\n\n// NewNode is constractor\nfunc NewNode(value int) *Node {\n\tl := new(Node)\n\tl.Value = value\n\tl.Right = nil\n\tl.Left = nil\n\treturn l\n}\n\nfunc main() {\n\tvar n, q int\n\t_, err := fmt.Scan(&n, &q)\n\tif err != nil {\n\t\tpanic(\"error\")\n\t}\n\ta := make([]*Node, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = NewNode(i)\n\t}\n\n\tvar parent, child int\n\tfor i := 0; i < n-1; i++ {\n\t\t_, err := fmt.Scan(&parent, &child)\n\t\tif err != nil {\n\t\t\tpanic(\"ERROR:1\")\n\t\t}\n\t\tif a[parent-1].Right == nil {\n\t\t\ta[parent-1].Right = a[child-1]\n\t\t} else if a[parent-1].Left == nil {\n\t\t\ta[parent-1].Left = a[child-1]\n\t\t} else {\n\t\t\tpanic(\"ERROR:2\")\n\t\t}\n\t}\n\n\tfor i := 0; i < q; i++ {\n\t\tvar val, number int\n\t\t_, err := fmt.Scan(&number, &val)\n\t\tif err != nil {\n\t\t\tpanic(\"ERROR:3\")\n\t\t}\n\t\tcount(val, a[number-1])\n\t}\n\n\tfor i := 0; i < len(a); i++ {\n\t\tfmt.Print(a[i].Count)\n fmt.Print(\" \")\n\t}\n\tfmt.Println()\n}\n\nfunc count(value int, point *Node) {\n\tpoint.Count += value\n\tif point.Right != nil {\n\t\tcount(value, point.Right)\n\t}\n if point.Left != nil {\n\t\tcount(value, point.Left)\n\t} \n return\n\t\n}\n", "language": "Go", "metadata": {"date": 1571440574, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02936.html", "problem_id": "p02936", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02936/input.txt", "sample_output_relpath": "derived/input_output/data/p02936/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02936/Go/s360247552.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s360247552", "user_id": "u017829818"}, "prompt_components": {"gold_output": "100 110 111 110\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\n// Node is tree\ntype Node struct {\n\tCount int\n\tValue int\n\tRight *Node\n\tLeft *Node\n}\n\n// NewNode is constractor\nfunc NewNode(value int) *Node {\n\tl := new(Node)\n\tl.Value = value\n\tl.Right = nil\n\tl.Left = nil\n\treturn l\n}\n\nfunc main() {\n\tvar n, q int\n\t_, err := fmt.Scan(&n, &q)\n\tif err != nil {\n\t\tpanic(\"error\")\n\t}\n\ta := make([]*Node, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = NewNode(i)\n\t}\n\n\tvar parent, child int\n\tfor i := 0; i < n-1; i++ {\n\t\t_, err := fmt.Scan(&parent, &child)\n\t\tif err != nil {\n\t\t\tpanic(\"ERROR:1\")\n\t\t}\n\t\tif a[parent-1].Right == nil {\n\t\t\ta[parent-1].Right = a[child-1]\n\t\t} else if a[parent-1].Left == nil {\n\t\t\ta[parent-1].Left = a[child-1]\n\t\t} else {\n\t\t\tpanic(\"ERROR:2\")\n\t\t}\n\t}\n\n\tfor i := 0; i < q; i++ {\n\t\tvar val, number int\n\t\t_, err := fmt.Scan(&number, &val)\n\t\tif err != nil {\n\t\t\tpanic(\"ERROR:3\")\n\t\t}\n\t\tcount(val, a[number-1])\n\t}\n\n\tfor i := 0; i < len(a); i++ {\n\t\tfmt.Print(a[i].Count)\n fmt.Print(\" \")\n\t}\n\tfmt.Println()\n}\n\nfunc count(value int, point *Node) {\n\tpoint.Count += value\n\tif point.Right != nil {\n\t\tcount(value, point.Right)\n\t}\n if point.Left != nil {\n\t\tcount(value, point.Left)\n\t} \n return\n\t\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "sample_input": "4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n"}, "reference_outputs": ["100 110 111 110\n"], "source_document_id": "p02936", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1168, "cpu_time_ms": 2109, "memory_kb": 30592}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s888430787", "group_id": "codeNet:p02936", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\ntype node struct {\n\tnumber int\n\trelated []int\n\tpoint int64\n}\n\nvar nodes [200000 + 5]node\nvar points [200000 + 5]int64\n\nfunc main() {\n\tvar N, Q int\n\tfmt.Scanf(\"%d\", &N)\n\tfmt.Scanf(\"%d\", &Q)\n\n\t//nodes = make([]node, N+1)\n\tvar a, b int\n\tfor i := 0; i < N-1; i++ {\n\t\tfmt.Scanf(\"%d\", &a)\n\t\tfmt.Scanf(\"%d\", &b)\n\t\tnodes[a].related = append(nodes[a].related, b)\n\t\tnodes[b].related = append(nodes[b].related, a)\n\t}\n\n\t//points = make([]int64, N+1)\n\tvar target, point int\n\tfor i := 0; i < Q; i++ {\n\t\tfmt.Scanf(\"%d\", &target)\n\t\tfmt.Scanf(\"%d\", &point)\n\t\tpoints[target] += int64(point)\n\t}\n\n\t//fmt.Println(nodes)\n\t//fmt.Println(points)\n\n\tcalcPoint(1, 0, -1)\n\tfor i := 1; i <= N; i++ {\n\t\tfmt.Print(strconv.FormatInt(nodes[i].point, 10) + \" \")\n\t}\n\t//for i, n := range nodes {\n\t//\tif i == 0 {\n\t//\t\tcontinue\n\t//\t}\n\t//\tfmt.Print(strconv.FormatInt(n.point, 10) + \" \")\n\t//}\n}\n\nfunc calcPoint(nodeNumber int, accumulated int64, parent int) {\n\taccumulated += points[nodeNumber]\n\tnodes[nodeNumber].point = accumulated\n\tfor _, r := range nodes[nodeNumber].related {\n\t\tif r == parent {\n\t\t\tcontinue\n\t\t}\n\t\tcalcPoint(r, accumulated, nodeNumber)\n\t}\n}", "language": "Go", "metadata": {"date": 1569633696, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02936.html", "problem_id": "p02936", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02936/input.txt", "sample_output_relpath": "derived/input_output/data/p02936/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02936/Go/s888430787.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s888430787", "user_id": "u304913019"}, "prompt_components": {"gold_output": "100 110 111 110\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\ntype node struct {\n\tnumber int\n\trelated []int\n\tpoint int64\n}\n\nvar nodes [200000 + 5]node\nvar points [200000 + 5]int64\n\nfunc main() {\n\tvar N, Q int\n\tfmt.Scanf(\"%d\", &N)\n\tfmt.Scanf(\"%d\", &Q)\n\n\t//nodes = make([]node, N+1)\n\tvar a, b int\n\tfor i := 0; i < N-1; i++ {\n\t\tfmt.Scanf(\"%d\", &a)\n\t\tfmt.Scanf(\"%d\", &b)\n\t\tnodes[a].related = append(nodes[a].related, b)\n\t\tnodes[b].related = append(nodes[b].related, a)\n\t}\n\n\t//points = make([]int64, N+1)\n\tvar target, point int\n\tfor i := 0; i < Q; i++ {\n\t\tfmt.Scanf(\"%d\", &target)\n\t\tfmt.Scanf(\"%d\", &point)\n\t\tpoints[target] += int64(point)\n\t}\n\n\t//fmt.Println(nodes)\n\t//fmt.Println(points)\n\n\tcalcPoint(1, 0, -1)\n\tfor i := 1; i <= N; i++ {\n\t\tfmt.Print(strconv.FormatInt(nodes[i].point, 10) + \" \")\n\t}\n\t//for i, n := range nodes {\n\t//\tif i == 0 {\n\t//\t\tcontinue\n\t//\t}\n\t//\tfmt.Print(strconv.FormatInt(n.point, 10) + \" \")\n\t//}\n}\n\nfunc calcPoint(nodeNumber int, accumulated int64, parent int) {\n\taccumulated += points[nodeNumber]\n\tnodes[nodeNumber].point = accumulated\n\tfor _, r := range nodes[nodeNumber].related {\n\t\tif r == parent {\n\t\t\tcontinue\n\t\t}\n\t\tcalcPoint(r, accumulated, nodeNumber)\n\t}\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "sample_input": "4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n"}, "reference_outputs": ["100 110 111 110\n"], "source_document_id": "p02936", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1164, "cpu_time_ms": 2108, "memory_kb": 22144}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s785507756", "group_id": "codeNet:p02936", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc init() {\n\t// read one word/char/int separated by space(s).\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 8000000), 8000000)\n\n\t// read one line.\n\t// sc.Split(bufio.ScanLines)\n}\n\nfunc main() {\n\tvar n, q int\n\tn = nextInt()\n\tq = nextInt()\n\tvar g = make([][]int, n+1)\n\tfor i := 1; i < n; i++ {\n\t\tvar a, b int\n\t\ta = nextInt()\n\t\tb = nextInt()\n\t\tg[a] = append(g[a], b)\n\t\tg[b] = append(g[b], a)\n\t}\n\tvar v = make([]int, n+1)\n\tfor i := 0; i < q; i++ {\n\t\tvar p, x int\n\t\tp = nextInt()\n\t\tx = nextInt()\n\t\tv[p] += x\n\t}\n\n\tque := make([]int, 0)\n\tque = append(que, 1)\n\tdone := make([]bool, n+1)\n\n\tfor len(que) != 0 {\n\t\tparent := que[0]\n\t\tque = que[1:]\n\t\tdone[parent] = true\n\n\t\tfor _, child := range g[parent] {\n\t\t\tif done[child] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tv[child] += v[parent]\n\t\t\tque = append(que, child)\n\t\t}\n\t}\n\tfor i := 1; i < n+1; i++ {\n\t\tif i > 1 {\n\t\t\tfmt.Print(\" \")\n\t\t}\n\t\tfmt.Print(v[i])\n\t}\n\tfmt.Println(\"\")\n}\n", "language": "Go", "metadata": {"date": 1566964510, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02936.html", "problem_id": "p02936", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02936/input.txt", "sample_output_relpath": "derived/input_output/data/p02936/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02936/Go/s785507756.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s785507756", "user_id": "u948882066"}, "prompt_components": {"gold_output": "100 110 111 110\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc init() {\n\t// read one word/char/int separated by space(s).\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 8000000), 8000000)\n\n\t// read one line.\n\t// sc.Split(bufio.ScanLines)\n}\n\nfunc main() {\n\tvar n, q int\n\tn = nextInt()\n\tq = nextInt()\n\tvar g = make([][]int, n+1)\n\tfor i := 1; i < n; i++ {\n\t\tvar a, b int\n\t\ta = nextInt()\n\t\tb = nextInt()\n\t\tg[a] = append(g[a], b)\n\t\tg[b] = append(g[b], a)\n\t}\n\tvar v = make([]int, n+1)\n\tfor i := 0; i < q; i++ {\n\t\tvar p, x int\n\t\tp = nextInt()\n\t\tx = nextInt()\n\t\tv[p] += x\n\t}\n\n\tque := make([]int, 0)\n\tque = append(que, 1)\n\tdone := make([]bool, n+1)\n\n\tfor len(que) != 0 {\n\t\tparent := que[0]\n\t\tque = que[1:]\n\t\tdone[parent] = true\n\n\t\tfor _, child := range g[parent] {\n\t\t\tif done[child] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tv[child] += v[parent]\n\t\t\tque = append(que, child)\n\t\t}\n\t}\n\tfor i := 1; i < n+1; i++ {\n\t\tif i > 1 {\n\t\t\tfmt.Print(\" \")\n\t\t}\n\t\tfmt.Print(v[i])\n\t}\n\tfmt.Println(\"\")\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "sample_input": "4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n"}, "reference_outputs": ["100 110 111 110\n"], "source_document_id": "p02936", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1112, "cpu_time_ms": 1069, "memory_kb": 34304}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s493051413", "group_id": "codeNet:p02936", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc main() {\n\tn, q := getInt(), getInt()\n\n\tvalues := make([]int, n)\n\tparents := make([]int, n)\n\n\tfor i := 0; i < n-1; i++ {\n\t\ta, b := getInt(), getInt()\n\t\tparents[b-1] = a\n\t}\n\n\tfor i := 0; i < q; i++ {\n\t\tp, x := getInt(), getInt()\n\t\tvalues[p-1] += x\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tif parents[i] != 0 {\n\t\t\tvalues[i] += values[parents[i] - 1]\n\t\t}\n\t}\n\n\tprintIntArray(values)\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\tstr := sc.Text()\n\tvalue, _ := strconv.Atoi(str)\n\treturn value\n}\n\nfunc scanStrings(len int) (strings []string) {\n\tfor i := 0; i < len; i++ {\n\t\tsc.Scan()\n\t\tstrings = append(strings, sc.Text())\n\t}\n\treturn\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray) - 1])\n}\n", "language": "Go", "metadata": {"date": 1566354776, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02936.html", "problem_id": "p02936", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02936/input.txt", "sample_output_relpath": "derived/input_output/data/p02936/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02936/Go/s493051413.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s493051413", "user_id": "u964273035"}, "prompt_components": {"gold_output": "100 110 111 110\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc main() {\n\tn, q := getInt(), getInt()\n\n\tvalues := make([]int, n)\n\tparents := make([]int, n)\n\n\tfor i := 0; i < n-1; i++ {\n\t\ta, b := getInt(), getInt()\n\t\tparents[b-1] = a\n\t}\n\n\tfor i := 0; i < q; i++ {\n\t\tp, x := getInt(), getInt()\n\t\tvalues[p-1] += x\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tif parents[i] != 0 {\n\t\t\tvalues[i] += values[parents[i] - 1]\n\t\t}\n\t}\n\n\tprintIntArray(values)\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\tstr := sc.Text()\n\tvalue, _ := strconv.Atoi(str)\n\treturn value\n}\n\nfunc scanStrings(len int) (strings []string) {\n\tfor i := 0; i < len; i++ {\n\t\tsc.Scan()\n\t\tstrings = append(strings, sc.Text())\n\t}\n\treturn\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray) - 1])\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "sample_input": "4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n"}, "reference_outputs": ["100 110 111 110\n"], "source_document_id": "p02936", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1603, "cpu_time_ms": 211, "memory_kb": 15616}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s392320901", "group_id": "codeNet:p02936", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\n)\n\n\nfunc main() {\n\tsolve(os.Stdin, os.Stdout)\n}\n\ntype ReaderEx struct {\n\tbaseScanner *bufio.Scanner\n\twords []string\n\tnextWordIdx func() int\n\tinitWordIdx func(int)\n}\n\nfunc NewScannerEx(stdin io.Reader) *ReaderEx {\n\tvar this ReaderEx\n\tvar idx int\n\tvar wordsCnt int\n\tthis.baseScanner = bufio.NewScanner(stdin)\n\tthis.baseScanner.Buffer(make([]byte, 0), 1E+11)\n\tthis.nextWordIdx = func() int {\n\t\tcur := idx\n\t\tidx = (idx + 1) % wordsCnt\n\t\treturn cur\n\t}\n\tthis.initWordIdx = func(wc int) {\n\t\tidx = 0\n\t\twordsCnt = wc\n\t}\n\treturn &this\n}\n\nfunc (me *ReaderEx) Scan(doSplit bool) (isScanned bool) {\n\tisScanned = me.baseScanner.Scan()\n\tif doSplit {\n\t\tme.words = strings.Fields(me.baseScanner.Text())\n\t} else {\n\t\tme.words = []string{me.baseScanner.Text()}\n\t}\n\tme.initWordIdx(len(me.words))\n\treturn\n}\n\nfunc (me *ReaderEx) nextBytes() []byte {\n\treturn []byte(me.words[me.nextWordIdx()])\n}\nfunc (me *ReaderEx) nextString() string {\n\treturn me.words[me.nextWordIdx()]\n}\n\ntype StringArray []string\n\nfunc (me *ReaderEx) nextStringArray() StringArray {\n\treturn me.words[me.nextWordIdx():]\n}\n\nfunc (me StringArray) toStrings() []string {\n\treturn me\n}\n\nfunc (me StringArray) toInts() []int {\n\tstrValues := me.toStrings()\n\tvalues := make([]int, len(strValues))\n\tfor i, v := range strValues {\n\t\tn, err := strconv.Atoi(v)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tvalues[i] = n\n\t}\n\treturn values\n}\nfunc (me *ReaderEx) nextInt() int {\n\tn, err := strconv.Atoi(me.words[me.nextWordIdx()])\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tpanic(fmt.Sprintf(\"getInt(%d)\", n))\n\t\t}\n\t}()\n\treturn n\n}\n\nfunc pow(x, y, mod int) (ans int) {\n\n\tans = 1\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(y)))); ; bit >>= 1 {\n\t\tif y&bit != 0 {\n\t\t\tans *= x\n\t\t\tif mod > 0 {\n\t\t\t\tans %= mod\n\t\t\t}\n\t\t}\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t\tans *= ans\n\t\tif mod > 0 {\n\t\t\tans %= mod\n\t\t}\n\t}\n}\n\ntype factType struct {\n\tprime int\n\tcount int\n}\n\nfunc fact(n int) (facts []*factType) {\n\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tfa := factType{prime: i}\n\t\t\tfor n%fa.prime == 0 {\n\t\t\t\tn /= fa.prime\n\t\t\t\tfa.count++\n\t\t\t}\n\t\t\tfacts = append(facts, &fa)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfacts = append(facts, &factType{prime: n, count: 1})\n\t}\n\treturn facts\n}\nfunc dec2bin(n int) (ret []bool) {\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(n)))); ; bit >>= 1 {\n\t\tret = append(ret, n&bit != 0)\n\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t}\n\n}\n\nfunc abs(v int) int {\n\tif v < 0 {\n\t\tv = -v\n\t}\n\treturn v\n}\n\nfunc b2i(b bool) (i int) {\n\tif b {\n\t\ti = 1\n\t} else {\n\t\ti = 0\n\t}\n\treturn\n}\n\n//Edge is\ntype Edge struct {\n\tnode *Node\n\tBridge *Bridge\n}\n\n//Node is\ntype Node struct {\n\tid int\n\tedges []*Edge\n\tcounter int\n\tadd int\n}\n\n//Bridge is\ntype Bridge struct {\n\tedges [2]Edge\n}\n\n//NewBridge is\nfunc NewBridge(a, b *Node) (bridge *Bridge) {\n\tbridge = &Bridge{edges: [...]Edge{{node: a, Bridge: bridge}, {node: b, Bridge: bridge}}}\n\ta.edges = append(a.edges, &bridge.edges[1])\n\t//b.edges = append(b.edges, &bridge.edges[0])\n\treturn\n}\n\n//Another is\nfunc (edge *Edge) Another() (another *Edge) {\n\tBridge := edge.Bridge\n\tif &Bridge.edges[0] == edge {\n\t\tanother = &Bridge.edges[1]\n\t} else {\n\t\tanother = &Bridge.edges[0]\n\t}\n\treturn\n}\n\nfunc solve(stdin io.Reader, stdout io.Writer) {\n\n\tr := NewScannerEx(stdin)\n\tr.Scan(true)\n\tn, q := r.nextInt(), r.nextInt()\n\n\tnodes := make([]Node, n+1)\n\tfor i := 1; i <= n; i++ {\n\t\tnodes[i] = Node{id: i}\n\t}\n\n\tfor i := 0; i < n-1; i++ {\n\t\tr.Scan(true)\n\t\ta, b := r.nextInt(), r.nextInt()\n\t\tNewBridge(&nodes[a], &nodes[b])\n\t}\n\n\tfor i := 0; i < q; i++ {\n\t\tr.Scan(true)\n\t\tp, x := r.nextInt(), r.nextInt()\n\t\tnodes[p].add += x\n\t}\n\n\tnodePack := make([]*Node, 0, n)\n\tnodePack = append(nodePack, &nodes[1])\n\n\tfor len(nodePack) > 0 {\n\t\tcur := nodePack[len(nodePack)-1]\n\t\tnodePack = nodePack[0 : len(nodePack)-1]\n\n\t\tcur.counter += cur.add\n\t\tfor _, next := range cur.edges {\n\t\t\tnext.node.add += cur.add\n\t\t\tnodePack = append(nodePack, next.node)\n\t\t}\n\t}\n\n\tout := make([]string, 0, n)\n\tfor i := 1; i <= n; i++ {\n\t\tout = append(out, fmt.Sprint(nodes[i].counter))\n\t}\n\tfmt.Fprintln(stdout, strings.Join(out, \" \"))\n}\n", "language": "Go", "metadata": {"date": 1566263082, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02936.html", "problem_id": "p02936", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02936/input.txt", "sample_output_relpath": "derived/input_output/data/p02936/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02936/Go/s392320901.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s392320901", "user_id": "u463655976"}, "prompt_components": {"gold_output": "100 110 111 110\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\n)\n\n\nfunc main() {\n\tsolve(os.Stdin, os.Stdout)\n}\n\ntype ReaderEx struct {\n\tbaseScanner *bufio.Scanner\n\twords []string\n\tnextWordIdx func() int\n\tinitWordIdx func(int)\n}\n\nfunc NewScannerEx(stdin io.Reader) *ReaderEx {\n\tvar this ReaderEx\n\tvar idx int\n\tvar wordsCnt int\n\tthis.baseScanner = bufio.NewScanner(stdin)\n\tthis.baseScanner.Buffer(make([]byte, 0), 1E+11)\n\tthis.nextWordIdx = func() int {\n\t\tcur := idx\n\t\tidx = (idx + 1) % wordsCnt\n\t\treturn cur\n\t}\n\tthis.initWordIdx = func(wc int) {\n\t\tidx = 0\n\t\twordsCnt = wc\n\t}\n\treturn &this\n}\n\nfunc (me *ReaderEx) Scan(doSplit bool) (isScanned bool) {\n\tisScanned = me.baseScanner.Scan()\n\tif doSplit {\n\t\tme.words = strings.Fields(me.baseScanner.Text())\n\t} else {\n\t\tme.words = []string{me.baseScanner.Text()}\n\t}\n\tme.initWordIdx(len(me.words))\n\treturn\n}\n\nfunc (me *ReaderEx) nextBytes() []byte {\n\treturn []byte(me.words[me.nextWordIdx()])\n}\nfunc (me *ReaderEx) nextString() string {\n\treturn me.words[me.nextWordIdx()]\n}\n\ntype StringArray []string\n\nfunc (me *ReaderEx) nextStringArray() StringArray {\n\treturn me.words[me.nextWordIdx():]\n}\n\nfunc (me StringArray) toStrings() []string {\n\treturn me\n}\n\nfunc (me StringArray) toInts() []int {\n\tstrValues := me.toStrings()\n\tvalues := make([]int, len(strValues))\n\tfor i, v := range strValues {\n\t\tn, err := strconv.Atoi(v)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tvalues[i] = n\n\t}\n\treturn values\n}\nfunc (me *ReaderEx) nextInt() int {\n\tn, err := strconv.Atoi(me.words[me.nextWordIdx()])\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tpanic(fmt.Sprintf(\"getInt(%d)\", n))\n\t\t}\n\t}()\n\treturn n\n}\n\nfunc pow(x, y, mod int) (ans int) {\n\n\tans = 1\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(y)))); ; bit >>= 1 {\n\t\tif y&bit != 0 {\n\t\t\tans *= x\n\t\t\tif mod > 0 {\n\t\t\t\tans %= mod\n\t\t\t}\n\t\t}\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t\tans *= ans\n\t\tif mod > 0 {\n\t\t\tans %= mod\n\t\t}\n\t}\n}\n\ntype factType struct {\n\tprime int\n\tcount int\n}\n\nfunc fact(n int) (facts []*factType) {\n\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tfa := factType{prime: i}\n\t\t\tfor n%fa.prime == 0 {\n\t\t\t\tn /= fa.prime\n\t\t\t\tfa.count++\n\t\t\t}\n\t\t\tfacts = append(facts, &fa)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfacts = append(facts, &factType{prime: n, count: 1})\n\t}\n\treturn facts\n}\nfunc dec2bin(n int) (ret []bool) {\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(n)))); ; bit >>= 1 {\n\t\tret = append(ret, n&bit != 0)\n\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t}\n\n}\n\nfunc abs(v int) int {\n\tif v < 0 {\n\t\tv = -v\n\t}\n\treturn v\n}\n\nfunc b2i(b bool) (i int) {\n\tif b {\n\t\ti = 1\n\t} else {\n\t\ti = 0\n\t}\n\treturn\n}\n\n//Edge is\ntype Edge struct {\n\tnode *Node\n\tBridge *Bridge\n}\n\n//Node is\ntype Node struct {\n\tid int\n\tedges []*Edge\n\tcounter int\n\tadd int\n}\n\n//Bridge is\ntype Bridge struct {\n\tedges [2]Edge\n}\n\n//NewBridge is\nfunc NewBridge(a, b *Node) (bridge *Bridge) {\n\tbridge = &Bridge{edges: [...]Edge{{node: a, Bridge: bridge}, {node: b, Bridge: bridge}}}\n\ta.edges = append(a.edges, &bridge.edges[1])\n\t//b.edges = append(b.edges, &bridge.edges[0])\n\treturn\n}\n\n//Another is\nfunc (edge *Edge) Another() (another *Edge) {\n\tBridge := edge.Bridge\n\tif &Bridge.edges[0] == edge {\n\t\tanother = &Bridge.edges[1]\n\t} else {\n\t\tanother = &Bridge.edges[0]\n\t}\n\treturn\n}\n\nfunc solve(stdin io.Reader, stdout io.Writer) {\n\n\tr := NewScannerEx(stdin)\n\tr.Scan(true)\n\tn, q := r.nextInt(), r.nextInt()\n\n\tnodes := make([]Node, n+1)\n\tfor i := 1; i <= n; i++ {\n\t\tnodes[i] = Node{id: i}\n\t}\n\n\tfor i := 0; i < n-1; i++ {\n\t\tr.Scan(true)\n\t\ta, b := r.nextInt(), r.nextInt()\n\t\tNewBridge(&nodes[a], &nodes[b])\n\t}\n\n\tfor i := 0; i < q; i++ {\n\t\tr.Scan(true)\n\t\tp, x := r.nextInt(), r.nextInt()\n\t\tnodes[p].add += x\n\t}\n\n\tnodePack := make([]*Node, 0, n)\n\tnodePack = append(nodePack, &nodes[1])\n\n\tfor len(nodePack) > 0 {\n\t\tcur := nodePack[len(nodePack)-1]\n\t\tnodePack = nodePack[0 : len(nodePack)-1]\n\n\t\tcur.counter += cur.add\n\t\tfor _, next := range cur.edges {\n\t\t\tnext.node.add += cur.add\n\t\t\tnodePack = append(nodePack, next.node)\n\t\t}\n\t}\n\n\tout := make([]string, 0, n)\n\tfor i := 1; i <= n; i++ {\n\t\tout = append(out, fmt.Sprint(nodes[i].counter))\n\t}\n\tfmt.Fprintln(stdout, strings.Join(out, \" \"))\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "sample_input": "4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n"}, "reference_outputs": ["100 110 111 110\n"], "source_document_id": "p02936", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4114, "cpu_time_ms": 583, "memory_kb": 44544}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s830298452", "group_id": "codeNet:p02936", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar t [][]int\nvar a []int\n\nfunc dfs(v int, p int) {\n\tfor _, u := range t[v] {\n\t\tif u != p {\n\t\t\ta[u] += a[v]\n\t\t\tdfs(u, v)\n\t\t}\n\t}\n}\n\nfunc main() {\n\tvar n, q int\n\n\tfmt.Scan(&n, &q)\n\n\tt = make([][]int, n)\n\ta = make([]int, n)\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\tfor i := 0; i < n-1; i++ {\n\t\tscanner.Scan()\n\t\tinputs := strings.Split(scanner.Text(), \" \")\n\n\t\tp, _ := strconv.Atoi(inputs[0])\n\t\tc, _ := strconv.Atoi(inputs[1])\n\n\t\tp--\n\t\tc--\n\n\t\tt[p] = append(t[p], c)\n\t\tt[c] = append(t[c], p)\n\t}\n\n\tfor i := 0; i < q; i++ {\n\t\tscanner.Scan()\n\t\tinputs := strings.Split(scanner.Text(), \" \")\n\n\t\tp, _ := strconv.Atoi(inputs[0])\n\t\tx, _ := strconv.Atoi(inputs[1])\n\n\t\tp--\n\n\t\ta[p] += x\n\t}\n\n\tdfs(0, -1)\n\n\tbuffer := bufio.NewWriter(os.Stdout)\n\n\tfor _, v := range a {\n buffer.WriteString(strconv.Itoa(v))\n\t\tbuffer.WriteString(\"\\n\")\n\t}\n\n\tbuffer.Flush()\n}\n", "language": "Go", "metadata": {"date": 1566193255, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02936.html", "problem_id": "p02936", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02936/input.txt", "sample_output_relpath": "derived/input_output/data/p02936/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02936/Go/s830298452.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s830298452", "user_id": "u981932242"}, "prompt_components": {"gold_output": "100 110 111 110\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar t [][]int\nvar a []int\n\nfunc dfs(v int, p int) {\n\tfor _, u := range t[v] {\n\t\tif u != p {\n\t\t\ta[u] += a[v]\n\t\t\tdfs(u, v)\n\t\t}\n\t}\n}\n\nfunc main() {\n\tvar n, q int\n\n\tfmt.Scan(&n, &q)\n\n\tt = make([][]int, n)\n\ta = make([]int, n)\n\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\tfor i := 0; i < n-1; i++ {\n\t\tscanner.Scan()\n\t\tinputs := strings.Split(scanner.Text(), \" \")\n\n\t\tp, _ := strconv.Atoi(inputs[0])\n\t\tc, _ := strconv.Atoi(inputs[1])\n\n\t\tp--\n\t\tc--\n\n\t\tt[p] = append(t[p], c)\n\t\tt[c] = append(t[c], p)\n\t}\n\n\tfor i := 0; i < q; i++ {\n\t\tscanner.Scan()\n\t\tinputs := strings.Split(scanner.Text(), \" \")\n\n\t\tp, _ := strconv.Atoi(inputs[0])\n\t\tx, _ := strconv.Atoi(inputs[1])\n\n\t\tp--\n\n\t\ta[p] += x\n\t}\n\n\tdfs(0, -1)\n\n\tbuffer := bufio.NewWriter(os.Stdout)\n\n\tfor _, v := range a {\n buffer.WriteString(strconv.Itoa(v))\n\t\tbuffer.WriteString(\"\\n\")\n\t}\n\n\tbuffer.Flush()\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "sample_input": "4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n"}, "reference_outputs": ["100 110 111 110\n"], "source_document_id": "p02936", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 910, "cpu_time_ms": 348, "memory_kb": 54272}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s466196998", "group_id": "codeNet:p02936", "input_text": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n)\n\nfunc main() {\n scanner := bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n\n scanner.Scan()\n N, _ := strconv.Atoi(scanner.Text())\n scanner.Scan()\n Q, _ := strconv.Atoi(scanner.Text())\n\n edges := make([][]int, N+1)\n for i := 0; i < len(edges); i++ {\n edges[i] = make([]int, 0)\n }\n for i := 1; i <= N-1; i++ {\n scanner.Scan()\n a, _ := strconv.Atoi(scanner.Text())\n scanner.Scan()\n b, _ := strconv.Atoi(scanner.Text())\n edges[a] = append(edges[a], b)\n }\n\n counts := make([]int, N+1)\n for j := 1; j <= Q; j++ {\n scanner.Scan()\n p, _ := strconv.Atoi(scanner.Text())\n scanner.Scan()\n x, _ := strconv.Atoi(scanner.Text())\n counts[p] += x\n }\n\n for i := 1; i <= N; i++ {\n if counts[i] == 0 {\n continue\n }\n edges := edges[i]\n for k := 0; k < len(edges); k++ {\n counts[edges[k]] += counts[i]\n }\n }\n\n w := bufio.NewWriter(os.Stdout)\n for i := 1; i <= N-1; i++ {\n w.WriteString(strconv.Itoa(counts[i]) + \" \")\n }\n w.WriteString(strconv.Itoa(counts[N]) + \"\\n\")\n w.Flush()\n}\n", "language": "Go", "metadata": {"date": 1566181741, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02936.html", "problem_id": "p02936", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02936/input.txt", "sample_output_relpath": "derived/input_output/data/p02936/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02936/Go/s466196998.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s466196998", "user_id": "u882460931"}, "prompt_components": {"gold_output": "100 110 111 110\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n)\n\nfunc main() {\n scanner := bufio.NewScanner(os.Stdin)\n scanner.Split(bufio.ScanWords)\n\n scanner.Scan()\n N, _ := strconv.Atoi(scanner.Text())\n scanner.Scan()\n Q, _ := strconv.Atoi(scanner.Text())\n\n edges := make([][]int, N+1)\n for i := 0; i < len(edges); i++ {\n edges[i] = make([]int, 0)\n }\n for i := 1; i <= N-1; i++ {\n scanner.Scan()\n a, _ := strconv.Atoi(scanner.Text())\n scanner.Scan()\n b, _ := strconv.Atoi(scanner.Text())\n edges[a] = append(edges[a], b)\n }\n\n counts := make([]int, N+1)\n for j := 1; j <= Q; j++ {\n scanner.Scan()\n p, _ := strconv.Atoi(scanner.Text())\n scanner.Scan()\n x, _ := strconv.Atoi(scanner.Text())\n counts[p] += x\n }\n\n for i := 1; i <= N; i++ {\n if counts[i] == 0 {\n continue\n }\n edges := edges[i]\n for k := 0; k < len(edges); k++ {\n counts[edges[k]] += counts[i]\n }\n }\n\n w := bufio.NewWriter(os.Stdout)\n for i := 1; i <= N-1; i++ {\n w.WriteString(strconv.Itoa(counts[i]) + \" \")\n }\n w.WriteString(strconv.Itoa(counts[N]) + \"\\n\")\n w.Flush()\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "sample_input": "4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n"}, "reference_outputs": ["100 110 111 110\n"], "source_document_id": "p02936", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1490, "cpu_time_ms": 225, "memory_kb": 17536}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s151907796", "group_id": "codeNet:p02936", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar m = map[int][]int{}\nvar tree = map[int]int{}\n\nfunc recursive(p int, x int) {\n\ttree[p] += x\n\tfor i := 0; i < len(m[p]); i++ {\n\t\trecursive(m[p][i], x)\n\t}\n\treturn\n}\n\nfunc main() {\n\tvar n, q int\n\tfmt.Scan(&n)\n\tfmt.Scan(&q)\n\ta := make([]int, n-1)\n\tb := make([]int, n-1)\n\t// m := map[int]string{}\n\tm = map[int][]int{}\n\ttree = map[int]int{}\n\tfor i := 0; i < n-1; i++ {\n\t\tfmt.Scan(&a[i])\n\t\tfmt.Scan(&b[i])\n\t\tm[a[i]] = append(m[a[i]], b[i])\n\t\ttree[a[i]] = 0\n\t}\n\tfor i := 0; i < q; i++ {\n\t\tvar p, x int\n\t\tfmt.Scan(&p)\n\t\tfmt.Scan(&x)\n\t\trecursive(p, x)\n\t}\n\tfor i := 1; i < n; i++ {\n\t\tfmt.Printf(\"%d \", tree[i])\n\t}\n\tfmt.Println(tree[n])\n}\n", "language": "Go", "metadata": {"date": 1566181350, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02936.html", "problem_id": "p02936", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02936/input.txt", "sample_output_relpath": "derived/input_output/data/p02936/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02936/Go/s151907796.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s151907796", "user_id": "u895838522"}, "prompt_components": {"gold_output": "100 110 111 110\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar m = map[int][]int{}\nvar tree = map[int]int{}\n\nfunc recursive(p int, x int) {\n\ttree[p] += x\n\tfor i := 0; i < len(m[p]); i++ {\n\t\trecursive(m[p][i], x)\n\t}\n\treturn\n}\n\nfunc main() {\n\tvar n, q int\n\tfmt.Scan(&n)\n\tfmt.Scan(&q)\n\ta := make([]int, n-1)\n\tb := make([]int, n-1)\n\t// m := map[int]string{}\n\tm = map[int][]int{}\n\ttree = map[int]int{}\n\tfor i := 0; i < n-1; i++ {\n\t\tfmt.Scan(&a[i])\n\t\tfmt.Scan(&b[i])\n\t\tm[a[i]] = append(m[a[i]], b[i])\n\t\ttree[a[i]] = 0\n\t}\n\tfor i := 0; i < q; i++ {\n\t\tvar p, x int\n\t\tfmt.Scan(&p)\n\t\tfmt.Scan(&x)\n\t\trecursive(p, x)\n\t}\n\tfor i := 1; i < n; i++ {\n\t\tfmt.Printf(\"%d \", tree[i])\n\t}\n\tfmt.Println(tree[n])\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "sample_input": "4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n"}, "reference_outputs": ["100 110 111 110\n"], "source_document_id": "p02936", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2109, "memory_kb": 40192}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s288420991", "group_id": "codeNet:p02936", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar n, q int\nvar ps [][]int\nvar xm []int\nvar pt []int\nvar ptd []bool\n\nfunc main() {\n\n\tfmt.Scan(&n, &q)\n\tps = make([][]int, n)\n\n\tvar sc = bufio.NewScanner(os.Stdin)\n\n\tfor i := 0; i < n-1; i++ {\n\t\tsc.Scan()\n\t\ts := strings.Split(sc.Text(), \" \")\n\t\ta, _ := strconv.Atoi(s[0])\n\t\tb, _ := strconv.Atoi(s[1])\n\t\ta--\n\t\tb--\n\t\tps[a] = append(ps[a], b)\n\t\tps[b] = append(ps[b], a)\n\t}\n\n\txm = make([]int, n)\n\tfor i := 0; i < q; i++ {\n\t\tsc.Scan()\n\t\ts := strings.Split(sc.Text(), \" \")\n\t\tp, _ := strconv.Atoi(s[0])\n\t\tx, _ := strconv.Atoi(s[1])\n\t\tp--\n\t\txm[p] += x\n\t}\n\n\tpt = make([]int, n)\n\tptd = make([]bool, n)\n\tnext(0, 0)\n\n\tfor i := range pt {\n\t\tif i == n-1 {\n\t\t\tfmt.Println(pt[i])\n\t\t} else {\n\t\t\tfmt.Printf(\"%d \", pt[i])\n\t\t}\n\t}\n}\n\nfunc next(p, cp int) {\n\tcp += xm[p]\n\tpt[p] = cp\n\tptd[p] = true\n\tfor _, v := range ps[p] {\n\t\tif ptd[v] {\n\t\t\tcontinue\n\t\t}\n\t\tptd[v] = true\n\t\tnext(v, cp)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1566181205, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02936.html", "problem_id": "p02936", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02936/input.txt", "sample_output_relpath": "derived/input_output/data/p02936/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02936/Go/s288420991.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s288420991", "user_id": "u282164747"}, "prompt_components": {"gold_output": "100 110 111 110\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar n, q int\nvar ps [][]int\nvar xm []int\nvar pt []int\nvar ptd []bool\n\nfunc main() {\n\n\tfmt.Scan(&n, &q)\n\tps = make([][]int, n)\n\n\tvar sc = bufio.NewScanner(os.Stdin)\n\n\tfor i := 0; i < n-1; i++ {\n\t\tsc.Scan()\n\t\ts := strings.Split(sc.Text(), \" \")\n\t\ta, _ := strconv.Atoi(s[0])\n\t\tb, _ := strconv.Atoi(s[1])\n\t\ta--\n\t\tb--\n\t\tps[a] = append(ps[a], b)\n\t\tps[b] = append(ps[b], a)\n\t}\n\n\txm = make([]int, n)\n\tfor i := 0; i < q; i++ {\n\t\tsc.Scan()\n\t\ts := strings.Split(sc.Text(), \" \")\n\t\tp, _ := strconv.Atoi(s[0])\n\t\tx, _ := strconv.Atoi(s[1])\n\t\tp--\n\t\txm[p] += x\n\t}\n\n\tpt = make([]int, n)\n\tptd = make([]bool, n)\n\tnext(0, 0)\n\n\tfor i := range pt {\n\t\tif i == n-1 {\n\t\t\tfmt.Println(pt[i])\n\t\t} else {\n\t\t\tfmt.Printf(\"%d \", pt[i])\n\t\t}\n\t}\n}\n\nfunc next(p, cp int) {\n\tcp += xm[p]\n\tpt[p] = cp\n\tptd[p] = true\n\tfor _, v := range ps[p] {\n\t\tif ptd[v] {\n\t\t\tcontinue\n\t\t}\n\t\tptd[v] = true\n\t\tnext(v, cp)\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "sample_input": "4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n"}, "reference_outputs": ["100 110 111 110\n"], "source_document_id": "p02936", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 937, "cpu_time_ms": 736, "memory_kb": 52736}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s465781434", "group_id": "codeNet:p02936", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar n, q int\nvar ps [][]int\nvar xm []int\nvar par []int\nvar pt []int\nvar ptd []bool\nvar pls []int\n\nfunc main() {\n\n\tfmt.Scan(&n, &q)\n\tps = make([][]int, n)\n\n\tvar sc = bufio.NewScanner(os.Stdin)\n\n\tfor i := 0; i < n-1; i++ {\n\t\tsc.Scan()\n\t\ts := strings.Split(sc.Text(), \" \")\n\t\ta, _ := strconv.Atoi(s[0])\n\t\tb, _ := strconv.Atoi(s[1])\n\t\ta--\n\t\tb--\n\t\tps[a] = append(ps[a], b)\n\t\tps[b] = append(ps[b], a)\n\t}\n\n\txm = make([]int, n)\n\tfor i := 0; i < q; i++ {\n\t\tsc.Scan()\n\t\ts := strings.Split(sc.Text(), \" \")\n\t\tp, _ := strconv.Atoi(s[0])\n\t\tx, _ := strconv.Atoi(s[1])\n\t\tp--\n\t\txm[p] += x\n\t}\n\n\tpar = make([]int, n)\n\tfor i := range par {\n\t\tpar[i] = -2\n\t}\n\tpar[0] = -1\n\tnext(0)\n\n\tpt = make([]int, n)\n\tptd = make([]bool, n)\n\tfor i := n - 1; i >= 0; i-- {\n\t\tif ptd[i] {\n\t\t\tcontinue\n\t\t}\n\t\tpls = make([]int, 0)\n\t\tpoint(i)\n\t}\n\n\tfor i := range pt {\n\t\tif i == n-1 {\n\t\t\tfmt.Println(pt[i])\n\t\t} else {\n\t\t\tfmt.Printf(\"%d \", pt[i])\n\t\t}\n\t}\n}\n\nfunc point(p int) {\n\tpls = append(pls, p)\n\tif xm[p] > 0 {\n\t\tfor _, v := range pls {\n\t\t\tpt[v] += xm[p]\n\t\t}\n\t}\n\tprt := par[p]\n\tif prt == -1 {\n\t\tfor _, v := range pls {\n\t\t\tptd[v] = true\n\t\t}\n\t\treturn\n\t}\n\tif ptd[prt] {\n\t\tfor _, v := range pls {\n\t\t\tpt[v] += pt[prt]\n\t\t\tptd[v] = true\n\t\t}\n\t\treturn\n\t}\n\tpoint(prt)\n}\n\nfunc next(p int) {\n\tfor _, v := range ps[p] {\n\t\tif par[v] != -2 {\n\t\t\tcontinue\n\t\t}\n\t\tpar[v] = p\n\t\tnext(v)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1566180731, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02936.html", "problem_id": "p02936", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02936/input.txt", "sample_output_relpath": "derived/input_output/data/p02936/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02936/Go/s465781434.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s465781434", "user_id": "u282164747"}, "prompt_components": {"gold_output": "100 110 111 110\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar n, q int\nvar ps [][]int\nvar xm []int\nvar par []int\nvar pt []int\nvar ptd []bool\nvar pls []int\n\nfunc main() {\n\n\tfmt.Scan(&n, &q)\n\tps = make([][]int, n)\n\n\tvar sc = bufio.NewScanner(os.Stdin)\n\n\tfor i := 0; i < n-1; i++ {\n\t\tsc.Scan()\n\t\ts := strings.Split(sc.Text(), \" \")\n\t\ta, _ := strconv.Atoi(s[0])\n\t\tb, _ := strconv.Atoi(s[1])\n\t\ta--\n\t\tb--\n\t\tps[a] = append(ps[a], b)\n\t\tps[b] = append(ps[b], a)\n\t}\n\n\txm = make([]int, n)\n\tfor i := 0; i < q; i++ {\n\t\tsc.Scan()\n\t\ts := strings.Split(sc.Text(), \" \")\n\t\tp, _ := strconv.Atoi(s[0])\n\t\tx, _ := strconv.Atoi(s[1])\n\t\tp--\n\t\txm[p] += x\n\t}\n\n\tpar = make([]int, n)\n\tfor i := range par {\n\t\tpar[i] = -2\n\t}\n\tpar[0] = -1\n\tnext(0)\n\n\tpt = make([]int, n)\n\tptd = make([]bool, n)\n\tfor i := n - 1; i >= 0; i-- {\n\t\tif ptd[i] {\n\t\t\tcontinue\n\t\t}\n\t\tpls = make([]int, 0)\n\t\tpoint(i)\n\t}\n\n\tfor i := range pt {\n\t\tif i == n-1 {\n\t\t\tfmt.Println(pt[i])\n\t\t} else {\n\t\t\tfmt.Printf(\"%d \", pt[i])\n\t\t}\n\t}\n}\n\nfunc point(p int) {\n\tpls = append(pls, p)\n\tif xm[p] > 0 {\n\t\tfor _, v := range pls {\n\t\t\tpt[v] += xm[p]\n\t\t}\n\t}\n\tprt := par[p]\n\tif prt == -1 {\n\t\tfor _, v := range pls {\n\t\t\tptd[v] = true\n\t\t}\n\t\treturn\n\t}\n\tif ptd[prt] {\n\t\tfor _, v := range pls {\n\t\t\tpt[v] += pt[prt]\n\t\t\tptd[v] = true\n\t\t}\n\t\treturn\n\t}\n\tpoint(prt)\n}\n\nfunc next(p int) {\n\tfor _, v := range ps[p] {\n\t\tif par[v] != -2 {\n\t\t\tcontinue\n\t\t}\n\t\tpar[v] = p\n\t\tnext(v)\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "sample_input": "4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n"}, "reference_outputs": ["100 110 111 110\n"], "source_document_id": "p02936", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1398, "cpu_time_ms": 2109, "memory_kb": 71936}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s017769901", "group_id": "codeNet:p02936", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\n\tsc.Scan()\n\telems := strings.Split(sc.Text(), \" \")\n\tN, _ := strconv.Atoi(elems[0])\n\tQ, _ := strconv.Atoi(elems[1])\n\n\ttree := make([][]int, N)\n\tfor i := 0; i < N; i++ {\n\t\ttree[i] = []int{}\n\t}\n\tsousa := make([]int, N)\n\n\tfor i := 0; i < N-1; i++ {\n\t\tsc.Scan()\n\t\ttext := sc.Text()\n\t\telems := strings.Split(text, \" \")\n\t\ta, _ := strconv.Atoi(elems[0])\n\t\tb, _ := strconv.Atoi(elems[1])\n\t\ta--\n\t\tb--\n\t\ttree[a] = append(tree[a], b)\n\t\ttree[b] = append(tree[b], a)\n\t}\n\n\tfor i := 0; i < Q; i++ {\n\t\tsc.Scan()\n\t\ttext := sc.Text()\n\t\telems := strings.Split(text, \" \")\n\t\tp, _ := strconv.Atoi(elems[0])\n\t\tx, _ := strconv.Atoi(elems[1])\n\t\tp--\n\t\tsousa[p] += x\n\t}\n\n\tcounter := make([]int, N)\n\n\trec(0, -1, 0, counter, sousa, tree)\n\n\tfmt.Print(counter[0])\n\tfor i := 1; i < N; i++ {\n\t\tfmt.Printf(\" %d\", counter[i])\n\t}\n\tfmt.Println(\"\")\n}\n\nfunc rec(pos, parent, count int, counter, sousa []int, tree [][]int) {\n\tcounter[pos] += sousa[pos] + count\n\tchildren := tree[pos]\n\tfor _, child := range children {\n\t\tif child == parent {\n\t\t\tcontinue\n\t\t}\n\t\trec(child, pos, sousa[pos]+count, counter, sousa, tree)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1566180003, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02936.html", "problem_id": "p02936", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02936/input.txt", "sample_output_relpath": "derived/input_output/data/p02936/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02936/Go/s017769901.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s017769901", "user_id": "u328099989"}, "prompt_components": {"gold_output": "100 110 111 110\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\n\tsc.Scan()\n\telems := strings.Split(sc.Text(), \" \")\n\tN, _ := strconv.Atoi(elems[0])\n\tQ, _ := strconv.Atoi(elems[1])\n\n\ttree := make([][]int, N)\n\tfor i := 0; i < N; i++ {\n\t\ttree[i] = []int{}\n\t}\n\tsousa := make([]int, N)\n\n\tfor i := 0; i < N-1; i++ {\n\t\tsc.Scan()\n\t\ttext := sc.Text()\n\t\telems := strings.Split(text, \" \")\n\t\ta, _ := strconv.Atoi(elems[0])\n\t\tb, _ := strconv.Atoi(elems[1])\n\t\ta--\n\t\tb--\n\t\ttree[a] = append(tree[a], b)\n\t\ttree[b] = append(tree[b], a)\n\t}\n\n\tfor i := 0; i < Q; i++ {\n\t\tsc.Scan()\n\t\ttext := sc.Text()\n\t\telems := strings.Split(text, \" \")\n\t\tp, _ := strconv.Atoi(elems[0])\n\t\tx, _ := strconv.Atoi(elems[1])\n\t\tp--\n\t\tsousa[p] += x\n\t}\n\n\tcounter := make([]int, N)\n\n\trec(0, -1, 0, counter, sousa, tree)\n\n\tfmt.Print(counter[0])\n\tfor i := 1; i < N; i++ {\n\t\tfmt.Printf(\" %d\", counter[i])\n\t}\n\tfmt.Println(\"\")\n}\n\nfunc rec(pos, parent, count int, counter, sousa []int, tree [][]int) {\n\tcounter[pos] += sousa[pos] + count\n\tchildren := tree[pos]\n\tfor _, child := range children {\n\t\tif child == parent {\n\t\t\tcontinue\n\t\t}\n\t\trec(child, pos, sousa[pos]+count, counter, sousa, tree)\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "sample_input": "4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n"}, "reference_outputs": ["100 110 111 110\n"], "source_document_id": "p02936", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1198, "cpu_time_ms": 986, "memory_kb": 123008}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s065499334", "group_id": "codeNet:p02936", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar q int\n\tfmt.Scan(&q)\n\tg := make([][]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tg[i] = make([]int, 0)\n\t}\n\n\tfor i := 0; i+1 < n; i++ {\n\t\tvar a, b int\n\t\tfmt.Scan(&a, &b)\n\t\ta--\n\t\tb--\n\t\tg[a] = append(g[a], b)\n\t\tg[b] = append(g[b], a)\n\t}\n\n\tvalue := make([]int, n)\n\tfor i := 0; i < q; i++ {\n\t\tvar p, x int\n\t\tfmt.Scan(&p, &x)\n\t\tp--\n\t\tvalue[p] += x\n\t}\n\n\tused := make([]bool, n)\n\tqueue := make(chan int, n+10)\n\n\tqueue <- 0\n\tused[0] = true\n\n\tfor i := 0; i < n; i++ {\n\t\tcur := <-queue\n\t\tfor _, u := range g[cur] {\n\t\t\tif used[u] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tused[u] = true\n\t\t\tvalue[u] += value[cur]\n\t\t\tqueue <- u\n\t\t}\n\t}\n\tfor _, x := range value {\n\t\tfmt.Println(x)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1566178787, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02936.html", "problem_id": "p02936", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02936/input.txt", "sample_output_relpath": "derived/input_output/data/p02936/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02936/Go/s065499334.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s065499334", "user_id": "u181736559"}, "prompt_components": {"gold_output": "100 110 111 110\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar q int\n\tfmt.Scan(&q)\n\tg := make([][]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tg[i] = make([]int, 0)\n\t}\n\n\tfor i := 0; i+1 < n; i++ {\n\t\tvar a, b int\n\t\tfmt.Scan(&a, &b)\n\t\ta--\n\t\tb--\n\t\tg[a] = append(g[a], b)\n\t\tg[b] = append(g[b], a)\n\t}\n\n\tvalue := make([]int, n)\n\tfor i := 0; i < q; i++ {\n\t\tvar p, x int\n\t\tfmt.Scan(&p, &x)\n\t\tp--\n\t\tvalue[p] += x\n\t}\n\n\tused := make([]bool, n)\n\tqueue := make(chan int, n+10)\n\n\tqueue <- 0\n\tused[0] = true\n\n\tfor i := 0; i < n; i++ {\n\t\tcur := <-queue\n\t\tfor _, u := range g[cur] {\n\t\t\tif used[u] {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tused[u] = true\n\t\t\tvalue[u] += value[cur]\n\t\t\tqueue <- u\n\t\t}\n\t}\n\tfor _, x := range value {\n\t\tfmt.Println(x)\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "sample_input": "4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n"}, "reference_outputs": ["100 110 111 110\n"], "source_document_id": "p02936", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a rooted tree with N vertices numbered 1 to N.\nThe root is Vertex 1, and the i-th edge (1 \\leq i \\leq N - 1) connects Vertex a_i and b_i.\n\nEach of the vertices has a counter installed. Initially, the counters on all the vertices have the value 0.\n\nNow, the following Q operations will be performed:\n\nOperation j (1 \\leq j \\leq Q): Increment by x_j the counter on every vertex contained in the subtree rooted at Vertex p_j.\n\nFind the value of the counter on each vertex after all operations.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n1 \\leq a_i < b_i \\leq N\n\n1 \\leq p_j \\leq N\n\n1 \\leq x_j \\leq 10^4\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\na_1 b_1\n:\na_{N-1} b_{N-1}\np_1 x_1\n:\np_Q x_Q\n\nOutput\n\nPrint the values of the counters on Vertex 1, 2, \\ldots, N after all operations, in this order, with spaces in between.\n\nSample Input 1\n\n4 3\n1 2\n2 3\n2 4\n2 10\n1 100\n3 1\n\nSample Output 1\n\n100 110 111 110\n\nThe tree in this input is as follows:\n\nEach operation changes the values of the counters on the vertices as follows:\n\nOperation 1: Increment by 10 the counter on every vertex contained in the subtree rooted at Vertex 2, that is, Vertex 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 0, 10, 10, 10, respectively.\n\nOperation 2: Increment by 100 the counter on every vertex contained in the subtree rooted at Vertex 1, that is, Vertex 1, 2, 3, 4. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 110, 110, respectively.\n\nOperation 3: Increment by 1 the counter on every vertex contained in the subtree rooted at Vertex 3, that is, Vertex 3. The values of the counters on Vertex 1, 2, 3, 4 are now 100, 110, 111, 110, respectively.\n\nSample Input 2\n\n6 2\n1 2\n1 3\n2 4\n3 6\n2 5\n1 10\n1 10\n\nSample Output 2\n\n20 20 20 20 20 20", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 719, "cpu_time_ms": 2108, "memory_kb": 22276}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s811384472", "group_id": "codeNet:p02949", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc init() {\n\t// read one word/char/int separated by space(s).\n\tsc.Split(bufio.ScanWords)\n\n\t// read one line.\n\t// sc.Split(bufio.ScanLines)\n}\n\ntype edge struct {\n\tfrom int\n\tto int\n\tcost int\n}\n\ntype nodes map[int]interface{}\n\nfunc solve(edges *[]*edge, start, goal, num int) (int, bool) {\n\tns := nodes{}\n\tns[start] = 0\n\tupdated := true\n\tcount := 0\n\tprev := 0\n\tfor updated {\n\t\tupdated = false\n\t\tcount ++\n\t\tfor _, e := range *edges {\n\t\t\tif ns[e.from] == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif ns[e.to] == nil {\n\t\t\t\tns[e.to] = ns[e.from].(int) + e.cost\n\t\t\t\tupdated = true\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\tif ns[e.from].(int) + e.cost > ns[e.to].(int) {\n\t\t\t\t\tns[e.to] = ns[e.from].(int) + e.cost\n\t\t\t\t\tupdated = true\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif count >= num && ns[goal] == prev {\n\t\t\treturn prev, true\n\t\t}\n\t\tif count >= num && ns[goal] != prev {\n\t\t\treturn -1, false\n\t\t}\n\t\tif _, ok := ns[goal].(int); !ok {\n\t\t\tcontinue\n\t\t}\n\t\tprev = ns[goal].(int)\n\t}\n\treturn ns[goal].(int), true\n}\n\nfunc main() {\n\tN := nextInt()\n\tM := nextInt()\n\tP := nextInt()\n\tedges := make([]*edge, M)\n\tfor i := 0; i < M; i++ {\n\t\te := edge{}\n\t\te.from = nextInt()\n\t\te.to = nextInt()\n\t\te.cost = nextInt() - P\n\t\tedges[i] = &e\n\t}\n\tans, ok := solve(&edges, 1, N, N)\n\tif !ok {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tif ans < 0 {\n\t\tans = 0\n\t}\n\tfmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1566022890, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02949.html", "problem_id": "p02949", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02949/input.txt", "sample_output_relpath": "derived/input_output/data/p02949/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02949/Go/s811384472.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s811384472", "user_id": "u686302771"}, "prompt_components": {"gold_output": "35\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc init() {\n\t// read one word/char/int separated by space(s).\n\tsc.Split(bufio.ScanWords)\n\n\t// read one line.\n\t// sc.Split(bufio.ScanLines)\n}\n\ntype edge struct {\n\tfrom int\n\tto int\n\tcost int\n}\n\ntype nodes map[int]interface{}\n\nfunc solve(edges *[]*edge, start, goal, num int) (int, bool) {\n\tns := nodes{}\n\tns[start] = 0\n\tupdated := true\n\tcount := 0\n\tprev := 0\n\tfor updated {\n\t\tupdated = false\n\t\tcount ++\n\t\tfor _, e := range *edges {\n\t\t\tif ns[e.from] == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif ns[e.to] == nil {\n\t\t\t\tns[e.to] = ns[e.from].(int) + e.cost\n\t\t\t\tupdated = true\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\tif ns[e.from].(int) + e.cost > ns[e.to].(int) {\n\t\t\t\t\tns[e.to] = ns[e.from].(int) + e.cost\n\t\t\t\t\tupdated = true\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif count >= num && ns[goal] == prev {\n\t\t\treturn prev, true\n\t\t}\n\t\tif count >= num && ns[goal] != prev {\n\t\t\treturn -1, false\n\t\t}\n\t\tif _, ok := ns[goal].(int); !ok {\n\t\t\tcontinue\n\t\t}\n\t\tprev = ns[goal].(int)\n\t}\n\treturn ns[goal].(int), true\n}\n\nfunc main() {\n\tN := nextInt()\n\tM := nextInt()\n\tP := nextInt()\n\tedges := make([]*edge, M)\n\tfor i := 0; i < M; i++ {\n\t\te := edge{}\n\t\te.from = nextInt()\n\t\te.to = nextInt()\n\t\te.cost = nextInt() - P\n\t\tedges[i] = &e\n\t}\n\tans, ok := solve(&edges, 1, N, N)\n\tif !ok {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tif ans < 0 {\n\t\tans = 0\n\t}\n\tfmt.Println(ans)\n}", "problem_context": "Score : 500 points\n\nProblem Statement\n\nThere is a directed graph with N vertices numbered 1 to N and M edges.\nThe i-th edge is directed from Vertex A_i to Vertex B_i, and there are C_i coins \bplaced along that edge.\nAdditionally, there is a button on Vertex N.\n\nWe will play a game on this graph.\nYou start the game on Vertex 1 with zero coins, and head for Vertex N by traversing the edges while collecting coins.\nIt takes one minute to traverse an edge, and you can collect the coins placed along the edge each time you traverse it.\nAs usual in games, even if you traverse an edge once and collect the coins, the same number of coins will reappear next time you traverse that edge, which you can collect again.\n\nWhen you reach Vertex N, you can end the game by pressing the button. (You can also choose to leave Vertex N without pressing the button and continue traveling.)\nHowever, when you end the game, you will be asked to pay T \\times P coins, where T is the number of minutes elapsed since the start of the game. If you have less than T \\times P coins, you will have to pay all of your coins instead.\n\nYour score will be the number of coins you have after this payment.\nDetermine if there exists a maximum value of the score that can be obtained. If the answer is yes, find that maximum value.\n\nConstraints\n\n2 \\leq N \\leq 2500\n\n1 \\leq M \\leq 5000\n\n1 \\leq A_i, B_i \\leq N\n\n1 \\leq C_i \\leq 10^5\n\n0 \\leq P \\leq 10^5\n\nAll values in input are integers.\n\nVertex N can be reached from Vertex 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M P\nA_1 B_1 C_1\n:\nA_M B_M C_M\n\nOutput\n\nIf there exists a maximum value of the score that can be obtained, print that maximum value; otherwise, print -1.\n\nSample Input 1\n\n3 3 10\n1 2 20\n2 3 30\n1 3 45\n\nSample Output 1\n\n35\n\nThere are two ways to travel from Vertex 1 to Vertex 3:\n\nVertex 1 \\rightarrow 2 \\rightarrow 3: You collect 20 + 30 = 50 coins on the way. After two minutes from the start of the game, you press the button, pay 2 \\times 10 = 20 coins, and you have 50 - 20 = 30 coins left.\n\nVertex 1 \\rightarrow 2: You collect 45 coins on the way. After one minute from the start of the game, you press the button, pay 1 \\times 10 = 10 coins, and you have 45 - 10 = 35 coins left.\n\nThus, the maximum score that can be obtained is 35.\n\nSample Input 2\n\n2 2 10\n1 2 100\n2 2 100\n\nSample Output 2\n\n-1\n\nThe edge extending from Vertex 1 takes you to Vertex 2. If you then traverse the edge extending from Vertex 2 to itself t times and press the button, your score will be 90 + 90t. Thus, you can infinitely increase your score, which means there is no maximum value of the score that can be obtained.\n\nSample Input 3\n\n4 5 10\n1 2 1\n1 4 1\n3 4 1\n2 2 100\n3 3 100\n\nSample Output 3\n\n0\n\nThere is no way to travel from Vertex 1 to Vertex 4 other than traversing the edge leading from Vertex 1 to Vertex 4 directly. You will pick up one coin along this edge, but after being asked to paying 10 coins, your score will be 0.\n\nNote that you can collect an infinite number of coins if you traverse the edge leading from Vertex 1 to Vertex 2, but this is pointless since you can no longer reach Vertex 4 and end the game.", "sample_input": "3 3 10\n1 2 20\n2 3 30\n1 3 45\n"}, "reference_outputs": ["35\n"], "source_document_id": "p02949", "source_text": "Score : 500 points\n\nProblem Statement\n\nThere is a directed graph with N vertices numbered 1 to N and M edges.\nThe i-th edge is directed from Vertex A_i to Vertex B_i, and there are C_i coins \bplaced along that edge.\nAdditionally, there is a button on Vertex N.\n\nWe will play a game on this graph.\nYou start the game on Vertex 1 with zero coins, and head for Vertex N by traversing the edges while collecting coins.\nIt takes one minute to traverse an edge, and you can collect the coins placed along the edge each time you traverse it.\nAs usual in games, even if you traverse an edge once and collect the coins, the same number of coins will reappear next time you traverse that edge, which you can collect again.\n\nWhen you reach Vertex N, you can end the game by pressing the button. (You can also choose to leave Vertex N without pressing the button and continue traveling.)\nHowever, when you end the game, you will be asked to pay T \\times P coins, where T is the number of minutes elapsed since the start of the game. If you have less than T \\times P coins, you will have to pay all of your coins instead.\n\nYour score will be the number of coins you have after this payment.\nDetermine if there exists a maximum value of the score that can be obtained. If the answer is yes, find that maximum value.\n\nConstraints\n\n2 \\leq N \\leq 2500\n\n1 \\leq M \\leq 5000\n\n1 \\leq A_i, B_i \\leq N\n\n1 \\leq C_i \\leq 10^5\n\n0 \\leq P \\leq 10^5\n\nAll values in input are integers.\n\nVertex N can be reached from Vertex 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M P\nA_1 B_1 C_1\n:\nA_M B_M C_M\n\nOutput\n\nIf there exists a maximum value of the score that can be obtained, print that maximum value; otherwise, print -1.\n\nSample Input 1\n\n3 3 10\n1 2 20\n2 3 30\n1 3 45\n\nSample Output 1\n\n35\n\nThere are two ways to travel from Vertex 1 to Vertex 3:\n\nVertex 1 \\rightarrow 2 \\rightarrow 3: You collect 20 + 30 = 50 coins on the way. After two minutes from the start of the game, you press the button, pay 2 \\times 10 = 20 coins, and you have 50 - 20 = 30 coins left.\n\nVertex 1 \\rightarrow 2: You collect 45 coins on the way. After one minute from the start of the game, you press the button, pay 1 \\times 10 = 10 coins, and you have 45 - 10 = 35 coins left.\n\nThus, the maximum score that can be obtained is 35.\n\nSample Input 2\n\n2 2 10\n1 2 100\n2 2 100\n\nSample Output 2\n\n-1\n\nThe edge extending from Vertex 1 takes you to Vertex 2. If you then traverse the edge extending from Vertex 2 to itself t times and press the button, your score will be 90 + 90t. Thus, you can infinitely increase your score, which means there is no maximum value of the score that can be obtained.\n\nSample Input 3\n\n4 5 10\n1 2 1\n1 4 1\n3 4 1\n2 2 100\n3 3 100\n\nSample Output 3\n\n0\n\nThere is no way to travel from Vertex 1 to Vertex 4 other than traversing the edge leading from Vertex 1 to Vertex 4 directly. You will pick up one coin along this edge, but after being asked to paying 10 coins, your score will be 0.\n\nNote that you can collect an infinite number of coins if you traverse the edge leading from Vertex 1 to Vertex 2, but this is pointless since you can no longer reach Vertex 4 and end the game.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1568, "cpu_time_ms": 2104, "memory_kb": 7552}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s792067438", "group_id": "codeNet:p02949", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc init() {\n\t// read one word/char/int separated by space(s).\n\tsc.Split(bufio.ScanWords)\n\n\t// read one line.\n\t// sc.Split(bufio.ScanLines)\n}\n\ntype edge struct {\n\tfrom int\n\tto int\n\tcost int\n}\n\ntype nodes map[int]interface{}\n\nfunc solve(edges []edge, start, goal, num int) (int, bool) {\n\tns := nodes{}\n\tns[start] = 0\n\tupdated := true\n\tcount := 0\n\tprev := 0\n\tfor updated {\n\t\tupdated = false\n\t\tcount ++\n\t\tfor _, e := range edges {\n\t\t\tif ns[e.from] == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif ns[e.to] == nil {\n\t\t\t\tif _, ok := ns[e.from].(int); !ok {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tns[e.to] = ns[e.from].(int) + e.cost\n\t\t\t\tupdated = true\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\tif ns[e.from].(int) + e.cost > ns[e.to].(int) {\n\t\t\t\t\tns[e.to] = ns[e.from].(int) + e.cost\n\t\t\t\t\tupdated = true\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif count > num && ns[goal] == prev {\n\t\t\treturn prev, true\n\t\t}\n\t\tif count > num && ns[goal] != prev {\n\t\t\treturn -1, false\n\t\t}\n\t\tprev = ns[goal].(int)\n\t}\n\treturn ns[goal].(int), true\n}\n\nfunc main() {\n\tN := nextInt()\n\tM := nextInt()\n\tP := nextInt()\n\tedges := make([]edge, 0, M)\n\tfor i := 0; i < M; i++ {\n\t\tfrom := nextInt()\n\t\tto := nextInt()\n\t\tcost := nextInt()\n\t\tedges = append(edges, edge{\n\t\t\tfrom,\n\t\t\tto,\n\t\t\tcost-P,\n\t\t})\n\t}\n\tans, ok := solve(edges, 1, N, N)\n\tif !ok {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tif ans < 0 {\n\t\tans = 0\n\t}\n\tfmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1566016889, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02949.html", "problem_id": "p02949", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02949/input.txt", "sample_output_relpath": "derived/input_output/data/p02949/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02949/Go/s792067438.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s792067438", "user_id": "u686302771"}, "prompt_components": {"gold_output": "35\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc init() {\n\t// read one word/char/int separated by space(s).\n\tsc.Split(bufio.ScanWords)\n\n\t// read one line.\n\t// sc.Split(bufio.ScanLines)\n}\n\ntype edge struct {\n\tfrom int\n\tto int\n\tcost int\n}\n\ntype nodes map[int]interface{}\n\nfunc solve(edges []edge, start, goal, num int) (int, bool) {\n\tns := nodes{}\n\tns[start] = 0\n\tupdated := true\n\tcount := 0\n\tprev := 0\n\tfor updated {\n\t\tupdated = false\n\t\tcount ++\n\t\tfor _, e := range edges {\n\t\t\tif ns[e.from] == nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif ns[e.to] == nil {\n\t\t\t\tif _, ok := ns[e.from].(int); !ok {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tns[e.to] = ns[e.from].(int) + e.cost\n\t\t\t\tupdated = true\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\tif ns[e.from].(int) + e.cost > ns[e.to].(int) {\n\t\t\t\t\tns[e.to] = ns[e.from].(int) + e.cost\n\t\t\t\t\tupdated = true\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif count > num && ns[goal] == prev {\n\t\t\treturn prev, true\n\t\t}\n\t\tif count > num && ns[goal] != prev {\n\t\t\treturn -1, false\n\t\t}\n\t\tprev = ns[goal].(int)\n\t}\n\treturn ns[goal].(int), true\n}\n\nfunc main() {\n\tN := nextInt()\n\tM := nextInt()\n\tP := nextInt()\n\tedges := make([]edge, 0, M)\n\tfor i := 0; i < M; i++ {\n\t\tfrom := nextInt()\n\t\tto := nextInt()\n\t\tcost := nextInt()\n\t\tedges = append(edges, edge{\n\t\t\tfrom,\n\t\t\tto,\n\t\t\tcost-P,\n\t\t})\n\t}\n\tans, ok := solve(edges, 1, N, N)\n\tif !ok {\n\t\tfmt.Println(-1)\n\t\treturn\n\t}\n\tif ans < 0 {\n\t\tans = 0\n\t}\n\tfmt.Println(ans)\n}", "problem_context": "Score : 500 points\n\nProblem Statement\n\nThere is a directed graph with N vertices numbered 1 to N and M edges.\nThe i-th edge is directed from Vertex A_i to Vertex B_i, and there are C_i coins \bplaced along that edge.\nAdditionally, there is a button on Vertex N.\n\nWe will play a game on this graph.\nYou start the game on Vertex 1 with zero coins, and head for Vertex N by traversing the edges while collecting coins.\nIt takes one minute to traverse an edge, and you can collect the coins placed along the edge each time you traverse it.\nAs usual in games, even if you traverse an edge once and collect the coins, the same number of coins will reappear next time you traverse that edge, which you can collect again.\n\nWhen you reach Vertex N, you can end the game by pressing the button. (You can also choose to leave Vertex N without pressing the button and continue traveling.)\nHowever, when you end the game, you will be asked to pay T \\times P coins, where T is the number of minutes elapsed since the start of the game. If you have less than T \\times P coins, you will have to pay all of your coins instead.\n\nYour score will be the number of coins you have after this payment.\nDetermine if there exists a maximum value of the score that can be obtained. If the answer is yes, find that maximum value.\n\nConstraints\n\n2 \\leq N \\leq 2500\n\n1 \\leq M \\leq 5000\n\n1 \\leq A_i, B_i \\leq N\n\n1 \\leq C_i \\leq 10^5\n\n0 \\leq P \\leq 10^5\n\nAll values in input are integers.\n\nVertex N can be reached from Vertex 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M P\nA_1 B_1 C_1\n:\nA_M B_M C_M\n\nOutput\n\nIf there exists a maximum value of the score that can be obtained, print that maximum value; otherwise, print -1.\n\nSample Input 1\n\n3 3 10\n1 2 20\n2 3 30\n1 3 45\n\nSample Output 1\n\n35\n\nThere are two ways to travel from Vertex 1 to Vertex 3:\n\nVertex 1 \\rightarrow 2 \\rightarrow 3: You collect 20 + 30 = 50 coins on the way. After two minutes from the start of the game, you press the button, pay 2 \\times 10 = 20 coins, and you have 50 - 20 = 30 coins left.\n\nVertex 1 \\rightarrow 2: You collect 45 coins on the way. After one minute from the start of the game, you press the button, pay 1 \\times 10 = 10 coins, and you have 45 - 10 = 35 coins left.\n\nThus, the maximum score that can be obtained is 35.\n\nSample Input 2\n\n2 2 10\n1 2 100\n2 2 100\n\nSample Output 2\n\n-1\n\nThe edge extending from Vertex 1 takes you to Vertex 2. If you then traverse the edge extending from Vertex 2 to itself t times and press the button, your score will be 90 + 90t. Thus, you can infinitely increase your score, which means there is no maximum value of the score that can be obtained.\n\nSample Input 3\n\n4 5 10\n1 2 1\n1 4 1\n3 4 1\n2 2 100\n3 3 100\n\nSample Output 3\n\n0\n\nThere is no way to travel from Vertex 1 to Vertex 4 other than traversing the edge leading from Vertex 1 to Vertex 4 directly. You will pick up one coin along this edge, but after being asked to paying 10 coins, your score will be 0.\n\nNote that you can collect an infinite number of coins if you traverse the edge leading from Vertex 1 to Vertex 2, but this is pointless since you can no longer reach Vertex 4 and end the game.", "sample_input": "3 3 10\n1 2 20\n2 3 30\n1 3 45\n"}, "reference_outputs": ["35\n"], "source_document_id": "p02949", "source_text": "Score : 500 points\n\nProblem Statement\n\nThere is a directed graph with N vertices numbered 1 to N and M edges.\nThe i-th edge is directed from Vertex A_i to Vertex B_i, and there are C_i coins \bplaced along that edge.\nAdditionally, there is a button on Vertex N.\n\nWe will play a game on this graph.\nYou start the game on Vertex 1 with zero coins, and head for Vertex N by traversing the edges while collecting coins.\nIt takes one minute to traverse an edge, and you can collect the coins placed along the edge each time you traverse it.\nAs usual in games, even if you traverse an edge once and collect the coins, the same number of coins will reappear next time you traverse that edge, which you can collect again.\n\nWhen you reach Vertex N, you can end the game by pressing the button. (You can also choose to leave Vertex N without pressing the button and continue traveling.)\nHowever, when you end the game, you will be asked to pay T \\times P coins, where T is the number of minutes elapsed since the start of the game. If you have less than T \\times P coins, you will have to pay all of your coins instead.\n\nYour score will be the number of coins you have after this payment.\nDetermine if there exists a maximum value of the score that can be obtained. If the answer is yes, find that maximum value.\n\nConstraints\n\n2 \\leq N \\leq 2500\n\n1 \\leq M \\leq 5000\n\n1 \\leq A_i, B_i \\leq N\n\n1 \\leq C_i \\leq 10^5\n\n0 \\leq P \\leq 10^5\n\nAll values in input are integers.\n\nVertex N can be reached from Vertex 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M P\nA_1 B_1 C_1\n:\nA_M B_M C_M\n\nOutput\n\nIf there exists a maximum value of the score that can be obtained, print that maximum value; otherwise, print -1.\n\nSample Input 1\n\n3 3 10\n1 2 20\n2 3 30\n1 3 45\n\nSample Output 1\n\n35\n\nThere are two ways to travel from Vertex 1 to Vertex 3:\n\nVertex 1 \\rightarrow 2 \\rightarrow 3: You collect 20 + 30 = 50 coins on the way. After two minutes from the start of the game, you press the button, pay 2 \\times 10 = 20 coins, and you have 50 - 20 = 30 coins left.\n\nVertex 1 \\rightarrow 2: You collect 45 coins on the way. After one minute from the start of the game, you press the button, pay 1 \\times 10 = 10 coins, and you have 45 - 10 = 35 coins left.\n\nThus, the maximum score that can be obtained is 35.\n\nSample Input 2\n\n2 2 10\n1 2 100\n2 2 100\n\nSample Output 2\n\n-1\n\nThe edge extending from Vertex 1 takes you to Vertex 2. If you then traverse the edge extending from Vertex 2 to itself t times and press the button, your score will be 90 + 90t. Thus, you can infinitely increase your score, which means there is no maximum value of the score that can be obtained.\n\nSample Input 3\n\n4 5 10\n1 2 1\n1 4 1\n3 4 1\n2 2 100\n3 3 100\n\nSample Output 3\n\n0\n\nThere is no way to travel from Vertex 1 to Vertex 4 other than traversing the edge leading from Vertex 1 to Vertex 4 directly. You will pick up one coin along this edge, but after being asked to paying 10 coins, your score will be 0.\n\nNote that you can collect an infinite number of coins if you traverse the edge leading from Vertex 1 to Vertex 2, but this is pointless since you can no longer reach Vertex 4 and end the game.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1596, "cpu_time_ms": 2104, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s997625045", "group_id": "codeNet:p02949", "input_text": "// https://atcoder.jp/contests/abc137/tasks/abc137_e\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// d: debug IO. it can print debug in test.\nfunc solve(io *Io, d *Io) {\n\tN := io.NextInt()\n\tM := io.NextInt()\n\tP := io.NextInt()\n\n\tedges := make([][]int, M)\n\n\tfor i := 0; i < M; i++ {\n\t\tA := io.NextInt()\n\t\tB := io.NextInt()\n\t\tC := io.NextInt()\n\n\t\tedges[i] = []int{\n\t\t\tA,\n\t\t\tB,\n\t\t\tC,\n\t\t}\n\t}\n\n\tfromToEdges := make([][][]int, N+1)\n\tfor i := range fromToEdges {\n\t\tfromToEdges[i] = make([][]int, 0)\n\t}\n\n\ttoFromEdges := make([][][]int, N+1)\n\tfor i := range toFromEdges {\n\t\ttoFromEdges[i] = make([][]int, 0)\n\t}\n\n\tfor _, e := range edges {\n\t\tfromToEdges[e[0]] = append(fromToEdges[e[0]], []int{e[1], e[2]})\n\t\ttoFromEdges[e[1]] = append(toFromEdges[e[1]], []int{e[0], e[2]})\n\t}\n\n\tgoalReachableNodes := map[int]bool{}\n\n\tvar addGoalReachableNodes func(currentNode int)\n\taddGoalReachableNodes = func(currentNode int) {\n\t\t// already added\n\t\tif goalReachableNodes[currentNode] {\n\t\t\treturn\n\t\t}\n\n\t\tgoalReachableNodes[currentNode] = true\n\n\t\tedges := toFromEdges[currentNode]\n\t\tfor _, edge := range edges {\n\t\t\taddGoalReachableNodes(edge[0])\n\t\t}\n\t}\n\n\taddGoalReachableNodes(N)\n\n\t// 各 node へのスコアの最大値\n\tscoreMap := map[int]int{}\n\n\tvar dfs func(node, score, visited int) bool\n\tdfs = func(node int, score int, visited int) bool {\n\t\t_, included := scoreMap[node]\n\n\t\tif included {\n\t\t\tif score > scoreMap[node] {\n\t\t\t\tif visited > len(fromToEdges) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\n\t\t\t\tscoreMap[node] = score\n\t\t\t} else {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\tvisited++\n\t\tscoreMap[node] = score\n\n\t\tedges := fromToEdges[node]\n\n\t\tfor _, edge := range edges {\n\t\t\tnextScore := score + edge[1] - P\n\t\t\tnextNode := edge[0]\n\n\t\t\tif !goalReachableNodes[nextNode] {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif dfs(nextNode, nextScore, visited) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\n\t\treturn false\n\t}\n\n\tinfinity := dfs(1, 0, 0)\n\n\tif infinity {\n\t\tio.Println(-1)\n\t\treturn\n\t}\n\n\tio.Println(Max(scoreMap[N], 0))\n}\n\n// ベルマンフォードに帰着\nfunc solve2(io *Io, d *Io) {\n\tN := io.NextInt()\n\tM := io.NextInt()\n\tP := io.NextInt()\n\n\ttype Edge struct {\n\t\tfrom int\n\t\tto int\n\t\tcost int\n\t}\n\n\tedges := make([]Edge, M)\n\n\tfor i := 0; i < M; i++ {\n\t\tA := io.NextInt()\n\t\tB := io.NextInt()\n\t\tC := io.NextInt()\n\n\t\tedges[i] = Edge{\n\t\t\tfrom: A,\n\t\t\tto: B,\n\t\t\tcost: -(C - P), // 最短経路問題にするためマイナスをかける\n\t\t}\n\t}\n\n\tfromToEdges := make([][]int, N+1)\n\ttoFromEdges := make([][]int, N+1)\n\n\tfor _, e := range edges {\n\t\tfromToEdges[e.from] = append(fromToEdges[e.from], e.to)\n\t\ttoFromEdges[e.to] = append(toFromEdges[e.to], e.from)\n\t}\n\n\tvar addReachableNodes func(node int, edges [][]int, reachableMap map[int]bool)\n\taddReachableNodes = func(node int, edges [][]int, reachableMap map[int]bool) {\n\t\tif reachableMap[node] {\n\t\t\treturn\n\t\t}\n\n\t\treachableMap[node] = true\n\n\t\tfor _, to := range edges[node] {\n\t\t\taddReachableNodes(to, edges, reachableMap)\n\t\t}\n\t}\n\n\tstartReachableNodes := map[int]bool{}\n\taddReachableNodes(1, fromToEdges, startReachableNodes)\n\tgoalReachableNodes := map[int]bool{}\n\taddReachableNodes(N, toFromEdges, goalReachableNodes)\n\treachableNodes := map[int]bool{}\n\n\tfor node, startReachable := range startReachableNodes {\n\t\tif startReachable && goalReachableNodes[node] {\n\t\t\treachableNodes[node] = true\n\t\t}\n\t}\n\n\tINF := int(1e18)\n\tcosts := make([]int, N+1)\n\tfor i := range costs {\n\t\tcosts[i] = INF\n\t}\n\tcosts[1] = 0\n\n\tfor i := 1; i <= N; i++ {\n\t\tupdated := false\n\n\t\tfor _, e := range edges {\n\t\t\tif !reachableNodes[e.to] || !reachableNodes[e.from] {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif costs[e.from]+e.cost < costs[e.to] {\n\t\t\t\tcosts[e.to] = costs[e.from] + e.cost\n\t\t\t\tupdated = true\n\n\t\t\t\t// 負の閉路が無ければ高々 N-1 回 しか更新されない\n\t\t\t\tif i == N {\n\t\t\t\t\tio.Println(-1)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif !updated {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tio.Println(Max(-costs[N], 0))\n}\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\tsolve2(io, nil)\n}\n\n/* IO Helpers */\n\n// Io combines reader, writer, & tokens as the state when processing the input\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\n// NewIo creates Io with Stdin & Stdout\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\n// Flush calls the writer's Flush\nfunc (io *Io) Flush() {\n\tio.writer.Flush()\n}\n\n// NextLine returns the string from reader.ReadLine()\nfunc (io *Io) NextLine() string {\n\tif io.nextToken < len(io.tokens) {\n\t\tpanic(\"io.nextToken < len(io.tokens)\")\n\t}\n\n\tvar buffer bytes.Buffer\n\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer.Write(line)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn buffer.String()\n}\n\n// NextLines returns []string from next n lines\nfunc (io *Io) NextLines(n int) []string {\n\tres := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextLine()\n\t}\n\treturn res\n}\n\n// Next returns the string token (partial string of the line divided by spaces)\nfunc (io *Io) Next() string {\n\tif io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\n\tres := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn res\n}\n\n// NextStrings returns the []string from the next n tokens\nfunc (io *Io) NextStrings(n int) []string {\n\tres := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.Next()\n\t}\n\treturn res\n}\n\n// NextInt returns the int from the next token\nfunc (io *Io) NextInt() int {\n\tres, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n\n// NextInts returns the []int from the next n tokens\nfunc (io *Io) NextInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextInt()\n\t}\n\treturn res\n}\n\n// NextFloat returns the float64 from the next token\nfunc (io *Io) NextFloat() float64 {\n\tres, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n\n// NextFloats returns the []float64 from the next n tokens\nfunc (io *Io) NextFloats(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextFloat()\n\t}\n\treturn res\n}\n\n// Println prints the input to the writer in an easy-to-see form\nfunc (io *Io) Println(a ...interface{}) {\n\tvar values []string\n\tfor i := 0; i < len(a); i++ {\n\t\tvalues = append(values, \"%v\")\n\t}\n\tio.Printfln(strings.Join(values, \" \"), a...)\n}\n\n// Print calls Fprint to the writer\nfunc (io *Io) Print(a interface{}) {\n\tfmt.Fprint(io.writer, a)\n}\n\n// Printfln calls Fprint to the writer\nfunc (io *Io) Printfln(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format+\"\\n\", a...)\n}\n\n// Debug calls Println and Flush immediately\nfunc (io *Io) Debug(a ...interface{}) {\n\tif io == nil {\n\t\treturn\n\t}\n\n\tio.Println(a...)\n\tio.Flush()\n}\n\n/* Math Helpers */\n\n// MOD is 10^9 + 7\nconst MOD = 1000000007\n\n// Max of the ints\nfunc Max(numbers ...int) int {\n\tmax := numbers[0]\n\tfor i, number := range numbers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif number > max {\n\t\t\tmax = number\n\t\t}\n\t}\n\treturn max\n}\n\n// Min of the ints\nfunc Min(numbers ...int) int {\n\tmax := numbers[0]\n\tfor i, number := range numbers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif max > number {\n\t\t\tmax = number\n\t\t}\n\t}\n\treturn max\n}\n\n// DigitSum returns sum of the int's digits\nfunc DigitSum(n int) int {\n\tif n < 0 {\n\t\treturn -1\n\t}\n\n\tres := 0\n\n\tfor n > 0 {\n\t\tres += n % 10\n\t\tn /= 10\n\t}\n\n\treturn res\n}\n\n// Sum of the ints\nfunc Sum(numbers ...int) int {\n\tsum := 0\n\n\tfor _, number := range numbers {\n\t\tsum += number\n\t}\n\n\treturn sum\n}\n\n// Pow calculates the pow for int with O(log e)\nfunc Pow(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(fmt.Sprintf(\"Pow was called for a < 0 or e < 0, a: %d, e: %d\", a, e))\n\t}\n\n\tif e == 0 {\n\t\treturn 1\n\t}\n\n\tif e%2 == 0 {\n\t\thalf := Pow(a, e/2)\n\t\treturn half * half\n\t}\n\n\treturn a * Pow(a, e-1)\n}\n\n// Abs returns the absolute value of the input\nfunc Abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\n\treturn a\n}\n\n/* Structure Helpers */\n\n// Set is orderless List\ntype Set map[interface{}]struct{}\n\n// NewSet returns empty Set\nfunc NewSet() *Set {\n\treturn &Set{}\n}\n\n// Add the value to the set\nfunc (set *Set) Add(value interface{}) {\n\t(*set)[value] = struct{}{}\n}\n\n// Includes check the set has the value\nfunc (set *Set) Includes(value interface{}) bool {\n\t_, included := (*set)[value]\n\treturn included\n}\n\n// Remove deletes the value from the set if exists\nfunc (set *Set) Remove(value interface{}) {\n\tif !set.Includes(value) {\n\t\treturn\n\t}\n\n\tdelete(*set, value)\n}\n\n// ImmutableSort returns sorted slice without mutating original one\nfunc ImmutableSort(slice []int) []int {\n\tres := make([]int, len(slice))\n\tcopy(res, slice)\n\tsort.Ints(res)\n\treturn res\n}\n\n/* Util helpers */\n\n// Ternary is like `cond ? a : b`. should assert the returned value like `Ternary(cond, a, b).(int)`\nfunc Ternary(cond bool, a, b interface{}) interface{} {\n\tif cond {\n\t\treturn a\n\t}\n\n\treturn b\n}\n\n// TernaryInt uses Ternary and assert the value as int\nfunc TernaryInt(cond bool, a, b int) int {\n\treturn Ternary(cond, a, b).(int)\n}\n\n// TernaryString uses Ternary and assert the value as string\nfunc TernaryString(cond bool, a, b string) string {\n\treturn Ternary(cond, a, b).(string)\n}\n", "language": "Go", "metadata": {"date": 1565761953, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02949.html", "problem_id": "p02949", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02949/input.txt", "sample_output_relpath": "derived/input_output/data/p02949/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02949/Go/s997625045.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s997625045", "user_id": "u751468134"}, "prompt_components": {"gold_output": "35\n", "input_to_evaluate": "// https://atcoder.jp/contests/abc137/tasks/abc137_e\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// d: debug IO. it can print debug in test.\nfunc solve(io *Io, d *Io) {\n\tN := io.NextInt()\n\tM := io.NextInt()\n\tP := io.NextInt()\n\n\tedges := make([][]int, M)\n\n\tfor i := 0; i < M; i++ {\n\t\tA := io.NextInt()\n\t\tB := io.NextInt()\n\t\tC := io.NextInt()\n\n\t\tedges[i] = []int{\n\t\t\tA,\n\t\t\tB,\n\t\t\tC,\n\t\t}\n\t}\n\n\tfromToEdges := make([][][]int, N+1)\n\tfor i := range fromToEdges {\n\t\tfromToEdges[i] = make([][]int, 0)\n\t}\n\n\ttoFromEdges := make([][][]int, N+1)\n\tfor i := range toFromEdges {\n\t\ttoFromEdges[i] = make([][]int, 0)\n\t}\n\n\tfor _, e := range edges {\n\t\tfromToEdges[e[0]] = append(fromToEdges[e[0]], []int{e[1], e[2]})\n\t\ttoFromEdges[e[1]] = append(toFromEdges[e[1]], []int{e[0], e[2]})\n\t}\n\n\tgoalReachableNodes := map[int]bool{}\n\n\tvar addGoalReachableNodes func(currentNode int)\n\taddGoalReachableNodes = func(currentNode int) {\n\t\t// already added\n\t\tif goalReachableNodes[currentNode] {\n\t\t\treturn\n\t\t}\n\n\t\tgoalReachableNodes[currentNode] = true\n\n\t\tedges := toFromEdges[currentNode]\n\t\tfor _, edge := range edges {\n\t\t\taddGoalReachableNodes(edge[0])\n\t\t}\n\t}\n\n\taddGoalReachableNodes(N)\n\n\t// 各 node へのスコアの最大値\n\tscoreMap := map[int]int{}\n\n\tvar dfs func(node, score, visited int) bool\n\tdfs = func(node int, score int, visited int) bool {\n\t\t_, included := scoreMap[node]\n\n\t\tif included {\n\t\t\tif score > scoreMap[node] {\n\t\t\t\tif visited > len(fromToEdges) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\n\t\t\t\tscoreMap[node] = score\n\t\t\t} else {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\tvisited++\n\t\tscoreMap[node] = score\n\n\t\tedges := fromToEdges[node]\n\n\t\tfor _, edge := range edges {\n\t\t\tnextScore := score + edge[1] - P\n\t\t\tnextNode := edge[0]\n\n\t\t\tif !goalReachableNodes[nextNode] {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif dfs(nextNode, nextScore, visited) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\n\t\treturn false\n\t}\n\n\tinfinity := dfs(1, 0, 0)\n\n\tif infinity {\n\t\tio.Println(-1)\n\t\treturn\n\t}\n\n\tio.Println(Max(scoreMap[N], 0))\n}\n\n// ベルマンフォードに帰着\nfunc solve2(io *Io, d *Io) {\n\tN := io.NextInt()\n\tM := io.NextInt()\n\tP := io.NextInt()\n\n\ttype Edge struct {\n\t\tfrom int\n\t\tto int\n\t\tcost int\n\t}\n\n\tedges := make([]Edge, M)\n\n\tfor i := 0; i < M; i++ {\n\t\tA := io.NextInt()\n\t\tB := io.NextInt()\n\t\tC := io.NextInt()\n\n\t\tedges[i] = Edge{\n\t\t\tfrom: A,\n\t\t\tto: B,\n\t\t\tcost: -(C - P), // 最短経路問題にするためマイナスをかける\n\t\t}\n\t}\n\n\tfromToEdges := make([][]int, N+1)\n\ttoFromEdges := make([][]int, N+1)\n\n\tfor _, e := range edges {\n\t\tfromToEdges[e.from] = append(fromToEdges[e.from], e.to)\n\t\ttoFromEdges[e.to] = append(toFromEdges[e.to], e.from)\n\t}\n\n\tvar addReachableNodes func(node int, edges [][]int, reachableMap map[int]bool)\n\taddReachableNodes = func(node int, edges [][]int, reachableMap map[int]bool) {\n\t\tif reachableMap[node] {\n\t\t\treturn\n\t\t}\n\n\t\treachableMap[node] = true\n\n\t\tfor _, to := range edges[node] {\n\t\t\taddReachableNodes(to, edges, reachableMap)\n\t\t}\n\t}\n\n\tstartReachableNodes := map[int]bool{}\n\taddReachableNodes(1, fromToEdges, startReachableNodes)\n\tgoalReachableNodes := map[int]bool{}\n\taddReachableNodes(N, toFromEdges, goalReachableNodes)\n\treachableNodes := map[int]bool{}\n\n\tfor node, startReachable := range startReachableNodes {\n\t\tif startReachable && goalReachableNodes[node] {\n\t\t\treachableNodes[node] = true\n\t\t}\n\t}\n\n\tINF := int(1e18)\n\tcosts := make([]int, N+1)\n\tfor i := range costs {\n\t\tcosts[i] = INF\n\t}\n\tcosts[1] = 0\n\n\tfor i := 1; i <= N; i++ {\n\t\tupdated := false\n\n\t\tfor _, e := range edges {\n\t\t\tif !reachableNodes[e.to] || !reachableNodes[e.from] {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif costs[e.from]+e.cost < costs[e.to] {\n\t\t\t\tcosts[e.to] = costs[e.from] + e.cost\n\t\t\t\tupdated = true\n\n\t\t\t\t// 負の閉路が無ければ高々 N-1 回 しか更新されない\n\t\t\t\tif i == N {\n\t\t\t\t\tio.Println(-1)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif !updated {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tio.Println(Max(-costs[N], 0))\n}\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\tsolve2(io, nil)\n}\n\n/* IO Helpers */\n\n// Io combines reader, writer, & tokens as the state when processing the input\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\n// NewIo creates Io with Stdin & Stdout\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\n// Flush calls the writer's Flush\nfunc (io *Io) Flush() {\n\tio.writer.Flush()\n}\n\n// NextLine returns the string from reader.ReadLine()\nfunc (io *Io) NextLine() string {\n\tif io.nextToken < len(io.tokens) {\n\t\tpanic(\"io.nextToken < len(io.tokens)\")\n\t}\n\n\tvar buffer bytes.Buffer\n\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer.Write(line)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn buffer.String()\n}\n\n// NextLines returns []string from next n lines\nfunc (io *Io) NextLines(n int) []string {\n\tres := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextLine()\n\t}\n\treturn res\n}\n\n// Next returns the string token (partial string of the line divided by spaces)\nfunc (io *Io) Next() string {\n\tif io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\n\tres := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn res\n}\n\n// NextStrings returns the []string from the next n tokens\nfunc (io *Io) NextStrings(n int) []string {\n\tres := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.Next()\n\t}\n\treturn res\n}\n\n// NextInt returns the int from the next token\nfunc (io *Io) NextInt() int {\n\tres, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n\n// NextInts returns the []int from the next n tokens\nfunc (io *Io) NextInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextInt()\n\t}\n\treturn res\n}\n\n// NextFloat returns the float64 from the next token\nfunc (io *Io) NextFloat() float64 {\n\tres, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n\n// NextFloats returns the []float64 from the next n tokens\nfunc (io *Io) NextFloats(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextFloat()\n\t}\n\treturn res\n}\n\n// Println prints the input to the writer in an easy-to-see form\nfunc (io *Io) Println(a ...interface{}) {\n\tvar values []string\n\tfor i := 0; i < len(a); i++ {\n\t\tvalues = append(values, \"%v\")\n\t}\n\tio.Printfln(strings.Join(values, \" \"), a...)\n}\n\n// Print calls Fprint to the writer\nfunc (io *Io) Print(a interface{}) {\n\tfmt.Fprint(io.writer, a)\n}\n\n// Printfln calls Fprint to the writer\nfunc (io *Io) Printfln(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format+\"\\n\", a...)\n}\n\n// Debug calls Println and Flush immediately\nfunc (io *Io) Debug(a ...interface{}) {\n\tif io == nil {\n\t\treturn\n\t}\n\n\tio.Println(a...)\n\tio.Flush()\n}\n\n/* Math Helpers */\n\n// MOD is 10^9 + 7\nconst MOD = 1000000007\n\n// Max of the ints\nfunc Max(numbers ...int) int {\n\tmax := numbers[0]\n\tfor i, number := range numbers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif number > max {\n\t\t\tmax = number\n\t\t}\n\t}\n\treturn max\n}\n\n// Min of the ints\nfunc Min(numbers ...int) int {\n\tmax := numbers[0]\n\tfor i, number := range numbers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif max > number {\n\t\t\tmax = number\n\t\t}\n\t}\n\treturn max\n}\n\n// DigitSum returns sum of the int's digits\nfunc DigitSum(n int) int {\n\tif n < 0 {\n\t\treturn -1\n\t}\n\n\tres := 0\n\n\tfor n > 0 {\n\t\tres += n % 10\n\t\tn /= 10\n\t}\n\n\treturn res\n}\n\n// Sum of the ints\nfunc Sum(numbers ...int) int {\n\tsum := 0\n\n\tfor _, number := range numbers {\n\t\tsum += number\n\t}\n\n\treturn sum\n}\n\n// Pow calculates the pow for int with O(log e)\nfunc Pow(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(fmt.Sprintf(\"Pow was called for a < 0 or e < 0, a: %d, e: %d\", a, e))\n\t}\n\n\tif e == 0 {\n\t\treturn 1\n\t}\n\n\tif e%2 == 0 {\n\t\thalf := Pow(a, e/2)\n\t\treturn half * half\n\t}\n\n\treturn a * Pow(a, e-1)\n}\n\n// Abs returns the absolute value of the input\nfunc Abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\n\treturn a\n}\n\n/* Structure Helpers */\n\n// Set is orderless List\ntype Set map[interface{}]struct{}\n\n// NewSet returns empty Set\nfunc NewSet() *Set {\n\treturn &Set{}\n}\n\n// Add the value to the set\nfunc (set *Set) Add(value interface{}) {\n\t(*set)[value] = struct{}{}\n}\n\n// Includes check the set has the value\nfunc (set *Set) Includes(value interface{}) bool {\n\t_, included := (*set)[value]\n\treturn included\n}\n\n// Remove deletes the value from the set if exists\nfunc (set *Set) Remove(value interface{}) {\n\tif !set.Includes(value) {\n\t\treturn\n\t}\n\n\tdelete(*set, value)\n}\n\n// ImmutableSort returns sorted slice without mutating original one\nfunc ImmutableSort(slice []int) []int {\n\tres := make([]int, len(slice))\n\tcopy(res, slice)\n\tsort.Ints(res)\n\treturn res\n}\n\n/* Util helpers */\n\n// Ternary is like `cond ? a : b`. should assert the returned value like `Ternary(cond, a, b).(int)`\nfunc Ternary(cond bool, a, b interface{}) interface{} {\n\tif cond {\n\t\treturn a\n\t}\n\n\treturn b\n}\n\n// TernaryInt uses Ternary and assert the value as int\nfunc TernaryInt(cond bool, a, b int) int {\n\treturn Ternary(cond, a, b).(int)\n}\n\n// TernaryString uses Ternary and assert the value as string\nfunc TernaryString(cond bool, a, b string) string {\n\treturn Ternary(cond, a, b).(string)\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nThere is a directed graph with N vertices numbered 1 to N and M edges.\nThe i-th edge is directed from Vertex A_i to Vertex B_i, and there are C_i coins \bplaced along that edge.\nAdditionally, there is a button on Vertex N.\n\nWe will play a game on this graph.\nYou start the game on Vertex 1 with zero coins, and head for Vertex N by traversing the edges while collecting coins.\nIt takes one minute to traverse an edge, and you can collect the coins placed along the edge each time you traverse it.\nAs usual in games, even if you traverse an edge once and collect the coins, the same number of coins will reappear next time you traverse that edge, which you can collect again.\n\nWhen you reach Vertex N, you can end the game by pressing the button. (You can also choose to leave Vertex N without pressing the button and continue traveling.)\nHowever, when you end the game, you will be asked to pay T \\times P coins, where T is the number of minutes elapsed since the start of the game. If you have less than T \\times P coins, you will have to pay all of your coins instead.\n\nYour score will be the number of coins you have after this payment.\nDetermine if there exists a maximum value of the score that can be obtained. If the answer is yes, find that maximum value.\n\nConstraints\n\n2 \\leq N \\leq 2500\n\n1 \\leq M \\leq 5000\n\n1 \\leq A_i, B_i \\leq N\n\n1 \\leq C_i \\leq 10^5\n\n0 \\leq P \\leq 10^5\n\nAll values in input are integers.\n\nVertex N can be reached from Vertex 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M P\nA_1 B_1 C_1\n:\nA_M B_M C_M\n\nOutput\n\nIf there exists a maximum value of the score that can be obtained, print that maximum value; otherwise, print -1.\n\nSample Input 1\n\n3 3 10\n1 2 20\n2 3 30\n1 3 45\n\nSample Output 1\n\n35\n\nThere are two ways to travel from Vertex 1 to Vertex 3:\n\nVertex 1 \\rightarrow 2 \\rightarrow 3: You collect 20 + 30 = 50 coins on the way. After two minutes from the start of the game, you press the button, pay 2 \\times 10 = 20 coins, and you have 50 - 20 = 30 coins left.\n\nVertex 1 \\rightarrow 2: You collect 45 coins on the way. After one minute from the start of the game, you press the button, pay 1 \\times 10 = 10 coins, and you have 45 - 10 = 35 coins left.\n\nThus, the maximum score that can be obtained is 35.\n\nSample Input 2\n\n2 2 10\n1 2 100\n2 2 100\n\nSample Output 2\n\n-1\n\nThe edge extending from Vertex 1 takes you to Vertex 2. If you then traverse the edge extending from Vertex 2 to itself t times and press the button, your score will be 90 + 90t. Thus, you can infinitely increase your score, which means there is no maximum value of the score that can be obtained.\n\nSample Input 3\n\n4 5 10\n1 2 1\n1 4 1\n3 4 1\n2 2 100\n3 3 100\n\nSample Output 3\n\n0\n\nThere is no way to travel from Vertex 1 to Vertex 4 other than traversing the edge leading from Vertex 1 to Vertex 4 directly. You will pick up one coin along this edge, but after being asked to paying 10 coins, your score will be 0.\n\nNote that you can collect an infinite number of coins if you traverse the edge leading from Vertex 1 to Vertex 2, but this is pointless since you can no longer reach Vertex 4 and end the game.", "sample_input": "3 3 10\n1 2 20\n2 3 30\n1 3 45\n"}, "reference_outputs": ["35\n"], "source_document_id": "p02949", "source_text": "Score : 500 points\n\nProblem Statement\n\nThere is a directed graph with N vertices numbered 1 to N and M edges.\nThe i-th edge is directed from Vertex A_i to Vertex B_i, and there are C_i coins \bplaced along that edge.\nAdditionally, there is a button on Vertex N.\n\nWe will play a game on this graph.\nYou start the game on Vertex 1 with zero coins, and head for Vertex N by traversing the edges while collecting coins.\nIt takes one minute to traverse an edge, and you can collect the coins placed along the edge each time you traverse it.\nAs usual in games, even if you traverse an edge once and collect the coins, the same number of coins will reappear next time you traverse that edge, which you can collect again.\n\nWhen you reach Vertex N, you can end the game by pressing the button. (You can also choose to leave Vertex N without pressing the button and continue traveling.)\nHowever, when you end the game, you will be asked to pay T \\times P coins, where T is the number of minutes elapsed since the start of the game. If you have less than T \\times P coins, you will have to pay all of your coins instead.\n\nYour score will be the number of coins you have after this payment.\nDetermine if there exists a maximum value of the score that can be obtained. If the answer is yes, find that maximum value.\n\nConstraints\n\n2 \\leq N \\leq 2500\n\n1 \\leq M \\leq 5000\n\n1 \\leq A_i, B_i \\leq N\n\n1 \\leq C_i \\leq 10^5\n\n0 \\leq P \\leq 10^5\n\nAll values in input are integers.\n\nVertex N can be reached from Vertex 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M P\nA_1 B_1 C_1\n:\nA_M B_M C_M\n\nOutput\n\nIf there exists a maximum value of the score that can be obtained, print that maximum value; otherwise, print -1.\n\nSample Input 1\n\n3 3 10\n1 2 20\n2 3 30\n1 3 45\n\nSample Output 1\n\n35\n\nThere are two ways to travel from Vertex 1 to Vertex 3:\n\nVertex 1 \\rightarrow 2 \\rightarrow 3: You collect 20 + 30 = 50 coins on the way. After two minutes from the start of the game, you press the button, pay 2 \\times 10 = 20 coins, and you have 50 - 20 = 30 coins left.\n\nVertex 1 \\rightarrow 2: You collect 45 coins on the way. After one minute from the start of the game, you press the button, pay 1 \\times 10 = 10 coins, and you have 45 - 10 = 35 coins left.\n\nThus, the maximum score that can be obtained is 35.\n\nSample Input 2\n\n2 2 10\n1 2 100\n2 2 100\n\nSample Output 2\n\n-1\n\nThe edge extending from Vertex 1 takes you to Vertex 2. If you then traverse the edge extending from Vertex 2 to itself t times and press the button, your score will be 90 + 90t. Thus, you can infinitely increase your score, which means there is no maximum value of the score that can be obtained.\n\nSample Input 3\n\n4 5 10\n1 2 1\n1 4 1\n3 4 1\n2 2 100\n3 3 100\n\nSample Output 3\n\n0\n\nThere is no way to travel from Vertex 1 to Vertex 4 other than traversing the edge leading from Vertex 1 to Vertex 4 directly. You will pick up one coin along this edge, but after being asked to paying 10 coins, your score will be 0.\n\nNote that you can collect an infinite number of coins if you traverse the edge leading from Vertex 1 to Vertex 2, but this is pointless since you can no longer reach Vertex 4 and end the game.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 9169, "cpu_time_ms": 852, "memory_kb": 2560}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s171328198", "group_id": "codeNet:p02953", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc Scan() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc iScan() int {\n\tn, _ := strconv.Atoi(Scan())\n\treturn n\n}\nfunc fScan() float64 {\n\tn, _ := strconv.ParseFloat(Scan(), 64)\n\treturn n\n}\nfunc stringToInt(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\nfunc SScan(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = Scan()\n\t}\n\treturn a\n}\nfunc iSScan(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = iScan()\n\t}\n\treturn a\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\nfunc larger(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc smaller(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc max(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x < a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc min(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x > a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc sum(a []int) int {\n\tx := 0\n\tfor _, v := range a {\n\t\tx += v\n\t}\n\treturn x\n}\n\nvar mod int = 1000000007\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, mod)\n\tsc.Split(bufio.ScanWords)\n\tn := iScan()\n\th := iSScan(n)\n\th[0]--\n\tans := \"Yes\"\n\tfor i := 1; i < n; i++ {\n\t\tif h[i-1] > h[i] {\n\t\t\tans = \"No\"\n\t\t\tbreak\n\t\t} else if h[i-1] < h[i] {\n\t\t\th[i]--\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1597162504, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02953.html", "problem_id": "p02953", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02953/input.txt", "sample_output_relpath": "derived/input_output/data/p02953/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02953/Go/s171328198.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s171328198", "user_id": "u843722521"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc Scan() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc iScan() int {\n\tn, _ := strconv.Atoi(Scan())\n\treturn n\n}\nfunc fScan() float64 {\n\tn, _ := strconv.ParseFloat(Scan(), 64)\n\treturn n\n}\nfunc stringToInt(s string) int {\n\tn, _ := strconv.Atoi(s)\n\treturn n\n}\nfunc SScan(n int) []string {\n\ta := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = Scan()\n\t}\n\treturn a\n}\nfunc iSScan(n int) []int {\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = iScan()\n\t}\n\treturn a\n}\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\nfunc larger(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc smaller(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\nfunc max(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x < a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc min(a []int) int {\n\tx := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif x > a[i] {\n\t\t\tx = a[i]\n\t\t}\n\t}\n\treturn x\n}\nfunc sum(a []int) int {\n\tx := 0\n\tfor _, v := range a {\n\t\tx += v\n\t}\n\treturn x\n}\n\nvar mod int = 1000000007\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, mod)\n\tsc.Split(bufio.ScanWords)\n\tn := iScan()\n\th := iSScan(n)\n\th[0]--\n\tans := \"Yes\"\n\tfor i := 1; i < n; i++ {\n\t\tif h[i-1] > h[i] {\n\t\t\tans = \"No\"\n\t\t\tbreak\n\t\t} else if h[i-1] < h[i] {\n\t\t\th[i]--\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "sample_input": "5\n1 2 1 1 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02953", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1388, "cpu_time_ms": 28, "memory_kb": 4208}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s970755751", "group_id": "codeNet:p02953", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tscanInit()\n\n\tn := nextInt()\n\tl := make([]int, n)\n\tticket := 0\n\tl[0] = nextInt()\n\tfor i := 1; i < n; i++ {\n\t\tl[i] = nextInt()\n\t\t//fmt.Println(l[i-1], \"->\", l[i])\n\t\tif l[i-1]-l[i] >= 2 {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t\tif l[i-1]-l[i] == 1 {\n\t\t\tif ticket == 0 {\n\t\t\t\tticket = 1\n\t\t\t\t//fmt.Println(\"ticket\")\n\t\t\t\tif i >= 2 && l[i-1] == l[i-2] {\n\t\t\t\t\t//fmt.Println(\"ticketed\")\n\t\t\t\t\tfmt.Println(\"No\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"No\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n}\n\n// ---- readfunc\nfunc scanInit() {\n\tconst cap = 200 * 1024 // Default=64\n\tvar buf = make([]byte, cap)\n\tsc.Buffer(buf, cap)\n\tsc.Split(bufio.ScanWords)\n\treturn\n}\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "language": "Go", "metadata": {"date": 1596318514, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02953.html", "problem_id": "p02953", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02953/input.txt", "sample_output_relpath": "derived/input_output/data/p02953/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02953/Go/s970755751.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s970755751", "user_id": "u756000295"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tscanInit()\n\n\tn := nextInt()\n\tl := make([]int, n)\n\tticket := 0\n\tl[0] = nextInt()\n\tfor i := 1; i < n; i++ {\n\t\tl[i] = nextInt()\n\t\t//fmt.Println(l[i-1], \"->\", l[i])\n\t\tif l[i-1]-l[i] >= 2 {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t\tif l[i-1]-l[i] == 1 {\n\t\t\tif ticket == 0 {\n\t\t\t\tticket = 1\n\t\t\t\t//fmt.Println(\"ticket\")\n\t\t\t\tif i >= 2 && l[i-1] == l[i-2] {\n\t\t\t\t\t//fmt.Println(\"ticketed\")\n\t\t\t\t\tfmt.Println(\"No\")\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"No\")\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n}\n\n// ---- readfunc\nfunc scanInit() {\n\tconst cap = 200 * 1024 // Default=64\n\tvar buf = make([]byte, cap)\n\tsc.Buffer(buf, cap)\n\tsc.Split(bufio.ScanWords)\n\treturn\n}\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "sample_input": "5\n1 2 1 1 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02953", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 927, "cpu_time_ms": 27, "memory_kb": 4408}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s328616451", "group_id": "codeNet:p02953", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"reflect\"\n\t\"strconv\"\n)\n\nconst (\n\tmaxBufSize = 1024 * 1024\n)\n\nvar (\n\tsc = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, 1)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n\tout = bufio.NewWriter(os.Stdout)\n)\n\nconst yes = \"Yes\"\nconst no = \"No\"\n\nfunc solve(n int64, hs []int64) bool {\n\tprev := hs[n - 1]\n\tfor i := n - 1 ; i >= int64(0); i-- {\n\t\tif hs[i] > prev + 1 {\n\t\t\treturn false\n\t\t}\n\t\tif hs[i] > prev {\n\t\t\ths[i] --\n\t\t}\n\t\tprev = hs[i]\n\t}\n\treturn true\n}\n\nfunc main() {\n\tdefer out.Flush()\n\n\tn := nextInt()\n\ths := nextInts(n)\n\tif solve(n, hs) {\n\t\tfmt.Fprintln(out, yes)\n\t} else {\n\t\tfmt.Fprintln(out, no)\n\t}\n}\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextStringAsBytes() []byte {\n\tsc.Scan()\n\treturn []byte(sc.Text())\n}\n\nfunc nextInt() int64 {\n\ta, _ := strconv.ParseInt(next(), 10, 64)\n\treturn a\n}\n\nfunc nextFloat() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int64) []int64 {\n\tret := make([]int64, n)\n\tfor i := int64(0); i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\n\nfunc nextFloats(n int64) []float64 {\n\tret := make([]float64, n)\n\tfor i := int64(0); i < n; i++ {\n\t\tret[i] = nextFloat()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int64) []string {\n\tret := make([]string, n)\n\tfor i := int64(0); i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\nfunc containStr(arr []string, target string) bool {\n\tfor _, v := range arr {\n\t\tif v == target {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc PrintOut(src interface{}, joinner string) {\n\tswitch reflect.TypeOf(src).Kind() {\n\tcase reflect.Slice:\n\t\ts := reflect.ValueOf(src)\n\t\tfor idx := 0; idx < s.Len(); idx++ {\n\t\t\tfmt.Fprintf(out, \"%v\", s.Index(idx))\n\t\t\tif idx < s.Len()-1 {\n\t\t\t\tfmt.Fprintf(out, \"%s\", joinner)\n\t\t\t} else {\n\t\t\t\tfmt.Fprintln(out)\n\t\t\t}\n\t\t}\n\tdefault:\n\t\tfmt.Fprintln(out, \"orz\")\n\t}\n}\n\n// mapからkeysとvaluesを返す\nfunc splitKeyValue(m map[interface{}]interface{}) (keys, values []interface{}) {\n\tswitch reflect.TypeOf(m).Kind() {\n\tcase reflect.Map:\n\t\ts := reflect.ValueOf(m)\n\t\tfor _, v := range s.MapKeys() {\n\t\t\tkeys = append(keys, v)\n\t\t\tvalues = append(values, s.MapIndex(v))\n\t\t}\n\tdefault:\n\t\tfmt.Fprintln(out, \"orz\")\n\t}\n\treturn\n}\n", "language": "Go", "metadata": {"date": 1594869440, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02953.html", "problem_id": "p02953", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02953/input.txt", "sample_output_relpath": "derived/input_output/data/p02953/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02953/Go/s328616451.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s328616451", "user_id": "u478530879"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"reflect\"\n\t\"strconv\"\n)\n\nconst (\n\tmaxBufSize = 1024 * 1024\n)\n\nvar (\n\tsc = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, 1)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n\tout = bufio.NewWriter(os.Stdout)\n)\n\nconst yes = \"Yes\"\nconst no = \"No\"\n\nfunc solve(n int64, hs []int64) bool {\n\tprev := hs[n - 1]\n\tfor i := n - 1 ; i >= int64(0); i-- {\n\t\tif hs[i] > prev + 1 {\n\t\t\treturn false\n\t\t}\n\t\tif hs[i] > prev {\n\t\t\ths[i] --\n\t\t}\n\t\tprev = hs[i]\n\t}\n\treturn true\n}\n\nfunc main() {\n\tdefer out.Flush()\n\n\tn := nextInt()\n\ths := nextInts(n)\n\tif solve(n, hs) {\n\t\tfmt.Fprintln(out, yes)\n\t} else {\n\t\tfmt.Fprintln(out, no)\n\t}\n}\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextStringAsBytes() []byte {\n\tsc.Scan()\n\treturn []byte(sc.Text())\n}\n\nfunc nextInt() int64 {\n\ta, _ := strconv.ParseInt(next(), 10, 64)\n\treturn a\n}\n\nfunc nextFloat() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int64) []int64 {\n\tret := make([]int64, n)\n\tfor i := int64(0); i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\n\nfunc nextFloats(n int64) []float64 {\n\tret := make([]float64, n)\n\tfor i := int64(0); i < n; i++ {\n\t\tret[i] = nextFloat()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int64) []string {\n\tret := make([]string, n)\n\tfor i := int64(0); i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\nfunc containStr(arr []string, target string) bool {\n\tfor _, v := range arr {\n\t\tif v == target {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc PrintOut(src interface{}, joinner string) {\n\tswitch reflect.TypeOf(src).Kind() {\n\tcase reflect.Slice:\n\t\ts := reflect.ValueOf(src)\n\t\tfor idx := 0; idx < s.Len(); idx++ {\n\t\t\tfmt.Fprintf(out, \"%v\", s.Index(idx))\n\t\t\tif idx < s.Len()-1 {\n\t\t\t\tfmt.Fprintf(out, \"%s\", joinner)\n\t\t\t} else {\n\t\t\t\tfmt.Fprintln(out)\n\t\t\t}\n\t\t}\n\tdefault:\n\t\tfmt.Fprintln(out, \"orz\")\n\t}\n}\n\n// mapからkeysとvaluesを返す\nfunc splitKeyValue(m map[interface{}]interface{}) (keys, values []interface{}) {\n\tswitch reflect.TypeOf(m).Kind() {\n\tcase reflect.Map:\n\t\ts := reflect.ValueOf(m)\n\t\tfor _, v := range s.MapKeys() {\n\t\t\tkeys = append(keys, v)\n\t\t\tvalues = append(values, s.MapIndex(v))\n\t\t}\n\tdefault:\n\t\tfmt.Fprintln(out, \"orz\")\n\t}\n\treturn\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "sample_input": "5\n1 2 1 1 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02953", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2244, "cpu_time_ms": 105, "memory_kb": 4260}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s599672981", "group_id": "codeNet:p02953", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc readInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc readString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readInt64() int64 {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn int64(i)\n}\n\nfunc readfloat64() float64 {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn float64(i)\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn a * -1\n\t}\n\treturn a\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc gcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t}\n\treturn gcd(y, x%y)\n}\n\nconst Mod = 1000000007\n\nfunc ModComb(n, k int) int {\n\tif k == 0 {\n\t\treturn 1\n\t}\n\tx, y := n, k\n\tfor i := 1; i < k; i++ {\n\t\tx = x * (n - i) % Mod\n\t\ty = y * (k - i) % Mod\n\t}\n\tinv := ModInv(y)\n\treturn x * inv % Mod\n}\n\nfunc ModFact(x int) int {\n\tfact := 1\n\tfor i := 1; i <= x; i++ {\n\t\tfact = fact * i % Mod\n\t}\n\treturn fact\n}\n\nfunc ModInv(x int) int {\n\treturn ModPow(x, Mod-2)\n}\n\nfunc ModPow(a, n int) int {\n\tres := 1\n\tfor n > 0 {\n\t\tif n%2 != 0 {\n\t\t\tres = res * a % Mod\n\t\t}\n\t\ta = a * a % Mod\n\t\tn /= 2\n\t}\n\treturn res\n}\n\nfunc pow(a, n int) int {\n\tif n == 0 {\n\t\treturn 1\n\t}\n\n\tans := 0\n\tif n%2 == 0 {\n\t\tans = pow(a*a, n/2)\n\t} else {\n\t\tans = a * pow(a*a, (n-1)/2)\n\t}\n\treturn ans\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn := readInt()\n\n\th := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\th[i] = readInt()\n\t}\n\n\tfor i := 1; i < n-1; i++ {\n\t\tif h[i+1]-h[i] < -1 {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t\tif h[i+1]-h[i] == -1 {\n\t\t\th[i] -= 1\n\t\t}\n\t\tif h[i]-h[i-1] < 0 {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n}\n", "language": "Go", "metadata": {"date": 1590847832, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02953.html", "problem_id": "p02953", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02953/input.txt", "sample_output_relpath": "derived/input_output/data/p02953/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02953/Go/s599672981.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s599672981", "user_id": "u309370374"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc readInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc readString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readInt64() int64 {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn int64(i)\n}\n\nfunc readfloat64() float64 {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn float64(i)\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn a * -1\n\t}\n\treturn a\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc gcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t}\n\treturn gcd(y, x%y)\n}\n\nconst Mod = 1000000007\n\nfunc ModComb(n, k int) int {\n\tif k == 0 {\n\t\treturn 1\n\t}\n\tx, y := n, k\n\tfor i := 1; i < k; i++ {\n\t\tx = x * (n - i) % Mod\n\t\ty = y * (k - i) % Mod\n\t}\n\tinv := ModInv(y)\n\treturn x * inv % Mod\n}\n\nfunc ModFact(x int) int {\n\tfact := 1\n\tfor i := 1; i <= x; i++ {\n\t\tfact = fact * i % Mod\n\t}\n\treturn fact\n}\n\nfunc ModInv(x int) int {\n\treturn ModPow(x, Mod-2)\n}\n\nfunc ModPow(a, n int) int {\n\tres := 1\n\tfor n > 0 {\n\t\tif n%2 != 0 {\n\t\t\tres = res * a % Mod\n\t\t}\n\t\ta = a * a % Mod\n\t\tn /= 2\n\t}\n\treturn res\n}\n\nfunc pow(a, n int) int {\n\tif n == 0 {\n\t\treturn 1\n\t}\n\n\tans := 0\n\tif n%2 == 0 {\n\t\tans = pow(a*a, n/2)\n\t} else {\n\t\tans = a * pow(a*a, (n-1)/2)\n\t}\n\treturn ans\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn := readInt()\n\n\th := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\th[i] = readInt()\n\t}\n\n\tfor i := 1; i < n-1; i++ {\n\t\tif h[i+1]-h[i] < -1 {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t\tif h[i+1]-h[i] == -1 {\n\t\t\th[i] -= 1\n\t\t}\n\t\tif h[i]-h[i-1] < 0 {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "sample_input": "5\n1 2 1 1 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02953", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1803, "cpu_time_ms": 29, "memory_kb": 3072}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s792177756", "group_id": "codeNet:p02953", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc lowerBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] >= x\n\t})\n\treturn idx\n}\n\nfunc upperBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] > x\n\t})\n\treturn idx\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tN := getInt()\n\th := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\th[i] = getInt()\n\t}\n\n\tfor i := 1; i < N; i++ {\n\t\tif h[i] > h[i-1] {\n\t\t\th[i]--\n\t\t}\n\t}\n\t// out(h)\n\tfor i := 1; i < N; i++ {\n\t\tif h[i] < h[i-1] {\n\t\t\tout(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tout(\"Yes\")\n\treturn\n}\n", "language": "Go", "metadata": {"date": 1589937425, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02953.html", "problem_id": "p02953", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02953/input.txt", "sample_output_relpath": "derived/input_output/data/p02953/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02953/Go/s792177756.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s792177756", "user_id": "u814575783"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc lowerBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] >= x\n\t})\n\treturn idx\n}\n\nfunc upperBound(a []int, x int) int {\n\tidx := sort.Search(len(a), func(i int) bool {\n\t\treturn a[i] > x\n\t})\n\treturn idx\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tN := getInt()\n\th := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\th[i] = getInt()\n\t}\n\n\tfor i := 1; i < N; i++ {\n\t\tif h[i] > h[i-1] {\n\t\t\th[i]--\n\t\t}\n\t}\n\t// out(h)\n\tfor i := 1; i < N; i++ {\n\t\tif h[i] < h[i-1] {\n\t\t\tout(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tout(\"Yes\")\n\treturn\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "sample_input": "5\n1 2 1 1 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02953", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1168, "cpu_time_ms": 28, "memory_kb": 3072}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s616779649", "group_id": "codeNet:p02953", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math/big\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() uint64 {\n\tsc.Scan()\n\ti, e := strconv.ParseUint(sc.Text(), 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc intArray(n []string) []int {\n\tvar m []int\n\tfor i, _ := range n {\n\t\tv, _ := strconv.Atoi(n[i])\n\t\tm = append(m, v)\n\t}\n\treturn m\n}\n\nfunc uint64Array(n []string) []uint64 {\n\tvar m []uint64\n\tfor i, _ := range n {\n\t\tv, _ := strconv.ParseUint(n[i], 10, 64)\n\t\tm = append(m, v)\n\t}\n\treturn m\n}\n\nfunc intExistIn(v int, arr []int) bool {\n\tfor _, a := range arr {\n\t\tif a == v {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc stringExistIn(v string, arr []string) bool {\n\tfor _, a := range arr {\n\t\tif a == v {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc gcd(m, n uint64) uint64 {\n\tx := new(big.Int)\n\ty := new(big.Int)\n\tz := new(big.Int)\n\ta := new(big.Int).SetUint64(m)\n\tb := new(big.Int).SetUint64(n)\n\treturn z.GCD(x, y, a, b).Uint64()\n}\n\nfunc uintArrayToStr(a []uint64) string {\n\tvar S string\n\n\tfor _, v := range a {\n\t\tS += strconv.Itoa(int(v))\n\t}\n\treturn S\n}\n\nfunc remove(x []uint64, y int) []uint64 {\n\tvar newArray []uint64\n\tfor i, _ := range x {\n\t\tif i != y {\n\t\t\tnewArray = append(newArray, x[i])\n\t\t}\n\t}\n\treturn newArray\n}\n\nfunc ascendSort(a []uint64) []uint64 {\n\tfor i := 0; i < len(a); i++ {\n\t\tfor i := 0; i < len(a)-1; i++ {\n\t\t\tif a[i] > a[i+1] {\n\t\t\t\ttmp := a[i+1]\n\t\t\t\ta[i+1] = a[i]\n\t\t\t\ta[i] = tmp\n\t\t\t}\n\t\t}\n\t}\n\treturn a\n}\n\nfunc descendSort(a []uint64) []uint64 {\n\tfor i := 0; i < len(a); i++ {\n\t\tfor i := 0; i < len(a)-1; i++ {\n\t\t\tif a[i] < a[i+1] {\n\t\t\t\ttmp := a[i+1]\n\t\t\t\ta[i+1] = a[i]\n\t\t\t\ta[i] = tmp\n\t\t\t}\n\t\t}\n\t}\n\treturn a\n}\n\nfunc maxAndIndex(a []uint64) (uint64, int) {\n\tmax := uint64(0)\n\tindex := 0\n\tfor i, v := range a {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t\tindex = i\n\t\t}\n\t}\n\treturn max, index\n}\n\nfunc sum(a []uint64) uint64 {\n\tsum := uint64(0)\n\tfor _, v := range a {\n\t\tsum += v\n\t}\n\treturn sum\n}\n\nfunc main() {\n\t// sc.Split(bufio.ScanWords)\n\t_ = int(nextInt())\n\tL := intArray(strings.Split(nextLine(), \" \"))\n\n\tfor i := len(L)-1; i > 0; i-- {\n\n\t\tif L[i-1] - L[i] > 1{\n\t\t\tfmt.Println(\"No\")\n\t\t\tos.Exit(0)\n\t\t} else if L[i-1] - L[i] == 1 {\n\t\t\tL[i-1] -= 1\n\t\t}\n\t}\n\n\tfmt.Println(\"Yes\")\n}\n", "language": "Go", "metadata": {"date": 1573743483, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02953.html", "problem_id": "p02953", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02953/input.txt", "sample_output_relpath": "derived/input_output/data/p02953/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02953/Go/s616779649.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s616779649", "user_id": "u124735330"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math/big\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() uint64 {\n\tsc.Scan()\n\ti, e := strconv.ParseUint(sc.Text(), 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc intArray(n []string) []int {\n\tvar m []int\n\tfor i, _ := range n {\n\t\tv, _ := strconv.Atoi(n[i])\n\t\tm = append(m, v)\n\t}\n\treturn m\n}\n\nfunc uint64Array(n []string) []uint64 {\n\tvar m []uint64\n\tfor i, _ := range n {\n\t\tv, _ := strconv.ParseUint(n[i], 10, 64)\n\t\tm = append(m, v)\n\t}\n\treturn m\n}\n\nfunc intExistIn(v int, arr []int) bool {\n\tfor _, a := range arr {\n\t\tif a == v {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc stringExistIn(v string, arr []string) bool {\n\tfor _, a := range arr {\n\t\tif a == v {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc gcd(m, n uint64) uint64 {\n\tx := new(big.Int)\n\ty := new(big.Int)\n\tz := new(big.Int)\n\ta := new(big.Int).SetUint64(m)\n\tb := new(big.Int).SetUint64(n)\n\treturn z.GCD(x, y, a, b).Uint64()\n}\n\nfunc uintArrayToStr(a []uint64) string {\n\tvar S string\n\n\tfor _, v := range a {\n\t\tS += strconv.Itoa(int(v))\n\t}\n\treturn S\n}\n\nfunc remove(x []uint64, y int) []uint64 {\n\tvar newArray []uint64\n\tfor i, _ := range x {\n\t\tif i != y {\n\t\t\tnewArray = append(newArray, x[i])\n\t\t}\n\t}\n\treturn newArray\n}\n\nfunc ascendSort(a []uint64) []uint64 {\n\tfor i := 0; i < len(a); i++ {\n\t\tfor i := 0; i < len(a)-1; i++ {\n\t\t\tif a[i] > a[i+1] {\n\t\t\t\ttmp := a[i+1]\n\t\t\t\ta[i+1] = a[i]\n\t\t\t\ta[i] = tmp\n\t\t\t}\n\t\t}\n\t}\n\treturn a\n}\n\nfunc descendSort(a []uint64) []uint64 {\n\tfor i := 0; i < len(a); i++ {\n\t\tfor i := 0; i < len(a)-1; i++ {\n\t\t\tif a[i] < a[i+1] {\n\t\t\t\ttmp := a[i+1]\n\t\t\t\ta[i+1] = a[i]\n\t\t\t\ta[i] = tmp\n\t\t\t}\n\t\t}\n\t}\n\treturn a\n}\n\nfunc maxAndIndex(a []uint64) (uint64, int) {\n\tmax := uint64(0)\n\tindex := 0\n\tfor i, v := range a {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t\tindex = i\n\t\t}\n\t}\n\treturn max, index\n}\n\nfunc sum(a []uint64) uint64 {\n\tsum := uint64(0)\n\tfor _, v := range a {\n\t\tsum += v\n\t}\n\treturn sum\n}\n\nfunc main() {\n\t// sc.Split(bufio.ScanWords)\n\t_ = int(nextInt())\n\tL := intArray(strings.Split(nextLine(), \" \"))\n\n\tfor i := len(L)-1; i > 0; i-- {\n\n\t\tif L[i-1] - L[i] > 1{\n\t\t\tfmt.Println(\"No\")\n\t\t\tos.Exit(0)\n\t\t} else if L[i-1] - L[i] == 1 {\n\t\t\tL[i-1] -= 1\n\t\t}\n\t}\n\n\tfmt.Println(\"Yes\")\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "sample_input": "5\n1 2 1 1 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02953", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2308, "cpu_time_ms": 1, "memory_kb": 768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s728122984", "group_id": "codeNet:p02953", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc solve() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\th := make([]int, n)\n\tsc := bufio.NewScanner(os.Stdin)\n\tbuffer := make([]byte, 10000)\n\tsc.Buffer(buffer, 2000000)\n\tsc.Scan()\n\targs := strings.Split(sc.Text(), \" \")\n\tfor i := 0; i < n; i++ {\n\t\th[i], _ = strconv.Atoi(args[i])\n\t}\n\n\table := true\n\tb := h[0] - 1\n\tfor i := 1; i < n; i++ {\n\t\tif b <= h[i]-1 {\n\t\t\tb = h[i] - 1\n\t\t} else if b <= h[i] {\n\t\t\tb = h[i]\n\t\t} else {\n\t\t\table = false\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif able {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\nfunc main() {\n\tsolve()\n}\n", "language": "Go", "metadata": {"date": 1572213862, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02953.html", "problem_id": "p02953", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02953/input.txt", "sample_output_relpath": "derived/input_output/data/p02953/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02953/Go/s728122984.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s728122984", "user_id": "u248995595"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc solve() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\th := make([]int, n)\n\tsc := bufio.NewScanner(os.Stdin)\n\tbuffer := make([]byte, 10000)\n\tsc.Buffer(buffer, 2000000)\n\tsc.Scan()\n\targs := strings.Split(sc.Text(), \" \")\n\tfor i := 0; i < n; i++ {\n\t\th[i], _ = strconv.Atoi(args[i])\n\t}\n\n\table := true\n\tb := h[0] - 1\n\tfor i := 1; i < n; i++ {\n\t\tif b <= h[i]-1 {\n\t\t\tb = h[i] - 1\n\t\t} else if b <= h[i] {\n\t\t\tb = h[i]\n\t\t} else {\n\t\t\table = false\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif able {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\nfunc main() {\n\tsolve()\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "sample_input": "5\n1 2 1 1 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02953", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 602, "cpu_time_ms": 22, "memory_kb": 6528}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s676109182", "group_id": "codeNet:p02953", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar ini int\n\tfmt.Scan(&ini)\n\ta := ini\n\tm := 0\n\tfor i := 1; i < n; i++ {\n\t\tvar h int\n\t\tfmt.Scan(&h)\n\t\tm = max(m, h)\n\t\tif a <= h {\n\t\t\ta = h\n\t\t\tcontinue\n\t\t} else if a-1 == h && m == h+1 {\n\t\t\ta = h\n\t\t\tcontinue\n\t\t} else {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n", "language": "Go", "metadata": {"date": 1570377384, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02953.html", "problem_id": "p02953", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02953/input.txt", "sample_output_relpath": "derived/input_output/data/p02953/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02953/Go/s676109182.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s676109182", "user_id": "u394040864"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tvar ini int\n\tfmt.Scan(&ini)\n\ta := ini\n\tm := 0\n\tfor i := 1; i < n; i++ {\n\t\tvar h int\n\t\tfmt.Scan(&h)\n\t\tm = max(m, h)\n\t\tif a <= h {\n\t\t\ta = h\n\t\t\tcontinue\n\t\t} else if a-1 == h && m == h+1 {\n\t\t\ta = h\n\t\t\tcontinue\n\t\t} else {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "sample_input": "5\n1 2 1 1 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02953", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 742, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s335549402", "group_id": "codeNet:p02953", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N int\n\tfmt.Scanf(\"%d\", &N)\n\tH := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scanf(\"%d\", &H[i])\n\t}\n\n\tcurrent := 0\n\tflag := true\n\tfor _, h := range H {\n\t\tif current > h {\n\t\t\tflag = false\n\t\t\tbreak\n\t\t} else if current < h {\n\t\t\tcurrent = h - 1\n\t\t}\n\t}\n\n\tif flag {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1570024350, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02953.html", "problem_id": "p02953", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02953/input.txt", "sample_output_relpath": "derived/input_output/data/p02953/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02953/Go/s335549402.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s335549402", "user_id": "u304913019"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N int\n\tfmt.Scanf(\"%d\", &N)\n\tH := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scanf(\"%d\", &H[i])\n\t}\n\n\tcurrent := 0\n\tflag := true\n\tfor _, h := range H {\n\t\tif current > h {\n\t\t\tflag = false\n\t\t\tbreak\n\t\t} else if current < h {\n\t\t\tcurrent = h - 1\n\t\t}\n\t}\n\n\tif flag {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "sample_input": "5\n1 2 1 1 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02953", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 365, "cpu_time_ms": 704, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s691534100", "group_id": "codeNet:p02953", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scanln(&N)\n\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\n\tvar cur int\n\tfor i := 0; i < N; i++ {\n\t\tsc.Scan()\n\t\th, _ := strconv.Atoi(sc.Text())\n\n\t\tif h < cur-1 {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t} else if h > cur {\n\t\t\tcur = h\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n}\n", "language": "Go", "metadata": {"date": 1567279059, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02953.html", "problem_id": "p02953", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02953/input.txt", "sample_output_relpath": "derived/input_output/data/p02953/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02953/Go/s691534100.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s691534100", "user_id": "u020639289"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scanln(&N)\n\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\n\tvar cur int\n\tfor i := 0; i < N; i++ {\n\t\tsc.Scan()\n\t\th, _ := strconv.Atoi(sc.Text())\n\n\t\tif h < cur-1 {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t} else if h > cur {\n\t\t\tcur = h\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "sample_input": "5\n1 2 1 1 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02953", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 27, "memory_kb": 2176}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s814603350", "group_id": "codeNet:p02953", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst pi = math.Pi\n\nvar mod int = pow(10, 9) + 7\nvar Umod uint64 = 1000000007\nvar cnt, ans int\n\nfunc main() {\n\treader.Split(bufio.ScanWords)\n\tN, _ := strconv.Atoi(read())\n\tH := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tH[i], _ = strconv.Atoi(read())\n\t}\n\tfor i := N - 1; 0 < i; i-- {\n\t\tif H[i] < H[i-1] {\n\t\t\tH[i-1]--\n\t\t}\n\n\t\tif H[i] < H[i-1] {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n}\n\n/* ---------------------------------------- */\n\nvar reader = bufio.NewScanner(os.Stdin)\n\nfunc read() string {\n\treader.Scan()\n\treturn reader.Text()\n}\n\nfunc lcm(x, y int) int {\n\treturn (x / gcd(x, y)) * y\n}\n\nfunc gcd(x, y int) int {\n\tif x%y == 0 {\n\t\treturn y\n\t} else {\n\t\tr := x % y\n\t\treturn gcd(y, r)\n\t}\n}\n\nvar fac [1000000]int\nvar finv [1000000]int\nvar inv [1000000]int\n\nfunc combination_init() {\n\tfac[0], fac[1] = 1, 1\n\tfinv[0], finv[1] = 1, 1\n\tinv[1] = 1\n\n\t// invは a^(-1) mod p\n\t// pをaで割ることを考える\n\n\t// p/a*(a) + p%a = p\n\t// p/a*(a) + p%a = 0 (mod p)\n\t// -p%a = p/a*(a) (mod p)\n\t// -p%a *a^(-1)= p/a (mod p)\n\t// a^(-1)= p/a * (-p%a)^(-1) (mod p)\n\t// a^(-1) =\n\n\tfor i := 2; i < 1000000; i++ {\n\t\tfac[i] = fac[i-1] * i % mod\n\t\tinv[i] = mod - inv[mod%i]*(mod/i)%mod\n\t\tfinv[i] = finv[i-1] * inv[i] % mod\n\t}\n}\n\nfunc combination(x, y int) int {\n\tif x < y {\n\t\treturn 0\n\t}\n\tif fac[0] != 1 {\n\t\tcombination_init()\n\t}\n\treturn fac[x] * (finv[y] * finv[x-y] % mod) % mod\n\t//return fac[x] / (fac[y] * fac[x-y])\n}\n\nfunc permutation(x, y int) int {\n\tif x < y {\n\t\treturn 0\n\t}\n\tif fac[0] != 1 {\n\t\tcombination_init()\n\t}\n\treturn fac[x] * (finv[x-y] % mod) % mod\n\t//return fac[x] / fac[x-y]\n}\n\nfunc max(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Max(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\n\nfunc min(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Min(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\nfunc pow(x, y int) int { return int(math.Pow(float64(x), float64(y))) }\nfunc abs(x int) int { return int(math.Abs(float64(x))) }\nfunc floor(x int) int { return int(math.Floor(float64(x))) }\nfunc ceil(x int) int { return int(math.Ceil(float64(x))) }\n\ntype SortBy [][]int\n\nfunc (a SortBy) Len() int { return len(a) }\nfunc (a SortBy) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a SortBy) Less(i, j int) bool {\n\tif a[i][0] == a[j][0] {\n\t\treturn a[i][1] > a[j][1]\n\t}\n\treturn a[i][0] < a[j][0]\n}\n\ntype PriorityQueue []int\n\nfunc (h PriorityQueue) Len() int { return len(h) }\nfunc (h PriorityQueue) Less(i, j int) bool { return h[i] > h[j] }\nfunc (h PriorityQueue) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\nfunc (h *PriorityQueue) Push(x interface{}) { *h = append(*h, x.(int)) }\nfunc (h *PriorityQueue) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n", "language": "Go", "metadata": {"date": 1566337642, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02953.html", "problem_id": "p02953", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02953/input.txt", "sample_output_relpath": "derived/input_output/data/p02953/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02953/Go/s814603350.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s814603350", "user_id": "u266742706"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst pi = math.Pi\n\nvar mod int = pow(10, 9) + 7\nvar Umod uint64 = 1000000007\nvar cnt, ans int\n\nfunc main() {\n\treader.Split(bufio.ScanWords)\n\tN, _ := strconv.Atoi(read())\n\tH := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tH[i], _ = strconv.Atoi(read())\n\t}\n\tfor i := N - 1; 0 < i; i-- {\n\t\tif H[i] < H[i-1] {\n\t\t\tH[i-1]--\n\t\t}\n\n\t\tif H[i] < H[i-1] {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n}\n\n/* ---------------------------------------- */\n\nvar reader = bufio.NewScanner(os.Stdin)\n\nfunc read() string {\n\treader.Scan()\n\treturn reader.Text()\n}\n\nfunc lcm(x, y int) int {\n\treturn (x / gcd(x, y)) * y\n}\n\nfunc gcd(x, y int) int {\n\tif x%y == 0 {\n\t\treturn y\n\t} else {\n\t\tr := x % y\n\t\treturn gcd(y, r)\n\t}\n}\n\nvar fac [1000000]int\nvar finv [1000000]int\nvar inv [1000000]int\n\nfunc combination_init() {\n\tfac[0], fac[1] = 1, 1\n\tfinv[0], finv[1] = 1, 1\n\tinv[1] = 1\n\n\t// invは a^(-1) mod p\n\t// pをaで割ることを考える\n\n\t// p/a*(a) + p%a = p\n\t// p/a*(a) + p%a = 0 (mod p)\n\t// -p%a = p/a*(a) (mod p)\n\t// -p%a *a^(-1)= p/a (mod p)\n\t// a^(-1)= p/a * (-p%a)^(-1) (mod p)\n\t// a^(-1) =\n\n\tfor i := 2; i < 1000000; i++ {\n\t\tfac[i] = fac[i-1] * i % mod\n\t\tinv[i] = mod - inv[mod%i]*(mod/i)%mod\n\t\tfinv[i] = finv[i-1] * inv[i] % mod\n\t}\n}\n\nfunc combination(x, y int) int {\n\tif x < y {\n\t\treturn 0\n\t}\n\tif fac[0] != 1 {\n\t\tcombination_init()\n\t}\n\treturn fac[x] * (finv[y] * finv[x-y] % mod) % mod\n\t//return fac[x] / (fac[y] * fac[x-y])\n}\n\nfunc permutation(x, y int) int {\n\tif x < y {\n\t\treturn 0\n\t}\n\tif fac[0] != 1 {\n\t\tcombination_init()\n\t}\n\treturn fac[x] * (finv[x-y] % mod) % mod\n\t//return fac[x] / fac[x-y]\n}\n\nfunc max(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Max(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\n\nfunc min(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Min(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\nfunc pow(x, y int) int { return int(math.Pow(float64(x), float64(y))) }\nfunc abs(x int) int { return int(math.Abs(float64(x))) }\nfunc floor(x int) int { return int(math.Floor(float64(x))) }\nfunc ceil(x int) int { return int(math.Ceil(float64(x))) }\n\ntype SortBy [][]int\n\nfunc (a SortBy) Len() int { return len(a) }\nfunc (a SortBy) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a SortBy) Less(i, j int) bool {\n\tif a[i][0] == a[j][0] {\n\t\treturn a[i][1] > a[j][1]\n\t}\n\treturn a[i][0] < a[j][0]\n}\n\ntype PriorityQueue []int\n\nfunc (h PriorityQueue) Len() int { return len(h) }\nfunc (h PriorityQueue) Less(i, j int) bool { return h[i] > h[j] }\nfunc (h PriorityQueue) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\nfunc (h *PriorityQueue) Push(x interface{}) { *h = append(*h, x.(int)) }\nfunc (h *PriorityQueue) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "sample_input": "5\n1 2 1 1 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02953", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2908, "cpu_time_ms": 28, "memory_kb": 3072}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s766065632", "group_id": "codeNet:p02953", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// type ByValue []float64\n\n// func (s ByValue) Len() int { return len(s) }\n// func (s ByValue) Swap(i, j int) { s[i], s[j] = s[j], s[i] }\n// func (s ByValue) Less(i, j int) bool { return s[i] < s[j] }\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Scan()\n\tn, _ := strconv.Atoi(sc.Text())\n\tsc.Scan()\n\tstrH := sc.Text()\n\tstrHList := strings.Split(strH, \" \")\n\thList := []int{}\n\tfor _, v := range strHList {\n\t\tintV, _ := strconv.Atoi(v)\n\t\thList = append(hList, intV)\n\t}\n\tres := \"Yes\"\n\t// max := hList[0]\n\tmax := 0\n\tfor i := 1; i < n; i++ {\n\t\t// if hList[i] < max {\n\t\t// \tres = \"No\"\n\t\t// }\n\t\t// if max < hList[i] {\n\t\t// \tmax = hList[i] - 1\n\t\t// }\n\t\tmax = hList[i]\n\t}\n\tfmt.Println(max)\n\tfmt.Println(res)\n}\n", "language": "Go", "metadata": {"date": 1566226070, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02953.html", "problem_id": "p02953", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02953/input.txt", "sample_output_relpath": "derived/input_output/data/p02953/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02953/Go/s766065632.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s766065632", "user_id": "u675497468"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// type ByValue []float64\n\n// func (s ByValue) Len() int { return len(s) }\n// func (s ByValue) Swap(i, j int) { s[i], s[j] = s[j], s[i] }\n// func (s ByValue) Less(i, j int) bool { return s[i] < s[j] }\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Scan()\n\tn, _ := strconv.Atoi(sc.Text())\n\tsc.Scan()\n\tstrH := sc.Text()\n\tstrHList := strings.Split(strH, \" \")\n\thList := []int{}\n\tfor _, v := range strHList {\n\t\tintV, _ := strconv.Atoi(v)\n\t\thList = append(hList, intV)\n\t}\n\tres := \"Yes\"\n\t// max := hList[0]\n\tmax := 0\n\tfor i := 1; i < n; i++ {\n\t\t// if hList[i] < max {\n\t\t// \tres = \"No\"\n\t\t// }\n\t\t// if max < hList[i] {\n\t\t// \tmax = hList[i] - 1\n\t\t// }\n\t\tmax = hList[i]\n\t}\n\tfmt.Println(max)\n\tfmt.Println(res)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "sample_input": "5\n1 2 1 1 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02953", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 791, "cpu_time_ms": 3, "memory_kb": 768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s844873195", "group_id": "codeNet:p02953", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// type ByValue []float64\n\n// func (s ByValue) Len() int { return len(s) }\n// func (s ByValue) Swap(i, j int) { s[i], s[j] = s[j], s[i] }\n// func (s ByValue) Less(i, j int) bool { return s[i] < s[j] }\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Scan()\n\tn, _ := strconv.Atoi(sc.Text())\n\tsc.Scan()\n\tstrH := sc.Text()\n\tstrHList := strings.Split(strH, \" \")\n\thList := []int{}\n\tfor _, v := range strHList {\n\t\tintV, _ := strconv.Atoi(v)\n\t\thList = append(hList, intV)\n\t}\n\tres := \"Yes\"\n\tmax := hList[0]\n\tfor i := 1; i < n; i++ {\n\t\tif hList[i] < max {\n\t\t\tres = \"No\"\n\t\t}\n\t\tif max < hList[i] {\n\t\t\tmax = hList[i] - 1\n\t\t}\n\t}\n\tfmt.Println(res)\n}\n", "language": "Go", "metadata": {"date": 1566224266, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02953.html", "problem_id": "p02953", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02953/input.txt", "sample_output_relpath": "derived/input_output/data/p02953/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02953/Go/s844873195.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s844873195", "user_id": "u675497468"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// type ByValue []float64\n\n// func (s ByValue) Len() int { return len(s) }\n// func (s ByValue) Swap(i, j int) { s[i], s[j] = s[j], s[i] }\n// func (s ByValue) Less(i, j int) bool { return s[i] < s[j] }\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Scan()\n\tn, _ := strconv.Atoi(sc.Text())\n\tsc.Scan()\n\tstrH := sc.Text()\n\tstrHList := strings.Split(strH, \" \")\n\thList := []int{}\n\tfor _, v := range strHList {\n\t\tintV, _ := strconv.Atoi(v)\n\t\thList = append(hList, intV)\n\t}\n\tres := \"Yes\"\n\tmax := hList[0]\n\tfor i := 1; i < n; i++ {\n\t\tif hList[i] < max {\n\t\t\tres = \"No\"\n\t\t}\n\t\tif max < hList[i] {\n\t\t\tmax = hList[i] - 1\n\t\t}\n\t}\n\tfmt.Println(res)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "sample_input": "5\n1 2 1 1 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02953", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 725, "cpu_time_ms": 3, "memory_kb": 768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s673903574", "group_id": "codeNet:p02953", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t//\t\"strings\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\n\tn := sc.NextInt()\n\tprev := -1\n\tfor i := 0; i < n; i++ {\n\t\th := sc.NextInt()\n\t\tif h > prev {\n\t\t\tprev = h - 1\n\t\t} else if h == prev {\n\t\t\tprev = h\n\t\t} else {\n\t\t\tfmt.Printf(\"No\\n\") // output for debug\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Printf(\"Yes\\n\")\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tresult = append(result, v)\n\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1566087109, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02953.html", "problem_id": "p02953", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02953/input.txt", "sample_output_relpath": "derived/input_output/data/p02953/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02953/Go/s673903574.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s673903574", "user_id": "u084693263"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t//\t\"strings\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\n\tn := sc.NextInt()\n\tprev := -1\n\tfor i := 0; i < n; i++ {\n\t\th := sc.NextInt()\n\t\tif h > prev {\n\t\t\tprev = h - 1\n\t\t} else if h == prev {\n\t\t\tprev = h\n\t\t} else {\n\t\t\tfmt.Printf(\"No\\n\") // output for debug\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Printf(\"Yes\\n\")\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tresult = append(result, v)\n\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "sample_input": "5\n1 2 1 1 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02953", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1811, "cpu_time_ms": 29, "memory_kb": 6528}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s936112332", "group_id": "codeNet:p02953", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tstdin := bufio.NewScanner(os.Stdin)\n\tstdin.Scan()\n\tstdin.Scan()\n\t_, _ = strconv.Atoi(stdin.Text())\n\tarr := strings.Split(stdin.Text(), \" \")\n\told := 0\n\tnow := 0\n\tb := true\n\tfor i, v := range arr {\n\t\tnow, _ = strconv.Atoi(v)\n\t\tswitch b == true {\n\t\tcase i == 0:\n\t\t\told = now\n\t\tdefault:\n\t\t\tchk := old - now\n\t\t\tswitch {\n\t\t\tcase chk == 0:\n\t\t\t\tb = true\n\t\t\t\told = now\n\t\t\tcase chk <= -1:\n\t\t\t\tb = true\n\t\t\t\tnow -= 1\n\t\t\t\told = now\n\t\t\tcase chk >= 1:\n\t\t\t\tb = false\n\t\t\t}\n\t\t}\n\t}\n\tif b == true {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\n", "language": "Go", "metadata": {"date": 1565465121, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02953.html", "problem_id": "p02953", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02953/input.txt", "sample_output_relpath": "derived/input_output/data/p02953/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02953/Go/s936112332.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s936112332", "user_id": "u852191794"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tstdin := bufio.NewScanner(os.Stdin)\n\tstdin.Scan()\n\tstdin.Scan()\n\t_, _ = strconv.Atoi(stdin.Text())\n\tarr := strings.Split(stdin.Text(), \" \")\n\told := 0\n\tnow := 0\n\tb := true\n\tfor i, v := range arr {\n\t\tnow, _ = strconv.Atoi(v)\n\t\tswitch b == true {\n\t\tcase i == 0:\n\t\t\told = now\n\t\tdefault:\n\t\t\tchk := old - now\n\t\t\tswitch {\n\t\t\tcase chk == 0:\n\t\t\t\tb = true\n\t\t\t\told = now\n\t\t\tcase chk <= -1:\n\t\t\t\tb = true\n\t\t\t\tnow -= 1\n\t\t\t\told = now\n\t\t\tcase chk >= 1:\n\t\t\t\tb = false\n\t\t\t}\n\t\t}\n\t}\n\tif b == true {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "sample_input": "5\n1 2 1 1 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02953", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 621, "cpu_time_ms": 1, "memory_kb": 768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s212186934", "group_id": "codeNet:p02953", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc nextInt(sc *bufio.Scanner) int {\n\tsc.Scan()\n\tt, _ := strconv.Atoi(sc.Text())\n\treturn t\n}\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\th := make([]int, n)\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tfor i := 0; i < n; i++ {\n\t\th[i] = nextInt(sc)\n\t}\n\tok := true\n\tprev := -1\n\tfor i := 0; i < n; i++ {\n\t\tif prev > h[i] {\n\t\t\tok = false\n\t\t\tbreak\n\t\t} else if prev < h[i] {\n\t\t\th[i]--\n\t\t}\n\t\tprev = h[i]\n\t}\n\tif ok {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1565060053, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02953.html", "problem_id": "p02953", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02953/input.txt", "sample_output_relpath": "derived/input_output/data/p02953/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02953/Go/s212186934.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s212186934", "user_id": "u196030116"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc nextInt(sc *bufio.Scanner) int {\n\tsc.Scan()\n\tt, _ := strconv.Atoi(sc.Text())\n\treturn t\n}\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\th := make([]int, n)\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tfor i := 0; i < n; i++ {\n\t\th[i] = nextInt(sc)\n\t}\n\tok := true\n\tprev := -1\n\tfor i := 0; i < n; i++ {\n\t\tif prev > h[i] {\n\t\t\tok = false\n\t\t\tbreak\n\t\t} else if prev < h[i] {\n\t\t\th[i]--\n\t\t}\n\t\tprev = h[i]\n\t}\n\tif ok {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "sample_input": "5\n1 2 1 1 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02953", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 538, "cpu_time_ms": 28, "memory_kb": 3072}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s840122843", "group_id": "codeNet:p02953", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc nextInt(sc *bufio.Scanner) int {\n\tsc.Scan()\n\tt, _ := strconv.Atoi(sc.Text())\n\treturn t\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\th := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\th[i] = nextInt(sc)\n\t}\n\n ok := true\n\tmaxh := h[0]\n\tfor i := 0; i < n-1; i++ {\n\t\tif h[i] > h[i+1] {\n\t\t\t// 今のマスの方が次のマスより背が高い\n\t\t\tif maxh >= h[i]-1 {\n\t\t\t\th[i]--\n\t\t\t\tmaxh = h[i]\n\t\t\t} else {\n\t\t\t\tok = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t} else {\n\t\t\tif h[i] > maxh {\n\t\t\t\tmaxh = h[i]\n\t\t\t}\n\t\t}\n\t}\n\tif ok {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1565053076, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02953.html", "problem_id": "p02953", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02953/input.txt", "sample_output_relpath": "derived/input_output/data/p02953/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02953/Go/s840122843.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s840122843", "user_id": "u196030116"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc nextInt(sc *bufio.Scanner) int {\n\tsc.Scan()\n\tt, _ := strconv.Atoi(sc.Text())\n\treturn t\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\th := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\th[i] = nextInt(sc)\n\t}\n\n ok := true\n\tmaxh := h[0]\n\tfor i := 0; i < n-1; i++ {\n\t\tif h[i] > h[i+1] {\n\t\t\t// 今のマスの方が次のマスより背が高い\n\t\t\tif maxh >= h[i]-1 {\n\t\t\t\th[i]--\n\t\t\t\tmaxh = h[i]\n\t\t\t} else {\n\t\t\t\tok = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t} else {\n\t\t\tif h[i] > maxh {\n\t\t\t\tmaxh = h[i]\n\t\t\t}\n\t\t}\n\t}\n\tif ok {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "sample_input": "5\n1 2 1 1 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02953", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 678, "cpu_time_ms": 28, "memory_kb": 3072}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s004955910", "group_id": "codeNet:p02953", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar ReadString func() string\nvar ReadLine func() string\nvar ReadInt64 func() int64\nvar ReadInt func() int\nvar ReadIntSlice func(int) []int\nvar ReadInt64Slice func(int) []int64\nvar GetIntAbs func(int) int\nvar Atoi func(string) int\nvar FindMin func([] int) int\nvar FindMax func([] int) int\nvar StrReverse func(string) string\n\nfunc init() {\n\tReadString = newReadString()\n\tReadLine = readLine\n\tReadInt64 = readInt64\n\tReadInt = readInt\n\tReadIntSlice = readIntSlice\n\tFindMin = findMin\n\tFindMax = findMax\n\tStrReverse = strReverse\n GetIntAbs = getIntAbs\n}\n\nfunc main() {\n\tn := ReadInt()\n h := ReadIntSlice(n)\n if n <= 1 {\n fmt.Println(\"Yes\")\n return\n }\n for i, cur := range h {\n if i + 1 == n {\n continue\n }\n next := h[i+1]\n nextDiff := GetIntAbs(cur - next)\n if i > 0 && (nextDiff <= 1 && GetIntAbs(cur - h[i - 1]) <= 1) {\n continue\n } else if i == 0 && nextDiff <= 1 {\n continue\n } else {\n fmt.Println(\"No\")\n return\n }\n }\n fmt.Println(\"Yes\")\n \n}\n\nfunc strReverse(s string) string {\n\trunes := []rune(s)\n\tl := len(runes)\n\tfor i, j := 0, l-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\n\nfunc newReadString() func() string {\n\tsc.Buffer(make([]byte, 1024), 2048)\n\tsc.Split(bufio.ScanWords)\n\treturn func() string {\n\t\tif !sc.Scan() {\n\t\t\tpanic(\"scanできなかった\")\n\t\t}\n\t\treturn sc.Text()\n\t}\n}\n\nfunc readLine() string {\n\tif !sc.Scan() {\n\t\tpanic(\"line をscanできなかった\")\n\t}\n\treturn sc.Text()\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tfmt.Println(\"parseInt失敗\")\n\t\tpanic(err.Error())\n\t}\n\treturn int64(i)\n}\n\nfunc readInt() int {\n\ti := ReadInt64()\n\treturn int(i)\n}\n\nfunc readIntSlice(n int) []int {\n\tarr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarr[i] = ReadInt()\n\t}\n\treturn arr\n}\n\nfunc readInt64Slice(n int) []int64 {\n\tarr := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tarr[i] = ReadInt64()\n\t}\n\treturn arr\n}\n\n/*------ number util ------*/\n\nfunc getIntAbs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\treturn n\n}\n\nfunc atoi(a string) int {\n\ti, err := strconv.Atoi(a)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc findMin(arr []int) int {\n\tif len(arr) == 0 {\n\t\treturn 0\n\t}\n\tmin := arr[0]\n\tfor _, v := range arr {\n\t\tif v < min {\n\t\t\tmin = v\n\t\t}\n\t}\n\treturn min\n}\n\nfunc findMax(arr []int) int {\n\tif len(arr) == 0 {\n\t\treturn 0\n\t}\n\tmax := arr[0]\n\tfor _, v := range arr {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}\n", "language": "Go", "metadata": {"date": 1564971923, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02953.html", "problem_id": "p02953", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02953/input.txt", "sample_output_relpath": "derived/input_output/data/p02953/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02953/Go/s004955910.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s004955910", "user_id": "u657610454"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar ReadString func() string\nvar ReadLine func() string\nvar ReadInt64 func() int64\nvar ReadInt func() int\nvar ReadIntSlice func(int) []int\nvar ReadInt64Slice func(int) []int64\nvar GetIntAbs func(int) int\nvar Atoi func(string) int\nvar FindMin func([] int) int\nvar FindMax func([] int) int\nvar StrReverse func(string) string\n\nfunc init() {\n\tReadString = newReadString()\n\tReadLine = readLine\n\tReadInt64 = readInt64\n\tReadInt = readInt\n\tReadIntSlice = readIntSlice\n\tFindMin = findMin\n\tFindMax = findMax\n\tStrReverse = strReverse\n GetIntAbs = getIntAbs\n}\n\nfunc main() {\n\tn := ReadInt()\n h := ReadIntSlice(n)\n if n <= 1 {\n fmt.Println(\"Yes\")\n return\n }\n for i, cur := range h {\n if i + 1 == n {\n continue\n }\n next := h[i+1]\n nextDiff := GetIntAbs(cur - next)\n if i > 0 && (nextDiff <= 1 && GetIntAbs(cur - h[i - 1]) <= 1) {\n continue\n } else if i == 0 && nextDiff <= 1 {\n continue\n } else {\n fmt.Println(\"No\")\n return\n }\n }\n fmt.Println(\"Yes\")\n \n}\n\nfunc strReverse(s string) string {\n\trunes := []rune(s)\n\tl := len(runes)\n\tfor i, j := 0, l-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\n\nfunc newReadString() func() string {\n\tsc.Buffer(make([]byte, 1024), 2048)\n\tsc.Split(bufio.ScanWords)\n\treturn func() string {\n\t\tif !sc.Scan() {\n\t\t\tpanic(\"scanできなかった\")\n\t\t}\n\t\treturn sc.Text()\n\t}\n}\n\nfunc readLine() string {\n\tif !sc.Scan() {\n\t\tpanic(\"line をscanできなかった\")\n\t}\n\treturn sc.Text()\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tfmt.Println(\"parseInt失敗\")\n\t\tpanic(err.Error())\n\t}\n\treturn int64(i)\n}\n\nfunc readInt() int {\n\ti := ReadInt64()\n\treturn int(i)\n}\n\nfunc readIntSlice(n int) []int {\n\tarr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarr[i] = ReadInt()\n\t}\n\treturn arr\n}\n\nfunc readInt64Slice(n int) []int64 {\n\tarr := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tarr[i] = ReadInt64()\n\t}\n\treturn arr\n}\n\n/*------ number util ------*/\n\nfunc getIntAbs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\treturn n\n}\n\nfunc atoi(a string) int {\n\ti, err := strconv.Atoi(a)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc findMin(arr []int) int {\n\tif len(arr) == 0 {\n\t\treturn 0\n\t}\n\tmin := arr[0]\n\tfor _, v := range arr {\n\t\tif v < min {\n\t\t\tmin = v\n\t\t}\n\t}\n\treturn min\n}\n\nfunc findMax(arr []int) int {\n\tif len(arr) == 0 {\n\t\treturn 0\n\t}\n\tmax := arr[0]\n\tfor _, v := range arr {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "sample_input": "5\n1 2 1 1 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02953", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2588, "cpu_time_ms": 30, "memory_kb": 3072}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s989131283", "group_id": "codeNet:p02953", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main(){\n var n,i uint64\n fmt.Scan(&n)\n h := make([]uint64, n)\n for i = 0; i < n; i++ {\n fmt.Scan(&h[i])\n }\n max := h[n - 1] + 1\n var flag bool = true\n for i = n - 1; i > 0; i-- {\n if h[i] > max {\n flag = false\n }\n max = h[i] + 1\n }\n if h[0] > max {\n flag = false\n }\n if(flag){\n fmt.Println(\"Yes\")\n }else{\n fmt.Println(\"No\")\n }\n}\n", "language": "Go", "metadata": {"date": 1564971640, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02953.html", "problem_id": "p02953", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02953/input.txt", "sample_output_relpath": "derived/input_output/data/p02953/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02953/Go/s989131283.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s989131283", "user_id": "u473913931"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main(){\n var n,i uint64\n fmt.Scan(&n)\n h := make([]uint64, n)\n for i = 0; i < n; i++ {\n fmt.Scan(&h[i])\n }\n max := h[n - 1] + 1\n var flag bool = true\n for i = n - 1; i > 0; i-- {\n if h[i] > max {\n flag = false\n }\n max = h[i] + 1\n }\n if h[0] > max {\n flag = false\n }\n if(flag){\n fmt.Println(\"Yes\")\n }else{\n fmt.Println(\"No\")\n }\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "sample_input": "5\n1 2 1 1 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02953", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 690, "memory_kb": 7296}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s342031291", "group_id": "codeNet:p02953", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\n\thArr := make([]int, N)\n\tfor i := range hArr {\n\t\tsc.Scan()\n\t\thArr[i], _ = strconv.Atoi(sc.Text())\n\t}\n\n\tenable := true\n\tfor i := 1; i < len(hArr); i++ {\n\t\tif hArr[i] - hArr[i-1] > 1 && i != len(hArr) - 1{\n\t\t\tenable = false\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif enable {\n\t\tfmt.Println(\"Yes\")\n\t}else{\n\t\tfmt.Println(\"No\")\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1564970769, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02953.html", "problem_id": "p02953", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02953/input.txt", "sample_output_relpath": "derived/input_output/data/p02953/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02953/Go/s342031291.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s342031291", "user_id": "u640431305"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\n\thArr := make([]int, N)\n\tfor i := range hArr {\n\t\tsc.Scan()\n\t\thArr[i], _ = strconv.Atoi(sc.Text())\n\t}\n\n\tenable := true\n\tfor i := 1; i < len(hArr); i++ {\n\t\tif hArr[i] - hArr[i-1] > 1 && i != len(hArr) - 1{\n\t\t\tenable = false\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif enable {\n\t\tfmt.Println(\"Yes\")\n\t}else{\n\t\tfmt.Println(\"No\")\n\t}\n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "sample_input": "5\n1 2 1 1 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02953", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 468, "cpu_time_ms": 28, "memory_kb": 3072}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s153660532", "group_id": "codeNet:p02953", "input_text": "package main\n\nimport \"fmt\"\n\nfunc inputSlice(inputNums int) []int {\n\tvar ary []int\n\tfor i := 0; i < inputNums; i++ {\n\t\tvar in int\n\t\tfmt.Scan(&in)\n\t\tary = append(ary, in)\n\t}\n\treturn ary\n}\n\nfunc check(ary []int) string {\n\tfor i := len(ary) - 1; i > 0; i-- {\n\t\tif ary[i]-1 == ary[i-1] {\n\t\t\tary[i]--\n\t\t}\n\t}\n\tfor i := 0; i < len(ary)-1; i++ {\n\t\tif ary[i] > ary[i+1] {\n\t\t\treturn \"No\"\n\t\t}\n\t}\n\treturn \"Yes\"\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tary := inputSlice(n)\n\tfmt.Println(check(ary))\n}\n", "language": "Go", "metadata": {"date": 1564970141, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02953.html", "problem_id": "p02953", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02953/input.txt", "sample_output_relpath": "derived/input_output/data/p02953/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02953/Go/s153660532.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s153660532", "user_id": "u895838522"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc inputSlice(inputNums int) []int {\n\tvar ary []int\n\tfor i := 0; i < inputNums; i++ {\n\t\tvar in int\n\t\tfmt.Scan(&in)\n\t\tary = append(ary, in)\n\t}\n\treturn ary\n}\n\nfunc check(ary []int) string {\n\tfor i := len(ary) - 1; i > 0; i-- {\n\t\tif ary[i]-1 == ary[i-1] {\n\t\t\tary[i]--\n\t\t}\n\t}\n\tfor i := 0; i < len(ary)-1; i++ {\n\t\tif ary[i] > ary[i+1] {\n\t\t\treturn \"No\"\n\t\t}\n\t}\n\treturn \"Yes\"\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tary := inputSlice(n)\n\tfmt.Println(check(ary))\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "sample_input": "5\n1 2 1 1 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02953", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 489, "cpu_time_ms": 758, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s581289470", "group_id": "codeNet:p02953", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.ParseInt(sc.Text(), 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn int(i)\n}\n\nfunc nextInt64() int64 {\n\tsc.Scan()\n\ti, e := strconv.ParseInt(sc.Text(), 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tn := nextInt()\n\tyes := \"Yes\"\n\tno := \"No\"\n\n\tif n == 1 {\n\t\tfmt.Println(yes)\n\t\treturn\n\t}\n\n\tnn := make([]int64, 0, n)\n\tfor i := 0; i < n; i++ {\n\t\tnn = append(nn, nextInt64())\n\t}\n\n\tnn = append(nn, 1000000000)\n\n\tfor i := 0; i < n; i++ {\n\t\t// if i+1 == n {\n\t\t// \tbreak\n\t\t// }\n\t\tif nn[i+1] == nn[i] {\n\t\t\tcontinue\n\t\t}\n\t\tif nn[i+1]-1 < nn[i] {\n\t\t\t// fmt.Printf(\"%#v %#v %#v\\n\", i, nn[i+1], nn[i])\n\t\t\tfmt.Println(no)\n\t\t\treturn\n\t\t}\n\n\t\tif nn[i+1] > nn[i] {\n\t\t\tnn[i+1]--\n\t\t}\n\t}\n\n\tfmt.Println(yes)\n}\n", "language": "Go", "metadata": {"date": 1564969177, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02953.html", "problem_id": "p02953", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02953/input.txt", "sample_output_relpath": "derived/input_output/data/p02953/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02953/Go/s581289470.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s581289470", "user_id": "u317845566"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.ParseInt(sc.Text(), 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn int(i)\n}\n\nfunc nextInt64() int64 {\n\tsc.Scan()\n\ti, e := strconv.ParseInt(sc.Text(), 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tn := nextInt()\n\tyes := \"Yes\"\n\tno := \"No\"\n\n\tif n == 1 {\n\t\tfmt.Println(yes)\n\t\treturn\n\t}\n\n\tnn := make([]int64, 0, n)\n\tfor i := 0; i < n; i++ {\n\t\tnn = append(nn, nextInt64())\n\t}\n\n\tnn = append(nn, 1000000000)\n\n\tfor i := 0; i < n; i++ {\n\t\t// if i+1 == n {\n\t\t// \tbreak\n\t\t// }\n\t\tif nn[i+1] == nn[i] {\n\t\t\tcontinue\n\t\t}\n\t\tif nn[i+1]-1 < nn[i] {\n\t\t\t// fmt.Printf(\"%#v %#v %#v\\n\", i, nn[i+1], nn[i])\n\t\t\tfmt.Println(no)\n\t\t\treturn\n\t\t}\n\n\t\tif nn[i+1] > nn[i] {\n\t\t\tnn[i+1]--\n\t\t}\n\t}\n\n\tfmt.Println(yes)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "sample_input": "5\n1 2 1 1 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02953", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 887, "cpu_time_ms": 29, "memory_kb": 4096}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s444590969", "group_id": "codeNet:p02953", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\th := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&h[i])\n\t}\n\n\tmax := 0\n\tfor i := 1; i < n; i++ {\n\t\tif h[i] > max {\n\t\t\tmax = h[i]\n\t\t}\n\t\tif max-h[i] > 1 {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n}\n", "language": "Go", "metadata": {"date": 1564969039, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02953.html", "problem_id": "p02953", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02953/input.txt", "sample_output_relpath": "derived/input_output/data/p02953/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02953/Go/s444590969.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s444590969", "user_id": "u842046626"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\th := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&h[i])\n\t}\n\n\tmax := 0\n\tfor i := 1; i < n; i++ {\n\t\tif h[i] > max {\n\t\t\tmax = h[i]\n\t\t}\n\t\tif max-h[i] > 1 {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "sample_input": "5\n1 2 1 1 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02953", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 701, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s992359615", "group_id": "codeNet:p02953", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\tN := sc.NextInt()\n\tA := sc.NextIntArray()\n\n\tmx := 0\n\tfor i := 0; i < N-1; i++ {\n\t\tif A[i] > A[i+1] {\n\t\t\tA[i]--\n\t\t}\n\t}\n\n\tfor i := 0; i < N; i++ {\n\t\tif mx <= A[i] {\n\t\t\tmx = A[i]\n\t\t} else {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(\"Yes\")\n\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *Scanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *Scanner) NextFloat() float64 {\n\tv, _ := strconv.ParseFloat(s.Next(), 64)\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)\n\t\t\tresult = append(result, int(v))\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\n\treturn result\n}\nfunc (s *Scanner) NextInt64Array() []int64 {\n\ts.pre()\n\tstart := s.p\n\tresult := []int64{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1564968938, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02953.html", "problem_id": "p02953", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02953/input.txt", "sample_output_relpath": "derived/input_output/data/p02953/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02953/Go/s992359615.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s992359615", "user_id": "u504669764"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\tN := sc.NextInt()\n\tA := sc.NextIntArray()\n\n\tmx := 0\n\tfor i := 0; i < N-1; i++ {\n\t\tif A[i] > A[i+1] {\n\t\t\tA[i]--\n\t\t}\n\t}\n\n\tfor i := 0; i < N; i++ {\n\t\tif mx <= A[i] {\n\t\t\tmx = A[i]\n\t\t} else {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(\"Yes\")\n\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *Scanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *Scanner) NextFloat() float64 {\n\tv, _ := strconv.ParseFloat(s.Next(), 64)\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)\n\t\t\tresult = append(result, int(v))\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\n\treturn result\n}\nfunc (s *Scanner) NextInt64Array() []int64 {\n\ts.pre()\n\tstart := s.p\n\tresult := []int64{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "sample_input": "5\n1 2 1 1 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02953", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2265, "cpu_time_ms": 33, "memory_kb": 6528}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s905394256", "group_id": "codeNet:p02953", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tvar l []int\n\n\tfmt.Scanf(\"%d\", &n)\n\tl = make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &l[i])\n\t}\n\n\tcnt := 0\n\n\tfor i := 1; i < n; i++ {\n\t\tif l[i-1] > l[i] {\n\t\t\tcnt++\n\t\t}\n\t}\n\n\tif cnt <= 1 {\n\t\tfmt.Print(\"Yes\")\n\t} else {\n\t\tfmt.Print(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1564968806, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02953.html", "problem_id": "p02953", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02953/input.txt", "sample_output_relpath": "derived/input_output/data/p02953/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02953/Go/s905394256.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s905394256", "user_id": "u764050215"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tvar l []int\n\n\tfmt.Scanf(\"%d\", &n)\n\tl = make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &l[i])\n\t}\n\n\tcnt := 0\n\n\tfor i := 1; i < n; i++ {\n\t\tif l[i-1] > l[i] {\n\t\t\tcnt++\n\t\t}\n\t}\n\n\tif cnt <= 1 {\n\t\tfmt.Print(\"Yes\")\n\t} else {\n\t\tfmt.Print(\"No\")\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "sample_input": "5\n1 2 1 1 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02953", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 311, "cpu_time_ms": 700, "memory_kb": 6272}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s123466735", "group_id": "codeNet:p02953", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\th := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&h[i])\n\t}\n\n\tc := 0\n\tfor i := 1; i < n; i++ {\n\t\tif h[i-1] > h[i] {\n\t\t\tif h[i-1]-1 > h[i] {\n\t\t\t\tfmt.Println(\"No\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tc++\n\t\t}\n\t\tif c > 1 {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n}\n", "language": "Go", "metadata": {"date": 1564968335, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02953.html", "problem_id": "p02953", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02953/input.txt", "sample_output_relpath": "derived/input_output/data/p02953/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02953/Go/s123466735.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s123466735", "user_id": "u842046626"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\th := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&h[i])\n\t}\n\n\tc := 0\n\tfor i := 1; i < n; i++ {\n\t\tif h[i-1] > h[i] {\n\t\t\tif h[i-1]-1 > h[i] {\n\t\t\t\tfmt.Println(\"No\")\n\t\t\t\treturn\n\t\t\t}\n\t\t\tc++\n\t\t}\n\t\tif c > 1 {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "sample_input": "5\n1 2 1 1 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02953", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 338, "cpu_time_ms": 695, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s723002138", "group_id": "codeNet:p02953", "input_text": "package main\n \nimport (\n \"fmt\"\n)\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n var ng bool\n var max int\n for i := 0; i < n; i++ {\n var h int\n fmt.Scan(&h)\n if h < max-1 {\n ng = true\n }\n if h > max {\n max = h\n }\n }\n if ng {\n fmt.Println(\"No\")\n } else {\n fmt.Println(\"Yes\")\n }\n}\n", "language": "Go", "metadata": {"date": 1564967511, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02953.html", "problem_id": "p02953", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02953/input.txt", "sample_output_relpath": "derived/input_output/data/p02953/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02953/Go/s723002138.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s723002138", "user_id": "u282164747"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n \nimport (\n \"fmt\"\n)\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n var ng bool\n var max int\n for i := 0; i < n; i++ {\n var h int\n fmt.Scan(&h)\n if h < max-1 {\n ng = true\n }\n if h > max {\n max = h\n }\n }\n if ng {\n fmt.Println(\"No\")\n } else {\n fmt.Println(\"Yes\")\n }\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "sample_input": "5\n1 2 1 1 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02953", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right. The height of the i-th square from the left is H_i.\n\nFor each square, you will perform either of the following operations once:\n\nDecrease the height of the square by 1.\n\nDo nothing.\n\nDetermine if it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right.\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\nIf it is possible to perform the operations so that the heights of the squares are non-decreasing from left to right, print Yes; otherwise, print No.\n\nSample Input 1\n\n5\n1 2 1 1 3\n\nSample Output 1\n\nYes\n\nYou can achieve the objective by decreasing the height of only the second square from the left by 1.\n\nSample Input 2\n\n4\n1 3 2 1\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n5\n1 2 3 4 5\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n1\n1000000000\n\nSample Output 4\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 754, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s033688923", "group_id": "codeNet:p02983", "input_text": "//go:generate echo \"https://atcoder.jp/contests/abc133/tasks/abc133_c\"\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"math/big\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scan = newScanner(os.Stdin)\n\nfunc solve(L, R int) int {\n\tif R-L >= 2019 {\n\t\treturn 0\n\t}\n\tmin := math.MaxInt64\n\tfor i := L; i < imin(R+1, L+2019); i++ {\n\t\tfor j := L; j < imin(R+1, L+2019); j++ {\n\t\t\tif i == j {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tchmin(&min, (i%2019)*(j%2019)%2019)\n\t\t}\n\t}\n\treturn min\n}\n\nfunc solve2(L, R int) int {\n\tmin := math.MaxInt64\n\tfor i := L; i <= R; i++ {\n\t\tfor j := L; j <= R; j++ {\n\t\t\tif i == j {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tchmin(&min, (i%2019)*(j%2019)%2019)\n\t\t\tif min == 0 {\n\t\t\t\treturn min\n\t\t\t}\n\t\t}\n\t}\n\treturn min\n}\n\nfunc main() {\n\tL, R := scan.Int(), scan.Int()\n\tfmt.Println(solve2(L, R))\n}\n\ntype scanner struct {\n\t*bufio.Scanner\n}\n\nfunc newScanner(r io.Reader) *scanner {\n\ts := bufio.NewScanner(r)\n\ts.Split(bufio.ScanWords)\n\ts.Buffer(nil, 100000000)\n\treturn &scanner{s}\n}\n\nfunc (s *scanner) String() string {\n\ts.Scan()\n\treturn s.Text()\n}\n\nfunc (s *scanner) Strings(l int) []string {\n\tif l == 0 {\n\t\treturn []string{}\n\t}\n\tsl := make([]string, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.String()\n\t}\n\treturn sl\n}\n\nfunc (s *scanner) Int() int {\n\tn, _ := strconv.Atoi(s.String())\n\treturn n\n}\n\nfunc (s *scanner) Ints(l int) []int {\n\tif l == 0 {\n\t\treturn []int{}\n\t}\n\tsl := make([]int, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.Int()\n\t}\n\treturn sl\n}\n\nfunc (s *scanner) Float64() float64 {\n\tf, _ := strconv.ParseFloat(s.String(), 64)\n\treturn f\n}\n\nfunc (s *scanner) Float64s(l int) []float64 {\n\tif l == 0 {\n\t\treturn []float64{}\n\t}\n\tsl := make([]float64, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.Float64()\n\t}\n\treturn sl\n}\n\nfunc (s *scanner) BigInt() *big.Int {\n\tn, _ := strconv.ParseInt(s.String(), 10, 64)\n\treturn big.NewInt(n)\n}\n\nfunc (s *scanner) BigInts(l int) []*big.Int {\n\tif l == 0 {\n\t\treturn []*big.Int{}\n\t}\n\tsl := make([]*big.Int, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.BigInt()\n\t}\n\treturn sl\n}\n\nfunc iabs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc imax(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc imin(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc ipow(x, n int) int {\n\tif n == 0 {\n\t\treturn 1\n\t}\n\ta := ipow(x, n>>1)\n\ta *= a\n\tif n&1 != 0 {\n\t\ta *= x\n\t}\n\treturn a\n}\n\nfunc isum(X []int) int {\n\ts := 0\n\tfor _, x := range X {\n\t\ts += x\n\t}\n\treturn s\n}\n\nfunc chmax(x *int, v int) {\n\tif *x < v {\n\t\t*x = v\n\t}\n}\n\nfunc chmin(x *int, v int) {\n\tif *x > v {\n\t\t*x = v\n\t}\n}\n\nfunc factor(n int) map[int]int {\n\tm := map[int]int{}\n\tfor i := 2; i*i <= n; i++ {\n\t\tfor n%i == 0 {\n\t\t\tn /= i\n\t\t\tm[i]++\n\t\t}\n\t}\n\tif n != 1 {\n\t\tm[n]++\n\t}\n\treturn m\n}\n\nvar mod = 1000000007\n\nfunc setMintMod(x int) {\n\tmod = x\n}\n\ntype mint int\n\nfunc newMint(v int) mint {\n\treturn mint((v%mod + mod) % mod)\n}\n\nfunc (x mint) Add(y mint) mint {\n\tv := x + y\n\tif v >= mint(mod) {\n\t\treturn v - mint(mod)\n\t}\n\treturn v\n}\n\nfunc (x mint) Sub(y mint) mint {\n\tv := x + mint(mod) - y\n\tif v >= mint(mod) {\n\t\treturn v - mint(mod)\n\t}\n\treturn v\n}\n\nfunc (x mint) Mul(y mint) mint {\n\treturn (x * y) % mint(mod)\n}\n\nfunc (x mint) pow(n int) mint {\n\tif n == 0 {\n\t\treturn mint(1)\n\t}\n\ta := x.pow(n >> 1)\n\ta = a.Mul(a)\n\tif n&1 != 0 {\n\t\ta = a.Mul(x)\n\t}\n\treturn a\n}\n\nfunc (x mint) Inverse() mint {\n\treturn x.pow(mod - 2)\n}\n\nfunc (x mint) Div(y mint) mint {\n\treturn x * y.Inverse()\n}\n\nfunc (x mint) Neg() mint {\n\treturn newMint(int(-x))\n}\n\ntype factorial struct {\n\tfact []mint\n\tfactInverse []mint\n}\n\nfunc newFactorial(n int) *factorial {\n\tf := new(factorial)\n\tf.init(n)\n\treturn f\n}\n\nfunc (f *factorial) init(n int) {\n\tfact := make([]mint, n+1, n+1)\n\tfact[0] = newMint(1)\n\tfor i := 1; i <= n; i++ {\n\t\tfact[i] = fact[i-1].Mul(newMint(i))\n\t}\n\n\tinv := make([]mint, n+1, n+1)\n\tinv[n] = fact[n].Inverse()\n\tfor i := n; i >= 1; i-- {\n\t\tinv[i-1] = inv[i].Mul(newMint(i))\n\t}\n\n\tf.fact = fact\n\tf.factInverse = inv\n}\n\nfunc (f *factorial) Get(n int) mint {\n\treturn f.fact[n]\n}\n\nfunc (f *factorial) GetInverse(n int) mint {\n\treturn f.factInverse[n]\n}\n\nfunc (f *factorial) Permutation(n, k int) mint {\n\tif k < 0 || n < k {\n\t\treturn 0\n\t}\n\treturn f.fact[n].Mul(f.factInverse[n-k])\n}\n\nfunc (f *factorial) Combination(n, k int) mint {\n\tif k < 0 || n < k {\n\t\treturn 0\n\t}\n\treturn f.fact[n].Mul(f.factInverse[k]).Mul(f.factInverse[n-k])\n}\n\ntype sieve struct {\n\tn int\n\tprimes []int\n\tmaxFactors []int\n}\n\nfunc newSieve(n int) *sieve {\n\ts := &sieve{\n\t\tn: n,\n\t\tprimes: []int{},\n\t\tmaxFactors: make([]int, n+1, n+1),\n\t}\n\ts.init()\n\treturn s\n}\n\nfunc (s *sieve) init() {\n\ts.maxFactors[0] = -1\n\ts.maxFactors[1] = -1\n\tfor i := 2; i <= s.n; i++ {\n\t\tif s.maxFactors[i] != 0 {\n\t\t\tcontinue\n\t\t}\n\t\ts.primes = append(s.primes, i)\n\t\ts.maxFactors[i] = i\n\t\tfor j := i * i; j <= s.n; j += i {\n\t\t\tif s.maxFactors[j] == 0 {\n\t\t\t\ts.maxFactors[j] = i\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc (s *sieve) IsPrime(x int) bool {\n\treturn s.maxFactors[x] == x\n}\n\nfunc (s *sieve) Factor(x int) map[int]int {\n\tm := map[int]int{}\n\tfor x != 1 {\n\t\tm[s.maxFactors[x]]++\n\t\tx /= s.maxFactors[x]\n\t}\n\treturn m\n}\n", "language": "Go", "metadata": {"date": 1600710316, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02983.html", "problem_id": "p02983", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02983/input.txt", "sample_output_relpath": "derived/input_output/data/p02983/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02983/Go/s033688923.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s033688923", "user_id": "u890085018"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "//go:generate echo \"https://atcoder.jp/contests/abc133/tasks/abc133_c\"\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"math/big\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scan = newScanner(os.Stdin)\n\nfunc solve(L, R int) int {\n\tif R-L >= 2019 {\n\t\treturn 0\n\t}\n\tmin := math.MaxInt64\n\tfor i := L; i < imin(R+1, L+2019); i++ {\n\t\tfor j := L; j < imin(R+1, L+2019); j++ {\n\t\t\tif i == j {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tchmin(&min, (i%2019)*(j%2019)%2019)\n\t\t}\n\t}\n\treturn min\n}\n\nfunc solve2(L, R int) int {\n\tmin := math.MaxInt64\n\tfor i := L; i <= R; i++ {\n\t\tfor j := L; j <= R; j++ {\n\t\t\tif i == j {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tchmin(&min, (i%2019)*(j%2019)%2019)\n\t\t\tif min == 0 {\n\t\t\t\treturn min\n\t\t\t}\n\t\t}\n\t}\n\treturn min\n}\n\nfunc main() {\n\tL, R := scan.Int(), scan.Int()\n\tfmt.Println(solve2(L, R))\n}\n\ntype scanner struct {\n\t*bufio.Scanner\n}\n\nfunc newScanner(r io.Reader) *scanner {\n\ts := bufio.NewScanner(r)\n\ts.Split(bufio.ScanWords)\n\ts.Buffer(nil, 100000000)\n\treturn &scanner{s}\n}\n\nfunc (s *scanner) String() string {\n\ts.Scan()\n\treturn s.Text()\n}\n\nfunc (s *scanner) Strings(l int) []string {\n\tif l == 0 {\n\t\treturn []string{}\n\t}\n\tsl := make([]string, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.String()\n\t}\n\treturn sl\n}\n\nfunc (s *scanner) Int() int {\n\tn, _ := strconv.Atoi(s.String())\n\treturn n\n}\n\nfunc (s *scanner) Ints(l int) []int {\n\tif l == 0 {\n\t\treturn []int{}\n\t}\n\tsl := make([]int, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.Int()\n\t}\n\treturn sl\n}\n\nfunc (s *scanner) Float64() float64 {\n\tf, _ := strconv.ParseFloat(s.String(), 64)\n\treturn f\n}\n\nfunc (s *scanner) Float64s(l int) []float64 {\n\tif l == 0 {\n\t\treturn []float64{}\n\t}\n\tsl := make([]float64, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.Float64()\n\t}\n\treturn sl\n}\n\nfunc (s *scanner) BigInt() *big.Int {\n\tn, _ := strconv.ParseInt(s.String(), 10, 64)\n\treturn big.NewInt(n)\n}\n\nfunc (s *scanner) BigInts(l int) []*big.Int {\n\tif l == 0 {\n\t\treturn []*big.Int{}\n\t}\n\tsl := make([]*big.Int, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.BigInt()\n\t}\n\treturn sl\n}\n\nfunc iabs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc imax(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc imin(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc ipow(x, n int) int {\n\tif n == 0 {\n\t\treturn 1\n\t}\n\ta := ipow(x, n>>1)\n\ta *= a\n\tif n&1 != 0 {\n\t\ta *= x\n\t}\n\treturn a\n}\n\nfunc isum(X []int) int {\n\ts := 0\n\tfor _, x := range X {\n\t\ts += x\n\t}\n\treturn s\n}\n\nfunc chmax(x *int, v int) {\n\tif *x < v {\n\t\t*x = v\n\t}\n}\n\nfunc chmin(x *int, v int) {\n\tif *x > v {\n\t\t*x = v\n\t}\n}\n\nfunc factor(n int) map[int]int {\n\tm := map[int]int{}\n\tfor i := 2; i*i <= n; i++ {\n\t\tfor n%i == 0 {\n\t\t\tn /= i\n\t\t\tm[i]++\n\t\t}\n\t}\n\tif n != 1 {\n\t\tm[n]++\n\t}\n\treturn m\n}\n\nvar mod = 1000000007\n\nfunc setMintMod(x int) {\n\tmod = x\n}\n\ntype mint int\n\nfunc newMint(v int) mint {\n\treturn mint((v%mod + mod) % mod)\n}\n\nfunc (x mint) Add(y mint) mint {\n\tv := x + y\n\tif v >= mint(mod) {\n\t\treturn v - mint(mod)\n\t}\n\treturn v\n}\n\nfunc (x mint) Sub(y mint) mint {\n\tv := x + mint(mod) - y\n\tif v >= mint(mod) {\n\t\treturn v - mint(mod)\n\t}\n\treturn v\n}\n\nfunc (x mint) Mul(y mint) mint {\n\treturn (x * y) % mint(mod)\n}\n\nfunc (x mint) pow(n int) mint {\n\tif n == 0 {\n\t\treturn mint(1)\n\t}\n\ta := x.pow(n >> 1)\n\ta = a.Mul(a)\n\tif n&1 != 0 {\n\t\ta = a.Mul(x)\n\t}\n\treturn a\n}\n\nfunc (x mint) Inverse() mint {\n\treturn x.pow(mod - 2)\n}\n\nfunc (x mint) Div(y mint) mint {\n\treturn x * y.Inverse()\n}\n\nfunc (x mint) Neg() mint {\n\treturn newMint(int(-x))\n}\n\ntype factorial struct {\n\tfact []mint\n\tfactInverse []mint\n}\n\nfunc newFactorial(n int) *factorial {\n\tf := new(factorial)\n\tf.init(n)\n\treturn f\n}\n\nfunc (f *factorial) init(n int) {\n\tfact := make([]mint, n+1, n+1)\n\tfact[0] = newMint(1)\n\tfor i := 1; i <= n; i++ {\n\t\tfact[i] = fact[i-1].Mul(newMint(i))\n\t}\n\n\tinv := make([]mint, n+1, n+1)\n\tinv[n] = fact[n].Inverse()\n\tfor i := n; i >= 1; i-- {\n\t\tinv[i-1] = inv[i].Mul(newMint(i))\n\t}\n\n\tf.fact = fact\n\tf.factInverse = inv\n}\n\nfunc (f *factorial) Get(n int) mint {\n\treturn f.fact[n]\n}\n\nfunc (f *factorial) GetInverse(n int) mint {\n\treturn f.factInverse[n]\n}\n\nfunc (f *factorial) Permutation(n, k int) mint {\n\tif k < 0 || n < k {\n\t\treturn 0\n\t}\n\treturn f.fact[n].Mul(f.factInverse[n-k])\n}\n\nfunc (f *factorial) Combination(n, k int) mint {\n\tif k < 0 || n < k {\n\t\treturn 0\n\t}\n\treturn f.fact[n].Mul(f.factInverse[k]).Mul(f.factInverse[n-k])\n}\n\ntype sieve struct {\n\tn int\n\tprimes []int\n\tmaxFactors []int\n}\n\nfunc newSieve(n int) *sieve {\n\ts := &sieve{\n\t\tn: n,\n\t\tprimes: []int{},\n\t\tmaxFactors: make([]int, n+1, n+1),\n\t}\n\ts.init()\n\treturn s\n}\n\nfunc (s *sieve) init() {\n\ts.maxFactors[0] = -1\n\ts.maxFactors[1] = -1\n\tfor i := 2; i <= s.n; i++ {\n\t\tif s.maxFactors[i] != 0 {\n\t\t\tcontinue\n\t\t}\n\t\ts.primes = append(s.primes, i)\n\t\ts.maxFactors[i] = i\n\t\tfor j := i * i; j <= s.n; j += i {\n\t\t\tif s.maxFactors[j] == 0 {\n\t\t\t\ts.maxFactors[j] = i\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc (s *sieve) IsPrime(x int) bool {\n\treturn s.maxFactors[x] == x\n}\n\nfunc (s *sieve) Factor(x int) map[int]int {\n\tm := map[int]int{}\n\tfor x != 1 {\n\t\tm[s.maxFactors[x]]++\n\t\tx /= s.maxFactors[x]\n\t}\n\treturn m\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "sample_input": "2020 2040\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02983", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4983, "cpu_time_ms": 7, "memory_kb": 1792}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s125293062", "group_id": "codeNet:p02983", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tL, R := ReadInt(), ReadInt()\n\tif R-L+1 >= 2019 {\n\t\tfmt.Println(1)\n\t\treturn\n\t}\n\tif L%2019 < R%2019 {\n\t\tfmt.Println(L * (L + 1) % 2019)\n\t} else {\n\t\tfmt.Println(1)\n\t}\n}\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadString() (s string) { Scan(&s); return }\nfunc ReadInts(n int) []int {\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tScan(&v[i])\n\t}\n\treturn v\n}\n", "language": "Go", "metadata": {"date": 1600134816, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02983.html", "problem_id": "p02983", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02983/input.txt", "sample_output_relpath": "derived/input_output/data/p02983/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02983/Go/s125293062.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s125293062", "user_id": "u328656362"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tL, R := ReadInt(), ReadInt()\n\tif R-L+1 >= 2019 {\n\t\tfmt.Println(1)\n\t\treturn\n\t}\n\tif L%2019 < R%2019 {\n\t\tfmt.Println(L * (L + 1) % 2019)\n\t} else {\n\t\tfmt.Println(1)\n\t}\n}\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadString() (s string) { Scan(&s); return }\nfunc ReadInts(n int) []int {\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tScan(&v[i])\n\t}\n\treturn v\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "sample_input": "2020 2040\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02983", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 575, "cpu_time_ms": 8, "memory_kb": 1840}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s708061065", "group_id": "codeNet:p02983", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024*1024), bufio.MaxScanTokenSize)\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tL := nextInt()\n\tR := nextInt()\n\tMIN := 214748347\n\tfor i := L; i < R; i++ {\n\t\tfor j := i + 1; j <= R; j++ {\n\t\t\tMIN = min(MIN, (i*j)%2019)\n\t\t}\n\t}\n\tfmt.Println(MIN)\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n", "language": "Go", "metadata": {"date": 1596921920, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02983.html", "problem_id": "p02983", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02983/input.txt", "sample_output_relpath": "derived/input_output/data/p02983/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02983/Go/s708061065.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s708061065", "user_id": "u467535434"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024*1024), bufio.MaxScanTokenSize)\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tL := nextInt()\n\tR := nextInt()\n\tMIN := 214748347\n\tfor i := L; i < R; i++ {\n\t\tfor j := i + 1; j <= R; j++ {\n\t\t\tMIN = min(MIN, (i*j)%2019)\n\t\t}\n\t}\n\tfmt.Println(MIN)\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "sample_input": "2020 2040\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02983", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 620, "cpu_time_ms": 2205, "memory_kb": 1820}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s941437860", "group_id": "codeNet:p02983", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e6 + 7\n)\n\nvar buf []byte = make([]byte, maxBufSize)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBufSize)\n}\n\nfunc main() {\n\tL, R := nextInt()%2019, nextInt()%2019\n\tif R-L >= 2019 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tans := 2019 + 1\n\tfor i := L; i < R; i++ {\n\t\tfor j := i + 1; j <= R; j++ {\n\t\t\tans = MinOf(ans, (i*j)%2019)\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc abs(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc pow(p, q int) int {\n\tres := p\n\tif q == 0 {\n\t\treturn 1\n\t}\n\tfor i := 0; i < q-1; i++ {\n\t\tres *= p\n\t}\n\treturn res\n}\n\nfunc MinOf(vars ...int) int {\n\tmin := vars[0]\n\tfor _, i := range vars {\n\t\tif min > i {\n\t\t\tmin = i\n\t\t}\n\t}\n\treturn min\n}\n\nfunc MaxOf(vars ...int) int {\n\tmax := vars[0]\n\tfor _, i := range vars {\n\t\tif max < i {\n\t\t\tmax = i\n\t\t}\n\t}\n\treturn max\n}\n\nfunc gcdof2numbers(a int, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcdof2numbers(b, a%b)\n}\n\nfunc lcmof2numbers(a int, b int) int {\n\treturn a / gcdof2numbers(a, b) * b\n}\n\n// マイナスの場合は考慮していない\nfunc fuctorial(a int) int {\n\tif a == 1 || a == 0 {\n\t\treturn 1\n\t} else {\n\t\treturn fuctorial(a-1) * a\n\t}\n}\n\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\n\n// 素因数分解したmapを返す\nfunc primeFuctorize(n int) map[int]int {\n\tpf := map[int]int{}\n\tfor i := 2; i*i <= n; i++ {\n\t\tfor n%i == 0 {\n\t\t\tpf[i]++\n\t\t\tn /= i\n\t\t}\n\t}\n\tif n != 1 {\n\t\tpf[n]++\n\t}\n\treturn pf\n}\n\n// ここから拝借\n// https://shoman.hatenablog.com/entry/2020/02/25/185456\n// Stackは[]intのエイリアス\ntype Stack []int\n\n// Push adds an element\nfunc (s *Stack) Push(v int) {\n\t*s = append(*s, v)\n}\n\n// Pop removes the top element and return it\nfunc (s *Stack) Pop() (int, error) {\n\tif s.Empty() {\n\t\treturn 0, fmt.Errorf(\"stack is empty\")\n\t}\n\n\tv := (*s)[len(*s)-1]\n\t*s = (*s)[:len(*s)-1]\n\treturn v, nil\n}\n\n// Peek returns the top value\nfunc (s *Stack) Peek() (int, error) {\n\tif s.Empty() {\n\t\treturn 0, fmt.Errorf(\"stack is empty\")\n\t}\n\n\treturn (*s)[len(*s)-1], nil\n}\n\n// Size returns the length of stack\nfunc (s *Stack) Size() int {\n\treturn len(*s)\n}\n\n// Empty returns true when stack is empty\nfunc (s *Stack) Empty() bool {\n\treturn s.Size() == 0\n}\n\n// NewStack generates stack\nfunc NewStack() *Stack {\n\ts := new(Stack)\n\treturn s\n}\n\n// golangの公式サンプルより\n// https://xn--go-hh0g6u.com/pkg/container/heap/#example__intHeap\n// IntHeap は,整数の最小ヒープです。\ntype IH []int\n\nfunc (h IH) Len() int { return len(h) }\nfunc (h IH) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h IH) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\n\nfunc (h *IH) Push(x interface{}) {\n\t// Push と Pop はポインタレシーバを使っています。\n\t// なぜなら,スライスの中身だけでなく,スライスの長さも変更するからです。\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IH) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\n// golangの公式サンプルより\n// https://xn--go-hh0g6u.com/pkg/container/heap/#example__priorityQueue\n\n// Item は,優先キューで管理する項目です。\ntype Item struct {\n\tvalue string // 値。任意です。\n\tpriority int // キューにおける優先度\n\t// index は heap.Interface メソッドで更新されます。\n\tindex int // ヒープにおけるインデックス\n}\n\n// PriorityQueue は heap.Interface を実装し,Item のリストを保持します。\ntype PriorityQueue []*Item\n\nfunc (pq PriorityQueue) Len() int { return len(pq) }\n\nfunc (pq PriorityQueue) Less(i, j int) bool {\n\t// Pop が最小ではなく最大の優先度を持つ項目を返して欲しいので,ここでは > を使っています。\n\treturn pq[i].priority > pq[j].priority\n}\n\nfunc (pq PriorityQueue) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n\tpq[i].index = i\n\tpq[j].index = j\n}\n\nfunc (pq *PriorityQueue) Push(x interface{}) {\n\tn := len(*pq)\n\titem := x.(*Item)\n\titem.index = n\n\t*pq = append(*pq, item)\n}\n\nfunc (pq *PriorityQueue) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\told[n-1] = nil // メモリリークを避ける\n\titem.index = -1 // 安全のため\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\n// update はキューの Item の優先度と値を更新します。\nfunc (pq *PriorityQueue) update(item *Item, value string, priority int) {\n\titem.value = value\n\titem.priority = priority\n\theap.Fix(pq, item.index)\n}\n", "language": "Go", "metadata": {"date": 1595485610, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02983.html", "problem_id": "p02983", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02983/input.txt", "sample_output_relpath": "derived/input_output/data/p02983/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02983/Go/s941437860.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s941437860", "user_id": "u605443479"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e6 + 7\n)\n\nvar buf []byte = make([]byte, maxBufSize)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBufSize)\n}\n\nfunc main() {\n\tL, R := nextInt()%2019, nextInt()%2019\n\tif R-L >= 2019 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tans := 2019 + 1\n\tfor i := L; i < R; i++ {\n\t\tfor j := i + 1; j <= R; j++ {\n\t\t\tans = MinOf(ans, (i*j)%2019)\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc abs(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc pow(p, q int) int {\n\tres := p\n\tif q == 0 {\n\t\treturn 1\n\t}\n\tfor i := 0; i < q-1; i++ {\n\t\tres *= p\n\t}\n\treturn res\n}\n\nfunc MinOf(vars ...int) int {\n\tmin := vars[0]\n\tfor _, i := range vars {\n\t\tif min > i {\n\t\t\tmin = i\n\t\t}\n\t}\n\treturn min\n}\n\nfunc MaxOf(vars ...int) int {\n\tmax := vars[0]\n\tfor _, i := range vars {\n\t\tif max < i {\n\t\t\tmax = i\n\t\t}\n\t}\n\treturn max\n}\n\nfunc gcdof2numbers(a int, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcdof2numbers(b, a%b)\n}\n\nfunc lcmof2numbers(a int, b int) int {\n\treturn a / gcdof2numbers(a, b) * b\n}\n\n// マイナスの場合は考慮していない\nfunc fuctorial(a int) int {\n\tif a == 1 || a == 0 {\n\t\treturn 1\n\t} else {\n\t\treturn fuctorial(a-1) * a\n\t}\n}\n\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\n\n// 素因数分解したmapを返す\nfunc primeFuctorize(n int) map[int]int {\n\tpf := map[int]int{}\n\tfor i := 2; i*i <= n; i++ {\n\t\tfor n%i == 0 {\n\t\t\tpf[i]++\n\t\t\tn /= i\n\t\t}\n\t}\n\tif n != 1 {\n\t\tpf[n]++\n\t}\n\treturn pf\n}\n\n// ここから拝借\n// https://shoman.hatenablog.com/entry/2020/02/25/185456\n// Stackは[]intのエイリアス\ntype Stack []int\n\n// Push adds an element\nfunc (s *Stack) Push(v int) {\n\t*s = append(*s, v)\n}\n\n// Pop removes the top element and return it\nfunc (s *Stack) Pop() (int, error) {\n\tif s.Empty() {\n\t\treturn 0, fmt.Errorf(\"stack is empty\")\n\t}\n\n\tv := (*s)[len(*s)-1]\n\t*s = (*s)[:len(*s)-1]\n\treturn v, nil\n}\n\n// Peek returns the top value\nfunc (s *Stack) Peek() (int, error) {\n\tif s.Empty() {\n\t\treturn 0, fmt.Errorf(\"stack is empty\")\n\t}\n\n\treturn (*s)[len(*s)-1], nil\n}\n\n// Size returns the length of stack\nfunc (s *Stack) Size() int {\n\treturn len(*s)\n}\n\n// Empty returns true when stack is empty\nfunc (s *Stack) Empty() bool {\n\treturn s.Size() == 0\n}\n\n// NewStack generates stack\nfunc NewStack() *Stack {\n\ts := new(Stack)\n\treturn s\n}\n\n// golangの公式サンプルより\n// https://xn--go-hh0g6u.com/pkg/container/heap/#example__intHeap\n// IntHeap は,整数の最小ヒープです。\ntype IH []int\n\nfunc (h IH) Len() int { return len(h) }\nfunc (h IH) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h IH) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\n\nfunc (h *IH) Push(x interface{}) {\n\t// Push と Pop はポインタレシーバを使っています。\n\t// なぜなら,スライスの中身だけでなく,スライスの長さも変更するからです。\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IH) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\n// golangの公式サンプルより\n// https://xn--go-hh0g6u.com/pkg/container/heap/#example__priorityQueue\n\n// Item は,優先キューで管理する項目です。\ntype Item struct {\n\tvalue string // 値。任意です。\n\tpriority int // キューにおける優先度\n\t// index は heap.Interface メソッドで更新されます。\n\tindex int // ヒープにおけるインデックス\n}\n\n// PriorityQueue は heap.Interface を実装し,Item のリストを保持します。\ntype PriorityQueue []*Item\n\nfunc (pq PriorityQueue) Len() int { return len(pq) }\n\nfunc (pq PriorityQueue) Less(i, j int) bool {\n\t// Pop が最小ではなく最大の優先度を持つ項目を返して欲しいので,ここでは > を使っています。\n\treturn pq[i].priority > pq[j].priority\n}\n\nfunc (pq PriorityQueue) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n\tpq[i].index = i\n\tpq[j].index = j\n}\n\nfunc (pq *PriorityQueue) Push(x interface{}) {\n\tn := len(*pq)\n\titem := x.(*Item)\n\titem.index = n\n\t*pq = append(*pq, item)\n}\n\nfunc (pq *PriorityQueue) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\told[n-1] = nil // メモリリークを避ける\n\titem.index = -1 // 安全のため\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\n// update はキューの Item の優先度と値を更新します。\nfunc (pq *PriorityQueue) update(item *Item, value string, priority int) {\n\titem.value = value\n\titem.priority = priority\n\theap.Fix(pq, item.index)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "sample_input": "2020 2040\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02983", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4960, "cpu_time_ms": 22, "memory_kb": 1808}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s723888200", "group_id": "codeNet:p02983", "input_text": "package main\n\nimport \"fmt\"\n\nvar moduler = 2019\n\nfunc main() {\n\tvar l, r int\n\tfmt.Scan(&l, &r)\n\tif r-l >= 2019 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tans := l * (l + 1) % moduler\n\tfor i := l; i < r; i++ {\n\t\tfor j := l + 1; j <= r; j++ {\n\t\t\tmod := i * j % moduler\n\t\t\tif mod < ans {\n\t\t\t\tans = mod\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1592775330, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p02983.html", "problem_id": "p02983", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02983/input.txt", "sample_output_relpath": "derived/input_output/data/p02983/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02983/Go/s723888200.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s723888200", "user_id": "u717943620"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nvar moduler = 2019\n\nfunc main() {\n\tvar l, r int\n\tfmt.Scan(&l, &r)\n\tif r-l >= 2019 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tans := l * (l + 1) % moduler\n\tfor i := l; i < r; i++ {\n\t\tfor j := l + 1; j <= r; j++ {\n\t\t\tmod := i * j % moduler\n\t\t\tif mod < ans {\n\t\t\t\tans = mod\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "sample_input": "2020 2040\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02983", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 49, "memory_kb": 1768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s888076884", "group_id": "codeNet:p02983", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc intMin(x, y int) int {\n\treturn int(math.Min(float64(x), float64(y)))\n}\n\nfunc main() {\n\tvar L, R int\n\tfmt.Scan(&L, &R)\n\n\tif (R - L) >= 2019 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tL, R = L%2019, R%2019\n\tif L > R {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tans := 2019\n\tfor i := L; i < R; i++ {\n\t\tfor j := i + 1; j <= R; j++ {\n\t\t\tans = intMin(ans, (i*j)%2019)\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1590094318, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02983.html", "problem_id": "p02983", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02983/input.txt", "sample_output_relpath": "derived/input_output/data/p02983/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02983/Go/s888076884.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s888076884", "user_id": "u941434715"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc intMin(x, y int) int {\n\treturn int(math.Min(float64(x), float64(y)))\n}\n\nfunc main() {\n\tvar L, R int\n\tfmt.Scan(&L, &R)\n\n\tif (R - L) >= 2019 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tL, R = L%2019, R%2019\n\tif L > R {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tans := 2019\n\tfor i := L; i < R; i++ {\n\t\tfor j := i + 1; j <= R; j++ {\n\t\t\tans = intMin(ans, (i*j)%2019)\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "sample_input": "2020 2040\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02983", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 413, "cpu_time_ms": 28, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s866158551", "group_id": "codeNet:p02983", "input_text": "// 参考: https://atcoder.jp/contests/abc133/submissions/6278434\n// matsuu さんありがとうございました。\n\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc minimumRemainder(minNum int, maxNum int, modNumInit int) int {\n\t// 各余り値の最小値\n\t// (最初なので考えられる余り値の最大値)\n\tvar modNum int = modNumInit\n\n\t// minNum(i)がmaxNumに徐々に接近!\n\tfor i := minNum; i < maxNum; i++ {\n\t\t// i+1(j)がmaxNumに徐々に接近してくっつく!\n\t\tfor j := i + 1; j <= maxNum; j++ {\n\t\t\t// 現在のminNum(i)×(i+1...maxNum) ÷ 2019 の余り値\n\t\t\tremainder := (i * j) % modNumInit\n\t\t\t// 現在の最小値より小さかったら\n\t\t\tif remainder < modNum {\n\t\t\t\t// 最小値更新\n\t\t\t\tmodNum = remainder\n\t\t\t\t// 余りが0になった時点で最小値が決定したので処理終了\n\t\t\t\tif modNum == 0 {\n\t\t\t\t\treturn modNum\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn modNum\n}\n\nfunc main() {\n\tvar minNum, maxNum int\n\tfmt.Scan(&minNum, &maxNum)\n\tfmt.Println(minimumRemainder(minNum, maxNum, 2019))\n}\n", "language": "Go", "metadata": {"date": 1588451468, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02983.html", "problem_id": "p02983", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02983/input.txt", "sample_output_relpath": "derived/input_output/data/p02983/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02983/Go/s866158551.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s866158551", "user_id": "u894135448"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "// 参考: https://atcoder.jp/contests/abc133/submissions/6278434\n// matsuu さんありがとうございました。\n\npackage main\n\nimport (\n\t\"fmt\"\n)\n\nfunc minimumRemainder(minNum int, maxNum int, modNumInit int) int {\n\t// 各余り値の最小値\n\t// (最初なので考えられる余り値の最大値)\n\tvar modNum int = modNumInit\n\n\t// minNum(i)がmaxNumに徐々に接近!\n\tfor i := minNum; i < maxNum; i++ {\n\t\t// i+1(j)がmaxNumに徐々に接近してくっつく!\n\t\tfor j := i + 1; j <= maxNum; j++ {\n\t\t\t// 現在のminNum(i)×(i+1...maxNum) ÷ 2019 の余り値\n\t\t\tremainder := (i * j) % modNumInit\n\t\t\t// 現在の最小値より小さかったら\n\t\t\tif remainder < modNum {\n\t\t\t\t// 最小値更新\n\t\t\t\tmodNum = remainder\n\t\t\t\t// 余りが0になった時点で最小値が決定したので処理終了\n\t\t\t\tif modNum == 0 {\n\t\t\t\t\treturn modNum\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn modNum\n}\n\nfunc main() {\n\tvar minNum, maxNum int\n\tfmt.Scan(&minNum, &maxNum)\n\tfmt.Println(minimumRemainder(minNum, maxNum, 2019))\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "sample_input": "2020 2040\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02983", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1014, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s184573392", "group_id": "codeNet:p02983", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar l, r int\n\tfmt.Scan(&l, &r)\n\n\tvar min int\n\tans := 1000000000\n\tfor i := l; i < r; i++ {\n\t\tfor j := i + 1; j <= r; j++ {\n\t\t\tmin = i * j % 2019\n\t\t\tif min < ans {\n\t\t\t\tans = min\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1588176229, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02983.html", "problem_id": "p02983", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02983/input.txt", "sample_output_relpath": "derived/input_output/data/p02983/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02983/Go/s184573392.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s184573392", "user_id": "u214033538"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar l, r int\n\tfmt.Scan(&l, &r)\n\n\tvar min int\n\tans := 1000000000\n\tfor i := l; i < r; i++ {\n\t\tfor j := i + 1; j <= r; j++ {\n\t\t\tmin = i * j % 2019\n\t\t\tif min < ans {\n\t\t\t\tans = min\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "sample_input": "2020 2040\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02983", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 252, "cpu_time_ms": 2107, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s820023963", "group_id": "codeNet:p02983", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tlog.SetFlags(log.Lshortfile)\n\tl := nextInt()\n\tr := nextInt()\n\tans := math.MaxInt32\n\tfor i := l; i <= r; i++ {\n\t\tfor j := i + 1; j <= r; j++ {\n\t\t\tans = min(ans, (i*j)%2019)\n\t\t\tif ans == 0 {\n\t\t\t\tfmt.Println(ans)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nvar dy = []int{0, 1, 0, -1}\nvar dx = []int{1, 0, -1, 0}\nvar MAX = math.MaxInt32\n\nfunc pow(a, b int) int {\n\treturn int(math.Pow(float64(a), float64(b)))\n}\n\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\ntype Pair struct {\n\ta, b int\n}\n\ntype Pairs []Pair\n\nfunc (p Pairs) Len() int {\n\treturn len(p)\n}\nfunc (p Pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p Pairs) Less(i, j int) bool {\n\tif p[i].a == p[j].a {\n\t\treturn p[i].b < p[j].b\n\t}\n\treturn p[i].a < p[j].a\n}\n", "language": "Go", "metadata": {"date": 1581781880, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02983.html", "problem_id": "p02983", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02983/input.txt", "sample_output_relpath": "derived/input_output/data/p02983/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02983/Go/s820023963.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s820023963", "user_id": "u696272993"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tlog.SetFlags(log.Lshortfile)\n\tl := nextInt()\n\tr := nextInt()\n\tans := math.MaxInt32\n\tfor i := l; i <= r; i++ {\n\t\tfor j := i + 1; j <= r; j++ {\n\t\t\tans = min(ans, (i*j)%2019)\n\t\t\tif ans == 0 {\n\t\t\t\tfmt.Println(ans)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n\nfunc nextString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nvar dy = []int{0, 1, 0, -1}\nvar dx = []int{1, 0, -1, 0}\nvar MAX = math.MaxInt32\n\nfunc pow(a, b int) int {\n\treturn int(math.Pow(float64(a), float64(b)))\n}\n\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\ntype Pair struct {\n\ta, b int\n}\n\ntype Pairs []Pair\n\nfunc (p Pairs) Len() int {\n\treturn len(p)\n}\nfunc (p Pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p Pairs) Less(i, j int) bool {\n\tif p[i].a == p[j].a {\n\t\treturn p[i].b < p[j].b\n\t}\n\treturn p[i].a < p[j].a\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "sample_input": "2020 2040\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02983", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1520, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s925573653", "group_id": "codeNet:p02983", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar l, r int32\n\n\tfmt.Scan(&l)\n\tfmt.Scan(&r)\n\n\tif r >= l + 2019 {\n\t\tr = l + 2019\n\t}\n\n\tanswer := int64(2018)\n\tfor i := l; i < r; i++ {\n\t\tfor j := i + 1; j <= r; j++ {\n\t\t\trem := (int64(i) * int64(j)) % 2019\n\t\t\tif rem < answer {\n\t\t\t\tanswer = rem\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(answer)\n}", "language": "Go", "metadata": {"date": 1579496295, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02983.html", "problem_id": "p02983", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02983/input.txt", "sample_output_relpath": "derived/input_output/data/p02983/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02983/Go/s925573653.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s925573653", "user_id": "u253759478"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar l, r int32\n\n\tfmt.Scan(&l)\n\tfmt.Scan(&r)\n\n\tif r >= l + 2019 {\n\t\tr = l + 2019\n\t}\n\n\tanswer := int64(2018)\n\tfor i := l; i < r; i++ {\n\t\tfor j := i + 1; j <= r; j++ {\n\t\t\trem := (int64(i) * int64(j)) % 2019\n\t\t\tif rem < answer {\n\t\t\t\tanswer = rem\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(answer)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "sample_input": "2020 2040\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02983", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 6, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s043698752", "group_id": "codeNet:p02983", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar l, r int\n\tfmt.Scan(&l, &r)\n\t//2019個以上ならおけ\n\tw := r-l+1\n\tif w%2019 == 0{\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tans := 1000000000\n\tcnt := 1000000000\n\tfor i:=l; i<=r ; i++ {\n\t\t//IからJの中で、2019で割り切れるるものは最小値0\n\t\tif i%2019 == 0 {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t}\n\t\t//範囲の中にある2019に一番近い2つの数字が答え\n\t\tcnt = i%2019\n\t\tif ans > cnt {\n\t\t\tans = cnt\n\t\t}\n\t}\n\tfmt.Println(ans*(ans+1))\n}", "language": "Go", "metadata": {"date": 1573179721, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02983.html", "problem_id": "p02983", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02983/input.txt", "sample_output_relpath": "derived/input_output/data/p02983/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02983/Go/s043698752.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s043698752", "user_id": "u394040864"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar l, r int\n\tfmt.Scan(&l, &r)\n\t//2019個以上ならおけ\n\tw := r-l+1\n\tif w%2019 == 0{\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tans := 1000000000\n\tcnt := 1000000000\n\tfor i:=l; i<=r ; i++ {\n\t\t//IからJの中で、2019で割り切れるるものは最小値0\n\t\tif i%2019 == 0 {\n\t\t\tfmt.Println(0)\n\t\t\treturn\n\t\t}\n\t\t//範囲の中にある2019に一番近い2つの数字が答え\n\t\tcnt = i%2019\n\t\tif ans > cnt {\n\t\t\tans = cnt\n\t\t}\n\t}\n\tfmt.Println(ans*(ans+1))\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "sample_input": "2020 2040\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02983", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 491, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s992354727", "group_id": "codeNet:p02983", "input_text": "package main\n\nimport(\n \"fmt\"\n)\n\nfunc main() {\n var l, r int\n fmt.Scan(&l, &r)\n\n if r - l >= 2019 {\n fmt.Println(0)\n return\n }\n\n var min int\n min = 2020\n for i:= l;i <= r;i++ {\n for j:= l+1;j <= r; j++ {\n if min > (i*j)%2019 {\n min = (i*j)%2019\n }\n }\n }\n\n fmt.Println(min)\n}\n", "language": "Go", "metadata": {"date": 1571451498, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02983.html", "problem_id": "p02983", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02983/input.txt", "sample_output_relpath": "derived/input_output/data/p02983/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02983/Go/s992354727.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s992354727", "user_id": "u017829818"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport(\n \"fmt\"\n)\n\nfunc main() {\n var l, r int\n fmt.Scan(&l, &r)\n\n if r - l >= 2019 {\n fmt.Println(0)\n return\n }\n\n var min int\n min = 2020\n for i:= l;i <= r;i++ {\n for j:= l+1;j <= r; j++ {\n if min > (i*j)%2019 {\n min = (i*j)%2019\n }\n }\n }\n\n fmt.Println(min)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "sample_input": "2020 2040\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02983", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 369, "cpu_time_ms": 10, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s228430705", "group_id": "codeNet:p02983", "input_text": "package main\n\nimport(\n \"fmt\"\n \"math\"\n)\n\nfunc main() {\n var l, r int\n fmt.Scan(&l, &r)\n var min, second int\n var num int\n min = 2020\n second = 2020\n for i:=l;i <=r;i++ {\n num = int(math.Abs(float64(i%2019)))\n if min > num{\n second = min\n min = i%2019\n } else if second > num && min < num{\n second = num\n } \n }\n fmt.Println(min*second)\n}\n", "language": "Go", "metadata": {"date": 1571448568, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02983.html", "problem_id": "p02983", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02983/input.txt", "sample_output_relpath": "derived/input_output/data/p02983/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02983/Go/s228430705.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s228430705", "user_id": "u017829818"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport(\n \"fmt\"\n \"math\"\n)\n\nfunc main() {\n var l, r int\n fmt.Scan(&l, &r)\n var min, second int\n var num int\n min = 2020\n second = 2020\n for i:=l;i <=r;i++ {\n num = int(math.Abs(float64(i%2019)))\n if min > num{\n second = min\n min = i%2019\n } else if second > num && min < num{\n second = num\n } \n }\n fmt.Println(min*second)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "sample_input": "2020 2040\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02983", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 430, "cpu_time_ms": 2107, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s722333094", "group_id": "codeNet:p02983", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tmod := 2019\n\n\tif a*b < mod {\n\t\tfmt.Println(a * b)\n\t\tos.Exit(0)\n\t} else if a*b%mod == 0 {\n\t\tfmt.Println(0)\n\t\tos.Exit(0)\n\t}\n\n\tres := 2019\n\tfor i := a; i <= b-1; i++ {\n\t\tfor j := i + 1; j <= b; j++ {\n\t\t\tif m := i * j % mod; m < res {\n\t\t\t\tres = m\n\t\t\t}\n\t\t\tif res == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif res == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(res)\n}\n", "language": "Go", "metadata": {"date": 1567524528, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02983.html", "problem_id": "p02983", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02983/input.txt", "sample_output_relpath": "derived/input_output/data/p02983/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02983/Go/s722333094.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s722333094", "user_id": "u950580836"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tmod := 2019\n\n\tif a*b < mod {\n\t\tfmt.Println(a * b)\n\t\tos.Exit(0)\n\t} else if a*b%mod == 0 {\n\t\tfmt.Println(0)\n\t\tos.Exit(0)\n\t}\n\n\tres := 2019\n\tfor i := a; i <= b-1; i++ {\n\t\tfor j := i + 1; j <= b; j++ {\n\t\t\tif m := i * j % mod; m < res {\n\t\t\t\tres = m\n\t\t\t}\n\t\t\tif res == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif res == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(res)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "sample_input": "2020 2040\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02983", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 422, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s253914004", "group_id": "codeNet:p02983", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc searchMin(l int, r int) int {\n\tmin := 2019\n\tfor i := l; i < r; i++ {\n\t\tfor j := i + 1; j <= r; j++ {\n\t\t\tmod := (i * j) % 2019\n\t\t\tif mod < min {\n\t\t\t\tmin = mod\n\t\t\t}\n\t\t\tif min == 0 {\n\t\t\t\treturn 0\n\t\t\t}\n\t\t}\n\t}\n\treturn min\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tl := nextInt()\n\tr := nextInt()\n\n\t// min := searchMin(l, r)\n\t// fmt.Println(min)\n\n\tif r > l+2019 {\n\t\tr = l + 2019\n\t}\n\tmin := 2019\n\tfor i := l; i < r; i++ {\n\t\tfor j := i + 1; j <= r; j++ {\n\t\t\tmod := (i * j) % 2019\n\t\t\tif mod < min {\n\t\t\t\tmin = mod\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(min)\n}\n", "language": "Go", "metadata": {"date": 1565505664, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02983.html", "problem_id": "p02983", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02983/input.txt", "sample_output_relpath": "derived/input_output/data/p02983/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02983/Go/s253914004.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s253914004", "user_id": "u895838522"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc searchMin(l int, r int) int {\n\tmin := 2019\n\tfor i := l; i < r; i++ {\n\t\tfor j := i + 1; j <= r; j++ {\n\t\t\tmod := (i * j) % 2019\n\t\t\tif mod < min {\n\t\t\t\tmin = mod\n\t\t\t}\n\t\t\tif min == 0 {\n\t\t\t\treturn 0\n\t\t\t}\n\t\t}\n\t}\n\treturn min\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tl := nextInt()\n\tr := nextInt()\n\n\t// min := searchMin(l, r)\n\t// fmt.Println(min)\n\n\tif r > l+2019 {\n\t\tr = l + 2019\n\t}\n\tmin := 2019\n\tfor i := l; i < r; i++ {\n\t\tfor j := i + 1; j <= r; j++ {\n\t\t\tmod := (i * j) % 2019\n\t\t\tif mod < min {\n\t\t\t\tmin = mod\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(min)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "sample_input": "2020 2040\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02983", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 746, "cpu_time_ms": 6, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s244430152", "group_id": "codeNet:p02983", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tinput := scanNums(2)\n\tL := int64(input[0])\n\tR := int64(input[1])\n\n\tvar minNum int64 = math.MaxInt64\n\tfor i := L; i <= R; i++ {\n\t\tfor j := i+1; j <= R; j++ {\n\t\t\tminNum = minInt64(minNum, (i*j)%2019)\n\t\t\tif minNum == 0 {\n\t\t\t\tfmt.Print(minNum)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Print(minNum)\n\treturn\n}\n\nfunc minInt64(x, y int64) int64 {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\nfunc scanNums(len int) (nums []int) {\n\tvar num int\n\tfor i := 0; i < len; i++ {\n\t\tfmt.Scan(&num)\n\t\tnums = append(nums, num)\n\t}\n\treturn\n}\n", "language": "Go", "metadata": {"date": 1563657303, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02983.html", "problem_id": "p02983", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02983/input.txt", "sample_output_relpath": "derived/input_output/data/p02983/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02983/Go/s244430152.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s244430152", "user_id": "u994755401"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tinput := scanNums(2)\n\tL := int64(input[0])\n\tR := int64(input[1])\n\n\tvar minNum int64 = math.MaxInt64\n\tfor i := L; i <= R; i++ {\n\t\tfor j := i+1; j <= R; j++ {\n\t\t\tminNum = minInt64(minNum, (i*j)%2019)\n\t\t\tif minNum == 0 {\n\t\t\t\tfmt.Print(minNum)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Print(minNum)\n\treturn\n}\n\nfunc minInt64(x, y int64) int64 {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\nfunc scanNums(len int) (nums []int) {\n\tvar num int\n\tfor i := 0; i < len; i++ {\n\t\tfmt.Scan(&num)\n\t\tnums = append(nums, num)\n\t}\n\treturn\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "sample_input": "2020 2040\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02983", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 557, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s979839549", "group_id": "codeNet:p02983", "input_text": "package main\n\nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n \"strconv\"\n \"math\"\n)\n\nfunc main() {\n sc := bufio.NewScanner(os.Stdin)\n sc.Split(bufio.ScanWords)\n\n sc.Scan()\n l, _ := strconv.Atoi(sc.Text())\n sc.Scan()\n r, _ := strconv.Atoi(sc.Text())\n\n min := math.MaxInt32\n for i := l; i < r; i++ {\n for j := l + 1; j <= r; j++ {\n tmp := ((i % 2019) * (j % 2019)) % 2019\n if tmp < min {\n min = tmp\n }\n }\n if min == 0 {\n break\n }\n }\n fmt.Println(min)\n}\n\n", "language": "Go", "metadata": {"date": 1563573290, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02983.html", "problem_id": "p02983", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02983/input.txt", "sample_output_relpath": "derived/input_output/data/p02983/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02983/Go/s979839549.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s979839549", "user_id": "u212486902"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n \"strconv\"\n \"math\"\n)\n\nfunc main() {\n sc := bufio.NewScanner(os.Stdin)\n sc.Split(bufio.ScanWords)\n\n sc.Scan()\n l, _ := strconv.Atoi(sc.Text())\n sc.Scan()\n r, _ := strconv.Atoi(sc.Text())\n\n min := math.MaxInt32\n for i := l; i < r; i++ {\n for j := l + 1; j <= r; j++ {\n tmp := ((i % 2019) * (j % 2019)) % 2019\n if tmp < min {\n min = tmp\n }\n }\n if min == 0 {\n break\n }\n }\n fmt.Println(min)\n}\n\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "sample_input": "2020 2040\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02983", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 490, "cpu_time_ms": 2107, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s010459809", "group_id": "codeNet:p02983", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nconst div = 2019\n\nfunc nextInt() int64 {\n\tsc.Scan()\n\ti, e := strconv.ParseInt(sc.Text(), 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tl, r := nextInt(), nextInt()\n\n\tif r-l >= 2019 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tre := int64(9999999999)\n\tfor i := l; i <= r; i++ {\n\t\tfor j := i; j <= r; j++ {\n\t\t\tif i == j {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tv := i * j % div\n\t\t\tif re > v {\n\t\t\t\tre = v\n\t\t\t}\n\t\t\tif re == 0 {\n\t\t\t\tfmt.Println(re)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(re)\n}\n", "language": "Go", "metadata": {"date": 1562554960, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02983.html", "problem_id": "p02983", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02983/input.txt", "sample_output_relpath": "derived/input_output/data/p02983/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02983/Go/s010459809.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s010459809", "user_id": "u317845566"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nconst div = 2019\n\nfunc nextInt() int64 {\n\tsc.Scan()\n\ti, e := strconv.ParseInt(sc.Text(), 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tl, r := nextInt(), nextInt()\n\n\tif r-l >= 2019 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tre := int64(9999999999)\n\tfor i := l; i <= r; i++ {\n\t\tfor j := i; j <= r; j++ {\n\t\t\tif i == j {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tv := i * j % div\n\t\t\tif re > v {\n\t\t\t\tre = v\n\t\t\t}\n\t\t\tif re == 0 {\n\t\t\t\tfmt.Println(re)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(re)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "sample_input": "2020 2040\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02983", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s276982135", "group_id": "codeNet:p02983", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n)\n\nconst pi = math.Pi\n\nvar A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z int\nvar mod int = pow(10, 9) + 7\nvar Umod uint64 = 2019\nvar ans int = 1e9\n\nfunc main() {\n\tvar L, R int\n\tfmt.Scan(&L, &R)\n\n\t// i*j = k...p (mod 2019)\n\t// (i*j+p) = k*2019\n\tif 2019 <= R-L {\n\t\tfmt.Println(0)\n\t} else {\n\t\tfor i := L; i <= R-1; i++ {\n\t\t\tfor j := L + 1; j <= R; j++ {\n\t\t\t\tcnt := i * j % 2019\n\t\t\t\tans = min(ans, cnt)\n\t\t\t}\n\t\t}\n\t\tfmt.Println(ans)\n\t}\n}\n\n/* ---------------------------------------- */\n\nvar reader = bufio.NewScanner(os.Stdin)\n\nfunc read() string {\n\treader.Scan()\n\treturn reader.Text()\n}\n\nfunc lcm(x, y int) int {\n\treturn (x / gcd(x, y)) * y\n}\n\nfunc gcd(x, y int) int {\n\tif x%y == 0 {\n\t\treturn y\n\t} else {\n\t\tr := x % y\n\t\treturn gcd(y, r)\n\t}\n}\n\nvar fac [1000000]int\nvar finv [1000000]int\nvar inv [1000000]int\n\nfunc combination_init() {\n\tfac[0], fac[1] = 1, 1\n\tfinv[0], finv[1] = 1, 1\n\tinv[1] = 1\n\n\t// invは a^(-1) mod p\n\t// pをaで割ることを考える\n\n\t// p/a*(a) + p%a = p\n\t// p/a*(a) + p%a = 0 (mod p)\n\t// -p%a = p/a*(a) (mod p)\n\t// -p%a *a^(-1)= p/a (mod p)\n\t// a^(-1)= p/a * (-p%a)^(-1) (mod p)\n\t// a^(-1) =\n\n\tfor i := 2; i < 1000000; i++ {\n\t\tfac[i] = fac[i-1] * i % mod\n\t\tinv[i] = mod - inv[mod%i]*(mod/i)%mod\n\t\tfinv[i] = finv[i-1] * inv[i] % mod\n\t}\n}\n\nfunc combination(x, y int) int {\n\tif x < y {\n\t\treturn 0\n\t}\n\tif fac[0] != 1 {\n\t\tcombination_init()\n\t}\n\treturn fac[x] * (finv[y] * finv[x-y] % mod) % mod\n\t//return fac[x] / (fac[y] * fac[x-y])\n}\n\nfunc permutation(x, y int) int {\n\tif x < y {\n\t\treturn 0\n\t}\n\tif fac[0] != 1 {\n\t\tcombination_init()\n\t}\n\treturn fac[x] * (finv[x-y] % mod) % mod\n\t//return fac[x] / fac[x-y]\n}\n\nfunc max(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Max(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\n\nfunc min(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Min(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\nfunc pow(x, y int) int { return int(math.Pow(float64(x), float64(y))) }\nfunc abs(x int) int { return int(math.Abs(float64(x))) }\nfunc floor(x int) int { return int(math.Floor(float64(x))) }\nfunc ceil(x int) int { return int(math.Ceil(float64(x))) }\n\ntype SortBy []int\n\nfunc (a SortBy) Len() int { return len(a) }\nfunc (a SortBy) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a SortBy) Less(i, j int) bool { return a[i] > a[j] }\n\ntype PriorityQueue []int\n\nfunc (h PriorityQueue) Len() int { return len(h) }\nfunc (h PriorityQueue) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h PriorityQueue) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\nfunc (h *PriorityQueue) Push(x interface{}) { *h = append(*h, x.(int)) }\nfunc (h *PriorityQueue) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n", "language": "Go", "metadata": {"date": 1562552438, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02983.html", "problem_id": "p02983", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02983/input.txt", "sample_output_relpath": "derived/input_output/data/p02983/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02983/Go/s276982135.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s276982135", "user_id": "u266742706"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n)\n\nconst pi = math.Pi\n\nvar A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z int\nvar mod int = pow(10, 9) + 7\nvar Umod uint64 = 2019\nvar ans int = 1e9\n\nfunc main() {\n\tvar L, R int\n\tfmt.Scan(&L, &R)\n\n\t// i*j = k...p (mod 2019)\n\t// (i*j+p) = k*2019\n\tif 2019 <= R-L {\n\t\tfmt.Println(0)\n\t} else {\n\t\tfor i := L; i <= R-1; i++ {\n\t\t\tfor j := L + 1; j <= R; j++ {\n\t\t\t\tcnt := i * j % 2019\n\t\t\t\tans = min(ans, cnt)\n\t\t\t}\n\t\t}\n\t\tfmt.Println(ans)\n\t}\n}\n\n/* ---------------------------------------- */\n\nvar reader = bufio.NewScanner(os.Stdin)\n\nfunc read() string {\n\treader.Scan()\n\treturn reader.Text()\n}\n\nfunc lcm(x, y int) int {\n\treturn (x / gcd(x, y)) * y\n}\n\nfunc gcd(x, y int) int {\n\tif x%y == 0 {\n\t\treturn y\n\t} else {\n\t\tr := x % y\n\t\treturn gcd(y, r)\n\t}\n}\n\nvar fac [1000000]int\nvar finv [1000000]int\nvar inv [1000000]int\n\nfunc combination_init() {\n\tfac[0], fac[1] = 1, 1\n\tfinv[0], finv[1] = 1, 1\n\tinv[1] = 1\n\n\t// invは a^(-1) mod p\n\t// pをaで割ることを考える\n\n\t// p/a*(a) + p%a = p\n\t// p/a*(a) + p%a = 0 (mod p)\n\t// -p%a = p/a*(a) (mod p)\n\t// -p%a *a^(-1)= p/a (mod p)\n\t// a^(-1)= p/a * (-p%a)^(-1) (mod p)\n\t// a^(-1) =\n\n\tfor i := 2; i < 1000000; i++ {\n\t\tfac[i] = fac[i-1] * i % mod\n\t\tinv[i] = mod - inv[mod%i]*(mod/i)%mod\n\t\tfinv[i] = finv[i-1] * inv[i] % mod\n\t}\n}\n\nfunc combination(x, y int) int {\n\tif x < y {\n\t\treturn 0\n\t}\n\tif fac[0] != 1 {\n\t\tcombination_init()\n\t}\n\treturn fac[x] * (finv[y] * finv[x-y] % mod) % mod\n\t//return fac[x] / (fac[y] * fac[x-y])\n}\n\nfunc permutation(x, y int) int {\n\tif x < y {\n\t\treturn 0\n\t}\n\tif fac[0] != 1 {\n\t\tcombination_init()\n\t}\n\treturn fac[x] * (finv[x-y] % mod) % mod\n\t//return fac[x] / fac[x-y]\n}\n\nfunc max(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Max(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\n\nfunc min(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Min(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\nfunc pow(x, y int) int { return int(math.Pow(float64(x), float64(y))) }\nfunc abs(x int) int { return int(math.Abs(float64(x))) }\nfunc floor(x int) int { return int(math.Floor(float64(x))) }\nfunc ceil(x int) int { return int(math.Ceil(float64(x))) }\n\ntype SortBy []int\n\nfunc (a SortBy) Len() int { return len(a) }\nfunc (a SortBy) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a SortBy) Less(i, j int) bool { return a[i] > a[j] }\n\ntype PriorityQueue []int\n\nfunc (h PriorityQueue) Len() int { return len(h) }\nfunc (h PriorityQueue) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h PriorityQueue) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\nfunc (h *PriorityQueue) Push(x interface{}) { *h = append(*h, x.(int)) }\nfunc (h *PriorityQueue) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "sample_input": "2020 2040\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02983", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2900, "cpu_time_ms": 56, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s079868842", "group_id": "codeNet:p02983", "input_text": "package main\n\nimport \"fmt\"\n\nvar moduler = 2019\n\nfunc main() {\n\tvar l, r int\n\tfmt.Scan(&l, &r)\n\tans := l * (l + 1) % moduler\n\tfor i := l; i < r; i++ {\n\t\tfor j := l + 1; j <= r; j++ {\n\t\t\tmod := i * j % moduler\n\t\t\tif mod < ans {\n\t\t\t\tans = mod\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1562552349, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02983.html", "problem_id": "p02983", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02983/input.txt", "sample_output_relpath": "derived/input_output/data/p02983/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02983/Go/s079868842.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s079868842", "user_id": "u717943620"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nvar moduler = 2019\n\nfunc main() {\n\tvar l, r int\n\tfmt.Scan(&l, &r)\n\tans := l * (l + 1) % moduler\n\tfor i := l; i < r; i++ {\n\t\tfor j := l + 1; j <= r; j++ {\n\t\t\tmod := i * j % moduler\n\t\t\tif mod < ans {\n\t\t\t\tans = mod\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "sample_input": "2020 2040\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02983", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2107, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s686202399", "group_id": "codeNet:p02983", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Scan()\n\tnumString := strings.Split(sc.Text(), \" \")\n\n\tl, _ := strconv.Atoi(numString[0])\n\tr, _ := strconv.Atoi(numString[1])\n\n\tvar flg bool\n\tvar rem, min int\n\tvar count int\n\tfor i := l; i < r; i++ {\n\t\tif i%2019 == 0 {\n\t\t\tmin = 0\n\t\t\tbreak\n\t\t}\n\t\tfor j := i + 1; j <= r; j++ {\n\t\t\tif flg == false {\n\t\t\t\tmin = i * j\n\t\t\t\tflg = true\n\t\t\t}\n\t\t\trem = (i * j) % 2019\n\t\t\tif rem < min {\n\t\t\t\tmin = rem\n\t\t\t}\n\t\t\tcount++\n\t\t\tif count > 2019 {\n\t\t\t\tcount = 0\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(min)\n}", "language": "Go", "metadata": {"date": 1562551766, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02983.html", "problem_id": "p02983", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02983/input.txt", "sample_output_relpath": "derived/input_output/data/p02983/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02983/Go/s686202399.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s686202399", "user_id": "u723383064"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tsc.Scan()\n\tnumString := strings.Split(sc.Text(), \" \")\n\n\tl, _ := strconv.Atoi(numString[0])\n\tr, _ := strconv.Atoi(numString[1])\n\n\tvar flg bool\n\tvar rem, min int\n\tvar count int\n\tfor i := l; i < r; i++ {\n\t\tif i%2019 == 0 {\n\t\t\tmin = 0\n\t\t\tbreak\n\t\t}\n\t\tfor j := i + 1; j <= r; j++ {\n\t\t\tif flg == false {\n\t\t\t\tmin = i * j\n\t\t\t\tflg = true\n\t\t\t}\n\t\t\trem = (i * j) % 2019\n\t\t\tif rem < min {\n\t\t\t\tmin = rem\n\t\t\t}\n\t\t\tcount++\n\t\t\tif count > 2019 {\n\t\t\t\tcount = 0\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(min)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "sample_input": "2020 2040\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02983", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 603, "cpu_time_ms": 12, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s554124201", "group_id": "codeNet:p02983", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tlr := strings.Fields(nextLine())\n\tl, _ := strconv.Atoi(lr[0])\n\tr, _ := strconv.Atoi(lr[1])\n\tnums := []int{}\n\tif l < r+2019 {\n\t\tfor i := l; i <= r; i++ {\n\t\t\tnums = append(nums, i%2019)\n\t\t}\n\t} else {\n\t\tfor i := l; i <= l+2019; i++ {\n\t\t\tnums = append(nums, i%2019)\n\t\t}\n\t}\n\tsort.Ints(nums)\n\tfmt.Println(nums[0] * nums[1])\n}\n", "language": "Go", "metadata": {"date": 1562551685, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02983.html", "problem_id": "p02983", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02983/input.txt", "sample_output_relpath": "derived/input_output/data/p02983/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02983/Go/s554124201.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s554124201", "user_id": "u900615460"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tlr := strings.Fields(nextLine())\n\tl, _ := strconv.Atoi(lr[0])\n\tr, _ := strconv.Atoi(lr[1])\n\tnums := []int{}\n\tif l < r+2019 {\n\t\tfor i := l; i <= r; i++ {\n\t\t\tnums = append(nums, i%2019)\n\t\t}\n\t} else {\n\t\tfor i := l; i <= l+2019; i++ {\n\t\t\tnums = append(nums, i%2019)\n\t\t}\n\t}\n\tsort.Ints(nums)\n\tfmt.Println(nums[0] * nums[1])\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "sample_input": "2020 2040\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02983", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 507, "cpu_time_ms": 2117, "memory_kb": 23424}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s324643591", "group_id": "codeNet:p02983", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar ReadString func() string\n\nfunc init() {\n\tReadString = newReadString()\n}\n\n/*------ scan ------*/\n\nfunc newReadString() func() string {\n\tsc.Buffer(make([]byte, 1024), 2048)\n\tsc.Split(bufio.ScanWords)\n\treturn func() string {\n\t\tif !sc.Scan() {\n\t\t\tpanic(\"scanできなかった\")\n\t\t}\n\t\treturn sc.Text()\n\t}\n}\n\nfunc ReadLine() string {\n\tif !sc.Scan() {\n\t\tpanic(\"line をscanできなかった\")\n\t}\n\treturn sc.Text()\n}\n\nfunc ReadInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tfmt.Println(\"parseInt失敗\")\n\t\tpanic(err.Error())\n\t}\n\treturn int64(i)\n}\n\nfunc ReadInt() int {\n\ti := ReadInt64()\n\treturn int(i)\n}\n\nfunc ReadIntSlice(n int) []int {\n\tarr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarr[i] = ReadInt()\n\t}\n\treturn arr\n}\n\nfunc ReadInt64Slice(n int) []int64 {\n\tarr := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tarr[i] = ReadInt64()\n\t}\n\treturn arr\n}\n\n/*------ number util ------*/\n\nfunc GetIntAbs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\treturn n\n}\n\nfunc Atoi(a string) int {\n\ti, err := strconv.Atoi(a)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc FindMin(arr []int) int {\n\tif len(arr) == 0 {\n\t\treturn 0\n\t}\n\tmin := arr[0]\n\tfor _, v := range arr {\n\t\tif v < min {\n\t\t\tmin = v\n\t\t}\n\t}\n\treturn min\n}\n\nfunc FindMax(arr []int) int {\n\tif len(arr) == 0 {\n\t\treturn 0\n\t}\n\tmax := arr[0]\n\tfor _, v := range arr {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}\n\n\nfunc main() {\n\tL := ReadInt()\n\tR := ReadInt()\n\tif L * R < 2019 {\n\t\tfmt.Println(L * R)\n\t} else {\n\n\t\tmax := L\n min := R\n\t\tif R > max {\n\t\t\tmax = R\n min = L\n\t\t}\n\t\tminRs := 1000000\n\t\tfor j := max; j >= min + 1; j-- {\n\t\t\tfor i := j - 1; i >= min; i-- {\n \tmod := (i * j) % 2019\n\t\t\t\tif mod < minRs {\n\t\t\t\t\tminRs = mod\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfmt.Println(minRs)\n\t}\n}", "language": "Go", "metadata": {"date": 1562551202, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02983.html", "problem_id": "p02983", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02983/input.txt", "sample_output_relpath": "derived/input_output/data/p02983/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02983/Go/s324643591.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s324643591", "user_id": "u657610454"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar ReadString func() string\n\nfunc init() {\n\tReadString = newReadString()\n}\n\n/*------ scan ------*/\n\nfunc newReadString() func() string {\n\tsc.Buffer(make([]byte, 1024), 2048)\n\tsc.Split(bufio.ScanWords)\n\treturn func() string {\n\t\tif !sc.Scan() {\n\t\t\tpanic(\"scanできなかった\")\n\t\t}\n\t\treturn sc.Text()\n\t}\n}\n\nfunc ReadLine() string {\n\tif !sc.Scan() {\n\t\tpanic(\"line をscanできなかった\")\n\t}\n\treturn sc.Text()\n}\n\nfunc ReadInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tfmt.Println(\"parseInt失敗\")\n\t\tpanic(err.Error())\n\t}\n\treturn int64(i)\n}\n\nfunc ReadInt() int {\n\ti := ReadInt64()\n\treturn int(i)\n}\n\nfunc ReadIntSlice(n int) []int {\n\tarr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarr[i] = ReadInt()\n\t}\n\treturn arr\n}\n\nfunc ReadInt64Slice(n int) []int64 {\n\tarr := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tarr[i] = ReadInt64()\n\t}\n\treturn arr\n}\n\n/*------ number util ------*/\n\nfunc GetIntAbs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\treturn n\n}\n\nfunc Atoi(a string) int {\n\ti, err := strconv.Atoi(a)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc FindMin(arr []int) int {\n\tif len(arr) == 0 {\n\t\treturn 0\n\t}\n\tmin := arr[0]\n\tfor _, v := range arr {\n\t\tif v < min {\n\t\t\tmin = v\n\t\t}\n\t}\n\treturn min\n}\n\nfunc FindMax(arr []int) int {\n\tif len(arr) == 0 {\n\t\treturn 0\n\t}\n\tmax := arr[0]\n\tfor _, v := range arr {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}\n\n\nfunc main() {\n\tL := ReadInt()\n\tR := ReadInt()\n\tif L * R < 2019 {\n\t\tfmt.Println(L * R)\n\t} else {\n\n\t\tmax := L\n min := R\n\t\tif R > max {\n\t\t\tmax = R\n min = L\n\t\t}\n\t\tminRs := 1000000\n\t\tfor j := max; j >= min + 1; j-- {\n\t\t\tfor i := j - 1; i >= min; i-- {\n \tmod := (i * j) % 2019\n\t\t\t\tif mod < minRs {\n\t\t\t\t\tminRs = mod\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfmt.Println(minRs)\n\t}\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "sample_input": "2020 2040\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02983", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1871, "cpu_time_ms": 2107, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s853988022", "group_id": "codeNet:p02983", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner = bufio.NewScanner(os.Stdin)\n\nfunc next() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(next())\n\treturn i\n}\n\nfunc main() {\n\tscanner.Split(bufio.ScanWords)\n\n\tl := nextInt()\n\tr := nextInt()\n\n\tif r-l >= 2018 {\n\t\tfmt.Println(0)\n\t} else {\n\t\tfor i := l; i <= r; i++ {\n\t\t\tif i%2019 == 0 {\n\t\t\t\tfmt.Println(0)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tfmt.Println((l * (l + 1)) % 2019)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1562550953, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02983.html", "problem_id": "p02983", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02983/input.txt", "sample_output_relpath": "derived/input_output/data/p02983/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02983/Go/s853988022.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s853988022", "user_id": "u262403099"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner = bufio.NewScanner(os.Stdin)\n\nfunc next() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(next())\n\treturn i\n}\n\nfunc main() {\n\tscanner.Split(bufio.ScanWords)\n\n\tl := nextInt()\n\tr := nextInt()\n\n\tif r-l >= 2018 {\n\t\tfmt.Println(0)\n\t} else {\n\t\tfor i := l; i <= r; i++ {\n\t\t\tif i%2019 == 0 {\n\t\t\t\tfmt.Println(0)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tfmt.Println((l * (l + 1)) % 2019)\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "sample_input": "2020 2040\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02983", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 481, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s444145368", "group_id": "codeNet:p02983", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar l, r int\n\tfmt.Scan(&l, &r)\n\n\ta := l % 2019\n\tb := r % 2019\n\n\tif a >= b || r-l > 2019 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tif a < b {\n\t\tmin := 10000\n\t\tfor i := a; i <= b-1; i++ {\n\t\t\tfor j := i + 1; j <= b; j++ {\n\t\t\t\tt := (i * j) % 2019\n\t\t\t\tif t < min {\n\t\t\t\t\tmin = t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfmt.Println(min)\n\t\treturn\n\t}\n}\n", "language": "Go", "metadata": {"date": 1562550720, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02983.html", "problem_id": "p02983", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02983/input.txt", "sample_output_relpath": "derived/input_output/data/p02983/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02983/Go/s444145368.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s444145368", "user_id": "u102310764"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar l, r int\n\tfmt.Scan(&l, &r)\n\n\ta := l % 2019\n\tb := r % 2019\n\n\tif a >= b || r-l > 2019 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tif a < b {\n\t\tmin := 10000\n\t\tfor i := a; i <= b-1; i++ {\n\t\t\tfor j := i + 1; j <= b; j++ {\n\t\t\t\tt := (i * j) % 2019\n\t\t\t\tif t < min {\n\t\t\t\t\tmin = t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfmt.Println(min)\n\t\treturn\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "sample_input": "2020 2040\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02983", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 5, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s419495434", "group_id": "codeNet:p02983", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := ZeroPaddingRuneSlice(num, 32)\n//str := PrintIntsLine(X...)\n\n/*******************************************************************/\n\nconst MOD = 1000000000 + 7\nconst ALPHABET_NUM = 26\nconst INF_INT64 = math.MaxInt64\nconst INF_BIT60 = 1 << 60\n\nvar l, r int\n\nfunc main() {\n\tl, r = ReadInt(), ReadInt()\n\n\tans := INF_INT64\n\t// flag := false\n\tcounter := 0\n\tfor i := l; i <= r; i++ {\n\t\tfor j := i + 1; j <= r; j++ {\n\t\t\tif counter == 1000000 {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tcounter++\n\t\t\tif ans > (i*j)%2019 {\n\t\t\t\tans = (i * j) % 2019\n\t\t\t\t// flag = true\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\n// MODはとったか?\n// 遷移だけじゃなくて最後の最後でちゃんと取れよ?\n\n/*******************************************************************/\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\tReadString = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\t// Split sets the split function for the Scanner. The default split function is ScanLines.\n\t// Split panics if it is called after scanning has started.\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadFloat64 returns an float64.\nfunc ReadFloat64() float64 {\n\treturn float64(readFloat64())\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(ReadString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// ReadFloatSlice returns an float64 slice that has n float64.\nfunc ReadFloat64Slice(n int) []float64 {\n\tb := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadFloat64()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n/*********** Debugging ***********/\n\n// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.\n// For debugging use.\nfunc ZeroPaddingRuneSlice(n, digitsNum int) []rune {\n\tsn := fmt.Sprintf(\"%b\", n)\n\n\tresidualLength := digitsNum - len(sn)\n\tif residualLength <= 0 {\n\t\treturn []rune(sn)\n\t}\n\n\tzeros := make([]rune, residualLength)\n\tfor i := 0; i < len(zeros); i++ {\n\t\tzeros[i] = '0'\n\t}\n\n\tres := []rune{}\n\tres = append(res, zeros...)\n\tres = append(res, []rune(sn)...)\n\n\treturn res\n}\n\n/*********** DP sub-functions ***********/\n\n// ChMin accepts a pointer of integer and a target value.\n// If target value is SMALLER than the first argument,\n//\tthen the first argument will be updated by the second argument.\nfunc ChMin(updatedValue *int, target int) bool {\n\tif *updatedValue > target {\n\t\t*updatedValue = target\n\t\treturn true\n\t}\n\treturn false\n}\n\n// ChMax accepts a pointer of integer and a target value.\n// If target value is LARGER than the first argument,\n//\tthen the first argument will be updated by the second argument.\nfunc ChMax(updatedValue *int, target int) bool {\n\tif *updatedValue < target {\n\t\t*updatedValue = target\n\t\treturn true\n\t}\n\treturn false\n}\n\n// NthBit returns nth bit value of an argument.\n// n starts from 0.\nfunc NthBit(num, nth int) int {\n\treturn num >> uint(nth) & 1\n}\n\n// OnBit returns the integer that has nth ON bit.\n// If an argument has nth ON bit, OnBit returns the argument.\nfunc OnBit(num, nth int) int {\n\treturn num | (1 << uint(nth))\n}\n\n// OffBit returns the integer that has nth OFF bit.\n// If an argument has nth OFF bit, OffBit returns the argument.\nfunc OffBit(num, nth int) int {\n\treturn num & ^(1 << uint(nth))\n}\n\n// PopCount returns the number of ON bit of an argument.\nfunc PopCount(num int) int {\n\tres := 0\n\n\tfor i := 0; i < 70; i++ {\n\t\tif ((num >> uint(i)) & 1) == 1 {\n\t\t\tres++\n\t\t}\n\t}\n\n\treturn res\n}\n\n/*********** Arithmetic ***********/\n\n// Max returns the max integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Max(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m < integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// Min returns the min integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Min(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m > integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// DigitSum returns digit sum of a decimal number.\n// DigitSum only accept a positive integer.\nfunc DigitSum(n int) int {\n\tif n < 0 {\n\t\treturn -1\n\t}\n\n\tres := 0\n\n\tfor n > 0 {\n\t\tres += n % 10\n\t\tn /= 10\n\t}\n\n\treturn res\n}\n\n// Sum returns multiple integers sum.\nfunc Sum(integers ...int) int {\n\ts := 0\n\n\tfor _, i := range integers {\n\t\ts += i\n\t}\n\n\treturn s\n}\n\n// CeilInt returns the minimum integer larger than or equal to float(a/b).\nfunc CeilInt(a, b int) int {\n\tres := a / b\n\tif a%b > 0 {\n\t\tres++\n\t}\n\treturn res\n}\n\n// FloorInt returns the maximum integer smaller than or equal to float(a/b)\nfunc FloorInt(a, b int) int {\n\tres := a / b\n\treturn res\n}\n\n// PowInt is integer version of math.Pow\n// PowInt calculate a power by Binary Power (二分累乗法(O(log e))).\nfunc PowInt(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(errors.New(\"[argument error]: PowInt does not accept negative integers\"))\n\t}\n\n\tif e == 0 {\n\t\treturn 1\n\t}\n\n\tif e%2 == 0 {\n\t\thalfE := e / 2\n\t\thalf := PowInt(a, halfE)\n\t\treturn half * half\n\t}\n\n\treturn a * PowInt(a, e-1)\n}\n\n// AbsInt is integer version of math.Abs\nfunc AbsInt(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// Gcd returns the Greatest Common Divisor of two natural numbers.\n// Gcd only accepts two natural numbers (a, b >= 1).\n// 0 or negative number causes panic.\n// Gcd uses the Euclidean Algorithm.\nfunc Gcd(a, b int) int {\n\tif a <= 0 || b <= 0 {\n\t\tpanic(errors.New(\"[argument error]: Gcd only accepts two NATURAL numbers\"))\n\t}\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\n\t// Euclidean Algorithm\n\tfor b > 0 {\n\t\tdiv := a % b\n\t\ta, b = b, div\n\t}\n\n\treturn a\n}\n\n// Lcm returns the Least Common Multiple of two natural numbers.\n// Lcd only accepts two natural numbers (a, b >= 1).\n// 0 or negative number causes panic.\n// Lcd uses the Euclidean Algorithm indirectly.\nfunc Lcm(a, b int) int {\n\tif a <= 0 || b <= 0 {\n\t\tpanic(errors.New(\"[argument error]: Gcd only accepts two NATURAL numbers\"))\n\t}\n\n\t// a = a'*gcd, b = b'*gcd, a*b = a'*b'*gcd^2\n\t// a' and b' are relatively prime numbers\n\t// gcd consists of prime numbers, that are included in a and b\n\tgcd := Gcd(a, b)\n\n\t// not (a * b / gcd), because of reducing a probability of overflow\n\treturn (a / gcd) * b\n}\n\n// Strtoi is a wrapper of `strconv.Atoi()`.\n// If `strconv.Atoi()` returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintIntsLine(A ...int) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.Itoa(A[i])\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n", "language": "Go", "metadata": {"date": 1562550386, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02983.html", "problem_id": "p02983", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02983/input.txt", "sample_output_relpath": "derived/input_output/data/p02983/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02983/Go/s419495434.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s419495434", "user_id": "u103600314"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := ZeroPaddingRuneSlice(num, 32)\n//str := PrintIntsLine(X...)\n\n/*******************************************************************/\n\nconst MOD = 1000000000 + 7\nconst ALPHABET_NUM = 26\nconst INF_INT64 = math.MaxInt64\nconst INF_BIT60 = 1 << 60\n\nvar l, r int\n\nfunc main() {\n\tl, r = ReadInt(), ReadInt()\n\n\tans := INF_INT64\n\t// flag := false\n\tcounter := 0\n\tfor i := l; i <= r; i++ {\n\t\tfor j := i + 1; j <= r; j++ {\n\t\t\tif counter == 1000000 {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tcounter++\n\t\t\tif ans > (i*j)%2019 {\n\t\t\t\tans = (i * j) % 2019\n\t\t\t\t// flag = true\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\n// MODはとったか?\n// 遷移だけじゃなくて最後の最後でちゃんと取れよ?\n\n/*******************************************************************/\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\tReadString = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\t// Split sets the split function for the Scanner. The default split function is ScanLines.\n\t// Split panics if it is called after scanning has started.\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadFloat64 returns an float64.\nfunc ReadFloat64() float64 {\n\treturn float64(readFloat64())\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(ReadString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// ReadFloatSlice returns an float64 slice that has n float64.\nfunc ReadFloat64Slice(n int) []float64 {\n\tb := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadFloat64()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n/*********** Debugging ***********/\n\n// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.\n// For debugging use.\nfunc ZeroPaddingRuneSlice(n, digitsNum int) []rune {\n\tsn := fmt.Sprintf(\"%b\", n)\n\n\tresidualLength := digitsNum - len(sn)\n\tif residualLength <= 0 {\n\t\treturn []rune(sn)\n\t}\n\n\tzeros := make([]rune, residualLength)\n\tfor i := 0; i < len(zeros); i++ {\n\t\tzeros[i] = '0'\n\t}\n\n\tres := []rune{}\n\tres = append(res, zeros...)\n\tres = append(res, []rune(sn)...)\n\n\treturn res\n}\n\n/*********** DP sub-functions ***********/\n\n// ChMin accepts a pointer of integer and a target value.\n// If target value is SMALLER than the first argument,\n//\tthen the first argument will be updated by the second argument.\nfunc ChMin(updatedValue *int, target int) bool {\n\tif *updatedValue > target {\n\t\t*updatedValue = target\n\t\treturn true\n\t}\n\treturn false\n}\n\n// ChMax accepts a pointer of integer and a target value.\n// If target value is LARGER than the first argument,\n//\tthen the first argument will be updated by the second argument.\nfunc ChMax(updatedValue *int, target int) bool {\n\tif *updatedValue < target {\n\t\t*updatedValue = target\n\t\treturn true\n\t}\n\treturn false\n}\n\n// NthBit returns nth bit value of an argument.\n// n starts from 0.\nfunc NthBit(num, nth int) int {\n\treturn num >> uint(nth) & 1\n}\n\n// OnBit returns the integer that has nth ON bit.\n// If an argument has nth ON bit, OnBit returns the argument.\nfunc OnBit(num, nth int) int {\n\treturn num | (1 << uint(nth))\n}\n\n// OffBit returns the integer that has nth OFF bit.\n// If an argument has nth OFF bit, OffBit returns the argument.\nfunc OffBit(num, nth int) int {\n\treturn num & ^(1 << uint(nth))\n}\n\n// PopCount returns the number of ON bit of an argument.\nfunc PopCount(num int) int {\n\tres := 0\n\n\tfor i := 0; i < 70; i++ {\n\t\tif ((num >> uint(i)) & 1) == 1 {\n\t\t\tres++\n\t\t}\n\t}\n\n\treturn res\n}\n\n/*********** Arithmetic ***********/\n\n// Max returns the max integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Max(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m < integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// Min returns the min integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Min(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m > integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// DigitSum returns digit sum of a decimal number.\n// DigitSum only accept a positive integer.\nfunc DigitSum(n int) int {\n\tif n < 0 {\n\t\treturn -1\n\t}\n\n\tres := 0\n\n\tfor n > 0 {\n\t\tres += n % 10\n\t\tn /= 10\n\t}\n\n\treturn res\n}\n\n// Sum returns multiple integers sum.\nfunc Sum(integers ...int) int {\n\ts := 0\n\n\tfor _, i := range integers {\n\t\ts += i\n\t}\n\n\treturn s\n}\n\n// CeilInt returns the minimum integer larger than or equal to float(a/b).\nfunc CeilInt(a, b int) int {\n\tres := a / b\n\tif a%b > 0 {\n\t\tres++\n\t}\n\treturn res\n}\n\n// FloorInt returns the maximum integer smaller than or equal to float(a/b)\nfunc FloorInt(a, b int) int {\n\tres := a / b\n\treturn res\n}\n\n// PowInt is integer version of math.Pow\n// PowInt calculate a power by Binary Power (二分累乗法(O(log e))).\nfunc PowInt(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(errors.New(\"[argument error]: PowInt does not accept negative integers\"))\n\t}\n\n\tif e == 0 {\n\t\treturn 1\n\t}\n\n\tif e%2 == 0 {\n\t\thalfE := e / 2\n\t\thalf := PowInt(a, halfE)\n\t\treturn half * half\n\t}\n\n\treturn a * PowInt(a, e-1)\n}\n\n// AbsInt is integer version of math.Abs\nfunc AbsInt(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// Gcd returns the Greatest Common Divisor of two natural numbers.\n// Gcd only accepts two natural numbers (a, b >= 1).\n// 0 or negative number causes panic.\n// Gcd uses the Euclidean Algorithm.\nfunc Gcd(a, b int) int {\n\tif a <= 0 || b <= 0 {\n\t\tpanic(errors.New(\"[argument error]: Gcd only accepts two NATURAL numbers\"))\n\t}\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\n\t// Euclidean Algorithm\n\tfor b > 0 {\n\t\tdiv := a % b\n\t\ta, b = b, div\n\t}\n\n\treturn a\n}\n\n// Lcm returns the Least Common Multiple of two natural numbers.\n// Lcd only accepts two natural numbers (a, b >= 1).\n// 0 or negative number causes panic.\n// Lcd uses the Euclidean Algorithm indirectly.\nfunc Lcm(a, b int) int {\n\tif a <= 0 || b <= 0 {\n\t\tpanic(errors.New(\"[argument error]: Gcd only accepts two NATURAL numbers\"))\n\t}\n\n\t// a = a'*gcd, b = b'*gcd, a*b = a'*b'*gcd^2\n\t// a' and b' are relatively prime numbers\n\t// gcd consists of prime numbers, that are included in a and b\n\tgcd := Gcd(a, b)\n\n\t// not (a * b / gcd), because of reducing a probability of overflow\n\treturn (a / gcd) * b\n}\n\n// Strtoi is a wrapper of `strconv.Atoi()`.\n// If `strconv.Atoi()` returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintIntsLine(A ...int) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.Itoa(A[i])\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "sample_input": "2020 2040\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02983", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 7757, "cpu_time_ms": 1949, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s023945039", "group_id": "codeNet:p02983", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\n// 一行読み出し\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// 文字列リバース関数\nfunc strReverse(s string) string {\n\trs := []rune(s)\n\tfor i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 {\n\t\trs[i], rs[j] = rs[j], rs[i]\n\t}\n\treturn string(rs)\n}\n\n// 引数個の数値を読み込む\nfunc scanNums(len int) (nums []int) {\n\tvar num int\n\tfor i := 0; i < len; i++ {\n\t\tfmt.Scan(&num)\n\t\tnums = append(nums, num)\n\t}\n\treturn\n}\n\nfunc main() {\n\tvar l, r int\n\tfmt.Scan(&l, &r)\n\n\tfor l >= 2019 {\n\t\tl = l - 2019\n\t\tr = r - 2019\n\t}\n\n\tans := l * (l + 1)\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1562548754, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p02983.html", "problem_id": "p02983", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02983/input.txt", "sample_output_relpath": "derived/input_output/data/p02983/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02983/Go/s023945039.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s023945039", "user_id": "u494568266"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\n// 一行読み出し\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// 文字列リバース関数\nfunc strReverse(s string) string {\n\trs := []rune(s)\n\tfor i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 {\n\t\trs[i], rs[j] = rs[j], rs[i]\n\t}\n\treturn string(rs)\n}\n\n// 引数個の数値を読み込む\nfunc scanNums(len int) (nums []int) {\n\tvar num int\n\tfor i := 0; i < len; i++ {\n\t\tfmt.Scan(&num)\n\t\tnums = append(nums, num)\n\t}\n\treturn\n}\n\nfunc main() {\n\tvar l, r int\n\tfmt.Scan(&l, &r)\n\n\tfor l >= 2019 {\n\t\tl = l - 2019\n\t\tr = r - 2019\n\t}\n\n\tans := l * (l + 1)\n\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "sample_input": "2020 2040\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02983", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j \\leq R.\nFind the minimum possible value of (i \\times j) \\mbox{ mod } 2019.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq L < R \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R\n\nOutput\n\nPrint the minimum possible value of (i \\times j) \\mbox{ mod } 2019 when i and j are chosen under the given condition.\n\nSample Input 1\n\n2020 2040\n\nSample Output 1\n\n2\n\nWhen (i, j) = (2020, 2021), (i \\times j) \\mbox{ mod } 2019 = 2.\n\nSample Input 2\n\n4 5\n\nSample Output 2\n\n20\n\nWe have only one choice: (i, j) = (4, 5).", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 666, "cpu_time_ms": 3, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s593824256", "group_id": "codeNet:p03018", "input_text": "package main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar s []byte\n\tfmt.Scan(&s)\n\n\ts = bytes.Replace(s, []byte(\"BC\"), []byte(\"D\"), -1)\n\tans := 0\n\tctA := 0\n\tfor i := 0; i < len(s); i++ {\n\t\tswitch s[i] {\n\t\tcase 'A':\n\t\t\tctA++\n\t\tcase 'D':\n\t\t\tans += ctA\n\t\tdefault:\n\t\t\tctA = 0\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1559719635, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03018.html", "problem_id": "p03018", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03018/input.txt", "sample_output_relpath": "derived/input_output/data/p03018/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03018/Go/s593824256.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s593824256", "user_id": "u554269352"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bytes\"\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar s []byte\n\tfmt.Scan(&s)\n\n\ts = bytes.Replace(s, []byte(\"BC\"), []byte(\"D\"), -1)\n\tans := 0\n\tctA := 0\n\tfor i := 0; i < len(s); i++ {\n\t\tswitch s[i] {\n\t\tcase 'A':\n\t\t\tctA++\n\t\tcase 'D':\n\t\t\tans += ctA\n\t\tdefault:\n\t\t\tctA = 0\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nYou are given a string s consisting of A, B and C.\n\nSnuke wants to perform the following operation on s as many times as possible:\n\nChoose a contiguous substring of s that reads ABC and replace it with BCA.\n\nFind the maximum possible number of operations.\n\nConstraints\n\n1 \\leq |s| \\leq 200000\n\nEach character of s is A, B and C.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\n\nOutput\n\nFind the maximum possible number of operations.\n\nSample Input 1\n\nABCABC\n\nSample Output 1\n\n3\n\nYou can perform the operations three times as follows: ABCABC → BCAABC → BCABCA → BCBCAA. This is the maximum result.\n\nSample Input 2\n\nC\n\nSample Output 2\n\n0\n\nSample Input 3\n\nABCACCBABCBCAABCB\n\nSample Output 3\n\n6", "sample_input": "ABCABC\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03018", "source_text": "Score : 600 points\n\nProblem Statement\n\nYou are given a string s consisting of A, B and C.\n\nSnuke wants to perform the following operation on s as many times as possible:\n\nChoose a contiguous substring of s that reads ABC and replace it with BCA.\n\nFind the maximum possible number of operations.\n\nConstraints\n\n1 \\leq |s| \\leq 200000\n\nEach character of s is A, B and C.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\n\nOutput\n\nFind the maximum possible number of operations.\n\nSample Input 1\n\nABCABC\n\nSample Output 1\n\n3\n\nYou can perform the operations three times as follows: ABCABC → BCAABC → BCABCA → BCBCAA. This is the maximum result.\n\nSample Input 2\n\nC\n\nSample Output 2\n\n0\n\nSample Input 3\n\nABCACCBABCBCAABCB\n\nSample Output 3\n\n6", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 302, "cpu_time_ms": 112, "memory_kb": 2432}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s034702791", "group_id": "codeNet:p03018", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treadString func() string\n\treadBytes func() []byte\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\treadString, readBytes = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) (func() string, func() []byte) {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\tf1 := func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n\tf2 := func() []byte {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Bytes()\n\t}\n\treturn f1, f2\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(stdout, f, args...)\n}\n\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(stdout, args...)\n}\n\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min64(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc max64(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc abs64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc gcd64(a, b int64) int64 {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd64(b, a%b)\n}\n\n// readString() string\n// readInt() int\n// readInt64() int64\n// readFloat64() float64\n\n// -----------------------------------------------------------------------------\n\nvar s []byte\nvar pos int\nvar a int\nvar ans int\n\ntype state func() state\n\nfunc start() state {\n\tp := pos\n\tpos++\n\tswitch s[p] {\n\tcase 'A':\n\t\ta++\n\t\treturn readA\n\tdefault:\n\t\treturn start\n\t}\n}\n\nfunc readA() state {\n\tp := pos\n\tpos++\n\tswitch s[p] {\n\tcase 'A':\n\t\ta++\n\t\treturn readA\n\tcase 'B':\n\t\treturn readAB\n\tcase 'C':\n\t\ta = 0\n\t\treturn start\n\t}\n\treturn nil\n}\n\nfunc readAB() state {\n\tp := pos\n\tpos++\n\tswitch s[p] {\n\tcase 'A':\n\t\ta = 1\n\t\treturn readA\n\tcase 'B':\n\t\ta = 0\n\t\treturn start\n\tcase 'C':\n\t\tans += a\n\t\treturn readA\n\t}\n\treturn nil\n}\n\nfunc main() {\n\tdefer stdout.Flush()\n\ts = readBytes()\n\n\tfor state := start; pos < len(s) && state != nil; state = state() {\n\t}\n\tprintln(ans)\n}\n\n// -----------------------------------------------------------------------------\n", "language": "Go", "metadata": {"date": 1559693901, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03018.html", "problem_id": "p03018", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03018/input.txt", "sample_output_relpath": "derived/input_output/data/p03018/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03018/Go/s034702791.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s034702791", "user_id": "u705974985"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treadString func() string\n\treadBytes func() []byte\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\treadString, readBytes = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) (func() string, func() []byte) {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\tf1 := func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n\tf2 := func() []byte {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Bytes()\n\t}\n\treturn f1, f2\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(stdout, f, args...)\n}\n\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(stdout, args...)\n}\n\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min64(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc max64(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc abs64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc gcd64(a, b int64) int64 {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd64(b, a%b)\n}\n\n// readString() string\n// readInt() int\n// readInt64() int64\n// readFloat64() float64\n\n// -----------------------------------------------------------------------------\n\nvar s []byte\nvar pos int\nvar a int\nvar ans int\n\ntype state func() state\n\nfunc start() state {\n\tp := pos\n\tpos++\n\tswitch s[p] {\n\tcase 'A':\n\t\ta++\n\t\treturn readA\n\tdefault:\n\t\treturn start\n\t}\n}\n\nfunc readA() state {\n\tp := pos\n\tpos++\n\tswitch s[p] {\n\tcase 'A':\n\t\ta++\n\t\treturn readA\n\tcase 'B':\n\t\treturn readAB\n\tcase 'C':\n\t\ta = 0\n\t\treturn start\n\t}\n\treturn nil\n}\n\nfunc readAB() state {\n\tp := pos\n\tpos++\n\tswitch s[p] {\n\tcase 'A':\n\t\ta = 1\n\t\treturn readA\n\tcase 'B':\n\t\ta = 0\n\t\treturn start\n\tcase 'C':\n\t\tans += a\n\t\treturn readA\n\t}\n\treturn nil\n}\n\nfunc main() {\n\tdefer stdout.Flush()\n\ts = readBytes()\n\n\tfor state := start; pos < len(s) && state != nil; state = state() {\n\t}\n\tprintln(ans)\n}\n\n// -----------------------------------------------------------------------------\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nYou are given a string s consisting of A, B and C.\n\nSnuke wants to perform the following operation on s as many times as possible:\n\nChoose a contiguous substring of s that reads ABC and replace it with BCA.\n\nFind the maximum possible number of operations.\n\nConstraints\n\n1 \\leq |s| \\leq 200000\n\nEach character of s is A, B and C.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\n\nOutput\n\nFind the maximum possible number of operations.\n\nSample Input 1\n\nABCABC\n\nSample Output 1\n\n3\n\nYou can perform the operations three times as follows: ABCABC → BCAABC → BCABCA → BCBCAA. This is the maximum result.\n\nSample Input 2\n\nC\n\nSample Output 2\n\n0\n\nSample Input 3\n\nABCACCBABCBCAABCB\n\nSample Output 3\n\n6", "sample_input": "ABCABC\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03018", "source_text": "Score : 600 points\n\nProblem Statement\n\nYou are given a string s consisting of A, B and C.\n\nSnuke wants to perform the following operation on s as many times as possible:\n\nChoose a contiguous substring of s that reads ABC and replace it with BCA.\n\nFind the maximum possible number of operations.\n\nConstraints\n\n1 \\leq |s| \\leq 200000\n\nEach character of s is A, B and C.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\n\nOutput\n\nFind the maximum possible number of operations.\n\nSample Input 1\n\nABCABC\n\nSample Output 1\n\n3\n\nYou can perform the operations three times as follows: ABCABC → BCAABC → BCABCA → BCBCAA. This is the maximum result.\n\nSample Input 2\n\nC\n\nSample Output 2\n\n0\n\nSample Input 3\n\nABCACCBABCBCAABCB\n\nSample Output 3\n\n6", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2794, "cpu_time_ms": 11, "memory_kb": 1024}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s033395688", "group_id": "codeNet:p03018", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc oneInt() int {\n\tvar a int\n\tfmt.Scan(&a)\n\treturn a\n}\nfunc oneStr() string {\n\tvar a string\n\tfmt.Scan(&a)\n\treturn a\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc scanNums() (nums []int) {\n\ts := nextLine()\n\tnumStr := strings.Split(s, \" \")\n\n\tfor _, n := range numStr {\n\t\ti, _ := strconv.Atoi(n)\n\t\tnums = append(nums, i)\n\t}\n\treturn nums\n}\n\nfunc scanStrings() (strs []string) {\n\ts := nextLine()\n\tlist := strings.Split(s, \" \")\n\tstrs = append(strs, list...)\n\treturn strs\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc sortAsc(a []int) []int {\n\tsort.Ints(a)\n\treturn a\n}\n\nfunc sortDesc(a []int) []int {\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\treturn a\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\tif a == 0 && b == 0 {\n\t\treturn 0\n\t}\n\treturn a * b / gcd(a, b)\n}\n\n\n\nfunc main() {\n\tS := oneStr()\n\tvar count int\n\n\tfor i := 0; i < len(S); i += 1 {\n\t\tkk := strings.Index(S[i:], \"ABC\")\n\n\t\tif kk-1 > 0 {\n\t\t\tfor index := kk - 1; S[index] == 'A'; index-- {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\n\t\tif kk+4 <= len(S) {\n\t\t\tfor index := kk + 2; S[index+1] == 'B' && S[index+2] == 'C'; index += 2 {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Print(count)\n\n}", "language": "Go", "metadata": {"date": 1559529618, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03018.html", "problem_id": "p03018", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03018/input.txt", "sample_output_relpath": "derived/input_output/data/p03018/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03018/Go/s033395688.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s033395688", "user_id": "u643520570"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc oneInt() int {\n\tvar a int\n\tfmt.Scan(&a)\n\treturn a\n}\nfunc oneStr() string {\n\tvar a string\n\tfmt.Scan(&a)\n\treturn a\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc scanNums() (nums []int) {\n\ts := nextLine()\n\tnumStr := strings.Split(s, \" \")\n\n\tfor _, n := range numStr {\n\t\ti, _ := strconv.Atoi(n)\n\t\tnums = append(nums, i)\n\t}\n\treturn nums\n}\n\nfunc scanStrings() (strs []string) {\n\ts := nextLine()\n\tlist := strings.Split(s, \" \")\n\tstrs = append(strs, list...)\n\treturn strs\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc sortAsc(a []int) []int {\n\tsort.Ints(a)\n\treturn a\n}\n\nfunc sortDesc(a []int) []int {\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\treturn a\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\tif a == 0 && b == 0 {\n\t\treturn 0\n\t}\n\treturn a * b / gcd(a, b)\n}\n\n\n\nfunc main() {\n\tS := oneStr()\n\tvar count int\n\n\tfor i := 0; i < len(S); i += 1 {\n\t\tkk := strings.Index(S[i:], \"ABC\")\n\n\t\tif kk-1 > 0 {\n\t\t\tfor index := kk - 1; S[index] == 'A'; index-- {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\n\t\tif kk+4 <= len(S) {\n\t\t\tfor index := kk + 2; S[index+1] == 'B' && S[index+2] == 'C'; index += 2 {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Print(count)\n\n}", "problem_context": "Score : 600 points\n\nProblem Statement\n\nYou are given a string s consisting of A, B and C.\n\nSnuke wants to perform the following operation on s as many times as possible:\n\nChoose a contiguous substring of s that reads ABC and replace it with BCA.\n\nFind the maximum possible number of operations.\n\nConstraints\n\n1 \\leq |s| \\leq 200000\n\nEach character of s is A, B and C.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\n\nOutput\n\nFind the maximum possible number of operations.\n\nSample Input 1\n\nABCABC\n\nSample Output 1\n\n3\n\nYou can perform the operations three times as follows: ABCABC → BCAABC → BCABCA → BCBCAA. This is the maximum result.\n\nSample Input 2\n\nC\n\nSample Output 2\n\n0\n\nSample Input 3\n\nABCACCBABCBCAABCB\n\nSample Output 3\n\n6", "sample_input": "ABCABC\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03018", "source_text": "Score : 600 points\n\nProblem Statement\n\nYou are given a string s consisting of A, B and C.\n\nSnuke wants to perform the following operation on s as many times as possible:\n\nChoose a contiguous substring of s that reads ABC and replace it with BCA.\n\nFind the maximum possible number of operations.\n\nConstraints\n\n1 \\leq |s| \\leq 200000\n\nEach character of s is A, B and C.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\n\nOutput\n\nFind the maximum possible number of operations.\n\nSample Input 1\n\nABCABC\n\nSample Output 1\n\n3\n\nYou can perform the operations three times as follows: ABCABC → BCAABC → BCABCA → BCBCAA. This is the maximum result.\n\nSample Input 2\n\nC\n\nSample Output 2\n\n0\n\nSample Input 3\n\nABCACCBABCBCAABCB\n\nSample Output 3\n\n6", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2001, "cpu_time_ms": 2107, "memory_kb": 2048}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s814253888", "group_id": "codeNet:p03018", "input_text": "package main\nimport \"fmt\"\nfunc main() {\n var s string\n fmt.Scan(&s)\n n := len(s)\n x := make([]int,n)\n for i:=0;i b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nconst inf = 10000\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, 10000)\n\n\tH, W := getInt(), getInt()\n\tdist := make([][]int, H)\n\ta := make([]string, H)\n\tfor i := 0; i < H; i++ {\n\t\ta[i] = getString()\n\t\tdist[i] = make([]int, W)\n\t}\n\n\tfor y := 0; y < H; y++ {\n\t\tt := inf\n\t\tfor x := 0; x < W; x++ {\n\t\t\tif a[y][x] == '#' {\n\t\t\t\tt = 0\n\t\t\t}\n\t\t\tdist[y][x] = t\n\t\t\tt++\n\t\t}\n\t\tt = dist[y][W-1]\n\t\tfor x := W - 1; x >= 0; x-- {\n\t\t\tif a[y][x] == '#' {\n\t\t\t\tt = 0\n\t\t\t}\n\t\t\tdist[y][x] = min(dist[y][x], t)\n\t\t\tt++\n\t\t}\n\t}\n\n\t// for y := 0; y < H; y++ {\n\t// \tout(dist[y])\n\t// }\n\t// out(\"----\")\n\n\tfor x := 0; x < W; x++ {\n\t\tt := dist[0][x]\n\t\tfor y := 0; y < H; y++ {\n\t\t\tif a[y][x] == '#' {\n\t\t\t\tt = 0\n\t\t\t}\n\t\t\tt = min(dist[y][x], t)\n\t\t\tdist[y][x] = t\n\t\t\tt++\n\t\t}\n\t\tt = dist[H-1][x]\n\t\tfor y := H - 1; y >= 0; y-- {\n\t\t\tif a[y][x] == '#' {\n\t\t\t\tt = 0\n\t\t\t}\n\t\t\tt = min(dist[y][x], t)\n\t\t\tdist[y][x] = t\n\t\t\tt++\n\t\t}\n\t}\n\n\t// for y := 0; y < H; y++ {\n\t// \tout(dist[y])\n\t// }\n\tans := 0\n\tfor y := 0; y < H; y++ {\n\t\tfor x := 0; x < W; x++ {\n\t\t\tans = max(ans, dist[y][x])\n\t\t}\n\t}\n\tout(ans)\n}\n", "language": "Go", "metadata": {"date": 1586482523, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03053.html", "problem_id": "p03053", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03053/input.txt", "sample_output_relpath": "derived/input_output/data/p03053/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03053/Go/s615203571.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s615203571", "user_id": "u814575783"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nconst inf = 10000\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, 10000)\n\n\tH, W := getInt(), getInt()\n\tdist := make([][]int, H)\n\ta := make([]string, H)\n\tfor i := 0; i < H; i++ {\n\t\ta[i] = getString()\n\t\tdist[i] = make([]int, W)\n\t}\n\n\tfor y := 0; y < H; y++ {\n\t\tt := inf\n\t\tfor x := 0; x < W; x++ {\n\t\t\tif a[y][x] == '#' {\n\t\t\t\tt = 0\n\t\t\t}\n\t\t\tdist[y][x] = t\n\t\t\tt++\n\t\t}\n\t\tt = dist[y][W-1]\n\t\tfor x := W - 1; x >= 0; x-- {\n\t\t\tif a[y][x] == '#' {\n\t\t\t\tt = 0\n\t\t\t}\n\t\t\tdist[y][x] = min(dist[y][x], t)\n\t\t\tt++\n\t\t}\n\t}\n\n\t// for y := 0; y < H; y++ {\n\t// \tout(dist[y])\n\t// }\n\t// out(\"----\")\n\n\tfor x := 0; x < W; x++ {\n\t\tt := dist[0][x]\n\t\tfor y := 0; y < H; y++ {\n\t\t\tif a[y][x] == '#' {\n\t\t\t\tt = 0\n\t\t\t}\n\t\t\tt = min(dist[y][x], t)\n\t\t\tdist[y][x] = t\n\t\t\tt++\n\t\t}\n\t\tt = dist[H-1][x]\n\t\tfor y := H - 1; y >= 0; y-- {\n\t\t\tif a[y][x] == '#' {\n\t\t\t\tt = 0\n\t\t\t}\n\t\t\tt = min(dist[y][x], t)\n\t\t\tdist[y][x] = t\n\t\t\tt++\n\t\t}\n\t}\n\n\t// for y := 0; y < H; y++ {\n\t// \tout(dist[y])\n\t// }\n\tans := 0\n\tfor y := 0; y < H; y++ {\n\t\tfor x := 0; x < W; x++ {\n\t\t\tans = max(ans, dist[y][x])\n\t\t}\n\t}\n\tout(ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "sample_input": "3 3\n...\n.#.\n...\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03053", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1678, "cpu_time_ms": 68, "memory_kb": 10112}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s206801229", "group_id": "codeNet:p03053", "input_text": "package main\n\nimport \"fmt\"\nimport \"bufio\"\nimport \"os\"\nimport \"strconv\"\nimport \"sort\"\n\nvar _sw = bufio.NewScanner(os.Stdin)\n\ntype Pt struct {\n\tx int\n\ty int\n}\n\nfunc main() {\n\tvar H, W int\n\tfmt.Scan(&H, &W)\n\n\tC := make([][]bool, H)\n\tB := []Pt{}\n\tfor y := range C {\n\t\tvar s string\n\t\tfmt.Scan(&s)\n\n\t\tC[y] = make([]bool, W)\n\t\tfor x := range C[y] {\n\t\t\tC[y][x] = s[x] == '#'\n\t\t\tif C[y][x] {\n\t\t\t\tB = append(B, Pt{x, y})\n\t\t\t}\n\t\t}\n\t}\n\n\tcnt := 0\n\tdone := len(B)\n\tnext := append([]Pt{}, B...)\n\tfor {\n\t\tif done == H*W {\n\t\t\tbreak\n\t\t}\n\t\tnext_ := []Pt{}\n\t\tfor _, b := range next {\n\t\t\tfor _, d := range []Pt{{-1, 0}, {+1, 0}, {0, -1}, {0, +1}} {\n\t\t\t\tp := Pt{Bounded(0, b.x+d.x, W-1), Bounded(0, b.y+d.y, H-1)}\n\t\t\t\tif C[p.y][p.x] {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tC[p.y][p.x] = true\n\t\t\t\tnext_ = append(next_, p)\n\t\t\t\tdone++\n\t\t\t}\n\t\t}\n\t\tnext = next_\n\t\tcnt++\n\t}\n\n\tfmt.Println(cnt)\n}\n\nfunc init() {\n\t_sw.Split(bufio.ScanWords)\n}\n\nfunc NextInt() int {\n\tif _sw.Scan() == false {\n\t\tpanic(_sw.Err())\n\t}\n\ti, e := strconv.Atoi(_sw.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc NextString() string {\n\tif _sw.Scan() == false {\n\t\tpanic(_sw.Err())\n\t}\n\treturn _sw.Text()\n}\n\nfunc Max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc Min(x, y int) int {\n\tif x > y {\n\t\treturn y\n\t}\n\treturn x\n}\n\nfunc Bounded(lower, n, upper int) int {\n\treturn Min(upper, Max(lower, n))\n}\n\nfunc SortInts(xs []int) {\n\tsort.Sort(sort.IntSlice(xs))\n}\n\nfunc ReverseSortInts(xs []int) {\n\tsort.Sort(sort.Reverse(sort.IntSlice(xs)))\n}\n", "language": "Go", "metadata": {"date": 1568258756, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03053.html", "problem_id": "p03053", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03053/input.txt", "sample_output_relpath": "derived/input_output/data/p03053/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03053/Go/s206801229.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s206801229", "user_id": "u764320774"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\nimport \"bufio\"\nimport \"os\"\nimport \"strconv\"\nimport \"sort\"\n\nvar _sw = bufio.NewScanner(os.Stdin)\n\ntype Pt struct {\n\tx int\n\ty int\n}\n\nfunc main() {\n\tvar H, W int\n\tfmt.Scan(&H, &W)\n\n\tC := make([][]bool, H)\n\tB := []Pt{}\n\tfor y := range C {\n\t\tvar s string\n\t\tfmt.Scan(&s)\n\n\t\tC[y] = make([]bool, W)\n\t\tfor x := range C[y] {\n\t\t\tC[y][x] = s[x] == '#'\n\t\t\tif C[y][x] {\n\t\t\t\tB = append(B, Pt{x, y})\n\t\t\t}\n\t\t}\n\t}\n\n\tcnt := 0\n\tdone := len(B)\n\tnext := append([]Pt{}, B...)\n\tfor {\n\t\tif done == H*W {\n\t\t\tbreak\n\t\t}\n\t\tnext_ := []Pt{}\n\t\tfor _, b := range next {\n\t\t\tfor _, d := range []Pt{{-1, 0}, {+1, 0}, {0, -1}, {0, +1}} {\n\t\t\t\tp := Pt{Bounded(0, b.x+d.x, W-1), Bounded(0, b.y+d.y, H-1)}\n\t\t\t\tif C[p.y][p.x] {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tC[p.y][p.x] = true\n\t\t\t\tnext_ = append(next_, p)\n\t\t\t\tdone++\n\t\t\t}\n\t\t}\n\t\tnext = next_\n\t\tcnt++\n\t}\n\n\tfmt.Println(cnt)\n}\n\nfunc init() {\n\t_sw.Split(bufio.ScanWords)\n}\n\nfunc NextInt() int {\n\tif _sw.Scan() == false {\n\t\tpanic(_sw.Err())\n\t}\n\ti, e := strconv.Atoi(_sw.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc NextString() string {\n\tif _sw.Scan() == false {\n\t\tpanic(_sw.Err())\n\t}\n\treturn _sw.Text()\n}\n\nfunc Max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc Min(x, y int) int {\n\tif x > y {\n\t\treturn y\n\t}\n\treturn x\n}\n\nfunc Bounded(lower, n, upper int) int {\n\treturn Min(upper, Max(lower, n))\n}\n\nfunc SortInts(xs []int) {\n\tsort.Sort(sort.IntSlice(xs))\n}\n\nfunc ReverseSortInts(xs []int) {\n\tsort.Sort(sort.Reverse(sort.IntSlice(xs)))\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "sample_input": "3 3\n...\n.#.\n...\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03053", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1484, "cpu_time_ms": 583, "memory_kb": 42368}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s970367276", "group_id": "codeNet:p03053", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tH := nextInt()\n\tW := nextInt()\n\tA := make([][]byte, H)\n\tfor i := 0; i < H; i++ {\n\t\tA[i] = nextBytes()\n\t\tif len(A[i]) != W {\n\t\t\tpanic(\"W\")\n\t\t}\n\t}\n\tq := make([]Pair, 0)\n\tnext := make([]Pair, 0)\n\tfor i := 0; i < H; i++ {\n\t\tfor j := 0; j < W; j++ {\n\t\t\tif A[i][j] == '#' {\n\t\t\t\tnext = append(next, Pair{i, j})\n\t\t\t}\n\t\t}\n\t}\n\tans := 0\n\tfor len(next) != 0 {\n\t\tq = make([]Pair, 0)\n\t\tfor _, n := range next {\n\t\t\tq = append(q, n)\n\t\t}\n\t\tnext = make([]Pair, 0)\n\t\tfor len(q) != 0 {\n\t\t\tp := q[len(q)-1]\n\t\t\tq = q[:len(q)-1]\n\t\t\tfor d := 0; d < 4; d++ {\n\t\t\t\tny := p.a + dy[d]\n\t\t\t\tnx := p.b + dx[d]\n\t\t\t\tif ny < 0 || ny >= H || nx < 0 || nx >= W {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif A[ny][nx] == '.' {\n\t\t\t\t\tA[ny][nx] = '#'\n\t\t\t\t\tnext = append(next, Pair{ny, nx})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tans++\n\t\t// log.Println(next)\n\t\t// for i := 0; i < H; i++ {\n\t\t// \tlog.Println(string(A[i]))\n\t\t// }\n\t}\n\tfmt.Println(ans - 1)\n}\n\nvar dy = []int{0, 1, 0, -1}\nvar dx = []int{1, 0, -1, 0}\nvar inf = int(1e9)\n\nfunc pow(a, b int) int {\n\treturn int(math.Pow(float64(a), float64(b)))\n}\n\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\ntype Pair struct {\n\ta, b int\n}\n\ntype pairs []Pair\n\nfunc (p pairs) Len() int {\n\treturn len(p)\n}\nfunc (p pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p pairs) Less(i, j int) bool {\n\tif p[i].a == p[j].a {\n\t\treturn p[i].b < p[j].b\n\t}\n\treturn p[i].a < p[j].a\n}\n\nvar nextReader func() []byte\n\nfunc init() {\n\tnextReader = newScanner()\n\tlog.SetFlags(log.Lshortfile)\n}\n\nfunc newScanner() func() []byte {\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Split(bufio.ScanWords)\n\treturn func() []byte {\n\t\tr.Scan()\n\t\treturn r.Bytes()\n\t}\n}\nfunc nextBytes() []byte {\n\treturn nextReader()\n}\n\nfunc nextString() string {\n\treturn string(nextReader())\n}\nfunc nextInt64() int64 {\n\tv, _ := strconv.ParseInt(string(nextReader()), 10, 64)\n\treturn v\n}\nfunc nextInt() int {\n\tv, _ := strconv.Atoi(string(nextReader()))\n\treturn v\n}\nfunc nextInts(n int) []int {\n\tr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt()\n\t}\n\treturn r\n}\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(string(nextReader()), 64)\n\treturn f\n}\n", "language": "Go", "metadata": {"date": 1563145683, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03053.html", "problem_id": "p03053", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03053/input.txt", "sample_output_relpath": "derived/input_output/data/p03053/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03053/Go/s970367276.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s970367276", "user_id": "u696272993"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tH := nextInt()\n\tW := nextInt()\n\tA := make([][]byte, H)\n\tfor i := 0; i < H; i++ {\n\t\tA[i] = nextBytes()\n\t\tif len(A[i]) != W {\n\t\t\tpanic(\"W\")\n\t\t}\n\t}\n\tq := make([]Pair, 0)\n\tnext := make([]Pair, 0)\n\tfor i := 0; i < H; i++ {\n\t\tfor j := 0; j < W; j++ {\n\t\t\tif A[i][j] == '#' {\n\t\t\t\tnext = append(next, Pair{i, j})\n\t\t\t}\n\t\t}\n\t}\n\tans := 0\n\tfor len(next) != 0 {\n\t\tq = make([]Pair, 0)\n\t\tfor _, n := range next {\n\t\t\tq = append(q, n)\n\t\t}\n\t\tnext = make([]Pair, 0)\n\t\tfor len(q) != 0 {\n\t\t\tp := q[len(q)-1]\n\t\t\tq = q[:len(q)-1]\n\t\t\tfor d := 0; d < 4; d++ {\n\t\t\t\tny := p.a + dy[d]\n\t\t\t\tnx := p.b + dx[d]\n\t\t\t\tif ny < 0 || ny >= H || nx < 0 || nx >= W {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif A[ny][nx] == '.' {\n\t\t\t\t\tA[ny][nx] = '#'\n\t\t\t\t\tnext = append(next, Pair{ny, nx})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tans++\n\t\t// log.Println(next)\n\t\t// for i := 0; i < H; i++ {\n\t\t// \tlog.Println(string(A[i]))\n\t\t// }\n\t}\n\tfmt.Println(ans - 1)\n}\n\nvar dy = []int{0, 1, 0, -1}\nvar dx = []int{1, 0, -1, 0}\nvar inf = int(1e9)\n\nfunc pow(a, b int) int {\n\treturn int(math.Pow(float64(a), float64(b)))\n}\n\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\ntype Pair struct {\n\ta, b int\n}\n\ntype pairs []Pair\n\nfunc (p pairs) Len() int {\n\treturn len(p)\n}\nfunc (p pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p pairs) Less(i, j int) bool {\n\tif p[i].a == p[j].a {\n\t\treturn p[i].b < p[j].b\n\t}\n\treturn p[i].a < p[j].a\n}\n\nvar nextReader func() []byte\n\nfunc init() {\n\tnextReader = newScanner()\n\tlog.SetFlags(log.Lshortfile)\n}\n\nfunc newScanner() func() []byte {\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Split(bufio.ScanWords)\n\treturn func() []byte {\n\t\tr.Scan()\n\t\treturn r.Bytes()\n\t}\n}\nfunc nextBytes() []byte {\n\treturn nextReader()\n}\n\nfunc nextString() string {\n\treturn string(nextReader())\n}\nfunc nextInt64() int64 {\n\tv, _ := strconv.ParseInt(string(nextReader()), 10, 64)\n\treturn v\n}\nfunc nextInt() int {\n\tv, _ := strconv.Atoi(string(nextReader()))\n\treturn v\n}\nfunc nextInts(n int) []int {\n\tr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt()\n\t}\n\treturn r\n}\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(string(nextReader()), 64)\n\treturn f\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "sample_input": "3 3\n...\n.#.\n...\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03053", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2640, "cpu_time_ms": 87, "memory_kb": 67968}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s301454562", "group_id": "codeNet:p03053", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\tif len(os.Args) > 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t}\n\n\tscanner := getScanner(fp)\n\n\twriter := bufio.NewWriter(os.Stdout)\n\n\tr := getNextInt(scanner)\n\tc := getNextInt(scanner)\n\tn := r * c\n\tmaze := make([]byte, n)\n\tsteps := make([]int, n)\n\tqueue := make([][2]int, n)\n\tql := 0\n\tqr := 0\n\tfor y := 0; y < r; y++ {\n\t\ts := getNextString(scanner)\n\t\tfor x := 0; x < c; x++ {\n\t\t\ti := y*c + x\n\t\t\tmaze[i] = s[x]\n\t\t\tif s[x] == '.' {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tsteps[i] = 1\n\t\t\tqueue[qr][0] = i\n\t\t\tqueue[qr][1] = 0\n\t\t\tqr++\n\t\t}\n\t}\n\n\td := [4]int{-c, -1, 1, c}\n\tans := -1\n\tfor qr-ql > 0 {\n\t\tp := queue[ql]\n\t\tql++\n\t\tans = p[1]\n\t\tfor i := 0; i < 4; i++ {\n\t\t\tii := p[0] + d[i]\n\t\t\tif ii < 0 || ii >= n {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif ii/r != p[0]/r && ii%c != p[0]%c {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif maze[ii] == '#' {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif steps[ii] > 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tsteps[ii] = 1\n\t\t\tqueue[qr%n][0] = ii\n\t\t\tqueue[qr%n][1] = p[1] + 1\n\t\t\tqr++\n\t\t}\n\t}\n\n\tfmt.Fprintln(writer, ans)\n\n\twriter.Flush()\n}\n", "language": "Go", "metadata": {"date": 1562770692, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03053.html", "problem_id": "p03053", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03053/input.txt", "sample_output_relpath": "derived/input_output/data/p03053/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03053/Go/s301454562.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s301454562", "user_id": "u150542210"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\tif len(os.Args) > 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t}\n\n\tscanner := getScanner(fp)\n\n\twriter := bufio.NewWriter(os.Stdout)\n\n\tr := getNextInt(scanner)\n\tc := getNextInt(scanner)\n\tn := r * c\n\tmaze := make([]byte, n)\n\tsteps := make([]int, n)\n\tqueue := make([][2]int, n)\n\tql := 0\n\tqr := 0\n\tfor y := 0; y < r; y++ {\n\t\ts := getNextString(scanner)\n\t\tfor x := 0; x < c; x++ {\n\t\t\ti := y*c + x\n\t\t\tmaze[i] = s[x]\n\t\t\tif s[x] == '.' {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tsteps[i] = 1\n\t\t\tqueue[qr][0] = i\n\t\t\tqueue[qr][1] = 0\n\t\t\tqr++\n\t\t}\n\t}\n\n\td := [4]int{-c, -1, 1, c}\n\tans := -1\n\tfor qr-ql > 0 {\n\t\tp := queue[ql]\n\t\tql++\n\t\tans = p[1]\n\t\tfor i := 0; i < 4; i++ {\n\t\t\tii := p[0] + d[i]\n\t\t\tif ii < 0 || ii >= n {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif ii/r != p[0]/r && ii%c != p[0]%c {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif maze[ii] == '#' {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif steps[ii] > 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tsteps[ii] = 1\n\t\t\tqueue[qr%n][0] = ii\n\t\t\tqueue[qr%n][1] = p[1] + 1\n\t\t\tqr++\n\t\t}\n\t}\n\n\tfmt.Fprintln(writer, ans)\n\n\twriter.Flush()\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "sample_input": "3 3\n...\n.#.\n...\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03053", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1552, "cpu_time_ms": 178, "memory_kb": 27392}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s762833748", "group_id": "codeNet:p03053", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\tif len(os.Args) > 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t}\n\n\tscanner := getScanner(fp)\n\n\twriter := bufio.NewWriter(os.Stdout)\n\n\tr := getNextInt(scanner)\n\tc := getNextInt(scanner)\n\tmaze := make([][]byte, r)\n\tsteps := make([][]int, r)\n\tqueue := make([][]int, 0)\n\tfor y := 0; y < r; y++ {\n\t\tmaze[y] = make([]byte, c)\n\t\tsteps[y] = make([]int, c)\n\t\ts := getNextString(scanner)\n\t\tfor x := 0; x < c; x++ {\n\t\t\tmaze[y][x] = s[x]\n\t\t\tif s[x] == '.' {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tsteps[y][x] = 1\n\t\t\tqueue = append(queue, []int{\n\t\t\t\ty, x,\n\t\t\t})\n\t\t}\n\t}\n\n\tdy := [4]int{-1, 0, 0, 1}\n\tdx := [4]int{0, -1, 1, 0}\n\tans := -1\n\tfor len(queue) > 0 {\n\t\tl := len(queue)\n\t\tfor q := 0; q < l; q++ {\n\t\t\tp := queue[q]\n\t\t\tfor i := 0; i < 4; i++ {\n\t\t\t\tif p[0]+dy[i] < 0 || p[0]+dy[i] >= r {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif p[1]+dx[i] < 0 || p[1]+dx[i] >= c {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif maze[p[0]+dy[i]][p[1]+dx[i]] == '#' {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif steps[p[0]+dy[i]][p[1]+dx[i]] > 0 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tsteps[p[0]+dy[i]][p[1]+dx[i]] = 1\n\t\t\t\tqueue = append(queue, []int{\n\t\t\t\t\tp[0] + dy[i],\n\t\t\t\t\tp[1] + dx[i],\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\tans++\n\t\tqueue = queue[l:]\n\t}\n\n\tfmt.Fprintln(writer, ans)\n\n\twriter.Flush()\n}\n", "language": "Go", "metadata": {"date": 1562768278, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03053.html", "problem_id": "p03053", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03053/input.txt", "sample_output_relpath": "derived/input_output/data/p03053/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03053/Go/s762833748.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s762833748", "user_id": "u150542210"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\tif len(os.Args) > 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t}\n\n\tscanner := getScanner(fp)\n\n\twriter := bufio.NewWriter(os.Stdout)\n\n\tr := getNextInt(scanner)\n\tc := getNextInt(scanner)\n\tmaze := make([][]byte, r)\n\tsteps := make([][]int, r)\n\tqueue := make([][]int, 0)\n\tfor y := 0; y < r; y++ {\n\t\tmaze[y] = make([]byte, c)\n\t\tsteps[y] = make([]int, c)\n\t\ts := getNextString(scanner)\n\t\tfor x := 0; x < c; x++ {\n\t\t\tmaze[y][x] = s[x]\n\t\t\tif s[x] == '.' {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tsteps[y][x] = 1\n\t\t\tqueue = append(queue, []int{\n\t\t\t\ty, x,\n\t\t\t})\n\t\t}\n\t}\n\n\tdy := [4]int{-1, 0, 0, 1}\n\tdx := [4]int{0, -1, 1, 0}\n\tans := -1\n\tfor len(queue) > 0 {\n\t\tl := len(queue)\n\t\tfor q := 0; q < l; q++ {\n\t\t\tp := queue[q]\n\t\t\tfor i := 0; i < 4; i++ {\n\t\t\t\tif p[0]+dy[i] < 0 || p[0]+dy[i] >= r {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif p[1]+dx[i] < 0 || p[1]+dx[i] >= c {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif maze[p[0]+dy[i]][p[1]+dx[i]] == '#' {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif steps[p[0]+dy[i]][p[1]+dx[i]] > 0 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tsteps[p[0]+dy[i]][p[1]+dx[i]] = 1\n\t\t\t\tqueue = append(queue, []int{\n\t\t\t\t\tp[0] + dy[i],\n\t\t\t\t\tp[1] + dx[i],\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t\tans++\n\t\tqueue = queue[l:]\n\t}\n\n\tfmt.Fprintln(writer, ans)\n\n\twriter.Flush()\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "sample_input": "3 3\n...\n.#.\n...\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03053", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1749, "cpu_time_ms": 694, "memory_kb": 119040}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s317930914", "group_id": "codeNet:p03053", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nconst INF = 1000000000\n\ntype node struct {\n\tdepth int\n\tadj []*node\n}\n\nfunc main() {\n\tsc = bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\th, w := nextInt(), nextInt()\n\n\troot := node{depth: -1}\n\tboard := make([][]*node, h)\n\tfor i := range board {\n\t\tsc.Scan()\n\t\ts := sc.Text()\n\t\tline := make([]*node, w)\n\t\tfor j, r := range s {\n\t\t\tline[j] = &node{depth: INF}\n\t\t\tif r == '#' {\n\t\t\t\troot.adj = append(root.adj, line[j])\n\t\t\t}\n\t\t}\n\t\tboard[i] = line\n\t}\n\n\tfor i, line := range board {\n\t\tfor j := range line {\n\t\t\tif i > 0 {\n\t\t\t\tboard[i][j].adj = append(board[i][j].adj, board[i-1][j])\n\t\t\t}\n\t\t\tif i < h-1 {\n\t\t\t\tboard[i][j].adj = append(board[i][j].adj, board[i+1][j])\n\t\t\t}\n\t\t\tif j > 0 {\n\t\t\t\tboard[i][j].adj = append(board[i][j].adj, board[i][j-1])\n\t\t\t}\n\t\t\tif j < w-1 {\n\t\t\t\tboard[i][j].adj = append(board[i][j].adj, board[i][j+1])\n\t\t\t}\n\t\t}\n\t}\n\n\tqueue := []*node{&root}\n\tfor len(queue) > 0 {\n\t\tgrid := queue[0]\n\t\tqueue = queue[1:]\n\t\tfor _, other := range grid.adj {\n\t\t\tif other.depth > grid.depth+1 {\n\t\t\t\tother.depth = grid.depth + 1\n\t\t\t\tqueue = append(queue, other)\n\t\t\t}\n\t\t}\n\t}\n\n\tans := 0\n\tfor _, line := range board {\n\t\tfor _, grid := range line {\n\t\t\tif ans < grid.depth {\n\t\t\t\tans = grid.depth\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1562095969, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03053.html", "problem_id": "p03053", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03053/input.txt", "sample_output_relpath": "derived/input_output/data/p03053/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03053/Go/s317930914.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s317930914", "user_id": "u712822150"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nconst INF = 1000000000\n\ntype node struct {\n\tdepth int\n\tadj []*node\n}\n\nfunc main() {\n\tsc = bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\th, w := nextInt(), nextInt()\n\n\troot := node{depth: -1}\n\tboard := make([][]*node, h)\n\tfor i := range board {\n\t\tsc.Scan()\n\t\ts := sc.Text()\n\t\tline := make([]*node, w)\n\t\tfor j, r := range s {\n\t\t\tline[j] = &node{depth: INF}\n\t\t\tif r == '#' {\n\t\t\t\troot.adj = append(root.adj, line[j])\n\t\t\t}\n\t\t}\n\t\tboard[i] = line\n\t}\n\n\tfor i, line := range board {\n\t\tfor j := range line {\n\t\t\tif i > 0 {\n\t\t\t\tboard[i][j].adj = append(board[i][j].adj, board[i-1][j])\n\t\t\t}\n\t\t\tif i < h-1 {\n\t\t\t\tboard[i][j].adj = append(board[i][j].adj, board[i+1][j])\n\t\t\t}\n\t\t\tif j > 0 {\n\t\t\t\tboard[i][j].adj = append(board[i][j].adj, board[i][j-1])\n\t\t\t}\n\t\t\tif j < w-1 {\n\t\t\t\tboard[i][j].adj = append(board[i][j].adj, board[i][j+1])\n\t\t\t}\n\t\t}\n\t}\n\n\tqueue := []*node{&root}\n\tfor len(queue) > 0 {\n\t\tgrid := queue[0]\n\t\tqueue = queue[1:]\n\t\tfor _, other := range grid.adj {\n\t\t\tif other.depth > grid.depth+1 {\n\t\t\t\tother.depth = grid.depth + 1\n\t\t\t\tqueue = append(queue, other)\n\t\t\t}\n\t\t}\n\t}\n\n\tans := 0\n\tfor _, line := range board {\n\t\tfor _, grid := range line {\n\t\t\tif ans < grid.depth {\n\t\t\t\tans = grid.depth\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "sample_input": "3 3\n...\n.#.\n...\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03053", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1413, "cpu_time_ms": 1060, "memory_kb": 131660}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s858305986", "group_id": "codeNet:p03053", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nconst INF = 1000000000\n\ntype node struct {\n\tdepth int\n\tadj []*node\n}\n\nfunc main() {\n\tsc = bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\th, w := nextInt(), nextInt()\n\n\tvar root node\n\troot.depth = -1\n\tboard := make([][]*node, h)\n\tfor i := range board {\n\t\tsc.Scan()\n\t\ts := sc.Text()\n\t\tline := make([]*node, w)\n\t\tfor j, r := range s {\n\t\t\tline[j] = &node{}\n\t\t\tline[j].depth = INF\n\t\t\tif r == '#' {\n\t\t\t\troot.adj = append(root.adj, line[j])\n\t\t\t}\n\t\t}\n\t\tboard[i] = line\n\t}\n\n\tfor i, line := range board {\n\t\tfor j := range line {\n\t\t\tif i > 0 {\n\t\t\t\tboard[i][j].adj = append(board[i][j].adj, board[i-1][j])\n\t\t\t}\n\t\t\tif i < h-1 {\n\t\t\t\tboard[i][j].adj = append(board[i][j].adj, board[i+1][j])\n\t\t\t}\n\t\t\tif j > 0 {\n\t\t\t\tboard[i][j].adj = append(board[i][j].adj, board[i][j-1])\n\t\t\t}\n\t\t\tif j < w-1 {\n\t\t\t\tboard[i][j].adj = append(board[i][j].adj, board[i][j+1])\n\t\t\t}\n\t\t}\n\t}\n\n\tans := 0\n\tqueue := []*node{&root}\n\tfor len(queue) > 0 {\n\t\tgrid := queue[0]\n\t\tqueue = queue[1:]\n\t\tfor _, other := range grid.adj {\n\t\t\tif other.depth > grid.depth+1 {\n\t\t\t\tother.depth = grid.depth + 1\n\t\t\t\tqueue = append(queue, other)\n\t\t\t\tans = other.depth\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1562095275, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03053.html", "problem_id": "p03053", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03053/input.txt", "sample_output_relpath": "derived/input_output/data/p03053/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03053/Go/s858305986.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s858305986", "user_id": "u712822150"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nconst INF = 1000000000\n\ntype node struct {\n\tdepth int\n\tadj []*node\n}\n\nfunc main() {\n\tsc = bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\th, w := nextInt(), nextInt()\n\n\tvar root node\n\troot.depth = -1\n\tboard := make([][]*node, h)\n\tfor i := range board {\n\t\tsc.Scan()\n\t\ts := sc.Text()\n\t\tline := make([]*node, w)\n\t\tfor j, r := range s {\n\t\t\tline[j] = &node{}\n\t\t\tline[j].depth = INF\n\t\t\tif r == '#' {\n\t\t\t\troot.adj = append(root.adj, line[j])\n\t\t\t}\n\t\t}\n\t\tboard[i] = line\n\t}\n\n\tfor i, line := range board {\n\t\tfor j := range line {\n\t\t\tif i > 0 {\n\t\t\t\tboard[i][j].adj = append(board[i][j].adj, board[i-1][j])\n\t\t\t}\n\t\t\tif i < h-1 {\n\t\t\t\tboard[i][j].adj = append(board[i][j].adj, board[i+1][j])\n\t\t\t}\n\t\t\tif j > 0 {\n\t\t\t\tboard[i][j].adj = append(board[i][j].adj, board[i][j-1])\n\t\t\t}\n\t\t\tif j < w-1 {\n\t\t\t\tboard[i][j].adj = append(board[i][j].adj, board[i][j+1])\n\t\t\t}\n\t\t}\n\t}\n\n\tans := 0\n\tqueue := []*node{&root}\n\tfor len(queue) > 0 {\n\t\tgrid := queue[0]\n\t\tqueue = queue[1:]\n\t\tfor _, other := range grid.adj {\n\t\t\tif other.depth > grid.depth+1 {\n\t\t\t\tother.depth = grid.depth + 1\n\t\t\t\tqueue = append(queue, other)\n\t\t\t\tans = other.depth\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "sample_input": "3 3\n...\n.#.\n...\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03053", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1058, "memory_kb": 143192}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s235864099", "group_id": "codeNet:p03053", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar H, W int\n\nfunc main() {\n\treader := bufio.NewReaderSize(os.Stdin, 1000000000)\n\tfmt.Scan(&H, &W)\n\n\tq := make([][]int, 0)\n\tm := make([][]bool, H)\n\n\tfor i := 0; i < H; i++ {\n\t\tline, _, _ := reader.ReadLine()\n\t\tm[i] = make([]bool, W) // Falseで初期化されている\n\n\t\tfor j, v := range line {\n\t\t\tif string(v) == \"#\" {\n\t\t\t\tq = append(q, []int{i, j})\n\t\t\t\tm[i][j] = true\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(bfs(q, m))\n}\n\nfunc bfs(q [][]int, m [][]bool) int {\n\tvar ans int\n\n\tfor len(q) != 0 {\n\t\tans++\n\t\tlen := len(q)\n\n\t\tfor i := 0; i < len; i++ {\n\t\t\tvar y, x int = q[0][0], q[0][1]\n\t\t\tq = append(q[1:])\n\n\t\t\tif 0 <= y+1 && y+1 < H && m[y+1][x] == false {\n\t\t\t\tm[y+1][x] = true\n\t\t\t\tq = append(q, []int{y + 1, x})\n\t\t\t}\n\t\t\tif 0 <= y-1 && y-1 < H && m[y-1][x] == false {\n\t\t\t\tm[y-1][x] = true\n\t\t\t\tq = append(q, []int{y - 1, x})\n\t\t\t}\n\t\t\tif 0 <= x+1 && x+1 < W && m[y][x+1] == false {\n\t\t\t\tm[y][x+1] = true\n\t\t\t\tq = append(q, []int{y, x + 1})\n\t\t\t}\n\t\t\tif 0 <= x-1 && x-1 < W && m[y][x-1] == false {\n\t\t\t\tm[y][x-1] = true\n\t\t\t\tq = append(q, []int{y, x - 1})\n\t\t\t}\n\t\t}\n\t}\n\treturn ans - 1\n}\n", "language": "Go", "metadata": {"date": 1560565560, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03053.html", "problem_id": "p03053", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03053/input.txt", "sample_output_relpath": "derived/input_output/data/p03053/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03053/Go/s235864099.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s235864099", "user_id": "u266742706"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar H, W int\n\nfunc main() {\n\treader := bufio.NewReaderSize(os.Stdin, 1000000000)\n\tfmt.Scan(&H, &W)\n\n\tq := make([][]int, 0)\n\tm := make([][]bool, H)\n\n\tfor i := 0; i < H; i++ {\n\t\tline, _, _ := reader.ReadLine()\n\t\tm[i] = make([]bool, W) // Falseで初期化されている\n\n\t\tfor j, v := range line {\n\t\t\tif string(v) == \"#\" {\n\t\t\t\tq = append(q, []int{i, j})\n\t\t\t\tm[i][j] = true\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(bfs(q, m))\n}\n\nfunc bfs(q [][]int, m [][]bool) int {\n\tvar ans int\n\n\tfor len(q) != 0 {\n\t\tans++\n\t\tlen := len(q)\n\n\t\tfor i := 0; i < len; i++ {\n\t\t\tvar y, x int = q[0][0], q[0][1]\n\t\t\tq = append(q[1:])\n\n\t\t\tif 0 <= y+1 && y+1 < H && m[y+1][x] == false {\n\t\t\t\tm[y+1][x] = true\n\t\t\t\tq = append(q, []int{y + 1, x})\n\t\t\t}\n\t\t\tif 0 <= y-1 && y-1 < H && m[y-1][x] == false {\n\t\t\t\tm[y-1][x] = true\n\t\t\t\tq = append(q, []int{y - 1, x})\n\t\t\t}\n\t\t\tif 0 <= x+1 && x+1 < W && m[y][x+1] == false {\n\t\t\t\tm[y][x+1] = true\n\t\t\t\tq = append(q, []int{y, x + 1})\n\t\t\t}\n\t\t\tif 0 <= x-1 && x-1 < W && m[y][x-1] == false {\n\t\t\t\tm[y][x-1] = true\n\t\t\t\tq = append(q, []int{y, x - 1})\n\t\t\t}\n\t\t}\n\t}\n\treturn ans - 1\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "sample_input": "3 3\n...\n.#.\n...\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03053", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1110, "cpu_time_ms": 137, "memory_kb": 186752}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s492504391", "group_id": "codeNet:p03053", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar H, W int\n\nfunc main() {\n\treader := bufio.NewReaderSize(os.Stdin, 10000000)\n\tfmt.Scan(&H, &W)\n\n\tq := make([][]int, 0)\n\tm := make([][]bool, H)\n\n\tfor i := 0; i < H; i++ {\n\t\tline, _, _ := reader.ReadLine()\n\t\tm[i] = make([]bool, W) // Falseで初期化されている\n\n\t\tfor j, v := range line {\n\t\t\tif string(v) == \"#\" {\n\t\t\t\tq = append(q, []int{i, j})\n\t\t\t\tm[i][j] = true\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(bfs(q, m))\n}\n\nfunc bfs(q [][]int, m [][]bool) int {\n\tvar ans int\n\n\tfor len(q) != 0 {\n\t\tans++\n\t\tlen := len(q)\n\n\t\tfor i := 0; i < len; i++ {\n\t\t\tvar y, x int = q[0][0], q[0][1]\n\t\t\tq = append(q[1:])\n\n\t\t\tif 0 <= y+1 && y+1 < H && m[y+1][x] == false {\n\t\t\t\tm[y+1][x] = true\n\t\t\t\tq = append(q, []int{y + 1, x})\n\t\t\t}\n\t\t\tif 0 <= y-1 && y-1 < H && m[y-1][x] == false {\n\t\t\t\tm[y-1][x] = true\n\t\t\t\tq = append(q, []int{y - 1, x})\n\t\t\t}\n\t\t\tif 0 <= x+1 && x+1 < W && m[y][x+1] == false {\n\t\t\t\tm[y][x+1] = true\n\t\t\t\tq = append(q, []int{y, x + 1})\n\t\t\t}\n\t\t\tif 0 <= x-1 && x-1 < W && m[y][x-1] == false {\n\t\t\t\tm[y][x-1] = true\n\t\t\t\tq = append(q, []int{y, x - 1})\n\t\t\t}\n\t\t}\n\t}\n\treturn ans - 1\n}\n", "language": "Go", "metadata": {"date": 1560565479, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03053.html", "problem_id": "p03053", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03053/input.txt", "sample_output_relpath": "derived/input_output/data/p03053/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03053/Go/s492504391.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s492504391", "user_id": "u266742706"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar H, W int\n\nfunc main() {\n\treader := bufio.NewReaderSize(os.Stdin, 10000000)\n\tfmt.Scan(&H, &W)\n\n\tq := make([][]int, 0)\n\tm := make([][]bool, H)\n\n\tfor i := 0; i < H; i++ {\n\t\tline, _, _ := reader.ReadLine()\n\t\tm[i] = make([]bool, W) // Falseで初期化されている\n\n\t\tfor j, v := range line {\n\t\t\tif string(v) == \"#\" {\n\t\t\t\tq = append(q, []int{i, j})\n\t\t\t\tm[i][j] = true\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(bfs(q, m))\n}\n\nfunc bfs(q [][]int, m [][]bool) int {\n\tvar ans int\n\n\tfor len(q) != 0 {\n\t\tans++\n\t\tlen := len(q)\n\n\t\tfor i := 0; i < len; i++ {\n\t\t\tvar y, x int = q[0][0], q[0][1]\n\t\t\tq = append(q[1:])\n\n\t\t\tif 0 <= y+1 && y+1 < H && m[y+1][x] == false {\n\t\t\t\tm[y+1][x] = true\n\t\t\t\tq = append(q, []int{y + 1, x})\n\t\t\t}\n\t\t\tif 0 <= y-1 && y-1 < H && m[y-1][x] == false {\n\t\t\t\tm[y-1][x] = true\n\t\t\t\tq = append(q, []int{y - 1, x})\n\t\t\t}\n\t\t\tif 0 <= x+1 && x+1 < W && m[y][x+1] == false {\n\t\t\t\tm[y][x+1] = true\n\t\t\t\tq = append(q, []int{y, x + 1})\n\t\t\t}\n\t\t\tif 0 <= x-1 && x-1 < W && m[y][x-1] == false {\n\t\t\t\tm[y][x-1] = true\n\t\t\t\tq = append(q, []int{y, x - 1})\n\t\t\t}\n\t\t}\n\t}\n\treturn ans - 1\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "sample_input": "3 3\n...\n.#.\n...\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03053", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1108, "cpu_time_ms": 583, "memory_kb": 139648}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s641641280", "group_id": "codeNet:p03053", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar H, W int\n\nfunc main() {\n\tfmt.Scan(&H, &W)\n\n\treader := bufio.NewScanner(os.Stdin)\n\tq := make([][]int, 0)\n\tm := make([][]bool, H)\n\n\tfor i := 0; i < H; i++ {\n\t\tm[i] = make([]bool, W) // Falseで初期化されている\n\t\treader.Scan()\n\n\t\tfor j := 0; j < W; j++ {\n\t\t\tif string(reader.Text()[j]) == \"#\" {\n\t\t\t\tq = append(q, []int{i, j})\n\t\t\t\tm[i][j] = true\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(bfs(q, m))\n}\n\nfunc bfs(q [][]int, m [][]bool) int {\n\tvar ans int\n\n\tfor len(q) != 0 {\n\t\tans++\n\t\tlen := len(q)\n\n\t\tfor i := 0; i < len; i++ {\n\t\t\tvar y, x int = q[0][0], q[0][1]\n\t\t\tq = append(q[1:])\n\n\t\t\tif 0 <= y+1 && y+1 < H && m[y+1][x] == false {\n\t\t\t\tm[y+1][x] = true\n\t\t\t\tq = append(q, []int{y + 1, x})\n\t\t\t}\n\t\t\tif 0 <= y-1 && y-1 < H && m[y-1][x] == false {\n\t\t\t\tm[y-1][x] = true\n\t\t\t\tq = append(q, []int{y - 1, x})\n\t\t\t}\n\t\t\tif 0 <= x+1 && x+1 < W && m[y][x+1] == false {\n\t\t\t\tm[y][x+1] = true\n\t\t\t\tq = append(q, []int{y, x + 1})\n\t\t\t}\n\t\t\tif 0 <= x-1 && x-1 < W && m[y][x-1] == false {\n\t\t\t\tm[y][x-1] = true\n\t\t\t\tq = append(q, []int{y, x - 1})\n\t\t\t}\n\t\t}\n\t}\n\treturn ans - 1\n}\n", "language": "Go", "metadata": {"date": 1560557613, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03053.html", "problem_id": "p03053", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03053/input.txt", "sample_output_relpath": "derived/input_output/data/p03053/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03053/Go/s641641280.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s641641280", "user_id": "u266742706"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar H, W int\n\nfunc main() {\n\tfmt.Scan(&H, &W)\n\n\treader := bufio.NewScanner(os.Stdin)\n\tq := make([][]int, 0)\n\tm := make([][]bool, H)\n\n\tfor i := 0; i < H; i++ {\n\t\tm[i] = make([]bool, W) // Falseで初期化されている\n\t\treader.Scan()\n\n\t\tfor j := 0; j < W; j++ {\n\t\t\tif string(reader.Text()[j]) == \"#\" {\n\t\t\t\tq = append(q, []int{i, j})\n\t\t\t\tm[i][j] = true\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(bfs(q, m))\n}\n\nfunc bfs(q [][]int, m [][]bool) int {\n\tvar ans int\n\n\tfor len(q) != 0 {\n\t\tans++\n\t\tlen := len(q)\n\n\t\tfor i := 0; i < len; i++ {\n\t\t\tvar y, x int = q[0][0], q[0][1]\n\t\t\tq = append(q[1:])\n\n\t\t\tif 0 <= y+1 && y+1 < H && m[y+1][x] == false {\n\t\t\t\tm[y+1][x] = true\n\t\t\t\tq = append(q, []int{y + 1, x})\n\t\t\t}\n\t\t\tif 0 <= y-1 && y-1 < H && m[y-1][x] == false {\n\t\t\t\tm[y-1][x] = true\n\t\t\t\tq = append(q, []int{y - 1, x})\n\t\t\t}\n\t\t\tif 0 <= x+1 && x+1 < W && m[y][x+1] == false {\n\t\t\t\tm[y][x+1] = true\n\t\t\t\tq = append(q, []int{y, x + 1})\n\t\t\t}\n\t\t\tif 0 <= x-1 && x-1 < W && m[y][x-1] == false {\n\t\t\t\tm[y][x-1] = true\n\t\t\t\tq = append(q, []int{y, x - 1})\n\t\t\t}\n\t\t}\n\t}\n\treturn ans - 1\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "sample_input": "3 3\n...\n.#.\n...\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03053", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1092, "cpu_time_ms": 1060, "memory_kb": 68480}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s403742075", "group_id": "codeNet:p03053", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\ntype YX struct {\n\ty int\n\tx int\n}\n\nfunc main() {\n\tvar h, w int\n\tfmt.Scan(&h, &w)\n\tvar a = make([][]byte, h)\n\tvar d = make([][]int, h)\n\tvar reader = bufio.NewReaderSize(os.Stdin, 1024)\n var ql = make([]YX, 0)\n var ans = 0\n\n\tfor y := 0; y < h; y++ {\n\t\tl, _, _ := reader.ReadLine()\n\t\ta[y] = make([]byte, w)\n\t\td[y] = make([]int, w)\n\t\tcopy(a[y], l)\n\t\tfor x := 0; x < w; x++ {\n\t\t\tif a[y][x] == '.' {\n\t\t\t\td[y][x] = -1\n\t\t\t} else {\n\t\t\t\tql = append(ql, YX{y, x})\n\t\t\t}\n\t\t}\n\t}\n\n\tfor len(ql) > 0 {\n\t\tvar newql = make([]YX, 0)\n\t\tfor _, q := range ql {\n\t\t\tel := []bool{false, false, false, false}\n\t\t\tif q.y > 0 {\n\t\t\t\tel[0] = true\n\t\t\t}\n\t\t\tif q.y < h-1 {\n\t\t\t\tel[2] = true\n\t\t\t}\n\t\t\tif q.x > 0 {\n\t\t\t\tel[3] = true\n\t\t\t}\n\t\t\tif q.x < w-1 {\n\t\t\t\tel[1] = true\n }\n ans = d[q.y][q.x]\n\t\t\tfor i, e := range el {\n\t\t\t\tif e {\n\t\t\t\t\tswitch i {\n\t\t\t\t\tcase 0:\n\t\t\t\t\t\ty, x := q.y-1, q.x\n\t\t\t\t\t\tif d[y][x] == -1 {\n\t\t\t\t\t\t\td[y][x] = d[q.y][q.x] + 1\n newql = append(newql, YX{y, x})\n\t\t\t\t\t\t}\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\ty, x := q.y, q.x+1\n\t\t\t\t\t\tif d[y][x] == -1 {\n\t\t\t\t\t\t\td[y][x] = d[q.y][q.x] + 1\n\t\t\t\t\t\t\tnewql = append(newql, YX{y, x})\n\t\t\t\t\t\t}\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\ty, x := q.y+1, q.x\n\t\t\t\t\t\tif d[y][x] == -1 {\n\t\t\t\t\t\t\td[y][x] = d[q.y][q.x] + 1\n\t\t\t\t\t\t\tnewql = append(newql, YX{y, x})\n\t\t\t\t\t\t}\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\ty, x := q.y, q.x-1\n\t\t\t\t\t\tif d[y][x] == -1 {\n\t\t\t\t\t\t\td[y][x] = d[q.y][q.x] + 1\n\t\t\t\t\t\t\tnewql = append(newql, YX{y, x})\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tql = newql\n\t}\n\n\tfmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1558470889, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03053.html", "problem_id": "p03053", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03053/input.txt", "sample_output_relpath": "derived/input_output/data/p03053/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03053/Go/s403742075.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s403742075", "user_id": "u113576476"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\ntype YX struct {\n\ty int\n\tx int\n}\n\nfunc main() {\n\tvar h, w int\n\tfmt.Scan(&h, &w)\n\tvar a = make([][]byte, h)\n\tvar d = make([][]int, h)\n\tvar reader = bufio.NewReaderSize(os.Stdin, 1024)\n var ql = make([]YX, 0)\n var ans = 0\n\n\tfor y := 0; y < h; y++ {\n\t\tl, _, _ := reader.ReadLine()\n\t\ta[y] = make([]byte, w)\n\t\td[y] = make([]int, w)\n\t\tcopy(a[y], l)\n\t\tfor x := 0; x < w; x++ {\n\t\t\tif a[y][x] == '.' {\n\t\t\t\td[y][x] = -1\n\t\t\t} else {\n\t\t\t\tql = append(ql, YX{y, x})\n\t\t\t}\n\t\t}\n\t}\n\n\tfor len(ql) > 0 {\n\t\tvar newql = make([]YX, 0)\n\t\tfor _, q := range ql {\n\t\t\tel := []bool{false, false, false, false}\n\t\t\tif q.y > 0 {\n\t\t\t\tel[0] = true\n\t\t\t}\n\t\t\tif q.y < h-1 {\n\t\t\t\tel[2] = true\n\t\t\t}\n\t\t\tif q.x > 0 {\n\t\t\t\tel[3] = true\n\t\t\t}\n\t\t\tif q.x < w-1 {\n\t\t\t\tel[1] = true\n }\n ans = d[q.y][q.x]\n\t\t\tfor i, e := range el {\n\t\t\t\tif e {\n\t\t\t\t\tswitch i {\n\t\t\t\t\tcase 0:\n\t\t\t\t\t\ty, x := q.y-1, q.x\n\t\t\t\t\t\tif d[y][x] == -1 {\n\t\t\t\t\t\t\td[y][x] = d[q.y][q.x] + 1\n newql = append(newql, YX{y, x})\n\t\t\t\t\t\t}\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\ty, x := q.y, q.x+1\n\t\t\t\t\t\tif d[y][x] == -1 {\n\t\t\t\t\t\t\td[y][x] = d[q.y][q.x] + 1\n\t\t\t\t\t\t\tnewql = append(newql, YX{y, x})\n\t\t\t\t\t\t}\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\ty, x := q.y+1, q.x\n\t\t\t\t\t\tif d[y][x] == -1 {\n\t\t\t\t\t\t\td[y][x] = d[q.y][q.x] + 1\n\t\t\t\t\t\t\tnewql = append(newql, YX{y, x})\n\t\t\t\t\t\t}\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\ty, x := q.y, q.x-1\n\t\t\t\t\t\tif d[y][x] == -1 {\n\t\t\t\t\t\t\td[y][x] = d[q.y][q.x] + 1\n\t\t\t\t\t\t\tnewql = append(newql, YX{y, x})\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tql = newql\n\t}\n\n\tfmt.Println(ans)\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "sample_input": "3 3\n...\n.#.\n...\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03053", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1534, "cpu_time_ms": 80, "memory_kb": 59392}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s519639918", "group_id": "codeNet:p03053", "input_text": "package main\n\nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n \"strings\"\n \"strconv\"\n)\n\nfunc main() {\n var fp *os.File\n fp = os.Stdin\n reader := bufio.NewReaderSize(fp, 1024)\n var queue [][]int\n line, _, _ := reader.ReadLine()\n arr := strings.Split(string(line), \" \")\n H, _ := strconv.Atoi(arr[0])\n W, _ := strconv.Atoi(arr[1])\n visited := make([][]int, H)\n maps := make([][]byte, H)\n\n for i := 0; i < H; i++ {\n maps[i] = make([]byte, W)\n line, _, _ = reader.ReadLine()\n copy(maps[i], line)\n\n for j := 0; j < W; j++ {\n visited[i] = append(visited[i], -1)\n\n if maps[i][j] == '#' {\n var val []int\n val = append(val, i)\n val = append(val, j)\n queue = append(queue, val)\n visited[i][j] = 0\n }\n }\n }\n\n bfs(queue, visited, H, W)\n}\n\nfunc bfs(queue [][]int, visited [][]int, H int, W int) {\n var dx [4]int\n var dy [4]int\n dx[0] = 0\n dx[1] = 0\n dx[2] = 1\n dx[3] = -1\n dy[0] = 1\n dy[1] = -1\n dy[2] = 0\n dy[3] = 0\n var now_x, now_y, next_x, next_y int\n var cnt int = 0\n\n for len(queue) > 0 {\n now_x = queue[0][0]\n now_y = queue[0][1]\n\n for i := 0; i < 4; i++ {\n next_x = queue[0][0] + dx[i]\n next_y = queue[0][1] + dy[i]\n\n if next_x >= 0 && next_x <= W - 1 &&\n next_y >= 0 && next_y <= H - 1 &&\n visited[next_x][next_y] == -1 {\n var val []int\n val = append(val, next_x)\n val = append(val, next_y)\n queue = append(queue, val)\n visited[next_x][next_y] = visited[now_x][now_y] + 1\n cnt = visited[next_x][next_y]\n }\n }\n\n queue = remove(queue)\n }\n\n fmt.Println(cnt)\n}\n\n// スライスの中身削除\nfunc remove(queue [][]int) [][]int {\n return queue[1:]\n}", "language": "Go", "metadata": {"date": 1558391807, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03053.html", "problem_id": "p03053", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03053/input.txt", "sample_output_relpath": "derived/input_output/data/p03053/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03053/Go/s519639918.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s519639918", "user_id": "u528868894"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n \"strings\"\n \"strconv\"\n)\n\nfunc main() {\n var fp *os.File\n fp = os.Stdin\n reader := bufio.NewReaderSize(fp, 1024)\n var queue [][]int\n line, _, _ := reader.ReadLine()\n arr := strings.Split(string(line), \" \")\n H, _ := strconv.Atoi(arr[0])\n W, _ := strconv.Atoi(arr[1])\n visited := make([][]int, H)\n maps := make([][]byte, H)\n\n for i := 0; i < H; i++ {\n maps[i] = make([]byte, W)\n line, _, _ = reader.ReadLine()\n copy(maps[i], line)\n\n for j := 0; j < W; j++ {\n visited[i] = append(visited[i], -1)\n\n if maps[i][j] == '#' {\n var val []int\n val = append(val, i)\n val = append(val, j)\n queue = append(queue, val)\n visited[i][j] = 0\n }\n }\n }\n\n bfs(queue, visited, H, W)\n}\n\nfunc bfs(queue [][]int, visited [][]int, H int, W int) {\n var dx [4]int\n var dy [4]int\n dx[0] = 0\n dx[1] = 0\n dx[2] = 1\n dx[3] = -1\n dy[0] = 1\n dy[1] = -1\n dy[2] = 0\n dy[3] = 0\n var now_x, now_y, next_x, next_y int\n var cnt int = 0\n\n for len(queue) > 0 {\n now_x = queue[0][0]\n now_y = queue[0][1]\n\n for i := 0; i < 4; i++ {\n next_x = queue[0][0] + dx[i]\n next_y = queue[0][1] + dy[i]\n\n if next_x >= 0 && next_x <= W - 1 &&\n next_y >= 0 && next_y <= H - 1 &&\n visited[next_x][next_y] == -1 {\n var val []int\n val = append(val, next_x)\n val = append(val, next_y)\n queue = append(queue, val)\n visited[next_x][next_y] = visited[now_x][now_y] + 1\n cnt = visited[next_x][next_y]\n }\n }\n\n queue = remove(queue)\n }\n\n fmt.Println(cnt)\n}\n\n// スライスの中身削除\nfunc remove(queue [][]int) [][]int {\n return queue[1:]\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "sample_input": "3 3\n...\n.#.\n...\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03053", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1957, "cpu_time_ms": 953, "memory_kb": 102272}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s513781073", "group_id": "codeNet:p03053", "input_text": "package main\n\nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n \"strings\"\n \"strconv\"\n)\n\nfunc main() {\n var fp *os.File\n fp = os.Stdin\n reader := bufio.NewReaderSize(fp, 4096)\n var line string\n var line_rune []rune\n var str string\n var queue [][]int\n line = readLine(reader)\n arr := strings.Split(line, \" \")\n H, _ := strconv.Atoi(arr[0])\n W, _ := strconv.Atoi(arr[1])\n maps := make([][]string, H)\n visited := make([][]int, H)\n\n for i := 0; i < H; i++ {\n line_rune = []rune(readLine(reader))\n for j := 0; j < W; j++ {\n str = string(line_rune[j:j+1])\n maps[i] = append(maps[i], str)\n visited[i] = append(visited[i], -1)\n\n if str == \"#\" {\n var val []int\n val = append(val, i)\n val = append(val, j)\n queue = append(queue, val)\n visited[i][j] = 0\n }\n }\n }\n\n bfs(queue, maps, visited, H, W)\n}\n\nfunc bfs(queue [][]int, maps [][]string, visited [][]int, H int, W int) {\n var dx [4]int\n var dy [4]int\n dx[0] = 0\n dx[1] = 0\n dx[2] = 1\n dx[3] = -1\n dy[0] = 1\n dy[1] = -1\n dy[2] = 0\n dy[3] = 0\n var now_x, now_y, next_x, next_y int\n var cnt int = 0\n\n for len(queue) > 0 {\n now_x = queue[0][0]\n now_y = queue[0][1]\n\n for i := 0; i < 4; i++ {\n next_x = queue[0][0] + dx[i]\n next_y = queue[0][1] + dy[i]\n\n if next_x >= 0 && next_x <= W - 1 &&\n next_y >= 0 && next_y <= H - 1 &&\n visited[next_x][next_y] == -1 {\n var val []int\n val = append(val, next_x)\n val = append(val, next_y)\n queue = append(queue, val)\n visited[next_x][next_y] = visited[now_x][now_y] + 1\n cnt = visited[next_x][next_y]\n }\n }\n\n queue = remove(queue)\n }\n\n fmt.Println(cnt)\n}\n\nfunc readLine(reader *bufio.Reader) string {\n buf := make([]byte, 0, 1000000)\n\n for {\n l, p, e := reader.ReadLine()\n\n if e != nil {\n panic(e)\n }\n\n buf = append(buf, l...)\n\n if !p {\n break\n }\n }\n\n return string(buf)\n}\n\n// スライスの中身削除\nfunc remove(queue [][]int) [][]int {\n return queue[1:]\n}", "language": "Go", "metadata": {"date": 1558390017, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03053.html", "problem_id": "p03053", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03053/input.txt", "sample_output_relpath": "derived/input_output/data/p03053/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03053/Go/s513781073.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s513781073", "user_id": "u528868894"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n \"strings\"\n \"strconv\"\n)\n\nfunc main() {\n var fp *os.File\n fp = os.Stdin\n reader := bufio.NewReaderSize(fp, 4096)\n var line string\n var line_rune []rune\n var str string\n var queue [][]int\n line = readLine(reader)\n arr := strings.Split(line, \" \")\n H, _ := strconv.Atoi(arr[0])\n W, _ := strconv.Atoi(arr[1])\n maps := make([][]string, H)\n visited := make([][]int, H)\n\n for i := 0; i < H; i++ {\n line_rune = []rune(readLine(reader))\n for j := 0; j < W; j++ {\n str = string(line_rune[j:j+1])\n maps[i] = append(maps[i], str)\n visited[i] = append(visited[i], -1)\n\n if str == \"#\" {\n var val []int\n val = append(val, i)\n val = append(val, j)\n queue = append(queue, val)\n visited[i][j] = 0\n }\n }\n }\n\n bfs(queue, maps, visited, H, W)\n}\n\nfunc bfs(queue [][]int, maps [][]string, visited [][]int, H int, W int) {\n var dx [4]int\n var dy [4]int\n dx[0] = 0\n dx[1] = 0\n dx[2] = 1\n dx[3] = -1\n dy[0] = 1\n dy[1] = -1\n dy[2] = 0\n dy[3] = 0\n var now_x, now_y, next_x, next_y int\n var cnt int = 0\n\n for len(queue) > 0 {\n now_x = queue[0][0]\n now_y = queue[0][1]\n\n for i := 0; i < 4; i++ {\n next_x = queue[0][0] + dx[i]\n next_y = queue[0][1] + dy[i]\n\n if next_x >= 0 && next_x <= W - 1 &&\n next_y >= 0 && next_y <= H - 1 &&\n visited[next_x][next_y] == -1 {\n var val []int\n val = append(val, next_x)\n val = append(val, next_y)\n queue = append(queue, val)\n visited[next_x][next_y] = visited[now_x][now_y] + 1\n cnt = visited[next_x][next_y]\n }\n }\n\n queue = remove(queue)\n }\n\n fmt.Println(cnt)\n}\n\nfunc readLine(reader *bufio.Reader) string {\n buf := make([]byte, 0, 1000000)\n\n for {\n l, p, e := reader.ReadLine()\n\n if e != nil {\n panic(e)\n }\n\n buf = append(buf, l...)\n\n if !p {\n break\n }\n }\n\n return string(buf)\n}\n\n// スライスの中身削除\nfunc remove(queue [][]int) [][]int {\n return queue[1:]\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "sample_input": "3 3\n...\n.#.\n...\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03053", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2346, "cpu_time_ms": 1062, "memory_kb": 91008}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s638001029", "group_id": "codeNet:p03053", "input_text": "package main\n\nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n \"strings\"\n \"strconv\"\n)\n\nfunc main() {\n var fp *os.File\n fp = os.Stdin\n reader := bufio.NewReaderSize(fp, 4096)\n var line string\n var str string\n var queue [][]int\n line = readLine(reader)\n arr := strings.Split(line, \" \")\n H, _ := strconv.Atoi(arr[0])\n W, _ := strconv.Atoi(arr[1])\n maps := make([][]string, H)\n visited := make([][]int, H)\n\n for i := 0; i < H; i++ {\n line = readLine(reader)\n \tfor k, v := range line {\n \t\tstr = string(v)\n maps[i] = append(maps[i], str)\n visited[i] = append(visited[i], -1)\n\n if str == \"#\" {\n var val []int\n val = append(val, i)\n val = append(val, k)\n queue = append(queue, val)\n visited[i][k] = 0\n }\n }\n }\n\n // BFS\n var dx [4]int\n var dy [4]int\n dx[0] = 0\n dx[1] = 0\n dx[2] = 1\n dx[3] = -1\n dy[0] = 1\n dy[1] = -1\n dy[2] = 0\n dy[3] = 0\n var now_x, now_y, next_x, next_y int\n var cnt int = 0\n\n for len(queue) > 0 {\n now_x = queue[0][0]\n now_y = queue[0][1]\n\n for i := 0; i < 4; i++ {\n next_x = queue[0][0] + dx[i]\n next_y = queue[0][1] + dy[i]\n\n if (next_x < 0 || next_x >= H || next_y < 0 || next_y >= W) {\n continue;\n }\n\n if visited[next_x][next_y] == -1 {\n //maps[next_x][next_y] == \".\" {\n\n //if next_x >= 0 && next_x <= W - 1 &&\n //next_y >= 0 && next_y <= H - 1 &&\n //visited[next_x][next_y] == -1 {\n //maps[next_x][next_y] == \".\" {\n var val []int\n val = append(val, next_x)\n val = append(val, next_y)\n queue = append(queue, val)\n visited[next_x][next_y] = visited[now_x][now_y] + 1\n cnt = visited[next_x][next_y]\n maps[next_x][next_y] = \"#\"\n }\n }\n\n queue = remove(queue, 0)\n }\n\n fmt.Println(cnt)\n}\n\nfunc readLine(reader *bufio.Reader) string {\n buf := make([]byte, 0, 1000000)\n\n for {\n l, p, e := reader.ReadLine()\n\n if e != nil {\n panic(e)\n }\n\n buf = append(buf, l...)\n\n if !p {\n break\n }\n }\n\n return string(buf)\n}\n\n// スライスの中身削除\nfunc remove(ints [][]int, key int) [][]int {\n result := [][]int{}\n\n\n for k, v := range ints {\n if k != key {\n result = append(result, v)\n }\n }\n\n return result\n}\n", "language": "Go", "metadata": {"date": 1558149608, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03053.html", "problem_id": "p03053", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03053/input.txt", "sample_output_relpath": "derived/input_output/data/p03053/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03053/Go/s638001029.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s638001029", "user_id": "u528868894"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n \"strings\"\n \"strconv\"\n)\n\nfunc main() {\n var fp *os.File\n fp = os.Stdin\n reader := bufio.NewReaderSize(fp, 4096)\n var line string\n var str string\n var queue [][]int\n line = readLine(reader)\n arr := strings.Split(line, \" \")\n H, _ := strconv.Atoi(arr[0])\n W, _ := strconv.Atoi(arr[1])\n maps := make([][]string, H)\n visited := make([][]int, H)\n\n for i := 0; i < H; i++ {\n line = readLine(reader)\n \tfor k, v := range line {\n \t\tstr = string(v)\n maps[i] = append(maps[i], str)\n visited[i] = append(visited[i], -1)\n\n if str == \"#\" {\n var val []int\n val = append(val, i)\n val = append(val, k)\n queue = append(queue, val)\n visited[i][k] = 0\n }\n }\n }\n\n // BFS\n var dx [4]int\n var dy [4]int\n dx[0] = 0\n dx[1] = 0\n dx[2] = 1\n dx[3] = -1\n dy[0] = 1\n dy[1] = -1\n dy[2] = 0\n dy[3] = 0\n var now_x, now_y, next_x, next_y int\n var cnt int = 0\n\n for len(queue) > 0 {\n now_x = queue[0][0]\n now_y = queue[0][1]\n\n for i := 0; i < 4; i++ {\n next_x = queue[0][0] + dx[i]\n next_y = queue[0][1] + dy[i]\n\n if (next_x < 0 || next_x >= H || next_y < 0 || next_y >= W) {\n continue;\n }\n\n if visited[next_x][next_y] == -1 {\n //maps[next_x][next_y] == \".\" {\n\n //if next_x >= 0 && next_x <= W - 1 &&\n //next_y >= 0 && next_y <= H - 1 &&\n //visited[next_x][next_y] == -1 {\n //maps[next_x][next_y] == \".\" {\n var val []int\n val = append(val, next_x)\n val = append(val, next_y)\n queue = append(queue, val)\n visited[next_x][next_y] = visited[now_x][now_y] + 1\n cnt = visited[next_x][next_y]\n maps[next_x][next_y] = \"#\"\n }\n }\n\n queue = remove(queue, 0)\n }\n\n fmt.Println(cnt)\n}\n\nfunc readLine(reader *bufio.Reader) string {\n buf := make([]byte, 0, 1000000)\n\n for {\n l, p, e := reader.ReadLine()\n\n if e != nil {\n panic(e)\n }\n\n buf = append(buf, l...)\n\n if !p {\n break\n }\n }\n\n return string(buf)\n}\n\n// スライスの中身削除\nfunc remove(ints [][]int, key int) [][]int {\n result := [][]int{}\n\n\n for k, v := range ints {\n if k != key {\n result = append(result, v)\n }\n }\n\n return result\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "sample_input": "3 3\n...\n.#.\n...\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03053", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2648, "cpu_time_ms": 1065, "memory_kb": 106624}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s878355952", "group_id": "codeNet:p03053", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strings\"\n)\n\nvar H, W int\nvar A [][]Point\n\n//var whiteNum int\n\ntype Point struct {\n\tx, y int\n\tcolor int\n\tisDone bool\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc (p Point) findNearestBlackDistance() (int, int, int) {\n\ti := 1\n\tvar x, y1, y2 int\n\tfor {\n\t\tfor j := -1 * i; j <= i; j++ {\n\t\t\tk := i - abs(j)\n\t\t\tx = p.x + j\n\t\t\ty1 = p.y + k\n\t\t\ty2 = p.y - k\n\t\t\tif x >= 0 && y1 >= 0 && x < W && y1 < H {\n\t\t\t\tif A[y1][x].color == 1 {\n\t\t\t\t\treturn i, y1, x\n\t\t\t\t}\n\t\t\t}\n\t\t\tif x >= 0 && y2 >= 0 && x < W && y2 < H {\n\t\t\t\tif A[y2][x].color == 1 {\n\t\t\t\t\treturn i, y2, x\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\ti += 1\n\t}\n\treturn -1, -1, -1\n}\n\nfunc (p Point) doWhitesWithDistance(distance int) {\n\tvar x, y1, y2 int\n\tfor i := 1; i <= distance; i++ {\n\t\tfor j := -1 * i; j <= i; j++ {\n\t\t\tk := i - abs(j)\n\t\t\tx = p.x + j\n\t\t\ty1 = p.y + k\n\t\t\ty2 = p.y - k\n\t\t\tif x >= 0 && y1 >= 0 && x < W && y1 < H {\n\t\t\t\tif A[y1][x].color == 0 {\n\t\t\t\t\tif A[y1][x].isDone != true {\n\t\t\t\t\t\tA[y1][x].isDone = true\n\t\t\t\t\t\t//\t\t\t\t\t\twhiteNum -= 1\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif x >= 0 && y2 >= 0 && x < W && y2 < H {\n\t\t\t\tif A[y2][x].color == 0 {\n\t\t\t\t\tif A[y2][x].isDone != true {\n\t\t\t\t\t\tA[y2][x].isDone = true\n\t\t\t\t\t\t//\t\t\t\t\t\twhiteNum -= 1\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc main() {\n\tfmt.Scan(&H, &W)\n\tA = make([][]Point, H)\n\ts := \"\"\n\tfor i := 0; i < H; i++ {\n\t\tA[i] = make([]Point, W)\n\t\tfmt.Scan(&s)\n\t\tinfo := strings.Split(s, \"\")\n\t\tfor j := 0; j < W; j++ {\n\t\t\tif info[j] == \".\" {\n\t\t\t\tA[i][j] = Point{x: j, y: i, color: 0, isDone: false}\n\t\t\t} else {\n\t\t\t\tA[i][j] = Point{x: j, y: i, color: 1, isDone: true}\n\t\t\t}\n\t\t}\n\t}\n\tmax := 0\n\ttmp := 0\n\tvar x, y int\n\n\tfor i := 0; i < H; i++ {\n\t\tfor j := 0; j < W; j++ {\n\t\t\tif A[i][j].isDone != true {\n\t\t\t\ttmp, x, y = A[i][j].findNearestBlackDistance()\n\t\t\t\tif tmp == -1 {\n\t\t\t\t\tfmt.Println(max)\n\t\t\t\t\tos.Exit(0)\n\t\t\t\t}\n\t\t\t\tA[y][x].doWhitesWithDistance(tmp)\n\t\t\t\tif tmp > max {\n\t\t\t\t\tmax = tmp\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(max)\n}\n", "language": "Go", "metadata": {"date": 1557246970, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03053.html", "problem_id": "p03053", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03053/input.txt", "sample_output_relpath": "derived/input_output/data/p03053/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03053/Go/s878355952.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s878355952", "user_id": "u761488152"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strings\"\n)\n\nvar H, W int\nvar A [][]Point\n\n//var whiteNum int\n\ntype Point struct {\n\tx, y int\n\tcolor int\n\tisDone bool\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc (p Point) findNearestBlackDistance() (int, int, int) {\n\ti := 1\n\tvar x, y1, y2 int\n\tfor {\n\t\tfor j := -1 * i; j <= i; j++ {\n\t\t\tk := i - abs(j)\n\t\t\tx = p.x + j\n\t\t\ty1 = p.y + k\n\t\t\ty2 = p.y - k\n\t\t\tif x >= 0 && y1 >= 0 && x < W && y1 < H {\n\t\t\t\tif A[y1][x].color == 1 {\n\t\t\t\t\treturn i, y1, x\n\t\t\t\t}\n\t\t\t}\n\t\t\tif x >= 0 && y2 >= 0 && x < W && y2 < H {\n\t\t\t\tif A[y2][x].color == 1 {\n\t\t\t\t\treturn i, y2, x\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\ti += 1\n\t}\n\treturn -1, -1, -1\n}\n\nfunc (p Point) doWhitesWithDistance(distance int) {\n\tvar x, y1, y2 int\n\tfor i := 1; i <= distance; i++ {\n\t\tfor j := -1 * i; j <= i; j++ {\n\t\t\tk := i - abs(j)\n\t\t\tx = p.x + j\n\t\t\ty1 = p.y + k\n\t\t\ty2 = p.y - k\n\t\t\tif x >= 0 && y1 >= 0 && x < W && y1 < H {\n\t\t\t\tif A[y1][x].color == 0 {\n\t\t\t\t\tif A[y1][x].isDone != true {\n\t\t\t\t\t\tA[y1][x].isDone = true\n\t\t\t\t\t\t//\t\t\t\t\t\twhiteNum -= 1\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif x >= 0 && y2 >= 0 && x < W && y2 < H {\n\t\t\t\tif A[y2][x].color == 0 {\n\t\t\t\t\tif A[y2][x].isDone != true {\n\t\t\t\t\t\tA[y2][x].isDone = true\n\t\t\t\t\t\t//\t\t\t\t\t\twhiteNum -= 1\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc main() {\n\tfmt.Scan(&H, &W)\n\tA = make([][]Point, H)\n\ts := \"\"\n\tfor i := 0; i < H; i++ {\n\t\tA[i] = make([]Point, W)\n\t\tfmt.Scan(&s)\n\t\tinfo := strings.Split(s, \"\")\n\t\tfor j := 0; j < W; j++ {\n\t\t\tif info[j] == \".\" {\n\t\t\t\tA[i][j] = Point{x: j, y: i, color: 0, isDone: false}\n\t\t\t} else {\n\t\t\t\tA[i][j] = Point{x: j, y: i, color: 1, isDone: true}\n\t\t\t}\n\t\t}\n\t}\n\tmax := 0\n\ttmp := 0\n\tvar x, y int\n\n\tfor i := 0; i < H; i++ {\n\t\tfor j := 0; j < W; j++ {\n\t\t\tif A[i][j].isDone != true {\n\t\t\t\ttmp, x, y = A[i][j].findNearestBlackDistance()\n\t\t\t\tif tmp == -1 {\n\t\t\t\t\tfmt.Println(max)\n\t\t\t\t\tos.Exit(0)\n\t\t\t\t}\n\t\t\t\tA[y][x].doWhitesWithDistance(tmp)\n\t\t\t\tif tmp > max {\n\t\t\t\t\tmax = tmp\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(max)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "sample_input": "3 3\n...\n.#.\n...\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03053", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1944, "cpu_time_ms": 1062, "memory_kb": 39808}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s360737609", "group_id": "codeNet:p03053", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\ntype xydata struct {\n\tx int\n\ty int\n}\n\nfunc main() {\n\tmatrix := input()\n\n\tcount := 0\n\tfor {\n\t\tif true == check(matrix) {\n\t\t\tbreak\n\t\t}\n\t\tXYdata := getxydate(matrix)\n\t\tmatrix = update(matrix, XYdata)\n\t\tcount++\n\t}\n\tfmt.Println(count)\n}\n\nfunc check(matrix [][]string) bool {\n\tfor x := 0; x < len(matrix[0]); x++ {\n\t\tfor y := 0; y < len(matrix); y++ {\n\t\t\tif matrix[y][x] == \".\" {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\treturn true\n}\n\nfunc update(matrix [][]string, inXYdata []xydata) [][]string {\n\tfor i := 0; i < len(inXYdata); i++ {\n\t\tif (inXYdata[i].x - 1) >= 0 {\n\t\t\tmatrix[inXYdata[i].y][inXYdata[i].x-1] = \"#\"\n\t\t}\n\t\tif (inXYdata[i].x + 1) < len(matrix[0]) {\n\t\t\tmatrix[inXYdata[i].y][inXYdata[i].x+1] = \"#\"\n\t\t}\n\t\tif (inXYdata[i].y - 1) >= 0 {\n\t\t\tmatrix[inXYdata[i].y-1][inXYdata[i].x] = \"#\"\n\t\t}\n\t\tif (inXYdata[i].y + 1) < len(matrix) {\n\t\t\tmatrix[inXYdata[i].y+1][inXYdata[i].x] = \"#\"\n\t\t}\n\t}\n\t/*\n\t\tfor x := 0; x < len(matrix); x++ {\n\t\t\tfor y := 0; y < len(matrix[0]); y++ {\n\t\t\t\tfmt.Printf(\"%s\", matrix[x][y])\n\t\t\t}\n\t\t\tfmt.Println()\n\t\t}\n\t*/\n\treturn matrix\n}\n\nfunc getxydate(matrix [][]string) []xydata {\n\tvar resXYdata []xydata\n\t//fmt.Printf(\"%d %d\\n\", len(matrix[0]), len(matrix))\n\tfor x := 0; x < len(matrix[0]); x++ {\n\t\tfor y := 0; y < len(matrix); y++ {\n\t\t\tif matrix[y][x] == \"#\" {\n\t\t\t\tresXYdata = append(resXYdata, xydata{x, y})\n\t\t\t\t//fmt.Printf(\"%d %d\\n\", x, y)\n\t\t\t}\n\t\t}\n\t}\n\treturn resXYdata\n}\n\nfunc input() [][]string {\n\tvar (\n\t\tx, y int\n\t)\n\tfmt.Scan(&x)\n\tfmt.Scan(&y)\n\tmatrix := make([][]string, y)\n\tfor yy := 0; yy < y; yy++ {\n\t\tmatrix[yy] = make([]string, x)\n\t}\n\n\tvar str string\n\tfor yy := 0; yy < y; yy++ {\n\t\tfmt.Scan(&str)\n\t\tr := []rune(str)\n\t\tfor xx := 0; xx < x; xx++ {\n\t\t\tmatrix[yy][xx] = string(r[xx])\n\t\t}\n\t}\n\t/*\n\t\tfor x := 0; x < i; x++ {\n\t\t\tfor y := 0; y < j; y++ {\n\t\t\t\tfmt.Printf(\"%s\", matrix[x][y])\n\t\t\t}\n\t\t\tfmt.Println()\n\t\t}\n\t*/\n\treturn matrix\n}\n", "language": "Go", "metadata": {"date": 1557157593, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03053.html", "problem_id": "p03053", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03053/input.txt", "sample_output_relpath": "derived/input_output/data/p03053/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03053/Go/s360737609.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s360737609", "user_id": "u393550875"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\ntype xydata struct {\n\tx int\n\ty int\n}\n\nfunc main() {\n\tmatrix := input()\n\n\tcount := 0\n\tfor {\n\t\tif true == check(matrix) {\n\t\t\tbreak\n\t\t}\n\t\tXYdata := getxydate(matrix)\n\t\tmatrix = update(matrix, XYdata)\n\t\tcount++\n\t}\n\tfmt.Println(count)\n}\n\nfunc check(matrix [][]string) bool {\n\tfor x := 0; x < len(matrix[0]); x++ {\n\t\tfor y := 0; y < len(matrix); y++ {\n\t\t\tif matrix[y][x] == \".\" {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\treturn true\n}\n\nfunc update(matrix [][]string, inXYdata []xydata) [][]string {\n\tfor i := 0; i < len(inXYdata); i++ {\n\t\tif (inXYdata[i].x - 1) >= 0 {\n\t\t\tmatrix[inXYdata[i].y][inXYdata[i].x-1] = \"#\"\n\t\t}\n\t\tif (inXYdata[i].x + 1) < len(matrix[0]) {\n\t\t\tmatrix[inXYdata[i].y][inXYdata[i].x+1] = \"#\"\n\t\t}\n\t\tif (inXYdata[i].y - 1) >= 0 {\n\t\t\tmatrix[inXYdata[i].y-1][inXYdata[i].x] = \"#\"\n\t\t}\n\t\tif (inXYdata[i].y + 1) < len(matrix) {\n\t\t\tmatrix[inXYdata[i].y+1][inXYdata[i].x] = \"#\"\n\t\t}\n\t}\n\t/*\n\t\tfor x := 0; x < len(matrix); x++ {\n\t\t\tfor y := 0; y < len(matrix[0]); y++ {\n\t\t\t\tfmt.Printf(\"%s\", matrix[x][y])\n\t\t\t}\n\t\t\tfmt.Println()\n\t\t}\n\t*/\n\treturn matrix\n}\n\nfunc getxydate(matrix [][]string) []xydata {\n\tvar resXYdata []xydata\n\t//fmt.Printf(\"%d %d\\n\", len(matrix[0]), len(matrix))\n\tfor x := 0; x < len(matrix[0]); x++ {\n\t\tfor y := 0; y < len(matrix); y++ {\n\t\t\tif matrix[y][x] == \"#\" {\n\t\t\t\tresXYdata = append(resXYdata, xydata{x, y})\n\t\t\t\t//fmt.Printf(\"%d %d\\n\", x, y)\n\t\t\t}\n\t\t}\n\t}\n\treturn resXYdata\n}\n\nfunc input() [][]string {\n\tvar (\n\t\tx, y int\n\t)\n\tfmt.Scan(&x)\n\tfmt.Scan(&y)\n\tmatrix := make([][]string, y)\n\tfor yy := 0; yy < y; yy++ {\n\t\tmatrix[yy] = make([]string, x)\n\t}\n\n\tvar str string\n\tfor yy := 0; yy < y; yy++ {\n\t\tfmt.Scan(&str)\n\t\tr := []rune(str)\n\t\tfor xx := 0; xx < x; xx++ {\n\t\t\tmatrix[yy][xx] = string(r[xx])\n\t\t}\n\t}\n\t/*\n\t\tfor x := 0; x < i; x++ {\n\t\t\tfor y := 0; y < j; y++ {\n\t\t\t\tfmt.Printf(\"%s\", matrix[x][y])\n\t\t\t}\n\t\t\tfmt.Println()\n\t\t}\n\t*/\n\treturn matrix\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "sample_input": "3 3\n...\n.#.\n...\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03053", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1885, "cpu_time_ms": 1062, "memory_kb": 83460}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s845155818", "group_id": "codeNet:p03053", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"unsafe\"\n)\n\nfunc decode(s string) []byte {\n\ts = strings.Replace(s, \"#\", \"1\", -1)\n\ts = strings.Replace(s, \".\", \"0\", -1)\n\tvec := *(*[]byte)(unsafe.Pointer(&s))\n\n\tfor i := range vec {\n\t\tvec[i] -= '0'\n\t}\n\treturn vec\n}\n\nfunc orVec(op0, op1 []byte) {\n\tfor i := range op0 {\n\t\top0[i] |= op1[i]\n\t}\n}\n\nfunc orMatrix(op0, op1 [][]byte) {\n\tfor i := range op0 {\n\t\torVec(op0[i], op1[i])\n\t}\n}\n\nfunc checkZeroVec(b []byte) bool {\n\tfor _, v := range b {\n\t\tif v == 1 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc checkFullVec(b, checked []byte) bool {\n\tfor i, v := range b {\n\t\tif checked[i] == 1 {\n\t\t\tcontinue\n\t\t}\n\t\tif v == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc checkFullMatrix(d, checked [][]byte) bool {\n\tfor i, v := range d {\n\t\tif !checkFullVec(v, checked[i]) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc genMask(op0, op1, checked [][]byte) {\n\tfor h := range op0 {\n\t\tfor w := 0; w < len(op0[h]); w++ {\n\t\t\tv := op0[h][w]\n\t\t\tif v == 1 && checked[h][w] == 0 {\n\t\t\t\tchecked[h][w] = 1\n\t\t\t\top1[h][w] = 1\n\t\t\t\tif h != 0 {\n\t\t\t\t\top1[h-1][w] = 1\n\t\t\t\t}\n\t\t\t\tif w != 0 {\n\t\t\t\t\top1[h][w-1] = 1\n\t\t\t\t}\n\t\t\t\tif h != len(op0)-1 {\n\t\t\t\t\top1[h+1][w] = 1\n\t\t\t\t}\n\t\t\t\tif w != len(op0[h])-1 {\n\t\t\t\t\top1[h][w+1] = 1\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc main() {\n\tvar h, w int\n\n\tfmt.Scanf(\"%d%d\", &h, &w)\n\n\ta := [][]byte{}\n\tfor i := 0; i < h; i++ {\n\t\tvar s string\n\t\tfmt.Scanf(\"%s\", &s)\n\t\ta = append(a, decode(s))\n\t}\n\n\tbuf := make([][]byte, len(a))\n\n\tfor i := 0; i < h; i++ {\n\t\tbuf[i] = make([]byte, len(a[i]))\n\t}\n\tchecked := make([][]byte, len(a))\n\n\tfor i := 0; i < h; i++ {\n\t\tchecked[i] = make([]byte, len(a[i]))\n\t}\n\n\tif checkFullMatrix(a, checked) {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tcnt := 0\n\tfor {\n\t\tgenMask(a, buf, checked)\n\t\tcnt++\n\t\tif checkFullMatrix(buf, checked) {\n\t\t\tfmt.Println(cnt)\n\t\t\treturn\n\t\t}\n\t\t//orMatrix(a, buf)\n\t\ta, buf = buf, a\n\t}\n}\n", "language": "Go", "metadata": {"date": 1557063013, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03053.html", "problem_id": "p03053", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03053/input.txt", "sample_output_relpath": "derived/input_output/data/p03053/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03053/Go/s845155818.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s845155818", "user_id": "u458583578"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"unsafe\"\n)\n\nfunc decode(s string) []byte {\n\ts = strings.Replace(s, \"#\", \"1\", -1)\n\ts = strings.Replace(s, \".\", \"0\", -1)\n\tvec := *(*[]byte)(unsafe.Pointer(&s))\n\n\tfor i := range vec {\n\t\tvec[i] -= '0'\n\t}\n\treturn vec\n}\n\nfunc orVec(op0, op1 []byte) {\n\tfor i := range op0 {\n\t\top0[i] |= op1[i]\n\t}\n}\n\nfunc orMatrix(op0, op1 [][]byte) {\n\tfor i := range op0 {\n\t\torVec(op0[i], op1[i])\n\t}\n}\n\nfunc checkZeroVec(b []byte) bool {\n\tfor _, v := range b {\n\t\tif v == 1 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc checkFullVec(b, checked []byte) bool {\n\tfor i, v := range b {\n\t\tif checked[i] == 1 {\n\t\t\tcontinue\n\t\t}\n\t\tif v == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc checkFullMatrix(d, checked [][]byte) bool {\n\tfor i, v := range d {\n\t\tif !checkFullVec(v, checked[i]) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc genMask(op0, op1, checked [][]byte) {\n\tfor h := range op0 {\n\t\tfor w := 0; w < len(op0[h]); w++ {\n\t\t\tv := op0[h][w]\n\t\t\tif v == 1 && checked[h][w] == 0 {\n\t\t\t\tchecked[h][w] = 1\n\t\t\t\top1[h][w] = 1\n\t\t\t\tif h != 0 {\n\t\t\t\t\top1[h-1][w] = 1\n\t\t\t\t}\n\t\t\t\tif w != 0 {\n\t\t\t\t\top1[h][w-1] = 1\n\t\t\t\t}\n\t\t\t\tif h != len(op0)-1 {\n\t\t\t\t\top1[h+1][w] = 1\n\t\t\t\t}\n\t\t\t\tif w != len(op0[h])-1 {\n\t\t\t\t\top1[h][w+1] = 1\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc main() {\n\tvar h, w int\n\n\tfmt.Scanf(\"%d%d\", &h, &w)\n\n\ta := [][]byte{}\n\tfor i := 0; i < h; i++ {\n\t\tvar s string\n\t\tfmt.Scanf(\"%s\", &s)\n\t\ta = append(a, decode(s))\n\t}\n\n\tbuf := make([][]byte, len(a))\n\n\tfor i := 0; i < h; i++ {\n\t\tbuf[i] = make([]byte, len(a[i]))\n\t}\n\tchecked := make([][]byte, len(a))\n\n\tfor i := 0; i < h; i++ {\n\t\tchecked[i] = make([]byte, len(a[i]))\n\t}\n\n\tif checkFullMatrix(a, checked) {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tcnt := 0\n\tfor {\n\t\tgenMask(a, buf, checked)\n\t\tcnt++\n\t\tif checkFullMatrix(buf, checked) {\n\t\t\tfmt.Println(cnt)\n\t\t\treturn\n\t\t}\n\t\t//orMatrix(a, buf)\n\t\ta, buf = buf, a\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "sample_input": "3 3\n...\n.#.\n...\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03053", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1843, "cpu_time_ms": 1060, "memory_kb": 4864}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s358058753", "group_id": "codeNet:p03053", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"sync\"\n\t\"unsafe\"\n)\n\nconst p = 1000\n\nvar semaphore = make(chan bool, p)\n\nfunc decode(s string) []byte {\n\ts = strings.Replace(s, \"#\", \"1\", -1)\n\ts = strings.Replace(s, \".\", \"0\", -1)\n\tvec := *(*[]byte)(unsafe.Pointer(&s))\n\n\tfor i := range vec {\n\t\tvec[i] -= '0'\n\t}\n\treturn vec\n}\n\nfunc orVec(op0, op1 []byte) {\n\tfor i := range op0 {\n\t\top0[i] |= op1[i]\n\t}\n}\n\nfunc orMatrix(op0, op1 [][]byte) {\n\tvar wg sync.WaitGroup\n\n\tfor i := range op0 {\n\t\twg.Add(1)\n\t\tsemaphore <- true\n\t\tgo func(op0 []byte, op1 []byte, wg *sync.WaitGroup) {\n\t\t\tdefer func() {\n\t\t\t\twg.Done()\n\t\t\t\t<-semaphore\n\t\t\t}()\n\t\t\torVec(op0, op1)\n\t\t}(op0[i], op1[i], &wg)\n\t}\n\twg.Wait()\n}\n\nfunc checkFullVec(b []byte) bool {\n\tfor _, v := range b {\n\t\tif v == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc checkFullMatrix(d [][]byte) bool {\n\tfor _, v := range d {\n\t\tif !checkFullVec(v) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc genMask(op0, op1 [][]byte) {\n\tvar wg sync.WaitGroup\n\tfor h := range op0 {\n\t\twg.Add(1)\n\t\tsemaphore <- true\n\t\tgo func(h int, wg *sync.WaitGroup) {\n\t\t\tfunc() {\n\t\t\t\twg.Done()\n\t\t\t\t<-semaphore\n\t\t\t}()\n\n\t\t\tfor w, v := range op0[h] {\n\t\t\t\tif v == 1 {\n\t\t\t\t\top1[h][w] = 1\n\t\t\t\t\tif h != 0 {\n\t\t\t\t\t\top1[h-1][w] = 1\n\t\t\t\t\t}\n\t\t\t\t\tif w != 0 {\n\t\t\t\t\t\top1[h][w-1] = 1\n\t\t\t\t\t}\n\t\t\t\t\tif h != len(op0)-1 {\n\t\t\t\t\t\top1[h+1][w] = 1\n\t\t\t\t\t}\n\t\t\t\t\tif w != len(op0[h])-1 {\n\t\t\t\t\t\top1[h][w+1] = 1\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}(h, &wg)\n\n\t}\n\twg.Wait()\n}\n\nfunc main() {\n\tvar h, w int\n\n\tfmt.Scanf(\"%d%d\", &h, &w)\n\n\ta := [][]byte{}\n\tfor i := 0; i < h; i++ {\n\t\tvar s string\n\t\tfmt.Scanf(\"%s\", &s)\n\t\ta = append(a, decode(s))\n\t}\n\n\tbuf := make([][]byte, len(a))\n\n\tfor i := 0; i < h; i++ {\n\t\tbuf[i] = make([]byte, len(a[i]))\n\t}\n\n\tif checkFullMatrix(a) {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tcnt := 0\n\tfor {\n\t\tgenMask(a, buf)\n\t\tcnt++\n\t\tif checkFullMatrix(buf) {\n\t\t\tfmt.Println(cnt)\n\t\t\treturn\n\t\t}\n\t\t//orMatrix(a, buf)\n\t\ta, buf = buf, a\n\t}\n}\n", "language": "Go", "metadata": {"date": 1557061660, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03053.html", "problem_id": "p03053", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03053/input.txt", "sample_output_relpath": "derived/input_output/data/p03053/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03053/Go/s358058753.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s358058753", "user_id": "u458583578"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"sync\"\n\t\"unsafe\"\n)\n\nconst p = 1000\n\nvar semaphore = make(chan bool, p)\n\nfunc decode(s string) []byte {\n\ts = strings.Replace(s, \"#\", \"1\", -1)\n\ts = strings.Replace(s, \".\", \"0\", -1)\n\tvec := *(*[]byte)(unsafe.Pointer(&s))\n\n\tfor i := range vec {\n\t\tvec[i] -= '0'\n\t}\n\treturn vec\n}\n\nfunc orVec(op0, op1 []byte) {\n\tfor i := range op0 {\n\t\top0[i] |= op1[i]\n\t}\n}\n\nfunc orMatrix(op0, op1 [][]byte) {\n\tvar wg sync.WaitGroup\n\n\tfor i := range op0 {\n\t\twg.Add(1)\n\t\tsemaphore <- true\n\t\tgo func(op0 []byte, op1 []byte, wg *sync.WaitGroup) {\n\t\t\tdefer func() {\n\t\t\t\twg.Done()\n\t\t\t\t<-semaphore\n\t\t\t}()\n\t\t\torVec(op0, op1)\n\t\t}(op0[i], op1[i], &wg)\n\t}\n\twg.Wait()\n}\n\nfunc checkFullVec(b []byte) bool {\n\tfor _, v := range b {\n\t\tif v == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc checkFullMatrix(d [][]byte) bool {\n\tfor _, v := range d {\n\t\tif !checkFullVec(v) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc genMask(op0, op1 [][]byte) {\n\tvar wg sync.WaitGroup\n\tfor h := range op0 {\n\t\twg.Add(1)\n\t\tsemaphore <- true\n\t\tgo func(h int, wg *sync.WaitGroup) {\n\t\t\tfunc() {\n\t\t\t\twg.Done()\n\t\t\t\t<-semaphore\n\t\t\t}()\n\n\t\t\tfor w, v := range op0[h] {\n\t\t\t\tif v == 1 {\n\t\t\t\t\top1[h][w] = 1\n\t\t\t\t\tif h != 0 {\n\t\t\t\t\t\top1[h-1][w] = 1\n\t\t\t\t\t}\n\t\t\t\t\tif w != 0 {\n\t\t\t\t\t\top1[h][w-1] = 1\n\t\t\t\t\t}\n\t\t\t\t\tif h != len(op0)-1 {\n\t\t\t\t\t\top1[h+1][w] = 1\n\t\t\t\t\t}\n\t\t\t\t\tif w != len(op0[h])-1 {\n\t\t\t\t\t\top1[h][w+1] = 1\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}(h, &wg)\n\n\t}\n\twg.Wait()\n}\n\nfunc main() {\n\tvar h, w int\n\n\tfmt.Scanf(\"%d%d\", &h, &w)\n\n\ta := [][]byte{}\n\tfor i := 0; i < h; i++ {\n\t\tvar s string\n\t\tfmt.Scanf(\"%s\", &s)\n\t\ta = append(a, decode(s))\n\t}\n\n\tbuf := make([][]byte, len(a))\n\n\tfor i := 0; i < h; i++ {\n\t\tbuf[i] = make([]byte, len(a[i]))\n\t}\n\n\tif checkFullMatrix(a) {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tcnt := 0\n\tfor {\n\t\tgenMask(a, buf)\n\t\tcnt++\n\t\tif checkFullMatrix(buf) {\n\t\t\tfmt.Println(cnt)\n\t\t\treturn\n\t\t}\n\t\t//orMatrix(a, buf)\n\t\ta, buf = buf, a\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "sample_input": "3 3\n...\n.#.\n...\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03053", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1060, "memory_kb": 7424}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s647359841", "group_id": "codeNet:p03053", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"unsafe\"\n)\n\nfunc decode(s string) []byte {\n\ts = strings.Replace(s, \"#\", \"1\", -1)\n\ts = strings.Replace(s, \".\", \"0\", -1)\n\tvec := *(*[]byte)(unsafe.Pointer(&s))\n\n\tfor i := range vec {\n\t\tvec[i] -= '0'\n\t}\n\treturn vec\n}\n\nfunc orVec(op0, op1 []byte) {\n\tfor i := range op0 {\n\t\top0[i] |= op1[i]\n\t}\n}\n\nfunc orMatrix(op0, op1 [][]byte) {\n\tfor i := range op0 {\n\t\torVec(op0[i], op1[i])\n\t}\n}\n\nfunc checkFullVec(b []byte) bool {\n\tfor _, v := range b {\n\t\tif v == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc checkFullMatrix(d [][]byte) bool {\n\tfor _, v := range d {\n\t\tif !checkFullVec(v) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc genMask(op0, op1 [][]byte) {\n\tfor h := range op0 {\n\t\tfor w, v := range op0[h] {\n\t\t\tif v == 1 {\n\t\t\t\top1[h][w] = 1\n\t\t\t\tif h != 0 {\n\t\t\t\t\top1[h-1][w] = 1\n\t\t\t\t}\n\t\t\t\tif w != 0 {\n\t\t\t\t\top1[h][w-1] = 1\n\t\t\t\t}\n\t\t\t\tif h != len(op0)-1 {\n\t\t\t\t\top1[h+1][w] = 1\n\t\t\t\t}\n\t\t\t\tif w != len(op0[h])-1 {\n\t\t\t\t\top1[h][w+1] = 1\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc main() {\n\tvar h, w int\n\n\tfmt.Scanf(\"%d%d\", &h, &w)\n\n\ta := [][]byte{}\n\tfor i := 0; i < h; i++ {\n\t\tvar s string\n\t\tfmt.Scanf(\"%s\", &s)\n\t\ta = append(a, decode(s))\n\t}\n\n\tbuf := make([][]byte, len(a))\n\n\tfor i := 0; i < h; i++ {\n\t\tbuf[i] = make([]byte, len(a[i]))\n\t}\n\n\tif checkFullMatrix(a) {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tcnt := 0\n\tfor {\n\t\tgenMask(a, buf)\n\t\tcnt++\n\t\tif checkFullMatrix(buf) {\n\t\t\tfmt.Println(cnt)\n\t\t\treturn\n\t\t}\n\t\torMatrix(a, buf)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1557059876, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03053.html", "problem_id": "p03053", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03053/input.txt", "sample_output_relpath": "derived/input_output/data/p03053/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03053/Go/s647359841.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s647359841", "user_id": "u458583578"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\t\"unsafe\"\n)\n\nfunc decode(s string) []byte {\n\ts = strings.Replace(s, \"#\", \"1\", -1)\n\ts = strings.Replace(s, \".\", \"0\", -1)\n\tvec := *(*[]byte)(unsafe.Pointer(&s))\n\n\tfor i := range vec {\n\t\tvec[i] -= '0'\n\t}\n\treturn vec\n}\n\nfunc orVec(op0, op1 []byte) {\n\tfor i := range op0 {\n\t\top0[i] |= op1[i]\n\t}\n}\n\nfunc orMatrix(op0, op1 [][]byte) {\n\tfor i := range op0 {\n\t\torVec(op0[i], op1[i])\n\t}\n}\n\nfunc checkFullVec(b []byte) bool {\n\tfor _, v := range b {\n\t\tif v == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc checkFullMatrix(d [][]byte) bool {\n\tfor _, v := range d {\n\t\tif !checkFullVec(v) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\nfunc genMask(op0, op1 [][]byte) {\n\tfor h := range op0 {\n\t\tfor w, v := range op0[h] {\n\t\t\tif v == 1 {\n\t\t\t\top1[h][w] = 1\n\t\t\t\tif h != 0 {\n\t\t\t\t\top1[h-1][w] = 1\n\t\t\t\t}\n\t\t\t\tif w != 0 {\n\t\t\t\t\top1[h][w-1] = 1\n\t\t\t\t}\n\t\t\t\tif h != len(op0)-1 {\n\t\t\t\t\top1[h+1][w] = 1\n\t\t\t\t}\n\t\t\t\tif w != len(op0[h])-1 {\n\t\t\t\t\top1[h][w+1] = 1\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc main() {\n\tvar h, w int\n\n\tfmt.Scanf(\"%d%d\", &h, &w)\n\n\ta := [][]byte{}\n\tfor i := 0; i < h; i++ {\n\t\tvar s string\n\t\tfmt.Scanf(\"%s\", &s)\n\t\ta = append(a, decode(s))\n\t}\n\n\tbuf := make([][]byte, len(a))\n\n\tfor i := 0; i < h; i++ {\n\t\tbuf[i] = make([]byte, len(a[i]))\n\t}\n\n\tif checkFullMatrix(a) {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\n\tcnt := 0\n\tfor {\n\t\tgenMask(a, buf)\n\t\tcnt++\n\t\tif checkFullMatrix(buf) {\n\t\t\tfmt.Println(cnt)\n\t\t\treturn\n\t\t}\n\t\torMatrix(a, buf)\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "sample_input": "3 3\n...\n.#.\n...\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03053", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1433, "cpu_time_ms": 1059, "memory_kb": 4864}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s175787535", "group_id": "codeNet:p03053", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\ntype xydata struct {\n\tx int\n\ty int\n}\n\nfunc main() {\n\tmatrix := input()\n\t//fmt.Print(len(matrix))\n\n\tcount := 0\n\tfor {\n\t\tif true == check(matrix) {\n\t\t\tbreak\n\t\t}\n\t\tXYdata := getxydate(matrix)\n\t\tmatrix = update(matrix, XYdata)\n\t\tcount++\n\t\tif count > 20 {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(count)\n}\n\nfunc check(matrix [][]string) bool {\n\tfor x := 0; x < len(matrix); x++ {\n\t\tfor y := 0; y < len(matrix[0]); y++ {\n\t\t\tif matrix[x][y] == \".\" {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\treturn true\n}\n\nfunc update(matrix [][]string, inXYdata []xydata) [][]string {\n\tfor i := 0; i < len(inXYdata); i++ {\n\t\tif (inXYdata[i].x - 1) >= 0 {\n\t\t\tmatrix[inXYdata[i].x-1][inXYdata[i].y] = \"#\"\n\t\t}\n\t\tif (inXYdata[i].x + 1) < len(matrix) {\n\t\t\tmatrix[inXYdata[i].x+1][inXYdata[i].y] = \"#\"\n\t\t}\n\t\tif (inXYdata[i].y - 1) >= 0 {\n\t\t\tmatrix[inXYdata[i].x][inXYdata[i].y-1] = \"#\"\n\t\t}\n\t\tif (inXYdata[i].y + 1) < len(matrix) {\n\t\t\tmatrix[inXYdata[i].x][inXYdata[i].y+1] = \"#\"\n\t\t}\n\t}\n\t/*\n\t\tfor x := 0; x < len(matrix); x++ {\n\t\t\tfor y := 0; y < len(matrix[0]); y++ {\n\t\t\t\tfmt.Printf(\"%s\", matrix[x][y])\n\t\t\t}\n\t\t\tfmt.Println()\n\t\t}\n\t*/\n\treturn matrix\n}\n\nfunc getxydate(matrix [][]string) []xydata {\n\tvar resXYdata []xydata\n\tfor x := 0; x < len(matrix); x++ {\n\t\tfor y := 0; y < len(matrix[0]); y++ {\n\t\t\tif matrix[x][y] == \"#\" {\n\t\t\t\tresXYdata = append(resXYdata, xydata{x, y})\n\t\t\t}\n\t\t}\n\t}\n\treturn resXYdata\n}\n\nfunc input() [][]string {\n\tvar (\n\t\ti, j int\n\t)\n\tfmt.Scan(&i)\n\tfmt.Scan(&j)\n\tmatrix := make([][]string, i)\n\tfor k := 0; k < j; k++ {\n\t\tmatrix[k] = make([]string, j)\n\t}\n\n\tvar str string\n\tfor x := 0; x < i; x++ {\n\t\tfmt.Scan(&str)\n\t\tr := []rune(str)\n\t\tfor y := 0; y < j; y++ {\n\t\t\tmatrix[x][y] = string(r[y])\n\t\t}\n\t}\n\t/*\n\t\tfor x := 0; x < i; x++ {\n\t\t\tfor y := 0; y < j; y++ {\n\t\t\t\tfmt.Printf(\"%s\", matrix[x][y])\n\t\t\t}\n\t\t\tfmt.Println()\n\t\t}\n\t*/\n\treturn matrix\n}\n", "language": "Go", "metadata": {"date": 1557025327, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03053.html", "problem_id": "p03053", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03053/input.txt", "sample_output_relpath": "derived/input_output/data/p03053/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03053/Go/s175787535.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s175787535", "user_id": "u393550875"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\ntype xydata struct {\n\tx int\n\ty int\n}\n\nfunc main() {\n\tmatrix := input()\n\t//fmt.Print(len(matrix))\n\n\tcount := 0\n\tfor {\n\t\tif true == check(matrix) {\n\t\t\tbreak\n\t\t}\n\t\tXYdata := getxydate(matrix)\n\t\tmatrix = update(matrix, XYdata)\n\t\tcount++\n\t\tif count > 20 {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(count)\n}\n\nfunc check(matrix [][]string) bool {\n\tfor x := 0; x < len(matrix); x++ {\n\t\tfor y := 0; y < len(matrix[0]); y++ {\n\t\t\tif matrix[x][y] == \".\" {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\treturn true\n}\n\nfunc update(matrix [][]string, inXYdata []xydata) [][]string {\n\tfor i := 0; i < len(inXYdata); i++ {\n\t\tif (inXYdata[i].x - 1) >= 0 {\n\t\t\tmatrix[inXYdata[i].x-1][inXYdata[i].y] = \"#\"\n\t\t}\n\t\tif (inXYdata[i].x + 1) < len(matrix) {\n\t\t\tmatrix[inXYdata[i].x+1][inXYdata[i].y] = \"#\"\n\t\t}\n\t\tif (inXYdata[i].y - 1) >= 0 {\n\t\t\tmatrix[inXYdata[i].x][inXYdata[i].y-1] = \"#\"\n\t\t}\n\t\tif (inXYdata[i].y + 1) < len(matrix) {\n\t\t\tmatrix[inXYdata[i].x][inXYdata[i].y+1] = \"#\"\n\t\t}\n\t}\n\t/*\n\t\tfor x := 0; x < len(matrix); x++ {\n\t\t\tfor y := 0; y < len(matrix[0]); y++ {\n\t\t\t\tfmt.Printf(\"%s\", matrix[x][y])\n\t\t\t}\n\t\t\tfmt.Println()\n\t\t}\n\t*/\n\treturn matrix\n}\n\nfunc getxydate(matrix [][]string) []xydata {\n\tvar resXYdata []xydata\n\tfor x := 0; x < len(matrix); x++ {\n\t\tfor y := 0; y < len(matrix[0]); y++ {\n\t\t\tif matrix[x][y] == \"#\" {\n\t\t\t\tresXYdata = append(resXYdata, xydata{x, y})\n\t\t\t}\n\t\t}\n\t}\n\treturn resXYdata\n}\n\nfunc input() [][]string {\n\tvar (\n\t\ti, j int\n\t)\n\tfmt.Scan(&i)\n\tfmt.Scan(&j)\n\tmatrix := make([][]string, i)\n\tfor k := 0; k < j; k++ {\n\t\tmatrix[k] = make([]string, j)\n\t}\n\n\tvar str string\n\tfor x := 0; x < i; x++ {\n\t\tfmt.Scan(&str)\n\t\tr := []rune(str)\n\t\tfor y := 0; y < j; y++ {\n\t\t\tmatrix[x][y] = string(r[y])\n\t\t}\n\t}\n\t/*\n\t\tfor x := 0; x < i; x++ {\n\t\t\tfor y := 0; y < j; y++ {\n\t\t\t\tfmt.Printf(\"%s\", matrix[x][y])\n\t\t\t}\n\t\t\tfmt.Println()\n\t\t}\n\t*/\n\treturn matrix\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "sample_input": "3 3\n...\n.#.\n...\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03053", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1838, "cpu_time_ms": 815, "memory_kb": 28412}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s643669641", "group_id": "codeNet:p03053", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar H, W int\nvar s string\nvar max int\nvar dir = [4][2]int{{1, 0}, {0, 1}, {-1, 0}, {0, -1}}\n\nfunc Min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc Max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc Abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc contains(s [][2]int, e [2]int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc bfs(h, w int, field [][]bool) int {\n\tmin := 1\n\tnow := [][2]int{{h, w}}\n\tvar nextNow [][2]int\n\tvisited := [][2]int{{h, w}}\nL:\n\tfor {\n\t\tfor _, n := range now {\n\t\t\tfor _, d := range dir {\n\t\t\t\tnext := [2]int{n[0] + d[0], n[1] + d[1]}\n\t\t\t\tif 0 <= next[0] && next[0] <= H-1 && 0 <= next[1] && next[1] <= W-1 {\n\t\t\t\t\tif !contains(visited, next) {\n\t\t\t\t\t\tif field[next[0]][next[1]] {\n\t\t\t\t\t\t\tbreak L\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvisited = append(visited, next)\n\t\t\t\t\t\tnextNow = append(nextNow, next)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tnow = nextNow\n\t\tnextNow = [][2]int{{}}\n\t\tmin++\n\t}\n\treturn min\n}\n\nfunc main() {\n\tfmt.Scan(&H, &W)\n\tvar field [][]bool\n\tfield = make([][]bool, H)\n\tfor h := 0; h < H; h++ {\n\t\tfield[h] = make([]bool, W)\n\t\tfmt.Scan(&s)\n\t\tfor w := 0; w < W; w++ {\n\t\t\tif s[w] == '#' {\n\t\t\t\tfield[h][w] = true\n\t\t\t}\n\t\t}\n\t}\n\tfor h := 0; h < H; h++ {\n\t\tfor w := 0; w < W; w++ {\n\t\t\tif !field[h][w] {\n\t\t\t\tmax = Max(max, bfs(h, w, field))\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(max)\n}\n", "language": "Go", "metadata": {"date": 1557024155, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03053.html", "problem_id": "p03053", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03053/input.txt", "sample_output_relpath": "derived/input_output/data/p03053/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03053/Go/s643669641.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s643669641", "user_id": "u884692162"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar H, W int\nvar s string\nvar max int\nvar dir = [4][2]int{{1, 0}, {0, 1}, {-1, 0}, {0, -1}}\n\nfunc Min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc Max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc Abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc contains(s [][2]int, e [2]int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc bfs(h, w int, field [][]bool) int {\n\tmin := 1\n\tnow := [][2]int{{h, w}}\n\tvar nextNow [][2]int\n\tvisited := [][2]int{{h, w}}\nL:\n\tfor {\n\t\tfor _, n := range now {\n\t\t\tfor _, d := range dir {\n\t\t\t\tnext := [2]int{n[0] + d[0], n[1] + d[1]}\n\t\t\t\tif 0 <= next[0] && next[0] <= H-1 && 0 <= next[1] && next[1] <= W-1 {\n\t\t\t\t\tif !contains(visited, next) {\n\t\t\t\t\t\tif field[next[0]][next[1]] {\n\t\t\t\t\t\t\tbreak L\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvisited = append(visited, next)\n\t\t\t\t\t\tnextNow = append(nextNow, next)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tnow = nextNow\n\t\tnextNow = [][2]int{{}}\n\t\tmin++\n\t}\n\treturn min\n}\n\nfunc main() {\n\tfmt.Scan(&H, &W)\n\tvar field [][]bool\n\tfield = make([][]bool, H)\n\tfor h := 0; h < H; h++ {\n\t\tfield[h] = make([]bool, W)\n\t\tfmt.Scan(&s)\n\t\tfor w := 0; w < W; w++ {\n\t\t\tif s[w] == '#' {\n\t\t\t\tfield[h][w] = true\n\t\t\t}\n\t\t}\n\t}\n\tfor h := 0; h < H; h++ {\n\t\tfor w := 0; w < W; w++ {\n\t\t\tif !field[h][w] {\n\t\t\t\tmax = Max(max, bfs(h, w, field))\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(max)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "sample_input": "3 3\n...\n.#.\n...\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03053", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1376, "cpu_time_ms": 1060, "memory_kb": 6656}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s020444751", "group_id": "codeNet:p03053", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar H, W int\nvar s string\nvar dirs = [][]int{{1, 0}, {0, 1}, {-1, 0}, {0, -1}}\n\nfunc check(field [][]bool) bool {\n\tfor h := 0; h < H; h++ {\n\t\tfor _, x := range field[h] {\n\t\t\tif !x {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}\n\nfunc main() {\n\tfmt.Scan(&H, &W)\n\tvar field, new_field [][]bool\n\tfield = make([][]bool, H)\n\tnew_field = make([][]bool, H)\n\tfor h := 0; h < H; h++ {\n\t\tfield[h] = make([]bool, W)\n\t\tnew_field[h] = make([]bool, W)\n\t\tfmt.Scan(&s)\n\t\tfor w := 0; w < W; w++ {\t\t\n\t\t\tif s[w] == '#' {\n\t\t\t\tfield[h][w] = true\n\t\t\t\tnew_field[h][w] = true\n\t\t\t}\n\t\t}\n\t}\n\tcount := 0\n\tfor check(field) {\n\t\tfor h, f := range field {\n\t\t\tfor w, ff := range f {\n\t\t\t\tif ff {\n\t\t\t\t\tfor _, d := range dirs {\n\t\t\t\t\t\tt := h + d[0]\n\t\t\t\t\t\ty := w + d[1]\n\t\t\t\t\t\tif 0 <= t && t <= H-1 && 0 <= y && y <= W-1 {\n\t\t\t\t\t\t\tnew_field[t][y] = true\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcount++\n\t\tcopy(new_field, field)\n\t}\n\tfmt.Println(count)\n}\n", "language": "Go", "metadata": {"date": 1557021444, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03053.html", "problem_id": "p03053", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03053/input.txt", "sample_output_relpath": "derived/input_output/data/p03053/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03053/Go/s020444751.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s020444751", "user_id": "u884692162"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nvar H, W int\nvar s string\nvar dirs = [][]int{{1, 0}, {0, 1}, {-1, 0}, {0, -1}}\n\nfunc check(field [][]bool) bool {\n\tfor h := 0; h < H; h++ {\n\t\tfor _, x := range field[h] {\n\t\t\tif !x {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}\n\nfunc main() {\n\tfmt.Scan(&H, &W)\n\tvar field, new_field [][]bool\n\tfield = make([][]bool, H)\n\tnew_field = make([][]bool, H)\n\tfor h := 0; h < H; h++ {\n\t\tfield[h] = make([]bool, W)\n\t\tnew_field[h] = make([]bool, W)\n\t\tfmt.Scan(&s)\n\t\tfor w := 0; w < W; w++ {\t\t\n\t\t\tif s[w] == '#' {\n\t\t\t\tfield[h][w] = true\n\t\t\t\tnew_field[h][w] = true\n\t\t\t}\n\t\t}\n\t}\n\tcount := 0\n\tfor check(field) {\n\t\tfor h, f := range field {\n\t\t\tfor w, ff := range f {\n\t\t\t\tif ff {\n\t\t\t\t\tfor _, d := range dirs {\n\t\t\t\t\t\tt := h + d[0]\n\t\t\t\t\t\ty := w + d[1]\n\t\t\t\t\t\tif 0 <= t && t <= H-1 && 0 <= y && y <= W-1 {\n\t\t\t\t\t\t\tnew_field[t][y] = true\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcount++\n\t\tcopy(new_field, field)\n\t}\n\tfmt.Println(count)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "sample_input": "3 3\n...\n.#.\n...\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03053", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 935, "cpu_time_ms": 1059, "memory_kb": 3712}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s617375736", "group_id": "codeNet:p03053", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tH := nextInt()\n\tW := nextInt()\n\tA := make([][]byte, H)\n\tfor i := 0; i < H; i++ {\n\t\tA[i] = nextBytes()\n\t}\n\tvar cnt int\n\tadd := make([]pair, 0)\n\tbfs := make([]pair, 0)\n\tfor i := 0; i < H; i++ {\n\t\tfor j := 0; j < W; j++ {\n\t\t\tif A[i][j] == '#' {\n\t\t\t\tadd = append(add, pair{i, j})\n\t\t\t}\n\t\t}\n\t}\n\tfor len(add) > 0 {\n\t\tbfs = make([]pair, len(add))\n\t\tfor i := 0; i < len(add); i++ {\n\t\t\tbfs[i] = add[i]\n\t\t}\n\t\tadd = make([]pair, 0)\n\t\tfor len(bfs) > 0 {\n\t\t\tnext := bfs[0]\n\t\t\tbfs = bfs[1:]\n\t\t\tfor d := 0; d < 8; d += 2 {\n\t\t\t\tny := next.a + dy[d]\n\t\t\t\tnx := next.b + dx[d]\n\t\t\t\tif ny < 0 || ny >= H || nx < 0 || nx >= W {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif A[ny][nx] == '.' {\n\t\t\t\t\tadd = append(add, pair{ny, nx})\n\t\t\t\t\tA[ny][nx] = '#'\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif len(add) > 0 {\n\t\t\tcnt++\n\t\t\t// log.Println(\"------\", cnt)\n\t\t\t// for i := 0; i < H; i++ {\n\t\t\t// \tlog.Println(string(A[i]))\n\t\t\t// }\n\t\t}\n\t}\n\tfmt.Println(cnt)\n}\n\nvar dy = []int{1, 1, 0, -1, -1, -1, 0, 1}\nvar dx = []int{0, 1, 1, 1, 0, -1, -1, -1}\nvar inf = int(1e9)\n\nfunc pow(a, b int) int {\n\treturn int(math.Pow(float64(a), float64(b)))\n}\n\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\ntype pair struct {\n\ta, b int\n}\n\ntype pairs []pair\n\nfunc (p pairs) Len() int {\n\treturn len(p)\n}\nfunc (p pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p pairs) Less(i, j int) bool {\n\tif p[i].a == p[j].a {\n\t\treturn p[i].b < p[j].b\n\t}\n\treturn p[i].a < p[j].a\n}\n\nvar nextReader func() []byte\n\nfunc init() {\n\tnextReader = newScanner()\n\tlog.SetFlags(log.Lshortfile)\n}\n\nfunc newScanner() func() []byte {\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\treturn func() []byte {\n\t\tr.Scan()\n\t\treturn r.Bytes()\n\t}\n}\nfunc nextBytes() []byte {\n\treturn nextReader()\n}\n\nfunc nextString() string {\n\treturn string(nextReader())\n}\nfunc nextInt64() int64 {\n\tv, _ := strconv.ParseInt(string(nextReader()), 10, 64)\n\treturn v\n}\nfunc nextInt() int {\n\tv, _ := strconv.Atoi(string(nextReader()))\n\treturn v\n}\nfunc nextInts(n int) []int {\n\tr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt()\n\t}\n\treturn r\n}\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(string(nextReader()), 64)\n\treturn f\n}\n", "language": "Go", "metadata": {"date": 1557020507, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03053.html", "problem_id": "p03053", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03053/input.txt", "sample_output_relpath": "derived/input_output/data/p03053/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03053/Go/s617375736.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s617375736", "user_id": "u696272993"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tH := nextInt()\n\tW := nextInt()\n\tA := make([][]byte, H)\n\tfor i := 0; i < H; i++ {\n\t\tA[i] = nextBytes()\n\t}\n\tvar cnt int\n\tadd := make([]pair, 0)\n\tbfs := make([]pair, 0)\n\tfor i := 0; i < H; i++ {\n\t\tfor j := 0; j < W; j++ {\n\t\t\tif A[i][j] == '#' {\n\t\t\t\tadd = append(add, pair{i, j})\n\t\t\t}\n\t\t}\n\t}\n\tfor len(add) > 0 {\n\t\tbfs = make([]pair, len(add))\n\t\tfor i := 0; i < len(add); i++ {\n\t\t\tbfs[i] = add[i]\n\t\t}\n\t\tadd = make([]pair, 0)\n\t\tfor len(bfs) > 0 {\n\t\t\tnext := bfs[0]\n\t\t\tbfs = bfs[1:]\n\t\t\tfor d := 0; d < 8; d += 2 {\n\t\t\t\tny := next.a + dy[d]\n\t\t\t\tnx := next.b + dx[d]\n\t\t\t\tif ny < 0 || ny >= H || nx < 0 || nx >= W {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif A[ny][nx] == '.' {\n\t\t\t\t\tadd = append(add, pair{ny, nx})\n\t\t\t\t\tA[ny][nx] = '#'\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif len(add) > 0 {\n\t\t\tcnt++\n\t\t\t// log.Println(\"------\", cnt)\n\t\t\t// for i := 0; i < H; i++ {\n\t\t\t// \tlog.Println(string(A[i]))\n\t\t\t// }\n\t\t}\n\t}\n\tfmt.Println(cnt)\n}\n\nvar dy = []int{1, 1, 0, -1, -1, -1, 0, 1}\nvar dx = []int{0, 1, 1, 1, 0, -1, -1, -1}\nvar inf = int(1e9)\n\nfunc pow(a, b int) int {\n\treturn int(math.Pow(float64(a), float64(b)))\n}\n\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\ntype pair struct {\n\ta, b int\n}\n\ntype pairs []pair\n\nfunc (p pairs) Len() int {\n\treturn len(p)\n}\nfunc (p pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p pairs) Less(i, j int) bool {\n\tif p[i].a == p[j].a {\n\t\treturn p[i].b < p[j].b\n\t}\n\treturn p[i].a < p[j].a\n}\n\nvar nextReader func() []byte\n\nfunc init() {\n\tnextReader = newScanner()\n\tlog.SetFlags(log.Lshortfile)\n}\n\nfunc newScanner() func() []byte {\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\treturn func() []byte {\n\t\tr.Scan()\n\t\treturn r.Bytes()\n\t}\n}\nfunc nextBytes() []byte {\n\treturn nextReader()\n}\n\nfunc nextString() string {\n\treturn string(nextReader())\n}\nfunc nextInt64() int64 {\n\tv, _ := strconv.ParseInt(string(nextReader()), 10, 64)\n\treturn v\n}\nfunc nextInt() int {\n\tv, _ := strconv.Atoi(string(nextReader()))\n\treturn v\n}\nfunc nextInts(n int) []int {\n\tr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt()\n\t}\n\treturn r\n}\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(string(nextReader()), 64)\n\treturn f\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "sample_input": "3 3\n...\n.#.\n...\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03053", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2721, "cpu_time_ms": 71, "memory_kb": 63616}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s889610025", "group_id": "codeNet:p03053", "input_text": "package main\n\nimport \"fmt\"\n\ntype rect struct {\n\th int\n\tw int\n}\n\nfunc main() {\n\tvar h, w int\n\tfmt.Scan(&h, &w)\n\tbr := make([][]bool, h)\n\tfor i := range br {\n\t\tbr[i] = make([]bool, w)\n\t}\n\tar := make([]rect, 0)\n\tfor i := 0; i < h; i++ {\n\t\tvar s string\n\t\tfmt.Scan(&s)\n\t\tfor j, v := range s {\n\t\t\tif v == '#' {\n\t\t\t\tbr[i][j] = true\n\t\t\t\tar = append(ar, rect{h: i, w: j})\n\t\t\t}\n\t\t}\n\t}\n\tsum := 0\n\tfor {\n\t\ttemp := []rect{}\n\t\tsousa := false\n\t\tfor _, v := range ar {\n\t\t\tif v.h != 0 {\n\t\t\t\tif !br[v.h-1][v.w] {\n\t\t\t\t\tsousa = true\n\t\t\t\t\tbr[v.h-1][v.w] = true\n\t\t\t\t\ttemp = append(temp, rect{h: v.h - 1, w: v.w})\n\t\t\t\t}\n\t\t\t}\n\t\t\tif v.h != h-1 {\n\t\t\t\tif !br[v.h+1][v.w] {\n\t\t\t\t\tsousa = true\n\t\t\t\t\tbr[v.h+1][v.w] = true\n\t\t\t\t\ttemp = append(temp, rect{h: v.h + 1, w: v.w})\n\t\t\t\t}\n\t\t\t}\n\t\t\tif v.w != 0 {\n\t\t\t\tif !br[v.h][v.w-1] {\n\t\t\t\t\tsousa = true\n\t\t\t\t\tbr[v.h][v.w-1] = true\n\t\t\t\t\ttemp = append(temp, rect{h: v.h, w: v.w - 1})\n\t\t\t\t}\n\t\t\t}\n\t\t\tif v.w != w-1 {\n\t\t\t\tif !br[v.h][v.w+1] {\n\t\t\t\t\tsousa = true\n\t\t\t\t\tbr[v.h][v.w+1] = true\n\t\t\t\t\ttemp = append(temp, rect{h: v.h, w: v.w + 1})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif sousa == false {\n\t\t\tfmt.Println(sum)\n\t\t\treturn\n\t\t}\n\t\tsum++\n\t\tar = temp\n\t}\n}\n", "language": "Go", "metadata": {"date": 1557020031, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03053.html", "problem_id": "p03053", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03053/input.txt", "sample_output_relpath": "derived/input_output/data/p03053/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03053/Go/s889610025.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s889610025", "user_id": "u375977529"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\ntype rect struct {\n\th int\n\tw int\n}\n\nfunc main() {\n\tvar h, w int\n\tfmt.Scan(&h, &w)\n\tbr := make([][]bool, h)\n\tfor i := range br {\n\t\tbr[i] = make([]bool, w)\n\t}\n\tar := make([]rect, 0)\n\tfor i := 0; i < h; i++ {\n\t\tvar s string\n\t\tfmt.Scan(&s)\n\t\tfor j, v := range s {\n\t\t\tif v == '#' {\n\t\t\t\tbr[i][j] = true\n\t\t\t\tar = append(ar, rect{h: i, w: j})\n\t\t\t}\n\t\t}\n\t}\n\tsum := 0\n\tfor {\n\t\ttemp := []rect{}\n\t\tsousa := false\n\t\tfor _, v := range ar {\n\t\t\tif v.h != 0 {\n\t\t\t\tif !br[v.h-1][v.w] {\n\t\t\t\t\tsousa = true\n\t\t\t\t\tbr[v.h-1][v.w] = true\n\t\t\t\t\ttemp = append(temp, rect{h: v.h - 1, w: v.w})\n\t\t\t\t}\n\t\t\t}\n\t\t\tif v.h != h-1 {\n\t\t\t\tif !br[v.h+1][v.w] {\n\t\t\t\t\tsousa = true\n\t\t\t\t\tbr[v.h+1][v.w] = true\n\t\t\t\t\ttemp = append(temp, rect{h: v.h + 1, w: v.w})\n\t\t\t\t}\n\t\t\t}\n\t\t\tif v.w != 0 {\n\t\t\t\tif !br[v.h][v.w-1] {\n\t\t\t\t\tsousa = true\n\t\t\t\t\tbr[v.h][v.w-1] = true\n\t\t\t\t\ttemp = append(temp, rect{h: v.h, w: v.w - 1})\n\t\t\t\t}\n\t\t\t}\n\t\t\tif v.w != w-1 {\n\t\t\t\tif !br[v.h][v.w+1] {\n\t\t\t\t\tsousa = true\n\t\t\t\t\tbr[v.h][v.w+1] = true\n\t\t\t\t\ttemp = append(temp, rect{h: v.h, w: v.w + 1})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif sousa == false {\n\t\t\tfmt.Println(sum)\n\t\t\treturn\n\t\t}\n\t\tsum++\n\t\tar = temp\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "sample_input": "3 3\n...\n.#.\n...\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03053", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1138, "cpu_time_ms": 599, "memory_kb": 52992}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s970502802", "group_id": "codeNet:p03053", "input_text": "package main\n\nimport \"fmt\"\n\ntype rect struct {\n\th int\n\tw int\n}\n\nfunc main() {\n\tvar h, w int\n\tfmt.Scan(&h, &w)\n\tbr := make([][]bool, h)\n\tfor i := range br {\n\t\tbr[i] = make([]bool, w)\n\t}\n\tar := make([]rect, 0)\n\tfor i := 0; i < h; i++ {\n\t\tvar s string\n\t\tfmt.Scan(&s)\n\t\tfor j, v := range s {\n\t\t\tif v == '#' {\n\t\t\t\tbr[i][j] = true\n\t\t\t\tar = append(ar, rect{h: i, w: j})\n\t\t\t}\n\t\t}\n\t}\n\tsum := 0\n\ttemp := []rect{}\n\tfor {\n\t\tsousa := false\n\t\tfor _, v := range ar {\n\t\t\tif v.h != 0 {\n\t\t\t\tif !br[v.h-1][v.w] {\n\t\t\t\t\tsousa = true\n\t\t\t\t\tbr[v.h-1][v.w] = true\n\t\t\t\t\ttemp = append(temp, rect{h: v.h - 1, w: v.w})\n\t\t\t\t}\n\t\t\t}\n\t\t\tif v.h != h-1 {\n\t\t\t\tif !br[v.h+1][v.w] {\n\t\t\t\t\tsousa = true\n\t\t\t\t\tbr[v.h+1][v.w] = true\n\t\t\t\t\ttemp = append(temp, rect{h: v.h + 1, w: v.w})\n\t\t\t\t}\n\t\t\t}\n\t\t\tif v.w != 0 {\n\t\t\t\tif !br[v.h][v.w-1] {\n\t\t\t\t\tsousa = true\n\t\t\t\t\tbr[v.h][v.w-1] = true\n\t\t\t\t\ttemp = append(temp, rect{h: v.h, w: v.w - 1})\n\t\t\t\t}\n\t\t\t}\n\t\t\tif v.w != w-1 {\n\t\t\t\tif !br[v.h][v.w+1] {\n\t\t\t\t\tsousa = true\n\t\t\t\t\tbr[v.h][v.w+1] = true\n\t\t\t\t\ttemp = append(temp, rect{h: v.h, w: v.w + 1})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif sousa == false {\n\t\t\tfmt.Println(sum)\n\t\t\treturn\n\t\t}\n\t\tsum++\n\t\tar = temp\n\t}\n}\n", "language": "Go", "metadata": {"date": 1557019692, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03053.html", "problem_id": "p03053", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03053/input.txt", "sample_output_relpath": "derived/input_output/data/p03053/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03053/Go/s970502802.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s970502802", "user_id": "u375977529"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\ntype rect struct {\n\th int\n\tw int\n}\n\nfunc main() {\n\tvar h, w int\n\tfmt.Scan(&h, &w)\n\tbr := make([][]bool, h)\n\tfor i := range br {\n\t\tbr[i] = make([]bool, w)\n\t}\n\tar := make([]rect, 0)\n\tfor i := 0; i < h; i++ {\n\t\tvar s string\n\t\tfmt.Scan(&s)\n\t\tfor j, v := range s {\n\t\t\tif v == '#' {\n\t\t\t\tbr[i][j] = true\n\t\t\t\tar = append(ar, rect{h: i, w: j})\n\t\t\t}\n\t\t}\n\t}\n\tsum := 0\n\ttemp := []rect{}\n\tfor {\n\t\tsousa := false\n\t\tfor _, v := range ar {\n\t\t\tif v.h != 0 {\n\t\t\t\tif !br[v.h-1][v.w] {\n\t\t\t\t\tsousa = true\n\t\t\t\t\tbr[v.h-1][v.w] = true\n\t\t\t\t\ttemp = append(temp, rect{h: v.h - 1, w: v.w})\n\t\t\t\t}\n\t\t\t}\n\t\t\tif v.h != h-1 {\n\t\t\t\tif !br[v.h+1][v.w] {\n\t\t\t\t\tsousa = true\n\t\t\t\t\tbr[v.h+1][v.w] = true\n\t\t\t\t\ttemp = append(temp, rect{h: v.h + 1, w: v.w})\n\t\t\t\t}\n\t\t\t}\n\t\t\tif v.w != 0 {\n\t\t\t\tif !br[v.h][v.w-1] {\n\t\t\t\t\tsousa = true\n\t\t\t\t\tbr[v.h][v.w-1] = true\n\t\t\t\t\ttemp = append(temp, rect{h: v.h, w: v.w - 1})\n\t\t\t\t}\n\t\t\t}\n\t\t\tif v.w != w-1 {\n\t\t\t\tif !br[v.h][v.w+1] {\n\t\t\t\t\tsousa = true\n\t\t\t\t\tbr[v.h][v.w+1] = true\n\t\t\t\t\ttemp = append(temp, rect{h: v.h, w: v.w + 1})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif sousa == false {\n\t\t\tfmt.Println(sum)\n\t\t\treturn\n\t\t}\n\t\tsum++\n\t\tar = temp\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "sample_input": "3 3\n...\n.#.\n...\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03053", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a grid of squares with H horizontal rows and W vertical columns, where each square is painted white or black.\nHW characters from A_{11} to A_{HW} represent the colors of the squares.\nA_{ij} is # if the square at the i-th row from the top and the j-th column from the left is black, and A_{ij} is . if that square is white.\n\nWe will repeatedly perform the following operation until all the squares are black:\n\nEvery white square that shares a side with a black square, becomes black.\n\nFind the number of operations that will be performed.\nThe initial grid has at least one black square.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\nA_{ij} is # or ..\n\nThe given grid has at least one black square.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nA_{11}A_{12}...A_{1W}\n:\nA_{H1}A_{H2}...A_{HW}\n\nOutput\n\nPrint the number of operations that will be performed.\n\nSample Input 1\n\n3 3\n...\n.#.\n...\n\nSample Output 1\n\n2\n\nAfter one operation, all but the corners of the grid will be black. After one more operation, all the squares will be black.\n\nSample Input 2\n\n6 6\n..#..#\n......\n#..#..\n......\n.#....\n....#.\n\nSample Output 2\n\n3", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1137, "cpu_time_ms": 1060, "memory_kb": 46720}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s131900723", "group_id": "codeNet:p03061", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc stringLineScan() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, 1000000009)\n\tsc.Split(bufio.ScanWords)\n\tn, _ := strconv.Atoi(stringLineScan())\n\td := make(map[int]int)\n\tans := 1\n\tfor i := 0; i < n; i++ {\n\t\ta, _ := strconv.Atoi(stringLineScan())\n\t\tx := PrimeFactors(a)\n\t\tfor _, y := range x {\n\t\t\td[y]++\n\t\t}\n\t}\n\tz := 1\n\tfor k, v := range d {\n\t\tif v%n == n-1 && k > z {\n\t\t\tz = k\n\t\t}\n\t\tans *= int(math.Pow(float64(k), float64(v/n)))\n\t}\n\tfmt.Println(ans * z)\n}\nfunc PrimeFactors(n int) (pfs []int) {\n\tfor n%2 == 0 {\n\t\tpfs = append(pfs, 2)\n\t\tn = n / 2\n\t}\n\tfor i := 3; i*i <= n; i = i + 2 {\n\t\tfor n%i == 0 {\n\t\t\tpfs = append(pfs, i)\n\t\t\tn = n / i\n\t\t}\n\t}\n\tif n > 2 {\n\t\tpfs = append(pfs, n)\n\t}\n\treturn\n}\n", "language": "Go", "metadata": {"date": 1583395326, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03061.html", "problem_id": "p03061", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03061/input.txt", "sample_output_relpath": "derived/input_output/data/p03061/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03061/Go/s131900723.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s131900723", "user_id": "u843722521"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc stringLineScan() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tbuf := make([]byte, 0)\n\tsc.Buffer(buf, 1000000009)\n\tsc.Split(bufio.ScanWords)\n\tn, _ := strconv.Atoi(stringLineScan())\n\td := make(map[int]int)\n\tans := 1\n\tfor i := 0; i < n; i++ {\n\t\ta, _ := strconv.Atoi(stringLineScan())\n\t\tx := PrimeFactors(a)\n\t\tfor _, y := range x {\n\t\t\td[y]++\n\t\t}\n\t}\n\tz := 1\n\tfor k, v := range d {\n\t\tif v%n == n-1 && k > z {\n\t\t\tz = k\n\t\t}\n\t\tans *= int(math.Pow(float64(k), float64(v/n)))\n\t}\n\tfmt.Println(ans * z)\n}\nfunc PrimeFactors(n int) (pfs []int) {\n\tfor n%2 == 0 {\n\t\tpfs = append(pfs, 2)\n\t\tn = n / 2\n\t}\n\tfor i := 3; i*i <= n; i = i + 2 {\n\t\tfor n%i == 0 {\n\t\t\tpfs = append(pfs, i)\n\t\t\tn = n / i\n\t\t}\n\t}\n\tif n > 2 {\n\t\tpfs = append(pfs, n)\n\t}\n\treturn\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, written on the blackboard.\n\nYou will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written.\n\nFind the maximum possible greatest common divisor of the N integers on the blackboard after your move.\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\nOutput\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 greatest common divisor of the N integers on the blackboard after your move.\n\nSample Input 1\n\n3\n7 6 8\n\nSample Output 1\n\n2\n\nIf we replace 7 with 4, the greatest common divisor of the three integers on the blackboard will be 2, which is the maximum possible value.\n\nSample Input 2\n\n3\n12 15 18\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2\n1000000000 1000000000\n\nSample Output 3\n\n1000000000\n\nWe can replace an integer with itself.", "sample_input": "3\n7 6 8\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03061", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, written on the blackboard.\n\nYou will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written.\n\nFind the maximum possible greatest common divisor of the N integers on the blackboard after your move.\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\nOutput\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 greatest common divisor of the N integers on the blackboard after your move.\n\nSample Input 1\n\n3\n7 6 8\n\nSample Output 1\n\n2\n\nIf we replace 7 with 4, the greatest common divisor of the three integers on the blackboard will be 2, which is the maximum possible value.\n\nSample Input 2\n\n3\n12 15 18\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2\n1000000000 1000000000\n\nSample Output 3\n\n1000000000\n\nWe can replace an integer with itself.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 849, "cpu_time_ms": 2107, "memory_kb": 9728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s995630639", "group_id": "codeNet:p03061", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tfor b > 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\ntype segmentTree struct {\n\tdata []int\n\toffset int\n}\n\nfunc newSegmentTree(n int) segmentTree {\n\tvar result segmentTree\n\tt := 1\n\tfor t < n {\n\t\tt *= 2\n\t}\n\tresult.offset = t - 1\n\tresult.data = make([]int, 2*t-1)\n\treturn result\n}\n\nfunc (st segmentTree) updateAll(a []int) {\n\tfor i, v := range a {\n\t\tst.data[st.offset+i] = v\n\t}\n\tfor i := st.offset - 1; i > -1; i-- {\n\t\tst.data[i] = gcd(st.data[i*2+1], st.data[i*2+2])\n\t}\n}\n\nfunc (st segmentTree) update(index, value int) {\n\ti := st.offset + index\n\tst.data[i] = value\n\tfor i >= 1 {\n\t\ti = (i - 1) / 2\n\t\tst.data[i] = gcd(st.data[i*2+1], st.data[i*2+2])\n\t}\n}\n\nfunc (st segmentTree) query(start, stop int) int {\n\tresult := 0\n\tl := start + st.offset\n\tr := stop + st.offset\n\tfor l < r {\n\t\tif l&1 == 0 {\n\t\t\tresult = gcd(result, st.data[l])\n\t\t}\n\t\tif r&1 == 0 {\n\t\t\tresult = gcd(result, st.data[r-1])\n\t\t}\n\t\tl = l / 2\n\t\tr = (r - 1) / 2\n\t}\n\treturn result\n}\n\nfunc main() {\n\tN := readInt()\n\tA := readInts(N)\n\n\tst := newSegmentTree(N)\n\tst.updateAll(A)\n\n\tresult := st.query(1, N)\n\tfor i := 1; i < N-1; i++ {\n\t\tresult = max(result, gcd(st.query(0, i), st.query(i+1, N)))\n\t}\n\tresult = max(result, st.query(0, N-1))\n\n\tfmt.Println(result)\n}\n\nconst (\n\tioBufferSize = 1 * 1024 * 1024 // 1 MB\n)\n\nvar stdinScanner = func() *bufio.Scanner {\n\tresult := bufio.NewScanner(os.Stdin)\n\tresult.Buffer(make([]byte, ioBufferSize), ioBufferSize)\n\tresult.Split(bufio.ScanWords)\n\treturn result\n}()\n\nfunc readString() string {\n\tstdinScanner.Scan()\n\treturn stdinScanner.Text()\n}\n\nfunc readInt() int {\n\tresult, err := strconv.Atoi(readString())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn result\n}\n\nfunc readInts(n int) []int {\n\tresult := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tresult[i] = readInt()\n\t}\n\treturn result\n}\n", "language": "Go", "metadata": {"date": 1581732131, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03061.html", "problem_id": "p03061", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03061/input.txt", "sample_output_relpath": "derived/input_output/data/p03061/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03061/Go/s995630639.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s995630639", "user_id": "u347640436"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tfor b > 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\ntype segmentTree struct {\n\tdata []int\n\toffset int\n}\n\nfunc newSegmentTree(n int) segmentTree {\n\tvar result segmentTree\n\tt := 1\n\tfor t < n {\n\t\tt *= 2\n\t}\n\tresult.offset = t - 1\n\tresult.data = make([]int, 2*t-1)\n\treturn result\n}\n\nfunc (st segmentTree) updateAll(a []int) {\n\tfor i, v := range a {\n\t\tst.data[st.offset+i] = v\n\t}\n\tfor i := st.offset - 1; i > -1; i-- {\n\t\tst.data[i] = gcd(st.data[i*2+1], st.data[i*2+2])\n\t}\n}\n\nfunc (st segmentTree) update(index, value int) {\n\ti := st.offset + index\n\tst.data[i] = value\n\tfor i >= 1 {\n\t\ti = (i - 1) / 2\n\t\tst.data[i] = gcd(st.data[i*2+1], st.data[i*2+2])\n\t}\n}\n\nfunc (st segmentTree) query(start, stop int) int {\n\tresult := 0\n\tl := start + st.offset\n\tr := stop + st.offset\n\tfor l < r {\n\t\tif l&1 == 0 {\n\t\t\tresult = gcd(result, st.data[l])\n\t\t}\n\t\tif r&1 == 0 {\n\t\t\tresult = gcd(result, st.data[r-1])\n\t\t}\n\t\tl = l / 2\n\t\tr = (r - 1) / 2\n\t}\n\treturn result\n}\n\nfunc main() {\n\tN := readInt()\n\tA := readInts(N)\n\n\tst := newSegmentTree(N)\n\tst.updateAll(A)\n\n\tresult := st.query(1, N)\n\tfor i := 1; i < N-1; i++ {\n\t\tresult = max(result, gcd(st.query(0, i), st.query(i+1, N)))\n\t}\n\tresult = max(result, st.query(0, N-1))\n\n\tfmt.Println(result)\n}\n\nconst (\n\tioBufferSize = 1 * 1024 * 1024 // 1 MB\n)\n\nvar stdinScanner = func() *bufio.Scanner {\n\tresult := bufio.NewScanner(os.Stdin)\n\tresult.Buffer(make([]byte, ioBufferSize), ioBufferSize)\n\tresult.Split(bufio.ScanWords)\n\treturn result\n}()\n\nfunc readString() string {\n\tstdinScanner.Scan()\n\treturn stdinScanner.Text()\n}\n\nfunc readInt() int {\n\tresult, err := strconv.Atoi(readString())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn result\n}\n\nfunc readInts(n int) []int {\n\tresult := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tresult[i] = readInt()\n\t}\n\treturn result\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, written on the blackboard.\n\nYou will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written.\n\nFind the maximum possible greatest common divisor of the N integers on the blackboard after your move.\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\nOutput\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 greatest common divisor of the N integers on the blackboard after your move.\n\nSample Input 1\n\n3\n7 6 8\n\nSample Output 1\n\n2\n\nIf we replace 7 with 4, the greatest common divisor of the three integers on the blackboard will be 2, which is the maximum possible value.\n\nSample Input 2\n\n3\n12 15 18\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2\n1000000000 1000000000\n\nSample Output 3\n\n1000000000\n\nWe can replace an integer with itself.", "sample_input": "3\n7 6 8\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03061", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, written on the blackboard.\n\nYou will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written.\n\nFind the maximum possible greatest common divisor of the N integers on the blackboard after your move.\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\nOutput\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 greatest common divisor of the N integers on the blackboard after your move.\n\nSample Input 1\n\n3\n7 6 8\n\nSample Output 1\n\n2\n\nIf we replace 7 with 4, the greatest common divisor of the three integers on the blackboard will be 2, which is the maximum possible value.\n\nSample Input 2\n\n3\n12 15 18\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2\n1000000000 1000000000\n\nSample Output 3\n\n1000000000\n\nWe can replace an integer with itself.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 80, "memory_kb": 6528}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s422538239", "group_id": "codeNet:p03061", "input_text": "package main\n\nimport \"fmt\"\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\n\tl := make([]int, n+1)\n\tr := make([]int, n+1)\n\tl[0] = 0\n\tr[0] = 0\n\tfor i := 0; i < n; i++ {\n\t\tl[i+1] = gcd(a[i], l[i])\n\t\tr[n-1-i] = gcd(a[n-1-i], r[n-i])\n\t}\n\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tt := gcd(l[i], r[i+1])\n\t\tif ans < t {\n\t\t\tans = t\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1571709866, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03061.html", "problem_id": "p03061", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03061/input.txt", "sample_output_relpath": "derived/input_output/data/p03061/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03061/Go/s422538239.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s422538239", "user_id": "u902409225"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\n\tl := make([]int, n+1)\n\tr := make([]int, n+1)\n\tl[0] = 0\n\tr[0] = 0\n\tfor i := 0; i < n; i++ {\n\t\tl[i+1] = gcd(a[i], l[i])\n\t\tr[n-1-i] = gcd(a[n-1-i], r[n-i])\n\t}\n\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tt := gcd(l[i], r[i+1])\n\t\tif ans < t {\n\t\t\tans = t\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, written on the blackboard.\n\nYou will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written.\n\nFind the maximum possible greatest common divisor of the N integers on the blackboard after your move.\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\nOutput\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 greatest common divisor of the N integers on the blackboard after your move.\n\nSample Input 1\n\n3\n7 6 8\n\nSample Output 1\n\n2\n\nIf we replace 7 with 4, the greatest common divisor of the three integers on the blackboard will be 2, which is the maximum possible value.\n\nSample Input 2\n\n3\n12 15 18\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2\n1000000000 1000000000\n\nSample Output 3\n\n1000000000\n\nWe can replace an integer with itself.", "sample_input": "3\n7 6 8\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03061", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, written on the blackboard.\n\nYou will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written.\n\nFind the maximum possible greatest common divisor of the N integers on the blackboard after your move.\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\nOutput\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 greatest common divisor of the N integers on the blackboard after your move.\n\nSample Input 1\n\n3\n7 6 8\n\nSample Output 1\n\n2\n\nIf we replace 7 with 4, the greatest common divisor of the three integers on the blackboard will be 2, which is the maximum possible value.\n\nSample Input 2\n\n3\n12 15 18\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2\n1000000000 1000000000\n\nSample Output 3\n\n1000000000\n\nWe can replace an integer with itself.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 484, "cpu_time_ms": 701, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s337024274", "group_id": "codeNet:p03061", "input_text": "// https://atcoder.jp/contests/abc125/tasks/abc125_c\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\n\tif b == 0 {\n\t\treturn a\n\t}\n\n\treturn gcd(b, a%b)\n}\n\n// d: debug IO. it can print debug in test.\nfunc solve(io *Io, d *Io) {\n\tN := io.NextInt()\n\tas := io.NextInts(N)\n\n\tlgcd := make([]int, N)\n\trgcd := make([]int, N)\n\n\tlgcd[0] = as[0]\n\trgcd[N-1] = as[N-1]\n\n\tfor i := 1; i < N; i++ {\n\t\tlgcd[i] = gcd(as[i], lgcd[i-1])\n\t}\n\n\tfor i := N - 2; i >= 0; i-- {\n\t\trgcd[i] = gcd(as[i], rgcd[i+1])\n\t}\n\n\tresMc := NewMaxCalculator(0)\n\n\tfor i := 0; i < N; i++ {\n\t\tif i == 0 {\n\t\t\tresMc.Check(rgcd[i+1])\n\t\t\tcontinue\n\t\t} else if i == N-1 {\n\t\t\tresMc.Check(lgcd[i-1])\n\t\t\tcontinue\n\t\t}\n\n\t\tresMc.Check(gcd(lgcd[i-1], rgcd[i+1]))\n\t}\n\n\tio.Println(resMc.current)\n}\n\ntype SegmentTree struct {\n\tn int // 最下段の数\n\tnodes []int\n\tzeroValue int\n}\n\nfunc (st *SegmentTree) calc(a, b int) int {\n\treturn gcd(a, b)\n}\n\nfunc (st *SegmentTree) init(vs []int, zeroValue int) {\n\tst.zeroValue = zeroValue\n\tst.n = 1\n\n\tfor st.n < len(vs) {\n\t\tst.n *= 2\n\t}\n\n\tst.nodes = make([]int, 2*st.n-1)\n\n\tfor i := range st.nodes {\n\t\tst.nodes[i] = st.zeroValue\n\t}\n\n\tfor i, v := range vs {\n\t\tst.nodes[i+st.n-1] = v\n\t}\n\n\tfor i := st.n - 2; i >= 0; i-- {\n\t\tst.nodes[i] = st.calc(st.nodes[i*2+1], st.nodes[i*2+2])\n\t}\n}\n\nfunc (st *SegmentTree) update(i, val int) {\n\ti += st.n - 1\n\tst.nodes[i] = val\n\n\tfor i > 0 {\n\t\ti = (i - 1) / 2\n\t\tst.nodes[i] = st.calc(st.nodes[2*i+1], st.nodes[2*i+2])\n\t}\n}\n\n// [from, to)\nfunc (st *SegmentTree) query(from, to int) int {\n\treturn st.queryInternal(from, to, 0, 0, st.n)\n}\n\nfunc (st *SegmentTree) queryInternal(from, to, k, l, r int) int {\n\tif r <= from || to <= l {\n\t\treturn st.zeroValue\n\t}\n\n\tif from <= l && r <= to {\n\t\treturn st.nodes[k]\n\t}\n\n\tvl := st.queryInternal(from, to, 2*k+1, l, (l+r)/2)\n\tvr := st.queryInternal(from, to, 2*k+2, (l+r)/2, r)\n\n\treturn st.calc(vl, vr)\n}\n\n// セグメント木を利用\n\nfunc solve2(io *Io, d *Io) {\n\tN := io.NextInt()\n\tas := io.NextInts(N)\n\n\tst := SegmentTree{}\n\tst.init(as, 0)\n\n\tres := 0\n\n\tfor i := range as {\n\t\tl := st.query(0, i)\n\t\tr := st.query(i+1, len(as))\n\t\tres = Max(res, gcd(l, r))\n\t}\n\n\tio.Println(res)\n}\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\tsolve2(io, nil)\n}\n\n/* IO Helpers */\n\n// Io combines reader, writer, & tokens as the state when processing the input\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\n// NewIo creates Io with Stdin & Stdout\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\n// Flush calls the writer's Flush\nfunc (io *Io) Flush() {\n\tio.writer.Flush()\n}\n\n// NextLine returns the string from reader.ReadLine()\nfunc (io *Io) NextLine() string {\n\tif io.nextToken < len(io.tokens) {\n\t\tpanic(\"io.nextToken < len(io.tokens)\")\n\t}\n\n\tvar buffer bytes.Buffer\n\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer.Write(line)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn buffer.String()\n}\n\n// NextLines returns []string from next n lines\nfunc (io *Io) NextLines(n int) []string {\n\tres := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextLine()\n\t}\n\treturn res\n}\n\n// Next returns the string token (partial string of the line divided by spaces)\nfunc (io *Io) Next() string {\n\tif io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\n\tres := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn res\n}\n\n// NextStrings returns the []string from the next n tokens\nfunc (io *Io) NextStrings(n int) []string {\n\tres := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.Next()\n\t}\n\treturn res\n}\n\n// NextInt returns the int from the next token\nfunc (io *Io) NextInt() int {\n\tres, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n\n// NextInts returns the []int from the next n tokens\nfunc (io *Io) NextInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextInt()\n\t}\n\treturn res\n}\n\n// Println prints the input to the writer in an easy-to-see form\nfunc (io *Io) Println(a ...interface{}) {\n\tvar values []string\n\tfor i := 0; i < len(a); i++ {\n\t\tvalues = append(values, \"%v\")\n\t}\n\tio.Printfln(strings.Join(values, \" \"), a...)\n}\n\n// Print calls Fprint to the writer\nfunc (io *Io) Print(a interface{}) {\n\tfmt.Fprint(io.writer, a)\n}\n\n// Printfln calls Fprint to the writer\nfunc (io *Io) Printfln(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format+\"\\n\", a...)\n}\n\n// Debug calls Println and Flush immediately\nfunc (io *Io) Debug(a ...interface{}) {\n\tif io == nil {\n\t\treturn\n\t}\n\n\tio.Println(a...)\n\tio.Flush()\n}\n\n/* Math Helpers */\n\n// Max of the ints\nfunc Max(numbers ...int) int {\n\tmax := numbers[0]\n\tfor i, number := range numbers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif number > max {\n\t\t\tmax = number\n\t\t}\n\t}\n\treturn max\n}\n\n// Min of the ints\nfunc Min(numbers ...int) int {\n\tmax := numbers[0]\n\tfor i, number := range numbers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif max > number {\n\t\t\tmax = number\n\t\t}\n\t}\n\treturn max\n}\n\n// DigitSum returns sum of the int's digits\nfunc DigitSum(n int) int {\n\tif n < 0 {\n\t\treturn -1\n\t}\n\n\tres := 0\n\n\tfor n > 0 {\n\t\tres += n % 10\n\t\tn /= 10\n\t}\n\n\treturn res\n}\n\n// Sum of the ints\nfunc Sum(numbers ...int) int {\n\tsum := 0\n\n\tfor _, number := range numbers {\n\t\tsum += number\n\t}\n\n\treturn sum\n}\n\n// Pow calculates the pow for int with O(log e)\nfunc Pow(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(fmt.Sprintf(\"Pow was called for a < 0 or e < 0, a: %d, e: %d\", a, e))\n\t}\n\n\tif e == 0 {\n\t\treturn 1\n\t}\n\n\tif e%2 == 0 {\n\t\thalf := Pow(a, e/2)\n\t\treturn half * half\n\t}\n\n\treturn a * Pow(a, e-1)\n}\n\n/* Structure Helpers */\n\n// Set is orderless List\ntype Set map[interface{}]struct{}\n\n// NewSet returns empty Set\nfunc NewSet() *Set {\n\treturn &Set{}\n}\n\n// Add the value to the set\nfunc (set *Set) Add(value interface{}) {\n\t(*set)[value] = struct{}{}\n}\n\n// Includes check the set has the value\nfunc (set *Set) Includes(value interface{}) bool {\n\t_, included := (*set)[value]\n\treturn included\n}\n\n// Remove deletes the value from the set if exists\nfunc (set *Set) Remove(value interface{}) {\n\tif !set.Includes(value) {\n\t\treturn\n\t}\n\n\tdelete(*set, value)\n}\n\n// ImmutableSort returns sorted slice without mutating original one\nfunc ImmutableSort(slice []int) []int {\n\tres := make([]int, len(slice))\n\tcopy(res, slice)\n\tsort.Ints(res)\n\treturn res\n}\n\n// MinCalculator is helper to get min value\ntype MinCalculator struct {\n\tcurrent int\n}\n\n// NewMinCalculator returns new MinCalculator with initial value\nfunc NewMinCalculator(initial int) *MinCalculator {\n\treturn &MinCalculator{\n\t\tcurrent: initial,\n\t}\n}\n\n// Check compares the value with current and update current if necessary\nfunc (mc *MinCalculator) Check(val int) {\n\tif val < mc.current {\n\t\tmc.current = val\n\t}\n}\n\n// MaxCalculator is helper to get max value\ntype MaxCalculator struct {\n\tcurrent int\n}\n\n// NewMaxCalculator returns new MaxCalculator with initial value\nfunc NewMaxCalculator(initial int) *MaxCalculator {\n\treturn &MaxCalculator{\n\t\tcurrent: initial,\n\t}\n}\n\n// Check compares the value with current and update current if necessary\nfunc (mc *MaxCalculator) Check(val int) {\n\tif val > mc.current {\n\t\tmc.current = val\n\t}\n}\n\n/* Util helpers */\n\n// Ternary is like `cond ? a : b`. should assert the returned value like `Ternary(cond, a, b).(int)`\nfunc Ternary(cond bool, a, b interface{}) interface{} {\n\tif cond {\n\t\treturn a\n\t}\n\n\treturn b\n}\n\n// TernaryInt uses Ternary and assert the value as int\nfunc TernaryInt(cond bool, a, b int) int {\n\treturn Ternary(cond, a, b).(int)\n}\n\n// TernaryString uses Ternary and assert the value as string\nfunc TernaryString(cond bool, a, b string) string {\n\treturn Ternary(cond, a, b).(string)\n}\n", "language": "Go", "metadata": {"date": 1566874907, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03061.html", "problem_id": "p03061", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03061/input.txt", "sample_output_relpath": "derived/input_output/data/p03061/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03061/Go/s337024274.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s337024274", "user_id": "u751468134"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "// https://atcoder.jp/contests/abc125/tasks/abc125_c\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\n\tif b == 0 {\n\t\treturn a\n\t}\n\n\treturn gcd(b, a%b)\n}\n\n// d: debug IO. it can print debug in test.\nfunc solve(io *Io, d *Io) {\n\tN := io.NextInt()\n\tas := io.NextInts(N)\n\n\tlgcd := make([]int, N)\n\trgcd := make([]int, N)\n\n\tlgcd[0] = as[0]\n\trgcd[N-1] = as[N-1]\n\n\tfor i := 1; i < N; i++ {\n\t\tlgcd[i] = gcd(as[i], lgcd[i-1])\n\t}\n\n\tfor i := N - 2; i >= 0; i-- {\n\t\trgcd[i] = gcd(as[i], rgcd[i+1])\n\t}\n\n\tresMc := NewMaxCalculator(0)\n\n\tfor i := 0; i < N; i++ {\n\t\tif i == 0 {\n\t\t\tresMc.Check(rgcd[i+1])\n\t\t\tcontinue\n\t\t} else if i == N-1 {\n\t\t\tresMc.Check(lgcd[i-1])\n\t\t\tcontinue\n\t\t}\n\n\t\tresMc.Check(gcd(lgcd[i-1], rgcd[i+1]))\n\t}\n\n\tio.Println(resMc.current)\n}\n\ntype SegmentTree struct {\n\tn int // 最下段の数\n\tnodes []int\n\tzeroValue int\n}\n\nfunc (st *SegmentTree) calc(a, b int) int {\n\treturn gcd(a, b)\n}\n\nfunc (st *SegmentTree) init(vs []int, zeroValue int) {\n\tst.zeroValue = zeroValue\n\tst.n = 1\n\n\tfor st.n < len(vs) {\n\t\tst.n *= 2\n\t}\n\n\tst.nodes = make([]int, 2*st.n-1)\n\n\tfor i := range st.nodes {\n\t\tst.nodes[i] = st.zeroValue\n\t}\n\n\tfor i, v := range vs {\n\t\tst.nodes[i+st.n-1] = v\n\t}\n\n\tfor i := st.n - 2; i >= 0; i-- {\n\t\tst.nodes[i] = st.calc(st.nodes[i*2+1], st.nodes[i*2+2])\n\t}\n}\n\nfunc (st *SegmentTree) update(i, val int) {\n\ti += st.n - 1\n\tst.nodes[i] = val\n\n\tfor i > 0 {\n\t\ti = (i - 1) / 2\n\t\tst.nodes[i] = st.calc(st.nodes[2*i+1], st.nodes[2*i+2])\n\t}\n}\n\n// [from, to)\nfunc (st *SegmentTree) query(from, to int) int {\n\treturn st.queryInternal(from, to, 0, 0, st.n)\n}\n\nfunc (st *SegmentTree) queryInternal(from, to, k, l, r int) int {\n\tif r <= from || to <= l {\n\t\treturn st.zeroValue\n\t}\n\n\tif from <= l && r <= to {\n\t\treturn st.nodes[k]\n\t}\n\n\tvl := st.queryInternal(from, to, 2*k+1, l, (l+r)/2)\n\tvr := st.queryInternal(from, to, 2*k+2, (l+r)/2, r)\n\n\treturn st.calc(vl, vr)\n}\n\n// セグメント木を利用\n\nfunc solve2(io *Io, d *Io) {\n\tN := io.NextInt()\n\tas := io.NextInts(N)\n\n\tst := SegmentTree{}\n\tst.init(as, 0)\n\n\tres := 0\n\n\tfor i := range as {\n\t\tl := st.query(0, i)\n\t\tr := st.query(i+1, len(as))\n\t\tres = Max(res, gcd(l, r))\n\t}\n\n\tio.Println(res)\n}\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\tsolve2(io, nil)\n}\n\n/* IO Helpers */\n\n// Io combines reader, writer, & tokens as the state when processing the input\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\n// NewIo creates Io with Stdin & Stdout\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\n// Flush calls the writer's Flush\nfunc (io *Io) Flush() {\n\tio.writer.Flush()\n}\n\n// NextLine returns the string from reader.ReadLine()\nfunc (io *Io) NextLine() string {\n\tif io.nextToken < len(io.tokens) {\n\t\tpanic(\"io.nextToken < len(io.tokens)\")\n\t}\n\n\tvar buffer bytes.Buffer\n\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer.Write(line)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn buffer.String()\n}\n\n// NextLines returns []string from next n lines\nfunc (io *Io) NextLines(n int) []string {\n\tres := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextLine()\n\t}\n\treturn res\n}\n\n// Next returns the string token (partial string of the line divided by spaces)\nfunc (io *Io) Next() string {\n\tif io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\n\tres := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn res\n}\n\n// NextStrings returns the []string from the next n tokens\nfunc (io *Io) NextStrings(n int) []string {\n\tres := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.Next()\n\t}\n\treturn res\n}\n\n// NextInt returns the int from the next token\nfunc (io *Io) NextInt() int {\n\tres, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n\n// NextInts returns the []int from the next n tokens\nfunc (io *Io) NextInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextInt()\n\t}\n\treturn res\n}\n\n// Println prints the input to the writer in an easy-to-see form\nfunc (io *Io) Println(a ...interface{}) {\n\tvar values []string\n\tfor i := 0; i < len(a); i++ {\n\t\tvalues = append(values, \"%v\")\n\t}\n\tio.Printfln(strings.Join(values, \" \"), a...)\n}\n\n// Print calls Fprint to the writer\nfunc (io *Io) Print(a interface{}) {\n\tfmt.Fprint(io.writer, a)\n}\n\n// Printfln calls Fprint to the writer\nfunc (io *Io) Printfln(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format+\"\\n\", a...)\n}\n\n// Debug calls Println and Flush immediately\nfunc (io *Io) Debug(a ...interface{}) {\n\tif io == nil {\n\t\treturn\n\t}\n\n\tio.Println(a...)\n\tio.Flush()\n}\n\n/* Math Helpers */\n\n// Max of the ints\nfunc Max(numbers ...int) int {\n\tmax := numbers[0]\n\tfor i, number := range numbers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif number > max {\n\t\t\tmax = number\n\t\t}\n\t}\n\treturn max\n}\n\n// Min of the ints\nfunc Min(numbers ...int) int {\n\tmax := numbers[0]\n\tfor i, number := range numbers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif max > number {\n\t\t\tmax = number\n\t\t}\n\t}\n\treturn max\n}\n\n// DigitSum returns sum of the int's digits\nfunc DigitSum(n int) int {\n\tif n < 0 {\n\t\treturn -1\n\t}\n\n\tres := 0\n\n\tfor n > 0 {\n\t\tres += n % 10\n\t\tn /= 10\n\t}\n\n\treturn res\n}\n\n// Sum of the ints\nfunc Sum(numbers ...int) int {\n\tsum := 0\n\n\tfor _, number := range numbers {\n\t\tsum += number\n\t}\n\n\treturn sum\n}\n\n// Pow calculates the pow for int with O(log e)\nfunc Pow(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(fmt.Sprintf(\"Pow was called for a < 0 or e < 0, a: %d, e: %d\", a, e))\n\t}\n\n\tif e == 0 {\n\t\treturn 1\n\t}\n\n\tif e%2 == 0 {\n\t\thalf := Pow(a, e/2)\n\t\treturn half * half\n\t}\n\n\treturn a * Pow(a, e-1)\n}\n\n/* Structure Helpers */\n\n// Set is orderless List\ntype Set map[interface{}]struct{}\n\n// NewSet returns empty Set\nfunc NewSet() *Set {\n\treturn &Set{}\n}\n\n// Add the value to the set\nfunc (set *Set) Add(value interface{}) {\n\t(*set)[value] = struct{}{}\n}\n\n// Includes check the set has the value\nfunc (set *Set) Includes(value interface{}) bool {\n\t_, included := (*set)[value]\n\treturn included\n}\n\n// Remove deletes the value from the set if exists\nfunc (set *Set) Remove(value interface{}) {\n\tif !set.Includes(value) {\n\t\treturn\n\t}\n\n\tdelete(*set, value)\n}\n\n// ImmutableSort returns sorted slice without mutating original one\nfunc ImmutableSort(slice []int) []int {\n\tres := make([]int, len(slice))\n\tcopy(res, slice)\n\tsort.Ints(res)\n\treturn res\n}\n\n// MinCalculator is helper to get min value\ntype MinCalculator struct {\n\tcurrent int\n}\n\n// NewMinCalculator returns new MinCalculator with initial value\nfunc NewMinCalculator(initial int) *MinCalculator {\n\treturn &MinCalculator{\n\t\tcurrent: initial,\n\t}\n}\n\n// Check compares the value with current and update current if necessary\nfunc (mc *MinCalculator) Check(val int) {\n\tif val < mc.current {\n\t\tmc.current = val\n\t}\n}\n\n// MaxCalculator is helper to get max value\ntype MaxCalculator struct {\n\tcurrent int\n}\n\n// NewMaxCalculator returns new MaxCalculator with initial value\nfunc NewMaxCalculator(initial int) *MaxCalculator {\n\treturn &MaxCalculator{\n\t\tcurrent: initial,\n\t}\n}\n\n// Check compares the value with current and update current if necessary\nfunc (mc *MaxCalculator) Check(val int) {\n\tif val > mc.current {\n\t\tmc.current = val\n\t}\n}\n\n/* Util helpers */\n\n// Ternary is like `cond ? a : b`. should assert the returned value like `Ternary(cond, a, b).(int)`\nfunc Ternary(cond bool, a, b interface{}) interface{} {\n\tif cond {\n\t\treturn a\n\t}\n\n\treturn b\n}\n\n// TernaryInt uses Ternary and assert the value as int\nfunc TernaryInt(cond bool, a, b int) int {\n\treturn Ternary(cond, a, b).(int)\n}\n\n// TernaryString uses Ternary and assert the value as string\nfunc TernaryString(cond bool, a, b string) string {\n\treturn Ternary(cond, a, b).(string)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, written on the blackboard.\n\nYou will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written.\n\nFind the maximum possible greatest common divisor of the N integers on the blackboard after your move.\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\nOutput\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 greatest common divisor of the N integers on the blackboard after your move.\n\nSample Input 1\n\n3\n7 6 8\n\nSample Output 1\n\n2\n\nIf we replace 7 with 4, the greatest common divisor of the three integers on the blackboard will be 2, which is the maximum possible value.\n\nSample Input 2\n\n3\n12 15 18\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2\n1000000000 1000000000\n\nSample Output 3\n\n1000000000\n\nWe can replace an integer with itself.", "sample_input": "3\n7 6 8\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03061", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, written on the blackboard.\n\nYou will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written.\n\nFind the maximum possible greatest common divisor of the N integers on the blackboard after your move.\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\nOutput\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 greatest common divisor of the N integers on the blackboard after your move.\n\nSample Input 1\n\n3\n7 6 8\n\nSample Output 1\n\n2\n\nIf we replace 7 with 4, the greatest common divisor of the three integers on the blackboard will be 2, which is the maximum possible value.\n\nSample Input 2\n\n3\n12 15 18\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2\n1000000000 1000000000\n\nSample Output 3\n\n1000000000\n\nWe can replace an integer with itself.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 7828, "cpu_time_ms": 136, "memory_kb": 6784}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s955304238", "group_id": "codeNet:p03061", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc add(cnt map[int]int, v int) {\n\tif _, ok := cnt[v]; !ok {\n\t\tcnt[v] = 1\n\t\treturn\n\t}\n\tcnt[v]++\n}\n\nfunc main() {\n\tsc := NewScanner(os.Stdin)\n\tN := sc.NextInt()\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = sc.NextInt()\n\t}\n\tl := make([]int, N)\n\tr := make([]int, N)\n\tl[0] = A[0]\n\tr[N-1] = A[N-1]\n\tfor i := 1; i < N; i++ {\n\t\tl[i] = gcd(l[i-1], A[i])\n\t}\n\tfor i := N - 2; i >= 0; i-- {\n\t\tr[i] = gcd(r[i+1], A[i])\n\t}\n\tans := max(l[N-2], r[1])\n\tfor i := 1; i < N-1; i++ {\n\t\tans = max(ans, gcd(l[i-1], r[i+1]))\n\t}\n\tfmt.Println(ans)\n}\n\nfunc vmin(v []int) int {\n\tmn := math.MaxInt32\n\tfor i := 0; i < len(v); i++ {\n\t\tmn = min(mn, v[i])\n\t}\n\treturn mn\n}\n\nfunc gcd(x, y int) int {\n\tif y > 0 {\n\t\treturn gcd(y, x%y)\n\t}\n\treturn x\n}\n\nfunc lcm(x, y int) int {\n\treturn x / gcd(x, y) * y\n}\n\nfunc max64(x, y int64) int64 {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\n// scanner\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner(r io.Reader) *Scanner {\n\trdr := bufio.NewReaderSize(r, 1024)\n\treturn &Scanner{r: rdr}\n}\n\nfunc (s *Scanner) ReadLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tline, isp, err := s.r.ReadLine()\n\t\tif err != nil {\n\t\t\tos.Exit(1)\n\t\t}\n\t\ts.buf = append(s.buf, line...)\n\t\tif !isp {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\nfunc (s *Scanner) NextInt64() int64 {\n\ti, err := strconv.ParseInt(s.Next(), 10, 64)\n\tif err != nil {\n\t\tos.Exit(1)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) NextInt() int {\n\ti, err := strconv.Atoi(s.Next())\n\tif err != nil {\n\t\tos.Exit(1)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) NextFloat64() float64 {\n\ti, err := strconv.ParseFloat(s.Next(), 64)\n\tif err != nil {\n\t\tos.Exit(1)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) Next() string {\n\ts.Pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tnext := string(s.buf[start:s.p])\n\ts.p++\n\treturn next\n}\n\nfunc (s *Scanner) Pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.ReadLine()\n\t\ts.p = 0\n\t}\n}\n", "language": "Go", "metadata": {"date": 1558301181, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03061.html", "problem_id": "p03061", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03061/input.txt", "sample_output_relpath": "derived/input_output/data/p03061/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03061/Go/s955304238.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s955304238", "user_id": "u310790595"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc add(cnt map[int]int, v int) {\n\tif _, ok := cnt[v]; !ok {\n\t\tcnt[v] = 1\n\t\treturn\n\t}\n\tcnt[v]++\n}\n\nfunc main() {\n\tsc := NewScanner(os.Stdin)\n\tN := sc.NextInt()\n\tA := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tA[i] = sc.NextInt()\n\t}\n\tl := make([]int, N)\n\tr := make([]int, N)\n\tl[0] = A[0]\n\tr[N-1] = A[N-1]\n\tfor i := 1; i < N; i++ {\n\t\tl[i] = gcd(l[i-1], A[i])\n\t}\n\tfor i := N - 2; i >= 0; i-- {\n\t\tr[i] = gcd(r[i+1], A[i])\n\t}\n\tans := max(l[N-2], r[1])\n\tfor i := 1; i < N-1; i++ {\n\t\tans = max(ans, gcd(l[i-1], r[i+1]))\n\t}\n\tfmt.Println(ans)\n}\n\nfunc vmin(v []int) int {\n\tmn := math.MaxInt32\n\tfor i := 0; i < len(v); i++ {\n\t\tmn = min(mn, v[i])\n\t}\n\treturn mn\n}\n\nfunc gcd(x, y int) int {\n\tif y > 0 {\n\t\treturn gcd(y, x%y)\n\t}\n\treturn x\n}\n\nfunc lcm(x, y int) int {\n\treturn x / gcd(x, y) * y\n}\n\nfunc max64(x, y int64) int64 {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\n// scanner\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner(r io.Reader) *Scanner {\n\trdr := bufio.NewReaderSize(r, 1024)\n\treturn &Scanner{r: rdr}\n}\n\nfunc (s *Scanner) ReadLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tline, isp, err := s.r.ReadLine()\n\t\tif err != nil {\n\t\t\tos.Exit(1)\n\t\t}\n\t\ts.buf = append(s.buf, line...)\n\t\tif !isp {\n\t\t\tbreak\n\t\t}\n\t}\n}\n\nfunc (s *Scanner) NextInt64() int64 {\n\ti, err := strconv.ParseInt(s.Next(), 10, 64)\n\tif err != nil {\n\t\tos.Exit(1)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) NextInt() int {\n\ti, err := strconv.Atoi(s.Next())\n\tif err != nil {\n\t\tos.Exit(1)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) NextFloat64() float64 {\n\ti, err := strconv.ParseFloat(s.Next(), 64)\n\tif err != nil {\n\t\tos.Exit(1)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) Next() string {\n\ts.Pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tnext := string(s.buf[start:s.p])\n\ts.p++\n\treturn next\n}\n\nfunc (s *Scanner) Pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.ReadLine()\n\t\ts.p = 0\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, written on the blackboard.\n\nYou will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written.\n\nFind the maximum possible greatest common divisor of the N integers on the blackboard after your move.\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\nOutput\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 greatest common divisor of the N integers on the blackboard after your move.\n\nSample Input 1\n\n3\n7 6 8\n\nSample Output 1\n\n2\n\nIf we replace 7 with 4, the greatest common divisor of the three integers on the blackboard will be 2, which is the maximum possible value.\n\nSample Input 2\n\n3\n12 15 18\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2\n1000000000 1000000000\n\nSample Output 3\n\n1000000000\n\nWe can replace an integer with itself.", "sample_input": "3\n7 6 8\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03061", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, written on the blackboard.\n\nYou will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written.\n\nFind the maximum possible greatest common divisor of the N integers on the blackboard after your move.\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\nOutput\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 greatest common divisor of the N integers on the blackboard after your move.\n\nSample Input 1\n\n3\n7 6 8\n\nSample Output 1\n\n2\n\nIf we replace 7 with 4, the greatest common divisor of the three integers on the blackboard will be 2, which is the maximum possible value.\n\nSample Input 2\n\n3\n12 15 18\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2\n1000000000 1000000000\n\nSample Output 3\n\n1000000000\n\nWe can replace an integer with itself.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2075, "cpu_time_ms": 31, "memory_kb": 6528}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s579071459", "group_id": "codeNet:p03061", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc main() {\n\tn := oneInt()\n\tas := scanNums(n)\n\tans := calc(n, as)\n\tfmt.Println(ans)\n\n}\n\nfunc calc(n int, as []int) int {\n\tL := make([]int, n+1)\n\tfor i := 0; i < n; i++ {\n\t\tL[i+1] = gcd(L[i], as[i])\n\t}\n\n\tR := make([]int, n+1)\n\tfor i := n - 1; i >= 0; i-- {\n\t\tR[i] = gcd(R[i+1], as[i])\n\t}\n\n\tans := 0\n\n\tfor i := 0; i < n; i++ {\n\t\tans = max(ans, gcd(L[i], R[i+1]))\n\t}\n\treturn ans\n}\n\nfunc oneInt() int {\n\tvar a int\n\tfmt.Scan(&a)\n\treturn a\n}\nfunc oneStr() string {\n\tvar a string\n\tfmt.Scan(&a)\n\treturn a\n}\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc scanNums(n int) (nums []int) {\n\tstr := readLine()\n\ts := strings.Split(str, \" \")\n\tfor i := 0; i < n; i++ {\n\t\tnum, _ := strconv.Atoi(s[i])\n\t\tnums = append(nums, num)\n\t}\n\treturn nums\n}\n\nfunc scanStrings() (nums []string) {\n\tstr := readLine()\n\ts := strings.Split(str, \" \")\n\n\treturn s\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc sortAsc(a []int) []int {\n\tsort.Ints(a)\n\treturn a\n}\n\nfunc sortDesc(a []int) []int {\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\treturn a\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\tif a == 0 && b == 0 {\n\t\treturn 0\n\t}\n\treturn a * b / gcd(a, b)\n}\n\nfunc cumSum(nums []int) []int {\n\tsums := []int{0}\n\n\tfor i := 0; i < len(nums); i++ {\n\t\tsums = append(sums, sums[i]+nums[i])\n\t}\n\treturn sums\n}\n", "language": "Go", "metadata": {"date": 1556845686, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03061.html", "problem_id": "p03061", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03061/input.txt", "sample_output_relpath": "derived/input_output/data/p03061/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03061/Go/s579071459.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s579071459", "user_id": "u134387396"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc main() {\n\tn := oneInt()\n\tas := scanNums(n)\n\tans := calc(n, as)\n\tfmt.Println(ans)\n\n}\n\nfunc calc(n int, as []int) int {\n\tL := make([]int, n+1)\n\tfor i := 0; i < n; i++ {\n\t\tL[i+1] = gcd(L[i], as[i])\n\t}\n\n\tR := make([]int, n+1)\n\tfor i := n - 1; i >= 0; i-- {\n\t\tR[i] = gcd(R[i+1], as[i])\n\t}\n\n\tans := 0\n\n\tfor i := 0; i < n; i++ {\n\t\tans = max(ans, gcd(L[i], R[i+1]))\n\t}\n\treturn ans\n}\n\nfunc oneInt() int {\n\tvar a int\n\tfmt.Scan(&a)\n\treturn a\n}\nfunc oneStr() string {\n\tvar a string\n\tfmt.Scan(&a)\n\treturn a\n}\n\nfunc readLine() string {\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc scanNums(n int) (nums []int) {\n\tstr := readLine()\n\ts := strings.Split(str, \" \")\n\tfor i := 0; i < n; i++ {\n\t\tnum, _ := strconv.Atoi(s[i])\n\t\tnums = append(nums, num)\n\t}\n\treturn nums\n}\n\nfunc scanStrings() (nums []string) {\n\tstr := readLine()\n\ts := strings.Split(str, \" \")\n\n\treturn s\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc sortAsc(a []int) []int {\n\tsort.Ints(a)\n\treturn a\n}\n\nfunc sortDesc(a []int) []int {\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\treturn a\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\tif a == 0 && b == 0 {\n\t\treturn 0\n\t}\n\treturn a * b / gcd(a, b)\n}\n\nfunc cumSum(nums []int) []int {\n\tsums := []int{0}\n\n\tfor i := 0; i < len(nums); i++ {\n\t\tsums = append(sums, sums[i]+nums[i])\n\t}\n\treturn sums\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, written on the blackboard.\n\nYou will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written.\n\nFind the maximum possible greatest common divisor of the N integers on the blackboard after your move.\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\nOutput\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 greatest common divisor of the N integers on the blackboard after your move.\n\nSample Input 1\n\n3\n7 6 8\n\nSample Output 1\n\n2\n\nIf we replace 7 with 4, the greatest common divisor of the three integers on the blackboard will be 2, which is the maximum possible value.\n\nSample Input 2\n\n3\n12 15 18\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2\n1000000000 1000000000\n\nSample Output 3\n\n1000000000\n\nWe can replace an integer with itself.", "sample_input": "3\n7 6 8\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03061", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, written on the blackboard.\n\nYou will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written.\n\nFind the maximum possible greatest common divisor of the N integers on the blackboard after your move.\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\nOutput\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 greatest common divisor of the N integers on the blackboard after your move.\n\nSample Input 1\n\n3\n7 6 8\n\nSample Output 1\n\n2\n\nIf we replace 7 with 4, the greatest common divisor of the three integers on the blackboard will be 2, which is the maximum possible value.\n\nSample Input 2\n\n3\n12 15 18\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2\n1000000000 1000000000\n\nSample Output 3\n\n1000000000\n\nWe can replace an integer with itself.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2321, "cpu_time_ms": 38, "memory_kb": 9856}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s860311422", "group_id": "codeNet:p03061", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc gcd(a, b int) int {\n\tif b > a {\n\t\ta, b = b, a\n\t}\n\t// 書き換え可能なパターンの計算簡略化のため\n\tif b == 0 {\n\t\treturn a\n\t}\n\tvar r int\n\tfor {\n\t\tr = a % b\n\t\tif r == 0 {\n\t\t\treturn b\n\t\t}\n\t\ta = b\n\t\tb = r\n\t}\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\ta := make([]int, n)\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tfor i := 0; i < n; i++ {\n\t\tsc.Scan()\n\t\ta[i], _ = strconv.Atoi(sc.Text())\n\t}\n\n\tl := make([]int, n+1)\n\tl[0] = 0\n\tfor i := 0; i < n; i++ {\n\t\tl[i+1] = gcd(l[i], a[i])\n\t}\n\tr := make([]int, n+1)\n\tr[n] = 0\n\tfor i := n - 1; i >= 0; i-- {\n\t\tr[i] = gcd(r[i+1], a[i])\n\t}\n\n\tmax := 0\n\tfor i := 0; i < n; i++ {\n\t\tif v := gcd(l[i], r[i+1]); v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\n\tfmt.Println(max)\n}\n", "language": "Go", "metadata": {"date": 1556597627, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03061.html", "problem_id": "p03061", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03061/input.txt", "sample_output_relpath": "derived/input_output/data/p03061/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03061/Go/s860311422.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s860311422", "user_id": "u461993794"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc gcd(a, b int) int {\n\tif b > a {\n\t\ta, b = b, a\n\t}\n\t// 書き換え可能なパターンの計算簡略化のため\n\tif b == 0 {\n\t\treturn a\n\t}\n\tvar r int\n\tfor {\n\t\tr = a % b\n\t\tif r == 0 {\n\t\t\treturn b\n\t\t}\n\t\ta = b\n\t\tb = r\n\t}\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\ta := make([]int, n)\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tfor i := 0; i < n; i++ {\n\t\tsc.Scan()\n\t\ta[i], _ = strconv.Atoi(sc.Text())\n\t}\n\n\tl := make([]int, n+1)\n\tl[0] = 0\n\tfor i := 0; i < n; i++ {\n\t\tl[i+1] = gcd(l[i], a[i])\n\t}\n\tr := make([]int, n+1)\n\tr[n] = 0\n\tfor i := n - 1; i >= 0; i-- {\n\t\tr[i] = gcd(r[i+1], a[i])\n\t}\n\n\tmax := 0\n\tfor i := 0; i < n; i++ {\n\t\tif v := gcd(l[i], r[i+1]); v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\n\tfmt.Println(max)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, written on the blackboard.\n\nYou will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written.\n\nFind the maximum possible greatest common divisor of the N integers on the blackboard after your move.\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\nOutput\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 greatest common divisor of the N integers on the blackboard after your move.\n\nSample Input 1\n\n3\n7 6 8\n\nSample Output 1\n\n2\n\nIf we replace 7 with 4, the greatest common divisor of the three integers on the blackboard will be 2, which is the maximum possible value.\n\nSample Input 2\n\n3\n12 15 18\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2\n1000000000 1000000000\n\nSample Output 3\n\n1000000000\n\nWe can replace an integer with itself.", "sample_input": "3\n7 6 8\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03061", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, written on the blackboard.\n\nYou will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written.\n\nFind the maximum possible greatest common divisor of the N integers on the blackboard after your move.\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\nOutput\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 greatest common divisor of the N integers on the blackboard after your move.\n\nSample Input 1\n\n3\n7 6 8\n\nSample Output 1\n\n2\n\nIf we replace 7 with 4, the greatest common divisor of the three integers on the blackboard will be 2, which is the maximum possible value.\n\nSample Input 2\n\n3\n12 15 18\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2\n1000000000 1000000000\n\nSample Output 3\n\n1000000000\n\nWe can replace an integer with itself.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 784, "cpu_time_ms": 35, "memory_kb": 4736}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s532551972", "group_id": "codeNet:p03061", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\t_ = oneInt()\n\tas := scanNums()\n\tn := len(as)\n\n\tans := 1\n\n\tarr0 := as[:n-1]\n\tans = Max(ans, gcds(arr0...))\n\tarr3 := as[1:]\n\tans = Max(ans, gcds(arr3...))\n\n\tfor i := 1; i < n-1; i++ {\n\t\tarr1 := as[:i]\n\t\tarr2 := as[i+1:]\n\n\t\tgcd1 := gcds(arr1...)\n\t\tgcd2 := gcds(arr2...)\n\n\t\ttmp := gcd(gcd1, gcd2)\n\n\t\tans = Max(ans, tmp)\n\t}\n\n\tfmt.Println(ans)\n}\n\nfunc gcds(nums ...int) int {\n\tif len(nums) == 2 {\n\t\treturn gcd(nums[0], nums[1])\n\t}\n\tif len(nums) == 1 {\n\t\treturn nums[0]\n\t}\n\ttmp := []int{gcd(nums[0], nums[1])}\n\ttmp = append(tmp, nums[2:]...)\n\tans := gcds(tmp...)\n\n\treturn ans\n}\n\nfunc oneInt() int {\n\tvar a int\n\tfmt.Scan(&a)\n\treturn a\n}\nfunc oneStr() string {\n\tvar a string\n\tfmt.Scan(&a)\n\treturn a\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc scanNums() (nums []int) {\n\ts := nextLine()\n\tnumStr := strings.Split(s, \" \")\n\n\tfor _, n := range numStr {\n\t\ti, _ := strconv.Atoi(n)\n\t\tnums = append(nums, i)\n\t}\n\treturn nums\n}\n\nfunc scanStrings() (strs []string) {\n\ts := nextLine()\n\tlist := strings.Split(s, \" \")\n\tstrs = append(strs, list...)\n\treturn strs\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc Max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc sortAsc(a []int) []int {\n\tsort.Ints(a)\n\treturn a\n}\n\nfunc sortDesc(a []int) []int {\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\treturn a\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\tif a == 0 && b == 0 {\n\t\treturn 0\n\t}\n\treturn a * b / gcd(a, b)\n}\n", "language": "Go", "metadata": {"date": 1556422308, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03061.html", "problem_id": "p03061", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03061/input.txt", "sample_output_relpath": "derived/input_output/data/p03061/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03061/Go/s532551972.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s532551972", "user_id": "u134387396"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\t_ = oneInt()\n\tas := scanNums()\n\tn := len(as)\n\n\tans := 1\n\n\tarr0 := as[:n-1]\n\tans = Max(ans, gcds(arr0...))\n\tarr3 := as[1:]\n\tans = Max(ans, gcds(arr3...))\n\n\tfor i := 1; i < n-1; i++ {\n\t\tarr1 := as[:i]\n\t\tarr2 := as[i+1:]\n\n\t\tgcd1 := gcds(arr1...)\n\t\tgcd2 := gcds(arr2...)\n\n\t\ttmp := gcd(gcd1, gcd2)\n\n\t\tans = Max(ans, tmp)\n\t}\n\n\tfmt.Println(ans)\n}\n\nfunc gcds(nums ...int) int {\n\tif len(nums) == 2 {\n\t\treturn gcd(nums[0], nums[1])\n\t}\n\tif len(nums) == 1 {\n\t\treturn nums[0]\n\t}\n\ttmp := []int{gcd(nums[0], nums[1])}\n\ttmp = append(tmp, nums[2:]...)\n\tans := gcds(tmp...)\n\n\treturn ans\n}\n\nfunc oneInt() int {\n\tvar a int\n\tfmt.Scan(&a)\n\treturn a\n}\nfunc oneStr() string {\n\tvar a string\n\tfmt.Scan(&a)\n\treturn a\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc scanNums() (nums []int) {\n\ts := nextLine()\n\tnumStr := strings.Split(s, \" \")\n\n\tfor _, n := range numStr {\n\t\ti, _ := strconv.Atoi(n)\n\t\tnums = append(nums, i)\n\t}\n\treturn nums\n}\n\nfunc scanStrings() (strs []string) {\n\ts := nextLine()\n\tlist := strings.Split(s, \" \")\n\tstrs = append(strs, list...)\n\treturn strs\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc Max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc sortAsc(a []int) []int {\n\tsort.Ints(a)\n\treturn a\n}\n\nfunc sortDesc(a []int) []int {\n\tsort.Sort(sort.Reverse(sort.IntSlice(a)))\n\treturn a\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\nfunc lcm(a, b int) int {\n\tif a == 0 && b == 0 {\n\t\treturn 0\n\t}\n\treturn a * b / gcd(a, b)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, written on the blackboard.\n\nYou will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written.\n\nFind the maximum possible greatest common divisor of the N integers on the blackboard after your move.\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\nOutput\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 greatest common divisor of the N integers on the blackboard after your move.\n\nSample Input 1\n\n3\n7 6 8\n\nSample Output 1\n\n2\n\nIf we replace 7 with 4, the greatest common divisor of the three integers on the blackboard will be 2, which is the maximum possible value.\n\nSample Input 2\n\n3\n12 15 18\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2\n1000000000 1000000000\n\nSample Output 3\n\n1000000000\n\nWe can replace an integer with itself.", "sample_input": "3\n7 6 8\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03061", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, written on the blackboard.\n\nYou will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written.\n\nFind the maximum possible greatest common divisor of the N integers on the blackboard after your move.\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\nOutput\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 greatest common divisor of the N integers on the blackboard after your move.\n\nSample Input 1\n\n3\n7 6 8\n\nSample Output 1\n\n2\n\nIf we replace 7 with 4, the greatest common divisor of the three integers on the blackboard will be 2, which is the maximum possible value.\n\nSample Input 2\n\n3\n12 15 18\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2\n1000000000 1000000000\n\nSample Output 3\n\n1000000000\n\nWe can replace an integer with itself.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2236, "cpu_time_ms": 2109, "memory_kb": 89728}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s796053293", "group_id": "codeNet:p03061", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\n\tm := make([]int, n)\n\tl := make([]int, n-1)\n\tr := make([]int, n-1)\n\tl[0] = a[0]\n\tr[0] = a[n-1]\n\n\tfor i := 1; i < n-1; i++ {\n\t\tl[i] = gcd(l[i-1], a[i])\n\t\tr[i] = gcd(r[i-1], a[n-1-i])\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tif i == 0 {\n\t\t\tm[i] = r[n-i-2]\n\t\t} else if i == n-1 {\n\t\t\tm[i] = l[n-2]\n\t\t} else {\n\t\t\tm[i] = gcd(l[i-1], r[n-i-2])\n\t\t}\n\t}\n\n\tret := m[0]\n\tfor i := 1; i < n; i++ {\n\t\tif m[i] > ret {\n\t\t\tret = m[i]\n\t\t}\n\t}\n\n\tfmt.Println(ret)\n}\n\nfunc gcd(a int, b int) int {\n\tfor {\n\t\tif b > a {\n\t\t\ta, b = b, a\n\t\t}\n\t\tc := a % b\n\t\tif c == 0 {\n\t\t\treturn b\n\t\t}\n\t\ta, b = b, c\n\t}\n}\n", "language": "Go", "metadata": {"date": 1556420616, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03061.html", "problem_id": "p03061", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03061/input.txt", "sample_output_relpath": "derived/input_output/data/p03061/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03061/Go/s796053293.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s796053293", "user_id": "u836866227"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&a[i])\n\t}\n\n\tm := make([]int, n)\n\tl := make([]int, n-1)\n\tr := make([]int, n-1)\n\tl[0] = a[0]\n\tr[0] = a[n-1]\n\n\tfor i := 1; i < n-1; i++ {\n\t\tl[i] = gcd(l[i-1], a[i])\n\t\tr[i] = gcd(r[i-1], a[n-1-i])\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tif i == 0 {\n\t\t\tm[i] = r[n-i-2]\n\t\t} else if i == n-1 {\n\t\t\tm[i] = l[n-2]\n\t\t} else {\n\t\t\tm[i] = gcd(l[i-1], r[n-i-2])\n\t\t}\n\t}\n\n\tret := m[0]\n\tfor i := 1; i < n; i++ {\n\t\tif m[i] > ret {\n\t\t\tret = m[i]\n\t\t}\n\t}\n\n\tfmt.Println(ret)\n}\n\nfunc gcd(a int, b int) int {\n\tfor {\n\t\tif b > a {\n\t\t\ta, b = b, a\n\t\t}\n\t\tc := a % b\n\t\tif c == 0 {\n\t\t\treturn b\n\t\t}\n\t\ta, b = b, c\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, written on the blackboard.\n\nYou will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written.\n\nFind the maximum possible greatest common divisor of the N integers on the blackboard after your move.\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\nOutput\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 greatest common divisor of the N integers on the blackboard after your move.\n\nSample Input 1\n\n3\n7 6 8\n\nSample Output 1\n\n2\n\nIf we replace 7 with 4, the greatest common divisor of the three integers on the blackboard will be 2, which is the maximum possible value.\n\nSample Input 2\n\n3\n12 15 18\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2\n1000000000 1000000000\n\nSample Output 3\n\n1000000000\n\nWe can replace an integer with itself.", "sample_input": "3\n7 6 8\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03061", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, written on the blackboard.\n\nYou will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written.\n\nFind the maximum possible greatest common divisor of the N integers on the blackboard after your move.\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\nOutput\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 greatest common divisor of the N integers on the blackboard after your move.\n\nSample Input 1\n\n3\n7 6 8\n\nSample Output 1\n\n2\n\nIf we replace 7 with 4, the greatest common divisor of the three integers on the blackboard will be 2, which is the maximum possible value.\n\nSample Input 2\n\n3\n12 15 18\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2\n1000000000 1000000000\n\nSample Output 3\n\n1000000000\n\nWe can replace an integer with itself.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 707, "cpu_time_ms": 704, "memory_kb": 7552}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s742403472", "group_id": "codeNet:p03061", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\tA := make([]int64, N)\n\tvar Amax int64\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&A[i])\n\t\tif A[i] > Amax {\n\t\t\tAmax = A[i]\n\t\t}\n\t}\n\n\tif N == 2 {\n\t\tif A[0] > A[1] {\n\t\t\tfmt.Println(A[0])\n\t\t} else {\n\t\t\tfmt.Println(A[1])\n\t\t}\n\t} else {\n\t\tfmt.Println(solve(N, A, Amax))\n\t}\n}\n\nfunc solve(N int, A []int64, Amax int64) int64 {\n\tvar a int\n\tvar b int64\n\tfor i := 0; i < N; i++ {\n\t\tif A[i] == Amax {\n\t\t\ta++\n\t\t} else {\n\t\t\tb = A[i]\n\t\t}\n\t}\n\tif a == 1 {\n\t\treturn b\n\t}\n\tif a == N-1 {\n\t\treturn Amax\n\t}\n\n\tfor i := Amax; i >= 1; i-- {\n\t\tmiss := 0\n\t\tfor j := 0; j < N; j++ {\n\t\t\tif A[j]%i != 0 {\n\t\t\t\tmiss++\n\t\t\t}\n\t\t\tif miss >= 2 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif miss <= 1 {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn 1\n}\n", "language": "Go", "metadata": {"date": 1556419265, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03061.html", "problem_id": "p03061", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03061/input.txt", "sample_output_relpath": "derived/input_output/data/p03061/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03061/Go/s742403472.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s742403472", "user_id": "u445515168"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\tA := make([]int64, N)\n\tvar Amax int64\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&A[i])\n\t\tif A[i] > Amax {\n\t\t\tAmax = A[i]\n\t\t}\n\t}\n\n\tif N == 2 {\n\t\tif A[0] > A[1] {\n\t\t\tfmt.Println(A[0])\n\t\t} else {\n\t\t\tfmt.Println(A[1])\n\t\t}\n\t} else {\n\t\tfmt.Println(solve(N, A, Amax))\n\t}\n}\n\nfunc solve(N int, A []int64, Amax int64) int64 {\n\tvar a int\n\tvar b int64\n\tfor i := 0; i < N; i++ {\n\t\tif A[i] == Amax {\n\t\t\ta++\n\t\t} else {\n\t\t\tb = A[i]\n\t\t}\n\t}\n\tif a == 1 {\n\t\treturn b\n\t}\n\tif a == N-1 {\n\t\treturn Amax\n\t}\n\n\tfor i := Amax; i >= 1; i-- {\n\t\tmiss := 0\n\t\tfor j := 0; j < N; j++ {\n\t\t\tif A[j]%i != 0 {\n\t\t\t\tmiss++\n\t\t\t}\n\t\t\tif miss >= 2 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif miss <= 1 {\n\t\t\treturn i\n\t\t}\n\t}\n\treturn 1\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, written on the blackboard.\n\nYou will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written.\n\nFind the maximum possible greatest common divisor of the N integers on the blackboard after your move.\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\nOutput\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 greatest common divisor of the N integers on the blackboard after your move.\n\nSample Input 1\n\n3\n7 6 8\n\nSample Output 1\n\n2\n\nIf we replace 7 with 4, the greatest common divisor of the three integers on the blackboard will be 2, which is the maximum possible value.\n\nSample Input 2\n\n3\n12 15 18\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2\n1000000000 1000000000\n\nSample Output 3\n\n1000000000\n\nWe can replace an integer with itself.", "sample_input": "3\n7 6 8\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03061", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, written on the blackboard.\n\nYou will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written.\n\nFind the maximum possible greatest common divisor of the N integers on the blackboard after your move.\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\nOutput\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 greatest common divisor of the N integers on the blackboard after your move.\n\nSample Input 1\n\n3\n7 6 8\n\nSample Output 1\n\n2\n\nIf we replace 7 with 4, the greatest common divisor of the three integers on the blackboard will be 2, which is the maximum possible value.\n\nSample Input 2\n\n3\n12 15 18\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2\n1000000000 1000000000\n\nSample Output 3\n\n1000000000\n\nWe can replace an integer with itself.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 741, "cpu_time_ms": 2108, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s151715562", "group_id": "codeNet:p03061", "input_text": "package main\n\nimport \"fmt\"\n\nfunc gcd(x, y int) int {\n for y > 0 {\n x, y = y, x % y\n }\n return x\n}\n\nfunc max(x, y int) int {\n if x > y {\n return x\n }\n return y\n}\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n a := make([]int, n)\n for i := 0; i < n; i++ {\n fmt.Scan(&a[i])\n }\n if n == 2 {\n fmt.Println(max(a[0], a[1]))\n } else {\n g := gcd(a[0], a[n - 1])\n forward, backword := make([]int, n), make([]int, n)\n forward[0], backword[n - 1] = g, g\n for i := 1; i < n; i++ {\n g := gcd(g, a[i])\n forward[i] = g\n }\n g = a[n - 1]\n for i := n - 2; i >= 0; i-- {\n g := gcd(g, a[i])\n backword[i] = g\n }\n first, second := 1000000007, 1000000007\n for i := 0; i < n; i++ {\n v := max(forward[i], backword[i])\n if v < first {\n second = first\n first = v\n } else if v < second {\n second = v\n }\n }\n fmt.Println(second)\n }\n}\n\n", "language": "Go", "metadata": {"date": 1556418846, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03061.html", "problem_id": "p03061", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03061/input.txt", "sample_output_relpath": "derived/input_output/data/p03061/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03061/Go/s151715562.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s151715562", "user_id": "u280512618"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc gcd(x, y int) int {\n for y > 0 {\n x, y = y, x % y\n }\n return x\n}\n\nfunc max(x, y int) int {\n if x > y {\n return x\n }\n return y\n}\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n a := make([]int, n)\n for i := 0; i < n; i++ {\n fmt.Scan(&a[i])\n }\n if n == 2 {\n fmt.Println(max(a[0], a[1]))\n } else {\n g := gcd(a[0], a[n - 1])\n forward, backword := make([]int, n), make([]int, n)\n forward[0], backword[n - 1] = g, g\n for i := 1; i < n; i++ {\n g := gcd(g, a[i])\n forward[i] = g\n }\n g = a[n - 1]\n for i := n - 2; i >= 0; i-- {\n g := gcd(g, a[i])\n backword[i] = g\n }\n first, second := 1000000007, 1000000007\n for i := 0; i < n; i++ {\n v := max(forward[i], backword[i])\n if v < first {\n second = first\n first = v\n } else if v < second {\n second = v\n }\n }\n fmt.Println(second)\n }\n}\n\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, written on the blackboard.\n\nYou will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written.\n\nFind the maximum possible greatest common divisor of the N integers on the blackboard after your move.\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\nOutput\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 greatest common divisor of the N integers on the blackboard after your move.\n\nSample Input 1\n\n3\n7 6 8\n\nSample Output 1\n\n2\n\nIf we replace 7 with 4, the greatest common divisor of the three integers on the blackboard will be 2, which is the maximum possible value.\n\nSample Input 2\n\n3\n12 15 18\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2\n1000000000 1000000000\n\nSample Output 3\n\n1000000000\n\nWe can replace an integer with itself.", "sample_input": "3\n7 6 8\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03061", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, written on the blackboard.\n\nYou will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written.\n\nFind the maximum possible greatest common divisor of the N integers on the blackboard after your move.\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\nOutput\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 greatest common divisor of the N integers on the blackboard after your move.\n\nSample Input 1\n\n3\n7 6 8\n\nSample Output 1\n\n2\n\nIf we replace 7 with 4, the greatest common divisor of the three integers on the blackboard will be 2, which is the maximum possible value.\n\nSample Input 2\n\n3\n12 15 18\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2\n1000000000 1000000000\n\nSample Output 3\n\n1000000000\n\nWe can replace an integer with itself.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1085, "cpu_time_ms": 737, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s107668004", "group_id": "codeNet:p03061", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n)\n\nfunc scanNums(len int) (nums []int) {\n\tvar num int\n\tfor i := 0; i < len; i++ {\n\t\tfmt.Scan(&num)\n\t\tnums = append(nums, num)\n\t}\n\treturn nums\n}\n\nfunc gcd(a, b int) int {\n\tfor b != 0 {\n\t\trem := math.Mod(float64(a), float64(b))\n\t\ta = b\n\t\tb = int(rem)\n\t}\n\n\treturn a\n}\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\n\tA := scanNums(N)\n\n\tsort.Sort(sort.Reverse(sort.IntSlice(A)))\n\n\tif N <= 2 {\n\t\tif A[0] > A[1] {\n\t\t\tfmt.Println(A[0])\n\t\t\tos.Exit(0)\n\t\t}\n\t\tfmt.Println(A[1])\n\t\tos.Exit(0)\n\t}\n\n\ta := gcd(A[0], A[1])\n\tb := gcd(A[1], A[2])\n\tc := gcd(A[2], A[0])\n\n\tvar m int\n\n\tcountA := 0\n\tcountB := 0\n\tcountC := 0\n\n\tfor i := 0; i < N; i++ {\n\t\tif countA > 1 {\n\t\t\ta = 1\n\t\t\tbreak\n\t\t}\n\t\tif A[i]%a != 0 {\n\t\t\tcountA += 1\n\t\t}\n\t}\n\tm = a\n\n\tfor i := 0; i < N; i++ {\n\t\tif countB > 1 {\n\t\t\tb = 1\n\t\t\tbreak\n\t\t}\n\t\tif A[i]%b != 0 {\n\t\t\tcountB += 1\n\t\t}\n\t}\n\tif b > m {\n\t\tm = b\n\t}\n\n\tfor i := 0; i < N; i++ {\n\t\tif countC > 1 {\n\t\t\tc = 1\n\t\t\tbreak\n\t\t}\n\t\tif A[i]%c != 0 {\n\t\t\tcountC += 1\n\t\t}\n\t}\n\tif c > m {\n\t\tm = c\n\t}\n\n\tfmt.Println(m)\n}\n", "language": "Go", "metadata": {"date": 1556418560, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03061.html", "problem_id": "p03061", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03061/input.txt", "sample_output_relpath": "derived/input_output/data/p03061/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03061/Go/s107668004.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s107668004", "user_id": "u688280835"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n)\n\nfunc scanNums(len int) (nums []int) {\n\tvar num int\n\tfor i := 0; i < len; i++ {\n\t\tfmt.Scan(&num)\n\t\tnums = append(nums, num)\n\t}\n\treturn nums\n}\n\nfunc gcd(a, b int) int {\n\tfor b != 0 {\n\t\trem := math.Mod(float64(a), float64(b))\n\t\ta = b\n\t\tb = int(rem)\n\t}\n\n\treturn a\n}\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\n\tA := scanNums(N)\n\n\tsort.Sort(sort.Reverse(sort.IntSlice(A)))\n\n\tif N <= 2 {\n\t\tif A[0] > A[1] {\n\t\t\tfmt.Println(A[0])\n\t\t\tos.Exit(0)\n\t\t}\n\t\tfmt.Println(A[1])\n\t\tos.Exit(0)\n\t}\n\n\ta := gcd(A[0], A[1])\n\tb := gcd(A[1], A[2])\n\tc := gcd(A[2], A[0])\n\n\tvar m int\n\n\tcountA := 0\n\tcountB := 0\n\tcountC := 0\n\n\tfor i := 0; i < N; i++ {\n\t\tif countA > 1 {\n\t\t\ta = 1\n\t\t\tbreak\n\t\t}\n\t\tif A[i]%a != 0 {\n\t\t\tcountA += 1\n\t\t}\n\t}\n\tm = a\n\n\tfor i := 0; i < N; i++ {\n\t\tif countB > 1 {\n\t\t\tb = 1\n\t\t\tbreak\n\t\t}\n\t\tif A[i]%b != 0 {\n\t\t\tcountB += 1\n\t\t}\n\t}\n\tif b > m {\n\t\tm = b\n\t}\n\n\tfor i := 0; i < N; i++ {\n\t\tif countC > 1 {\n\t\t\tc = 1\n\t\t\tbreak\n\t\t}\n\t\tif A[i]%c != 0 {\n\t\t\tcountC += 1\n\t\t}\n\t}\n\tif c > m {\n\t\tm = c\n\t}\n\n\tfmt.Println(m)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, written on the blackboard.\n\nYou will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written.\n\nFind the maximum possible greatest common divisor of the N integers on the blackboard after your move.\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\nOutput\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 greatest common divisor of the N integers on the blackboard after your move.\n\nSample Input 1\n\n3\n7 6 8\n\nSample Output 1\n\n2\n\nIf we replace 7 with 4, the greatest common divisor of the three integers on the blackboard will be 2, which is the maximum possible value.\n\nSample Input 2\n\n3\n12 15 18\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2\n1000000000 1000000000\n\nSample Output 3\n\n1000000000\n\nWe can replace an integer with itself.", "sample_input": "3\n7 6 8\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03061", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, written on the blackboard.\n\nYou will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written.\n\nFind the maximum possible greatest common divisor of the N integers on the blackboard after your move.\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\nOutput\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 greatest common divisor of the N integers on the blackboard after your move.\n\nSample Input 1\n\n3\n7 6 8\n\nSample Output 1\n\n2\n\nIf we replace 7 with 4, the greatest common divisor of the three integers on the blackboard will be 2, which is the maximum possible value.\n\nSample Input 2\n\n3\n12 15 18\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2\n1000000000 1000000000\n\nSample Output 3\n\n1000000000\n\nWe can replace an integer with itself.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1043, "cpu_time_ms": 704, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s741117780", "group_id": "codeNet:p03061", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n)\n\nfunc scanNums(len int) (nums []int) {\n\tvar num int\n\tfor i := 0; i < len; i++ {\n\t\tfmt.Scan(&num)\n\t\tnums = append(nums, num)\n\t}\n\treturn nums\n}\n\nfunc gcd(a, b int) int {\n\tfor b != 0 {\n\t\trem := math.Mod(float64(a), float64(b))\n\t\ta = b\n\t\tb = int(rem)\n\t}\n\n\treturn a\n}\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\n\tA := scanNums(N)\n\n\tsort.Sort(sort.Reverse(sort.IntSlice(A)))\n\n\tif N <= 2 {\n\t\tif A[0] > A[1] {\n\t\t\tfmt.Println(A[0])\n\t\t\tos.Exit(0)\n\t\t}\n\t\tfmt.Println(A[1])\n\t\tos.Exit(0)\n\t}\n\n\ta := gcd(A[0], A[1])\n\tb := gcd(A[1], A[2])\n\tc := gcd(A[2], A[0])\n\n\tvar m int\n\n\tcountA := 0\n\tcountB := 0\n\tcountC := 0\n\n\tfor i := 0; i < N; i++ {\n\t\tif countA > 1 {\n\t\t\ta = 0\n\t\t\tbreak\n\t\t}\n\t\tif A[i]%a != 0 {\n\t\t\tcountA += 1\n\t\t}\n\t}\n\tm = a\n\n\tfor i := 0; i < N; i++ {\n\t\tif countB > 1 {\n\t\t\tb = 1\n\t\t\tbreak\n\t\t}\n\t\tif A[i]%b != 0 {\n\t\t\tcountB += 1\n\t\t}\n\t}\n\tif b > m {\n\t\tm = b\n\t}\n\n\tfor i := 0; i < N; i++ {\n\t\tif countC > 1 {\n\t\t\tc = 1\n\t\t\tbreak\n\t\t}\n\t\tif A[i]%c != 0 {\n\t\t\tcountC += 1\n\t\t}\n\t}\n\tif c > m {\n\t\tm = c\n\t}\n\n\tfmt.Println(m)\n}\n", "language": "Go", "metadata": {"date": 1556418495, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03061.html", "problem_id": "p03061", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03061/input.txt", "sample_output_relpath": "derived/input_output/data/p03061/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03061/Go/s741117780.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s741117780", "user_id": "u688280835"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n)\n\nfunc scanNums(len int) (nums []int) {\n\tvar num int\n\tfor i := 0; i < len; i++ {\n\t\tfmt.Scan(&num)\n\t\tnums = append(nums, num)\n\t}\n\treturn nums\n}\n\nfunc gcd(a, b int) int {\n\tfor b != 0 {\n\t\trem := math.Mod(float64(a), float64(b))\n\t\ta = b\n\t\tb = int(rem)\n\t}\n\n\treturn a\n}\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\n\tA := scanNums(N)\n\n\tsort.Sort(sort.Reverse(sort.IntSlice(A)))\n\n\tif N <= 2 {\n\t\tif A[0] > A[1] {\n\t\t\tfmt.Println(A[0])\n\t\t\tos.Exit(0)\n\t\t}\n\t\tfmt.Println(A[1])\n\t\tos.Exit(0)\n\t}\n\n\ta := gcd(A[0], A[1])\n\tb := gcd(A[1], A[2])\n\tc := gcd(A[2], A[0])\n\n\tvar m int\n\n\tcountA := 0\n\tcountB := 0\n\tcountC := 0\n\n\tfor i := 0; i < N; i++ {\n\t\tif countA > 1 {\n\t\t\ta = 0\n\t\t\tbreak\n\t\t}\n\t\tif A[i]%a != 0 {\n\t\t\tcountA += 1\n\t\t}\n\t}\n\tm = a\n\n\tfor i := 0; i < N; i++ {\n\t\tif countB > 1 {\n\t\t\tb = 1\n\t\t\tbreak\n\t\t}\n\t\tif A[i]%b != 0 {\n\t\t\tcountB += 1\n\t\t}\n\t}\n\tif b > m {\n\t\tm = b\n\t}\n\n\tfor i := 0; i < N; i++ {\n\t\tif countC > 1 {\n\t\t\tc = 1\n\t\t\tbreak\n\t\t}\n\t\tif A[i]%c != 0 {\n\t\t\tcountC += 1\n\t\t}\n\t}\n\tif c > m {\n\t\tm = c\n\t}\n\n\tfmt.Println(m)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, written on the blackboard.\n\nYou will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written.\n\nFind the maximum possible greatest common divisor of the N integers on the blackboard after your move.\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\nOutput\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 greatest common divisor of the N integers on the blackboard after your move.\n\nSample Input 1\n\n3\n7 6 8\n\nSample Output 1\n\n2\n\nIf we replace 7 with 4, the greatest common divisor of the three integers on the blackboard will be 2, which is the maximum possible value.\n\nSample Input 2\n\n3\n12 15 18\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2\n1000000000 1000000000\n\nSample Output 3\n\n1000000000\n\nWe can replace an integer with itself.", "sample_input": "3\n7 6 8\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03061", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, written on the blackboard.\n\nYou will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written.\n\nFind the maximum possible greatest common divisor of the N integers on the blackboard after your move.\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\nOutput\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 greatest common divisor of the N integers on the blackboard after your move.\n\nSample Input 1\n\n3\n7 6 8\n\nSample Output 1\n\n2\n\nIf we replace 7 with 4, the greatest common divisor of the three integers on the blackboard will be 2, which is the maximum possible value.\n\nSample Input 2\n\n3\n12 15 18\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2\n1000000000 1000000000\n\nSample Output 3\n\n1000000000\n\nWe can replace an integer with itself.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1043, "cpu_time_ms": 707, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s989750553", "group_id": "codeNet:p03061", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"sort\"\n)\n\nfunc scanNums(len int) (nums []int) {\n\tvar num int\n\tfor i := 0; i < len; i++ {\n\t\tfmt.Scan(&num)\n\t\tnums = append(nums, num)\n\t}\n\treturn nums\n}\n\nfunc gcd(a, b int) int {\n\tfor b != 0 {\n\t\trem := math.Mod(float64(a), float64(b))\n\t\ta = b\n\t\tb = int(rem)\n\t}\n\n\treturn a\n}\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\n\tA := scanNums(N)\n\n\tsort.Sort(sort.Reverse(sort.IntSlice(A)))\n\n\ta := gcd(A[0], A[1])\n\tb := gcd(A[1], A[2])\n\tc := gcd(A[2], A[0])\n\tm := 0\n\n\tcountA := 0\n\tcountB := 0\n\tcountC := 0\n\tfor i := 3; i < N; i++ {\n\t\tif countA > 1 {\n\t\t\ta = 0\n\t\t\tbreak\n\t\t}\n\t\tif A[i]%a != 0 {\n\t\t\tcountA += 1\n\t\t}\n\t}\n\tm = a\n\n\tfor i := 3; i < N; i++ {\n\t\tif countB > 1 {\n\t\t\tb = 0\n\t\t\tbreak\n\t\t}\n\t\tif A[i]%b != 0 {\n\t\t\tcountB += 1\n\t\t}\n\t}\n\tif b > m {\n\t\tm = b\n\t}\n\n\tfor i := 3; i < N; i++ {\n\t\tif countC > 1 {\n\t\t\tc = 0\n\t\t\tbreak\n\t\t}\n\t\tif A[i]%c != 0 {\n\t\t\tcountC += 1\n\t\t}\n\t}\n\n\tif c > m {\n\t\tm = c\n\t}\n\n\tfmt.Println(m)\n}\n", "language": "Go", "metadata": {"date": 1556416984, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03061.html", "problem_id": "p03061", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03061/input.txt", "sample_output_relpath": "derived/input_output/data/p03061/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03061/Go/s989750553.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s989750553", "user_id": "u688280835"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"sort\"\n)\n\nfunc scanNums(len int) (nums []int) {\n\tvar num int\n\tfor i := 0; i < len; i++ {\n\t\tfmt.Scan(&num)\n\t\tnums = append(nums, num)\n\t}\n\treturn nums\n}\n\nfunc gcd(a, b int) int {\n\tfor b != 0 {\n\t\trem := math.Mod(float64(a), float64(b))\n\t\ta = b\n\t\tb = int(rem)\n\t}\n\n\treturn a\n}\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\n\tA := scanNums(N)\n\n\tsort.Sort(sort.Reverse(sort.IntSlice(A)))\n\n\ta := gcd(A[0], A[1])\n\tb := gcd(A[1], A[2])\n\tc := gcd(A[2], A[0])\n\tm := 0\n\n\tcountA := 0\n\tcountB := 0\n\tcountC := 0\n\tfor i := 3; i < N; i++ {\n\t\tif countA > 1 {\n\t\t\ta = 0\n\t\t\tbreak\n\t\t}\n\t\tif A[i]%a != 0 {\n\t\t\tcountA += 1\n\t\t}\n\t}\n\tm = a\n\n\tfor i := 3; i < N; i++ {\n\t\tif countB > 1 {\n\t\t\tb = 0\n\t\t\tbreak\n\t\t}\n\t\tif A[i]%b != 0 {\n\t\t\tcountB += 1\n\t\t}\n\t}\n\tif b > m {\n\t\tm = b\n\t}\n\n\tfor i := 3; i < N; i++ {\n\t\tif countC > 1 {\n\t\t\tc = 0\n\t\t\tbreak\n\t\t}\n\t\tif A[i]%c != 0 {\n\t\t\tcountC += 1\n\t\t}\n\t}\n\n\tif c > m {\n\t\tm = c\n\t}\n\n\tfmt.Println(m)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, written on the blackboard.\n\nYou will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written.\n\nFind the maximum possible greatest common divisor of the N integers on the blackboard after your move.\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\nOutput\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 greatest common divisor of the N integers on the blackboard after your move.\n\nSample Input 1\n\n3\n7 6 8\n\nSample Output 1\n\n2\n\nIf we replace 7 with 4, the greatest common divisor of the three integers on the blackboard will be 2, which is the maximum possible value.\n\nSample Input 2\n\n3\n12 15 18\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2\n1000000000 1000000000\n\nSample Output 3\n\n1000000000\n\nWe can replace an integer with itself.", "sample_input": "3\n7 6 8\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03061", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, written on the blackboard.\n\nYou will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written.\n\nFind the maximum possible greatest common divisor of the N integers on the blackboard after your move.\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\nOutput\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 greatest common divisor of the N integers on the blackboard after your move.\n\nSample Input 1\n\n3\n7 6 8\n\nSample Output 1\n\n2\n\nIf we replace 7 with 4, the greatest common divisor of the three integers on the blackboard will be 2, which is the maximum possible value.\n\nSample Input 2\n\n3\n12 15 18\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2\n1000000000 1000000000\n\nSample Output 3\n\n1000000000\n\nWe can replace an integer with itself.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 925, "cpu_time_ms": 708, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s478340128", "group_id": "codeNet:p03061", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n)\n\nfunc scanNums(len int) (nums []int) {\n\tvar num int\n\tfor i := 0; i < len; i++ {\n\t\tfmt.Scan(&num)\n\t\tnums = append(nums, num)\n\t}\n\treturn nums\n}\n\nfunc gcd(a, b int) int {\n\tfor b != 0 {\n\t\trem := math.Mod(float64(a), float64(b))\n\t\ta = b\n\t\tb = int(rem)\n\t}\n\n\treturn a\n}\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\n\tA := scanNums(N)\n\n\tsort.Sort(sort.Reverse(sort.IntSlice(A)))\n\tfmt.Println(A)\n\n\ta := gcd(A[0], A[1])\n\tb := gcd(A[1], A[2])\n\tc := gcd(A[2], A[0])\n\n\tfor i := 3; i < N; i++ {\n\t\tif A[i]%a != 0 {\n\t\t\tbreak\n\t\t} else {\n\t\t\tfmt.Println(a)\n\t\t\tos.Exit(0)\n\t\t}\n\t}\n\n\tfor i := 3; i < N; i++ {\n\t\tif A[i]%b != 0 {\n\t\t\tbreak\n\t\t} else {\n\t\t\tfmt.Println(b)\n\t\t\tos.Exit(0)\n\t\t}\n\t}\n\n\tfmt.Println(c)\n}\n", "language": "Go", "metadata": {"date": 1556415955, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03061.html", "problem_id": "p03061", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03061/input.txt", "sample_output_relpath": "derived/input_output/data/p03061/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03061/Go/s478340128.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s478340128", "user_id": "u688280835"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n)\n\nfunc scanNums(len int) (nums []int) {\n\tvar num int\n\tfor i := 0; i < len; i++ {\n\t\tfmt.Scan(&num)\n\t\tnums = append(nums, num)\n\t}\n\treturn nums\n}\n\nfunc gcd(a, b int) int {\n\tfor b != 0 {\n\t\trem := math.Mod(float64(a), float64(b))\n\t\ta = b\n\t\tb = int(rem)\n\t}\n\n\treturn a\n}\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\n\tA := scanNums(N)\n\n\tsort.Sort(sort.Reverse(sort.IntSlice(A)))\n\tfmt.Println(A)\n\n\ta := gcd(A[0], A[1])\n\tb := gcd(A[1], A[2])\n\tc := gcd(A[2], A[0])\n\n\tfor i := 3; i < N; i++ {\n\t\tif A[i]%a != 0 {\n\t\t\tbreak\n\t\t} else {\n\t\t\tfmt.Println(a)\n\t\t\tos.Exit(0)\n\t\t}\n\t}\n\n\tfor i := 3; i < N; i++ {\n\t\tif A[i]%b != 0 {\n\t\t\tbreak\n\t\t} else {\n\t\t\tfmt.Println(b)\n\t\t\tos.Exit(0)\n\t\t}\n\t}\n\n\tfmt.Println(c)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, written on the blackboard.\n\nYou will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written.\n\nFind the maximum possible greatest common divisor of the N integers on the blackboard after your move.\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\nOutput\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 greatest common divisor of the N integers on the blackboard after your move.\n\nSample Input 1\n\n3\n7 6 8\n\nSample Output 1\n\n2\n\nIf we replace 7 with 4, the greatest common divisor of the three integers on the blackboard will be 2, which is the maximum possible value.\n\nSample Input 2\n\n3\n12 15 18\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2\n1000000000 1000000000\n\nSample Output 3\n\n1000000000\n\nWe can replace an integer with itself.", "sample_input": "3\n7 6 8\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03061", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, written on the blackboard.\n\nYou will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written.\n\nFind the maximum possible greatest common divisor of the N integers on the blackboard after your move.\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\nOutput\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 greatest common divisor of the N integers on the blackboard after your move.\n\nSample Input 1\n\n3\n7 6 8\n\nSample Output 1\n\n2\n\nIf we replace 7 with 4, the greatest common divisor of the three integers on the blackboard will be 2, which is the maximum possible value.\n\nSample Input 2\n\n3\n12 15 18\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2\n1000000000 1000000000\n\nSample Output 3\n\n1000000000\n\nWe can replace an integer with itself.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 732, "cpu_time_ms": 722, "memory_kb": 7552}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s787828037", "group_id": "codeNet:p03061", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc (io *Io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\nfunc (io *Io) Next() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\nfunc (io *Io) NextInt() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) NextFloat() float64 {\n\ti, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) PrintLn(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\nfunc (io *Io) PrintIntLn(a []int) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc (io *Io) PrintStringLn(a []string) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc gcd_array(a []int) int {\n\tret := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tret = gcd(a[i], ret)\n\t}\n\treturn ret\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\n\treturn gcd(b, a%b)\n}\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\n\tN := io.NextInt()\n\n\tA := make([]int, N)\n\n\tfor i := range A {\n\t\tA[i] = io.NextInt()\n\t}\n\n\tmax := 0\n\tfor i := range A {\n\t\tAC := make([]int, len(A))\n\t\tcopy(AC, A)\n\t\ttmp := append(AC[:i], AC[i+1:]...)\n\t\tg := gcd_array(tmp)\n\n\t\tif g > max {\n\t\t\tmax = g\n\t\t}\n\t}\n\n\tio.PrintLn(max)\n\n}\n", "language": "Go", "metadata": {"date": 1556414965, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03061.html", "problem_id": "p03061", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03061/input.txt", "sample_output_relpath": "derived/input_output/data/p03061/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03061/Go/s787828037.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s787828037", "user_id": "u272266919"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc (io *Io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\nfunc (io *Io) Next() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\nfunc (io *Io) NextInt() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) NextFloat() float64 {\n\ti, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) PrintLn(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\nfunc (io *Io) PrintIntLn(a []int) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc (io *Io) PrintStringLn(a []string) {\n\tb := []interface{}{}\n\tfor _, x := range a {\n\t\tb = append(b, x)\n\t}\n\tio.PrintLn(b...)\n}\n\nfunc gcd_array(a []int) int {\n\tret := a[0]\n\tfor i := 1; i < len(a); i++ {\n\t\tret = gcd(a[i], ret)\n\t}\n\treturn ret\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\n\treturn gcd(b, a%b)\n}\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\n\tN := io.NextInt()\n\n\tA := make([]int, N)\n\n\tfor i := range A {\n\t\tA[i] = io.NextInt()\n\t}\n\n\tmax := 0\n\tfor i := range A {\n\t\tAC := make([]int, len(A))\n\t\tcopy(AC, A)\n\t\ttmp := append(AC[:i], AC[i+1:]...)\n\t\tg := gcd_array(tmp)\n\n\t\tif g > max {\n\t\t\tmax = g\n\t\t}\n\t}\n\n\tio.PrintLn(max)\n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, written on the blackboard.\n\nYou will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written.\n\nFind the maximum possible greatest common divisor of the N integers on the blackboard after your move.\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\nOutput\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 greatest common divisor of the N integers on the blackboard after your move.\n\nSample Input 1\n\n3\n7 6 8\n\nSample Output 1\n\n2\n\nIf we replace 7 with 4, the greatest common divisor of the three integers on the blackboard will be 2, which is the maximum possible value.\n\nSample Input 2\n\n3\n12 15 18\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2\n1000000000 1000000000\n\nSample Output 3\n\n1000000000\n\nWe can replace an integer with itself.", "sample_input": "3\n7 6 8\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03061", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N integers, A_1, A_2, ..., A_N, written on the blackboard.\n\nYou will choose one of them and replace it with an integer of your choice between 1 and 10^9 (inclusive), possibly the same as the integer originally written.\n\nFind the maximum possible greatest common divisor of the N integers on the blackboard after your move.\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\nOutput\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 greatest common divisor of the N integers on the blackboard after your move.\n\nSample Input 1\n\n3\n7 6 8\n\nSample Output 1\n\n2\n\nIf we replace 7 with 4, the greatest common divisor of the three integers on the blackboard will be 2, which is the maximum possible value.\n\nSample Input 2\n\n3\n12 15 18\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2\n1000000000 1000000000\n\nSample Output 3\n\n1000000000\n\nWe can replace an integer with itself.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1996, "cpu_time_ms": 2108, "memory_kb": 13696}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s568580185", "group_id": "codeNet:p03070", "input_text": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n \"fmt\"\n)\n\nvar reader = bufio.NewReaderSize(os.Stdin, 1000000)\nvar writer = bufio.NewWriter(os.Stdout)\nfunc NextLine() string {\n buffer := make([]byte, 0)\n for true {\n line, isPrefix, err := reader.ReadLine()\n if err != nil { panic(err) }\n buffer = append(buffer, line...)\n if !isPrefix { break }\n }\n return string(buffer)\n}\nfunc NextInt() int {\n n, _ := strconv.Atoi(NextLine())\n return n\n}\nfunc NextIntVec() []int {\n L := strings.Split(NextLine(), \" \")\n N := make([]int, len(L))\n for i := range N {\n N[i], _ = strconv.Atoi(L[i])\n }\n return N\n}\nfunc Write(s interface{}) {\n fmt.Fprintln(writer, s)\n}\nfunc Output() {\n _ = writer.Flush()\n}\n\nfunc MinInt(A ...int) int {\n min := A[0]\n for _, a := range A {\n if a < min { min = a }\n }\n return min\n}\nfunc SumInt(A ...int) int {\n sum := 0\n for _, a := range A {\n sum += a\n }\n return sum\n}\n\nconst p = 998244353\n\nfunc Solve() {\n N := NextInt()\n A := make([]int, N)\n for i := range A {\n A[i] = NextInt()\n }\n S := SumInt(A...)\n L := S / 2 + 1\n DP := make([][]int, N + 1)\n for i := range DP {\n DP[i] = make([]int, L + 1)\n }\n DP[0][0] = 1\n for i, a := range A {\n for j := range DP[i] {\n DP[i + 1][j] += 2 * DP[i][j]\n DP[i + 1][j] %= p\n DP[i + 1][MinInt(j + a, L)] += DP[i][j]\n DP[i + 1][MinInt(j + a, L)] %= p\n }\n }\n P := 1\n for i := 0; i < N; i++ {\n P = P * 3 % p\n }\n ans := (P + p - 3 * DP[N][L]) % p\n if S % 2 < 1 { ans = (ans + p - DP[N][S / 2] * 8 / 3) % p}\n Write(ans)\n return\n}\n\nfunc main() {\n Solve()\n Output()\n}", "language": "Go", "metadata": {"date": 1580708266, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03070.html", "problem_id": "p03070", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03070/input.txt", "sample_output_relpath": "derived/input_output/data/p03070/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03070/Go/s568580185.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s568580185", "user_id": "u415905784"}, "prompt_components": {"gold_output": "18\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"strings\"\n \"fmt\"\n)\n\nvar reader = bufio.NewReaderSize(os.Stdin, 1000000)\nvar writer = bufio.NewWriter(os.Stdout)\nfunc NextLine() string {\n buffer := make([]byte, 0)\n for true {\n line, isPrefix, err := reader.ReadLine()\n if err != nil { panic(err) }\n buffer = append(buffer, line...)\n if !isPrefix { break }\n }\n return string(buffer)\n}\nfunc NextInt() int {\n n, _ := strconv.Atoi(NextLine())\n return n\n}\nfunc NextIntVec() []int {\n L := strings.Split(NextLine(), \" \")\n N := make([]int, len(L))\n for i := range N {\n N[i], _ = strconv.Atoi(L[i])\n }\n return N\n}\nfunc Write(s interface{}) {\n fmt.Fprintln(writer, s)\n}\nfunc Output() {\n _ = writer.Flush()\n}\n\nfunc MinInt(A ...int) int {\n min := A[0]\n for _, a := range A {\n if a < min { min = a }\n }\n return min\n}\nfunc SumInt(A ...int) int {\n sum := 0\n for _, a := range A {\n sum += a\n }\n return sum\n}\n\nconst p = 998244353\n\nfunc Solve() {\n N := NextInt()\n A := make([]int, N)\n for i := range A {\n A[i] = NextInt()\n }\n S := SumInt(A...)\n L := S / 2 + 1\n DP := make([][]int, N + 1)\n for i := range DP {\n DP[i] = make([]int, L + 1)\n }\n DP[0][0] = 1\n for i, a := range A {\n for j := range DP[i] {\n DP[i + 1][j] += 2 * DP[i][j]\n DP[i + 1][j] %= p\n DP[i + 1][MinInt(j + a, L)] += DP[i][j]\n DP[i + 1][MinInt(j + a, L)] %= p\n }\n }\n P := 1\n for i := 0; i < N; i++ {\n P = P * 3 % p\n }\n ans := (P + p - 3 * DP[N][L]) % p\n if S % 2 < 1 { ans = (ans + p - DP[N][S / 2] * 8 / 3) % p}\n Write(ans)\n return\n}\n\nfunc main() {\n Solve()\n Output()\n}", "problem_context": "Score : 600 points\n\nProblem Statement\n\nYou are given N integers. The i-th integer is a_i.\nFind the number, modulo 998244353, of ways to paint each of the integers red, green or blue so that the following condition is satisfied:\n\nLet R, G and B be the sums of the integers painted red, green and blue, respectively. There exists a triangle with positive area whose sides have lengths R, G and B.\n\nConstraints\n\n3 \\leq N \\leq 300\n\n1 \\leq a_i \\leq 300(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\nPrint the number, modulo 998244353, of ways to paint each of the integers red, green or blue so that the condition is satisfied.\n\nSample Input 1\n\n4\n1\n1\n1\n2\n\nSample Output 1\n\n18\n\nWe can only paint the integers so that the lengths of the sides of the triangle will be 1, 2 and 2, and there are 18 such ways.\n\nSample Input 2\n\n6\n1\n3\n2\n3\n5\n2\n\nSample Output 2\n\n150\n\nSample Input 3\n\n20\n3\n1\n4\n1\n5\n9\n2\n6\n5\n3\n5\n8\n9\n7\n9\n3\n2\n3\n8\n4\n\nSample Output 3\n\n563038556", "sample_input": "4\n1\n1\n1\n2\n"}, "reference_outputs": ["18\n"], "source_document_id": "p03070", "source_text": "Score : 600 points\n\nProblem Statement\n\nYou are given N integers. The i-th integer is a_i.\nFind the number, modulo 998244353, of ways to paint each of the integers red, green or blue so that the following condition is satisfied:\n\nLet R, G and B be the sums of the integers painted red, green and blue, respectively. There exists a triangle with positive area whose sides have lengths R, G and B.\n\nConstraints\n\n3 \\leq N \\leq 300\n\n1 \\leq a_i \\leq 300(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\nPrint the number, modulo 998244353, of ways to paint each of the integers red, green or blue so that the condition is satisfied.\n\nSample Input 1\n\n4\n1\n1\n1\n2\n\nSample Output 1\n\n18\n\nWe can only paint the integers so that the lengths of the sides of the triangle will be 1, 2 and 2, and there are 18 such ways.\n\nSample Input 2\n\n6\n1\n3\n2\n3\n5\n2\n\nSample Output 2\n\n150\n\nSample Input 3\n\n20\n3\n1\n4\n1\n5\n9\n2\n6\n5\n3\n5\n8\n9\n7\n9\n3\n2\n3\n8\n4\n\nSample Output 3\n\n563038556", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1620, "cpu_time_ms": 341, "memory_kb": 109696}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s094048455", "group_id": "codeNet:p03105", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scan(&a, &b, &c)\n\n\tfmt.Println(min(b/a, c))\n}\n", "language": "Go", "metadata": {"date": 1597268318, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03105.html", "problem_id": "p03105", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03105/input.txt", "sample_output_relpath": "derived/input_output/data/p03105/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03105/Go/s094048455.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s094048455", "user_id": "u061804469"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scan(&a, &b, &c)\n\n\tfmt.Println(min(b/a, c))\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi likes the sound when he buys a drink from a vending machine.\n\nThat sound can be heard by spending A yen (the currency of Japan) each time.\n\nTakahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time.\n\nHow many times will he hear the sound?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 100\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 Takahashi will hear his favorite sound.\n\nSample Input 1\n\n2 11 4\n\nSample Output 1\n\n4\n\nSince he has not less than 8 yen, he will hear the sound four times and be satisfied.\n\nSample Input 2\n\n3 9 5\n\nSample Output 2\n\n3\n\nHe may not be able to be satisfied.\n\nSample Input 3\n\n100 1 10\n\nSample Output 3\n\n0", "sample_input": "2 11 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03105", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi likes the sound when he buys a drink from a vending machine.\n\nThat sound can be heard by spending A yen (the currency of Japan) each time.\n\nTakahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time.\n\nHow many times will he hear the sound?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 100\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 Takahashi will hear his favorite sound.\n\nSample Input 1\n\n2 11 4\n\nSample Output 1\n\n4\n\nSince he has not less than 8 yen, he will hear the sound four times and be satisfied.\n\nSample Input 2\n\n3 9 5\n\nSample Output 2\n\n3\n\nHe may not be able to be satisfied.\n\nSample Input 3\n\n100 1 10\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 6, "memory_kb": 1768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s140088964", "group_id": "codeNet:p03105", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar A, B, C int\n\tfmt.Scan(&A, &B, &C)\n\tif B > A*C {\n\t\tfmt.Println(C)\n\t} else {\n\t\tfmt.Println(B / A)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1586382844, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03105.html", "problem_id": "p03105", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03105/input.txt", "sample_output_relpath": "derived/input_output/data/p03105/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03105/Go/s140088964.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s140088964", "user_id": "u605443479"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar A, B, C int\n\tfmt.Scan(&A, &B, &C)\n\tif B > A*C {\n\t\tfmt.Println(C)\n\t} else {\n\t\tfmt.Println(B / A)\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi likes the sound when he buys a drink from a vending machine.\n\nThat sound can be heard by spending A yen (the currency of Japan) each time.\n\nTakahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time.\n\nHow many times will he hear the sound?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 100\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 Takahashi will hear his favorite sound.\n\nSample Input 1\n\n2 11 4\n\nSample Output 1\n\n4\n\nSince he has not less than 8 yen, he will hear the sound four times and be satisfied.\n\nSample Input 2\n\n3 9 5\n\nSample Output 2\n\n3\n\nHe may not be able to be satisfied.\n\nSample Input 3\n\n100 1 10\n\nSample Output 3\n\n0", "sample_input": "2 11 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03105", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi likes the sound when he buys a drink from a vending machine.\n\nThat sound can be heard by spending A yen (the currency of Japan) each time.\n\nTakahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time.\n\nHow many times will he hear the sound?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 100\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 Takahashi will hear his favorite sound.\n\nSample Input 1\n\n2 11 4\n\nSample Output 1\n\n4\n\nSince he has not less than 8 yen, he will hear the sound four times and be satisfied.\n\nSample Input 2\n\n3 9 5\n\nSample Output 2\n\n3\n\nHe may not be able to be satisfied.\n\nSample Input 3\n\n100 1 10\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s213179265", "group_id": "codeNet:p03105", "input_text": "// ProblemURL : https://atcoder.jp/contests/abc120/tasks/abc120_a\n// ---------------------------------------------\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\nfunc diff(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\nfunc larger(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc smaller(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc largest(a, b, c int) (lgst int) {\n\tif a > b {\n\t\tlgst = a\n\t} else {\n\t\tlgst = b\n\t}\n\tif c > lgst {\n\t\tlgst = c\n\t}\n\treturn\n}\nfunc smallest(a, b, c int) (slst int) {\n\tif a < b {\n\t\tslst = a\n\t} else {\n\t\tslst = b\n\t}\n\tif c < slst {\n\t\tslst = c\n\t}\n\treturn\n}\nfunc intsMax(a []int) (val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func intsMax: argument slice length must not be zero\")\n\t}\n\tval = a[0]\n\tfor _, aa := range a {\n\t\tif aa > val {\n\t\t\tval = aa\n\t\t}\n\t}\n\treturn\n}\nfunc intsMaxIdx(a []int) (idx, val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func intsMaxIdx: argument slice length must not be zero\")\n\t}\n\tval = a[0]\n\tfor i, aa := range a {\n\t\tif aa > val {\n\t\t\tidx, val = i, aa\n\t\t}\n\t}\n\treturn\n}\nfunc intsMin(a []int) (val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func intsMin: argument slice length must not be zero\")\n\t}\n\tval = a[0]\n\tfor _, aa := range a {\n\t\tif aa < val {\n\t\t\tval = aa\n\t\t}\n\t}\n\treturn\n}\nfunc intsMinIdx(a []int) (idx, val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func intsMinIdx: argument slice length must not be zero\")\n\t}\n\tval = a[0]\n\tfor i, aa := range a {\n\t\tif aa < val {\n\t\t\tidx, val = i, aa\n\t\t}\n\t}\n\treturn\n}\nfunc intsSum(a []int) int {\n\tres := 0\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\nfunc intsAve(s []int) float64 {\n\treturn float64(intsSum(s)) / float64(len(s))\n}\nfunc intsAdd(ints *[]int, x int) { *ints = append(*ints, x) }\nfunc intsJoin(a, b []int) []int { return append(a, b...) }\nfunc intsClear(a []int) []int { return a[:0] }\nfunc intsCopy(a []int) []int { return append([]int(nil), a...) }\nfunc intsSorted(a []int) []int {\n\ts := intsCopy(a)\n\tsort.Ints(s)\n\treturn s\n}\nfunc intsReverse(a []int) {\n\tfor i, j := 0, len(a)-1; i < j; i, j = i+1, j-1 {\n\t\ta[i], a[j] = a[j], a[i]\n\t}\n\treturn\n}\nfunc intsFill(a []int, val int) {\n\tfor i := 0; i < len(a); i++ {\n\t\ta[i] = val\n\t}\n\treturn\n}\nfunc intsPeekBack(a []int) int {\n\tif len(a) == 0 {\n\t\tpanic(\"func peekBack: zero length slice\")\n\t}\n\treturn a[len(a)-1]\n}\nfunc intsPeekFront(a []int) int {\n\tif len(a) == 0 {\n\t\tpanic(\"func peekFront: zero length slice\")\n\t}\n\treturn a[0]\n}\nfunc intsPopBack(a []int) (int, []int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func popBack: zero length slice\")\n\t}\n\treturn a[len(a)-1], a[:len(a)-1]\n}\nfunc intsPopFront(a []int) (int, []int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func popFront: zero length slice\")\n\t}\n\treturn a[0], a[1:]\n}\nfunc intsPushBack(a []int, x int) []int { return append(a, x) }\nfunc intsPushFront(a []int, x int) []int { return append([]int{x}, a...) }\nfunc intsAppendSentinelHead(a []int, sentinel int) []int {\n\treturn append([]int{sentinel}, a...)\n}\nfunc intsAppendSentinelTail(a []int, sentinel int) []int {\n\treturn append(a, sentinel)\n}\nfunc intsAppendSentinel(a []int, sentinel int) []int {\n\treturn append(append([]int{sentinel}, a[:len(a):len(a)+2]...), sentinel)\n}\nfunc isEven(n int) bool { return n&1 == 0 }\nfunc isOdd(n int) bool { return n&1 == 1 }\nfunc floor(x float64) int { return int(x) }\nfunc ceil(x float64) int { return int(math.Ceil(x)) }\nfunc ceilDiv(x, y int) int { return (x + y - 1) / y }\nfunc pow(x, y int) int {\n\tif y < 0 {\n\t\tpanic(\"Exponent must be a natural number\")\n\t}\n\tz := 1\n\tfor i := y; i != 0; i >>= 1 {\n\t\tif i&1 == 1 {\n\t\t\tz *= x\n\t\t}\n\t\tx *= x\n\t}\n\treturn z\n}\nfunc fact(x int) int {\n\tfact := 1\n\tfor i := 1; i <= x; i++ {\n\t\tfact *= i\n\t}\n\treturn fact\n}\nfunc sigmaK(n int) int { return n * (n + 1) / 2 }\nfunc sigmaKK(n int) int { return (n * (n + 1) / 2) * (2*n + 1) / 3 }\nfunc euclideanDistance(a, b point) float64 {\n\ts := diff(a.x, b.x)\n\ts *= s\n\tt := diff(a.y, b.y)\n\tt *= t\n\treturn math.Sqrt(float64(s) + float64(t))\n}\nfunc manhattanDistance(a, b point) int {\n\ts := diff(a.x, b.x)\n\tt := diff(a.y, b.y)\n\treturn s + t\n}\nfunc swap(a, b *int) { *a, *b = *b, *a }\nfunc chmax(a *int, b int) {\n\tif *a < b {\n\t\t*a = b\n\t}\n}\nfunc chmin(a *int, b int) {\n\tif *a > b {\n\t\t*a = b\n\t}\n}\nfunc cumSum(a []int) []int {\n\tb := append([]int{0}, a...)\n\tfor i := 1; i < len(b); i++ {\n\t\tb[i] += b[i-1]\n\t}\n\treturn b\n}\nfunc runesReverse(a []rune) {\n\tfor i, j := 0, len(a)-1; i < j; i, j = i+1, j-1 {\n\t\ta[i], a[j] = a[j], a[i]\n\t}\n\treturn\n}\nfunc bytesReverse(a []byte) {\n\tfor i, j := 0, len(a)-1; i < j; i, j = i+1, j-1 {\n\t\ta[i], a[j] = a[j], a[i]\n\t}\n\treturn\n}\nfunc strUpperCase(s string) string { return strings.ToUpper(s) }\nfunc strLowerCase(s string) string { return strings.ToLower(s) }\nfunc strToInt(s string) int {\n\ti, err := strconv.Atoi(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\nfunc intToStr(i int) string { return strconv.Itoa(i) }\nfunc CalcMod(a, mod int) int { return (a%mod + mod) % mod }\nfunc ModPow(x, y, mod int) int {\n\tif y < 0 {\n\t\tpanic(\"Exponent must be a natural number\")\n\t}\n\tz := 1\n\tfor i := y; i != 0; i >>= 1 {\n\t\tif i&1 == 1 {\n\t\t\tz = (z * x) % mod\n\t\t}\n\t\tx = (x * x) % mod\n\t}\n\treturn z\n}\nfunc ModFact(x, mod int) int {\n\tfact := 1\n\tfor i := 1; i <= x; i++ {\n\t\tfact = fact * i % mod\n\t}\n\treturn fact\n}\nfunc ModInv(x, mod int) int { return ModPow(x, mod-2, mod) }\nfunc initMatrixBool(parentSize, childSize int, initialValue bool) *[][]bool {\n\tres := make([][]bool, parentSize)\n\tfor i := range res {\n\t\tres[i] = make([]bool, childSize)\n\t\tfor j := range res[i] {\n\t\t\tres[i][j] = initialValue\n\t\t}\n\t}\n\treturn &res\n}\nfunc initMatrixInt(parentSize, childSize int, initialValue int) *[][]int {\n\tres := make([][]int, parentSize)\n\tfor i := range res {\n\t\tres[i] = make([]int, childSize)\n\t\tfor j := range res[i] {\n\t\t\tres[i][j] = initialValue\n\t\t}\n\t}\n\treturn &res\n}\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\tbw = bufio.NewWriterSize(os.Stdout, bwBufSize)\n)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1e7), 1e7)\n}\nfunc ru() (n int) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tfor _, v := range sc.Bytes() {\n\t\tn = n*10 + int(v-48)\n\t}\n\treturn\n}\nfunc ri() (n int) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tb := sc.Bytes()\n\tneg := false\n\tif b[0] == 45 {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tfor _, v := range b {\n\t\tn = n*10 + int(v-48)\n\t}\n\tif neg {\n\t\tn = -n\n\t}\n\treturn\n}\nfunc ri64() (n int64) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tb := sc.Bytes()\n\tneg := false\n\tif b[0] == 45 {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tfor _, v := range b {\n\t\tn = n*10 + int64(v-48)\n\t}\n\tif neg {\n\t\tn = -n\n\t}\n\treturn\n}\nfunc rf64() float64 {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tf, err := strconv.ParseFloat(sc.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn f\n}\nfunc rs() string {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn sc.Text()\n}\nfunc rb() []byte {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn sc.Bytes()\n}\nfunc rr() []rune {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn []rune(sc.Text())\n}\nfunc ris(n int) []int {\n\ts := make([]int, n)\n\tfor i := range s {\n\t\ts[i] = ri()\n\t}\n\treturn s\n}\nfunc risZeroBased(n int) []int {\n\ts := make([]int, n)\n\tfor i := range s {\n\t\ts[i] = ri() - 1\n\t}\n\treturn s\n}\nfunc ri64s(n int) []int64 {\n\ts := make([]int64, n)\n\tfor i := range s {\n\t\ts[i] = ri64()\n\t}\n\treturn s\n}\nfunc rss(n int) []string {\n\ts := make([]string, n)\n\tfor i := range s {\n\t\ts[i] = rs()\n\t}\n\treturn s\n}\nfunc pf(format string, a ...interface{}) {\n\tif _, err := fmt.Fprintf(bw, format, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc pln(a ...interface{}) {\n\tif _, err := fmt.Fprintln(bw, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc pints(a []int) {\n\tfor _, v := range a {\n\t\tfmt.Fprintln(bw, v)\n\t}\n}\nfunc pintsol(a []int) {\n\ts := fmt.Sprint(a)\n\tif _, err := fmt.Fprintln(bw, s[1:len(s)-1]); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc dbg(a ...interface{}) {\n\tif _, err := fmt.Fprintln(os.Stderr, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc YESorNO(b bool) string {\n\tif b {\n\t\treturn \"YES\"\n\t} else {\n\t\treturn \"NO\"\n\t}\n}\nfunc YesOrNo(b bool) string {\n\tif b {\n\t\treturn \"Yes\"\n\t} else {\n\t\treturn \"No\"\n\t}\n}\nfunc main() {\n\tsolve()\n\tbw.Flush()\n}\n\nconst (\n\tbwBufSize = 1e6\n\n\talphabetLower = \"abcdefghijklmnopqrstuvwxyz\"\n\talphabetUpper = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n\n\t// maxInt64 = 9223372036854775807 // 9e18\n\t// maxInt32 = 2147483647 // 2e9\n\t// maxUint64 = 18446744073709551615 // 1e19\n\tinf = 1 << 60\n\tmod = 1e9 + 7\n)\n\ntype pair struct{ fi, se int }\ntype byFiSe []pair\n\nfunc (p byFiSe) Len() int { return len(p) }\nfunc (p byFiSe) Swap(i, j int) { p[i], p[j] = p[j], p[i] }\nfunc (p byFiSe) Less(i, j int) bool {\n\tif p[i].fi == p[j].fi {\n\t\treturn p[i].se < p[j].se\n\t}\n\treturn p[i].fi < p[j].fi\n}\n\ntype point struct{ x, y int }\n\nfunc solve() {\n\ta, b, c := ri(), ri(), ri()\n\tneed := a * c\n\tif b >= need {\n\t\tpln(c)\n\t} else {\n\t\tpln(b / a)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1572332191, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03105.html", "problem_id": "p03105", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03105/input.txt", "sample_output_relpath": "derived/input_output/data/p03105/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03105/Go/s213179265.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s213179265", "user_id": "u554269352"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "// ProblemURL : https://atcoder.jp/contests/abc120/tasks/abc120_a\n// ---------------------------------------------\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\nfunc diff(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\nfunc larger(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc smaller(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc largest(a, b, c int) (lgst int) {\n\tif a > b {\n\t\tlgst = a\n\t} else {\n\t\tlgst = b\n\t}\n\tif c > lgst {\n\t\tlgst = c\n\t}\n\treturn\n}\nfunc smallest(a, b, c int) (slst int) {\n\tif a < b {\n\t\tslst = a\n\t} else {\n\t\tslst = b\n\t}\n\tif c < slst {\n\t\tslst = c\n\t}\n\treturn\n}\nfunc intsMax(a []int) (val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func intsMax: argument slice length must not be zero\")\n\t}\n\tval = a[0]\n\tfor _, aa := range a {\n\t\tif aa > val {\n\t\t\tval = aa\n\t\t}\n\t}\n\treturn\n}\nfunc intsMaxIdx(a []int) (idx, val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func intsMaxIdx: argument slice length must not be zero\")\n\t}\n\tval = a[0]\n\tfor i, aa := range a {\n\t\tif aa > val {\n\t\t\tidx, val = i, aa\n\t\t}\n\t}\n\treturn\n}\nfunc intsMin(a []int) (val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func intsMin: argument slice length must not be zero\")\n\t}\n\tval = a[0]\n\tfor _, aa := range a {\n\t\tif aa < val {\n\t\t\tval = aa\n\t\t}\n\t}\n\treturn\n}\nfunc intsMinIdx(a []int) (idx, val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func intsMinIdx: argument slice length must not be zero\")\n\t}\n\tval = a[0]\n\tfor i, aa := range a {\n\t\tif aa < val {\n\t\t\tidx, val = i, aa\n\t\t}\n\t}\n\treturn\n}\nfunc intsSum(a []int) int {\n\tres := 0\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\nfunc intsAve(s []int) float64 {\n\treturn float64(intsSum(s)) / float64(len(s))\n}\nfunc intsAdd(ints *[]int, x int) { *ints = append(*ints, x) }\nfunc intsJoin(a, b []int) []int { return append(a, b...) }\nfunc intsClear(a []int) []int { return a[:0] }\nfunc intsCopy(a []int) []int { return append([]int(nil), a...) }\nfunc intsSorted(a []int) []int {\n\ts := intsCopy(a)\n\tsort.Ints(s)\n\treturn s\n}\nfunc intsReverse(a []int) {\n\tfor i, j := 0, len(a)-1; i < j; i, j = i+1, j-1 {\n\t\ta[i], a[j] = a[j], a[i]\n\t}\n\treturn\n}\nfunc intsFill(a []int, val int) {\n\tfor i := 0; i < len(a); i++ {\n\t\ta[i] = val\n\t}\n\treturn\n}\nfunc intsPeekBack(a []int) int {\n\tif len(a) == 0 {\n\t\tpanic(\"func peekBack: zero length slice\")\n\t}\n\treturn a[len(a)-1]\n}\nfunc intsPeekFront(a []int) int {\n\tif len(a) == 0 {\n\t\tpanic(\"func peekFront: zero length slice\")\n\t}\n\treturn a[0]\n}\nfunc intsPopBack(a []int) (int, []int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func popBack: zero length slice\")\n\t}\n\treturn a[len(a)-1], a[:len(a)-1]\n}\nfunc intsPopFront(a []int) (int, []int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func popFront: zero length slice\")\n\t}\n\treturn a[0], a[1:]\n}\nfunc intsPushBack(a []int, x int) []int { return append(a, x) }\nfunc intsPushFront(a []int, x int) []int { return append([]int{x}, a...) }\nfunc intsAppendSentinelHead(a []int, sentinel int) []int {\n\treturn append([]int{sentinel}, a...)\n}\nfunc intsAppendSentinelTail(a []int, sentinel int) []int {\n\treturn append(a, sentinel)\n}\nfunc intsAppendSentinel(a []int, sentinel int) []int {\n\treturn append(append([]int{sentinel}, a[:len(a):len(a)+2]...), sentinel)\n}\nfunc isEven(n int) bool { return n&1 == 0 }\nfunc isOdd(n int) bool { return n&1 == 1 }\nfunc floor(x float64) int { return int(x) }\nfunc ceil(x float64) int { return int(math.Ceil(x)) }\nfunc ceilDiv(x, y int) int { return (x + y - 1) / y }\nfunc pow(x, y int) int {\n\tif y < 0 {\n\t\tpanic(\"Exponent must be a natural number\")\n\t}\n\tz := 1\n\tfor i := y; i != 0; i >>= 1 {\n\t\tif i&1 == 1 {\n\t\t\tz *= x\n\t\t}\n\t\tx *= x\n\t}\n\treturn z\n}\nfunc fact(x int) int {\n\tfact := 1\n\tfor i := 1; i <= x; i++ {\n\t\tfact *= i\n\t}\n\treturn fact\n}\nfunc sigmaK(n int) int { return n * (n + 1) / 2 }\nfunc sigmaKK(n int) int { return (n * (n + 1) / 2) * (2*n + 1) / 3 }\nfunc euclideanDistance(a, b point) float64 {\n\ts := diff(a.x, b.x)\n\ts *= s\n\tt := diff(a.y, b.y)\n\tt *= t\n\treturn math.Sqrt(float64(s) + float64(t))\n}\nfunc manhattanDistance(a, b point) int {\n\ts := diff(a.x, b.x)\n\tt := diff(a.y, b.y)\n\treturn s + t\n}\nfunc swap(a, b *int) { *a, *b = *b, *a }\nfunc chmax(a *int, b int) {\n\tif *a < b {\n\t\t*a = b\n\t}\n}\nfunc chmin(a *int, b int) {\n\tif *a > b {\n\t\t*a = b\n\t}\n}\nfunc cumSum(a []int) []int {\n\tb := append([]int{0}, a...)\n\tfor i := 1; i < len(b); i++ {\n\t\tb[i] += b[i-1]\n\t}\n\treturn b\n}\nfunc runesReverse(a []rune) {\n\tfor i, j := 0, len(a)-1; i < j; i, j = i+1, j-1 {\n\t\ta[i], a[j] = a[j], a[i]\n\t}\n\treturn\n}\nfunc bytesReverse(a []byte) {\n\tfor i, j := 0, len(a)-1; i < j; i, j = i+1, j-1 {\n\t\ta[i], a[j] = a[j], a[i]\n\t}\n\treturn\n}\nfunc strUpperCase(s string) string { return strings.ToUpper(s) }\nfunc strLowerCase(s string) string { return strings.ToLower(s) }\nfunc strToInt(s string) int {\n\ti, err := strconv.Atoi(s)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\nfunc intToStr(i int) string { return strconv.Itoa(i) }\nfunc CalcMod(a, mod int) int { return (a%mod + mod) % mod }\nfunc ModPow(x, y, mod int) int {\n\tif y < 0 {\n\t\tpanic(\"Exponent must be a natural number\")\n\t}\n\tz := 1\n\tfor i := y; i != 0; i >>= 1 {\n\t\tif i&1 == 1 {\n\t\t\tz = (z * x) % mod\n\t\t}\n\t\tx = (x * x) % mod\n\t}\n\treturn z\n}\nfunc ModFact(x, mod int) int {\n\tfact := 1\n\tfor i := 1; i <= x; i++ {\n\t\tfact = fact * i % mod\n\t}\n\treturn fact\n}\nfunc ModInv(x, mod int) int { return ModPow(x, mod-2, mod) }\nfunc initMatrixBool(parentSize, childSize int, initialValue bool) *[][]bool {\n\tres := make([][]bool, parentSize)\n\tfor i := range res {\n\t\tres[i] = make([]bool, childSize)\n\t\tfor j := range res[i] {\n\t\t\tres[i][j] = initialValue\n\t\t}\n\t}\n\treturn &res\n}\nfunc initMatrixInt(parentSize, childSize int, initialValue int) *[][]int {\n\tres := make([][]int, parentSize)\n\tfor i := range res {\n\t\tres[i] = make([]int, childSize)\n\t\tfor j := range res[i] {\n\t\t\tres[i][j] = initialValue\n\t\t}\n\t}\n\treturn &res\n}\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\tbw = bufio.NewWriterSize(os.Stdout, bwBufSize)\n)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1e7), 1e7)\n}\nfunc ru() (n int) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tfor _, v := range sc.Bytes() {\n\t\tn = n*10 + int(v-48)\n\t}\n\treturn\n}\nfunc ri() (n int) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tb := sc.Bytes()\n\tneg := false\n\tif b[0] == 45 {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tfor _, v := range b {\n\t\tn = n*10 + int(v-48)\n\t}\n\tif neg {\n\t\tn = -n\n\t}\n\treturn\n}\nfunc ri64() (n int64) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tb := sc.Bytes()\n\tneg := false\n\tif b[0] == 45 {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tfor _, v := range b {\n\t\tn = n*10 + int64(v-48)\n\t}\n\tif neg {\n\t\tn = -n\n\t}\n\treturn\n}\nfunc rf64() float64 {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tf, err := strconv.ParseFloat(sc.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn f\n}\nfunc rs() string {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn sc.Text()\n}\nfunc rb() []byte {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn sc.Bytes()\n}\nfunc rr() []rune {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn []rune(sc.Text())\n}\nfunc ris(n int) []int {\n\ts := make([]int, n)\n\tfor i := range s {\n\t\ts[i] = ri()\n\t}\n\treturn s\n}\nfunc risZeroBased(n int) []int {\n\ts := make([]int, n)\n\tfor i := range s {\n\t\ts[i] = ri() - 1\n\t}\n\treturn s\n}\nfunc ri64s(n int) []int64 {\n\ts := make([]int64, n)\n\tfor i := range s {\n\t\ts[i] = ri64()\n\t}\n\treturn s\n}\nfunc rss(n int) []string {\n\ts := make([]string, n)\n\tfor i := range s {\n\t\ts[i] = rs()\n\t}\n\treturn s\n}\nfunc pf(format string, a ...interface{}) {\n\tif _, err := fmt.Fprintf(bw, format, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc pln(a ...interface{}) {\n\tif _, err := fmt.Fprintln(bw, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc pints(a []int) {\n\tfor _, v := range a {\n\t\tfmt.Fprintln(bw, v)\n\t}\n}\nfunc pintsol(a []int) {\n\ts := fmt.Sprint(a)\n\tif _, err := fmt.Fprintln(bw, s[1:len(s)-1]); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc dbg(a ...interface{}) {\n\tif _, err := fmt.Fprintln(os.Stderr, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc YESorNO(b bool) string {\n\tif b {\n\t\treturn \"YES\"\n\t} else {\n\t\treturn \"NO\"\n\t}\n}\nfunc YesOrNo(b bool) string {\n\tif b {\n\t\treturn \"Yes\"\n\t} else {\n\t\treturn \"No\"\n\t}\n}\nfunc main() {\n\tsolve()\n\tbw.Flush()\n}\n\nconst (\n\tbwBufSize = 1e6\n\n\talphabetLower = \"abcdefghijklmnopqrstuvwxyz\"\n\talphabetUpper = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n\n\t// maxInt64 = 9223372036854775807 // 9e18\n\t// maxInt32 = 2147483647 // 2e9\n\t// maxUint64 = 18446744073709551615 // 1e19\n\tinf = 1 << 60\n\tmod = 1e9 + 7\n)\n\ntype pair struct{ fi, se int }\ntype byFiSe []pair\n\nfunc (p byFiSe) Len() int { return len(p) }\nfunc (p byFiSe) Swap(i, j int) { p[i], p[j] = p[j], p[i] }\nfunc (p byFiSe) Less(i, j int) bool {\n\tif p[i].fi == p[j].fi {\n\t\treturn p[i].se < p[j].se\n\t}\n\treturn p[i].fi < p[j].fi\n}\n\ntype point struct{ x, y int }\n\nfunc solve() {\n\ta, b, c := ri(), ri(), ri()\n\tneed := a * c\n\tif b >= need {\n\t\tpln(c)\n\t} else {\n\t\tpln(b / a)\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi likes the sound when he buys a drink from a vending machine.\n\nThat sound can be heard by spending A yen (the currency of Japan) each time.\n\nTakahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time.\n\nHow many times will he hear the sound?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 100\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 Takahashi will hear his favorite sound.\n\nSample Input 1\n\n2 11 4\n\nSample Output 1\n\n4\n\nSince he has not less than 8 yen, he will hear the sound four times and be satisfied.\n\nSample Input 2\n\n3 9 5\n\nSample Output 2\n\n3\n\nHe may not be able to be satisfied.\n\nSample Input 3\n\n100 1 10\n\nSample Output 3\n\n0", "sample_input": "2 11 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03105", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi likes the sound when he buys a drink from a vending machine.\n\nThat sound can be heard by spending A yen (the currency of Japan) each time.\n\nTakahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time.\n\nHow many times will he hear the sound?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 100\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 Takahashi will hear his favorite sound.\n\nSample Input 1\n\n2 11 4\n\nSample Output 1\n\n4\n\nSince he has not less than 8 yen, he will hear the sound four times and be satisfied.\n\nSample Input 2\n\n3 9 5\n\nSample Output 2\n\n3\n\nHe may not be able to be satisfied.\n\nSample Input 3\n\n100 1 10\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 8941, "cpu_time_ms": 11, "memory_kb": 1024}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s055123102", "group_id": "codeNet:p03105", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var a, b, c int\n fmt.Scan(&a, &b, &c)\n cnt := 0\n for {\n if b < a || b <= 0 || cnt >= c {\n fmt.Println(cnt)\n break\n }\n b = b - a\n cnt++\n }\n}", "language": "Go", "metadata": {"date": 1569913339, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03105.html", "problem_id": "p03105", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03105/input.txt", "sample_output_relpath": "derived/input_output/data/p03105/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03105/Go/s055123102.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s055123102", "user_id": "u195309147"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var a, b, c int\n fmt.Scan(&a, &b, &c)\n cnt := 0\n for {\n if b < a || b <= 0 || cnt >= c {\n fmt.Println(cnt)\n break\n }\n b = b - a\n cnt++\n }\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi likes the sound when he buys a drink from a vending machine.\n\nThat sound can be heard by spending A yen (the currency of Japan) each time.\n\nTakahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time.\n\nHow many times will he hear the sound?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 100\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 Takahashi will hear his favorite sound.\n\nSample Input 1\n\n2 11 4\n\nSample Output 1\n\n4\n\nSince he has not less than 8 yen, he will hear the sound four times and be satisfied.\n\nSample Input 2\n\n3 9 5\n\nSample Output 2\n\n3\n\nHe may not be able to be satisfied.\n\nSample Input 3\n\n100 1 10\n\nSample Output 3\n\n0", "sample_input": "2 11 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03105", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi likes the sound when he buys a drink from a vending machine.\n\nThat sound can be heard by spending A yen (the currency of Japan) each time.\n\nTakahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time.\n\nHow many times will he hear the sound?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 100\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 Takahashi will hear his favorite sound.\n\nSample Input 1\n\n2 11 4\n\nSample Output 1\n\n4\n\nSince he has not less than 8 yen, he will hear the sound four times and be satisfied.\n\nSample Input 2\n\n3 9 5\n\nSample Output 2\n\n3\n\nHe may not be able to be satisfied.\n\nSample Input 3\n\n100 1 10\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s288878085", "group_id": "codeNet:p03105", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scan(&a, &b, &c)\n\tif b*c <= a {\n\t\tfmt.Println(c)\n\t\treturn\n\t}\n\tfmt.Println(b / a)\n}\n", "language": "Go", "metadata": {"date": 1566595177, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03105.html", "problem_id": "p03105", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03105/input.txt", "sample_output_relpath": "derived/input_output/data/p03105/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03105/Go/s288878085.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s288878085", "user_id": "u937220467"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scan(&a, &b, &c)\n\tif b*c <= a {\n\t\tfmt.Println(c)\n\t\treturn\n\t}\n\tfmt.Println(b / a)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi likes the sound when he buys a drink from a vending machine.\n\nThat sound can be heard by spending A yen (the currency of Japan) each time.\n\nTakahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time.\n\nHow many times will he hear the sound?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 100\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 Takahashi will hear his favorite sound.\n\nSample Input 1\n\n2 11 4\n\nSample Output 1\n\n4\n\nSince he has not less than 8 yen, he will hear the sound four times and be satisfied.\n\nSample Input 2\n\n3 9 5\n\nSample Output 2\n\n3\n\nHe may not be able to be satisfied.\n\nSample Input 3\n\n100 1 10\n\nSample Output 3\n\n0", "sample_input": "2 11 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03105", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi likes the sound when he buys a drink from a vending machine.\n\nThat sound can be heard by spending A yen (the currency of Japan) each time.\n\nTakahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time.\n\nHow many times will he hear the sound?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 100\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 Takahashi will hear his favorite sound.\n\nSample Input 1\n\n2 11 4\n\nSample Output 1\n\n4\n\nSince he has not less than 8 yen, he will hear the sound four times and be satisfied.\n\nSample Input 2\n\n3 9 5\n\nSample Output 2\n\n3\n\nHe may not be able to be satisfied.\n\nSample Input 3\n\n100 1 10\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s886083012", "group_id": "codeNet:p03105", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar A, B, C int\n\tfmt.Scan(&A, &B, &C)\n\n\td := B / A\n\tif d < C {\n\t\tfmt.Println(d)\n\t} else {\n\t\tfmt.Println(C)\n\t}\n\n}", "language": "Go", "metadata": {"date": 1556442084, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03105.html", "problem_id": "p03105", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03105/input.txt", "sample_output_relpath": "derived/input_output/data/p03105/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03105/Go/s886083012.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s886083012", "user_id": "u298152049"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar A, B, C int\n\tfmt.Scan(&A, &B, &C)\n\n\td := B / A\n\tif d < C {\n\t\tfmt.Println(d)\n\t} else {\n\t\tfmt.Println(C)\n\t}\n\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi likes the sound when he buys a drink from a vending machine.\n\nThat sound can be heard by spending A yen (the currency of Japan) each time.\n\nTakahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time.\n\nHow many times will he hear the sound?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 100\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 Takahashi will hear his favorite sound.\n\nSample Input 1\n\n2 11 4\n\nSample Output 1\n\n4\n\nSince he has not less than 8 yen, he will hear the sound four times and be satisfied.\n\nSample Input 2\n\n3 9 5\n\nSample Output 2\n\n3\n\nHe may not be able to be satisfied.\n\nSample Input 3\n\n100 1 10\n\nSample Output 3\n\n0", "sample_input": "2 11 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03105", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi likes the sound when he buys a drink from a vending machine.\n\nThat sound can be heard by spending A yen (the currency of Japan) each time.\n\nTakahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time.\n\nHow many times will he hear the sound?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 100\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 Takahashi will hear his favorite sound.\n\nSample Input 1\n\n2 11 4\n\nSample Output 1\n\n4\n\nSince he has not less than 8 yen, he will hear the sound four times and be satisfied.\n\nSample Input 2\n\n3 9 5\n\nSample Output 2\n\n3\n\nHe may not be able to be satisfied.\n\nSample Input 3\n\n100 1 10\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s186435278", "group_id": "codeNet:p03105", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar (\n\t\ta int\n\t\tb int\n\t\tc int\n\t)\n\tfmt.Scan(&a, &b, &c)\n\n\tcnt := b / a\n\n\tif c <= cnt{\n\t\tfmt.Print(c)\n\t}else{\n\t\tfmt.Print(cnt)\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1554762655, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03105.html", "problem_id": "p03105", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03105/input.txt", "sample_output_relpath": "derived/input_output/data/p03105/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03105/Go/s186435278.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s186435278", "user_id": "u864700283"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar (\n\t\ta int\n\t\tb int\n\t\tc int\n\t)\n\tfmt.Scan(&a, &b, &c)\n\n\tcnt := b / a\n\n\tif c <= cnt{\n\t\tfmt.Print(c)\n\t}else{\n\t\tfmt.Print(cnt)\n\t}\n\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi likes the sound when he buys a drink from a vending machine.\n\nThat sound can be heard by spending A yen (the currency of Japan) each time.\n\nTakahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time.\n\nHow many times will he hear the sound?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 100\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 Takahashi will hear his favorite sound.\n\nSample Input 1\n\n2 11 4\n\nSample Output 1\n\n4\n\nSince he has not less than 8 yen, he will hear the sound four times and be satisfied.\n\nSample Input 2\n\n3 9 5\n\nSample Output 2\n\n3\n\nHe may not be able to be satisfied.\n\nSample Input 3\n\n100 1 10\n\nSample Output 3\n\n0", "sample_input": "2 11 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03105", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi likes the sound when he buys a drink from a vending machine.\n\nThat sound can be heard by spending A yen (the currency of Japan) each time.\n\nTakahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time.\n\nHow many times will he hear the sound?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 100\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 Takahashi will hear his favorite sound.\n\nSample Input 1\n\n2 11 4\n\nSample Output 1\n\n4\n\nSince he has not less than 8 yen, he will hear the sound four times and be satisfied.\n\nSample Input 2\n\n3 9 5\n\nSample Output 2\n\n3\n\nHe may not be able to be satisfied.\n\nSample Input 3\n\n100 1 10\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s579641408", "group_id": "codeNet:p03105", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scanln(&a, &b, &c)\n\tt := b / a\n\tif t > c {\n\t\tfmt.Println(c)\n\t} else {\n\t\tfmt.Println(t)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1553633896, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03105.html", "problem_id": "p03105", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03105/input.txt", "sample_output_relpath": "derived/input_output/data/p03105/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03105/Go/s579641408.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s579641408", "user_id": "u167355746"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scanln(&a, &b, &c)\n\tt := b / a\n\tif t > c {\n\t\tfmt.Println(c)\n\t} else {\n\t\tfmt.Println(t)\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi likes the sound when he buys a drink from a vending machine.\n\nThat sound can be heard by spending A yen (the currency of Japan) each time.\n\nTakahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time.\n\nHow many times will he hear the sound?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 100\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 Takahashi will hear his favorite sound.\n\nSample Input 1\n\n2 11 4\n\nSample Output 1\n\n4\n\nSince he has not less than 8 yen, he will hear the sound four times and be satisfied.\n\nSample Input 2\n\n3 9 5\n\nSample Output 2\n\n3\n\nHe may not be able to be satisfied.\n\nSample Input 3\n\n100 1 10\n\nSample Output 3\n\n0", "sample_input": "2 11 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03105", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi likes the sound when he buys a drink from a vending machine.\n\nThat sound can be heard by spending A yen (the currency of Japan) each time.\n\nTakahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time.\n\nHow many times will he hear the sound?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 100\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 Takahashi will hear his favorite sound.\n\nSample Input 1\n\n2 11 4\n\nSample Output 1\n\n4\n\nSince he has not less than 8 yen, he will hear the sound four times and be satisfied.\n\nSample Input 2\n\n3 9 5\n\nSample Output 2\n\n3\n\nHe may not be able to be satisfied.\n\nSample Input 3\n\n100 1 10\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 156, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s321715893", "group_id": "codeNet:p03105", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tnextReader = NewScanner()\n\tline1 := nextInt()\n\tcount := line1[1] / line1[0]\n\n\tif line1[2] > count {\n\t\tfmt.Println(count)\n\t} else {\n\t\tfmt.Println(line1[2])\n\t}\n}\n\n// ------ Mathライブラリ ---------------------------------//\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\n\nfunc maxIdx(a ...int) int {\n\tr := a[0]\n\tindex := 0\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t\tindex = i\n\t\t}\n\t}\n\treturn index\n}\n\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\n\nfunc minIdx(a ...int) int {\n\tr := a[0]\n\tindex := 0\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t\tindex = i\n\t\t}\n\t}\n\treturn index\n}\n\nfunc sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// ------ Mathライブラリ ---------------------------------//\n\n// ----- 標準入力用の関数 ----------------------------------//\nvar nextReader func() []string\n\nfunc NewScanner() func() []string {\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\treturn func() []string {\n\t\tr.Scan()\n\t\treturn strings.Fields(r.Text())\n\t}\n}\n\nfunc nextString() []string {\n\treturn nextReader()\n}\n\nfunc nextInt() []int {\n\tvar intArray []int\n\tstrArray := nextReader()\n\tfor _, v := range strArray {\n\t\ti, _ := strconv.Atoi(v)\n\t\tintArray = append(intArray, i)\n\t}\n\treturn intArray\n}\n\nfunc nextFloat64() []float64 {\n\tvar floatArray []float64\n\tstrArray := nextReader()\n\tfor _, v := range strArray {\n\t\tf, _ := strconv.ParseFloat(v, 64)\n\t\tfloatArray = append(floatArray, f)\n\t}\n\treturn floatArray\n}\n\n// ------ 標準入力用の関数 ---------------------------------//\n\n// ------ あまり使わない -----------------------------------//\nfunc nextInt64() []int64 {\n\tvar int64Array []int64\n\tstrArray := nextReader()\n\tfor _, v := range strArray {\n\t\ti, _ := strconv.ParseInt(v, 10, 64)\n\t\tint64Array = append(int64Array, i)\n\t}\n\treturn int64Array\n}\n\n// ------ あまり使わない -----------------------------------//\n", "language": "Go", "metadata": {"date": 1551993417, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03105.html", "problem_id": "p03105", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03105/input.txt", "sample_output_relpath": "derived/input_output/data/p03105/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03105/Go/s321715893.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s321715893", "user_id": "u048735692"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tnextReader = NewScanner()\n\tline1 := nextInt()\n\tcount := line1[1] / line1[0]\n\n\tif line1[2] > count {\n\t\tfmt.Println(count)\n\t} else {\n\t\tfmt.Println(line1[2])\n\t}\n}\n\n// ------ Mathライブラリ ---------------------------------//\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\n\nfunc maxIdx(a ...int) int {\n\tr := a[0]\n\tindex := 0\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t\tindex = i\n\t\t}\n\t}\n\treturn index\n}\n\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\n\nfunc minIdx(a ...int) int {\n\tr := a[0]\n\tindex := 0\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t\tindex = i\n\t\t}\n\t}\n\treturn index\n}\n\nfunc sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// ------ Mathライブラリ ---------------------------------//\n\n// ----- 標準入力用の関数 ----------------------------------//\nvar nextReader func() []string\n\nfunc NewScanner() func() []string {\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\treturn func() []string {\n\t\tr.Scan()\n\t\treturn strings.Fields(r.Text())\n\t}\n}\n\nfunc nextString() []string {\n\treturn nextReader()\n}\n\nfunc nextInt() []int {\n\tvar intArray []int\n\tstrArray := nextReader()\n\tfor _, v := range strArray {\n\t\ti, _ := strconv.Atoi(v)\n\t\tintArray = append(intArray, i)\n\t}\n\treturn intArray\n}\n\nfunc nextFloat64() []float64 {\n\tvar floatArray []float64\n\tstrArray := nextReader()\n\tfor _, v := range strArray {\n\t\tf, _ := strconv.ParseFloat(v, 64)\n\t\tfloatArray = append(floatArray, f)\n\t}\n\treturn floatArray\n}\n\n// ------ 標準入力用の関数 ---------------------------------//\n\n// ------ あまり使わない -----------------------------------//\nfunc nextInt64() []int64 {\n\tvar int64Array []int64\n\tstrArray := nextReader()\n\tfor _, v := range strArray {\n\t\ti, _ := strconv.ParseInt(v, 10, 64)\n\t\tint64Array = append(int64Array, i)\n\t}\n\treturn int64Array\n}\n\n// ------ あまり使わない -----------------------------------//\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi likes the sound when he buys a drink from a vending machine.\n\nThat sound can be heard by spending A yen (the currency of Japan) each time.\n\nTakahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time.\n\nHow many times will he hear the sound?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 100\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 Takahashi will hear his favorite sound.\n\nSample Input 1\n\n2 11 4\n\nSample Output 1\n\n4\n\nSince he has not less than 8 yen, he will hear the sound four times and be satisfied.\n\nSample Input 2\n\n3 9 5\n\nSample Output 2\n\n3\n\nHe may not be able to be satisfied.\n\nSample Input 3\n\n100 1 10\n\nSample Output 3\n\n0", "sample_input": "2 11 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03105", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi likes the sound when he buys a drink from a vending machine.\n\nThat sound can be heard by spending A yen (the currency of Japan) each time.\n\nTakahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time.\n\nHow many times will he hear the sound?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 100\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 Takahashi will hear his favorite sound.\n\nSample Input 1\n\n2 11 4\n\nSample Output 1\n\n4\n\nSince he has not less than 8 yen, he will hear the sound four times and be satisfied.\n\nSample Input 2\n\n3 9 5\n\nSample Output 2\n\n3\n\nHe may not be able to be satisfied.\n\nSample Input 3\n\n100 1 10\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2196, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s427428835", "group_id": "codeNet:p03105", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = readInt()\n\t}\n\treturn b\n}\n\nfunc readLengthAndSlice() (int, []int) {\n\tn := readInt()\n\treturn n, readIntSlice(n)\n}\n\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(stdout, f, args...)\n}\n\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(stdout, args...)\n}\n\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\n// readString() string\n// readInt() int\n// readIntSlice(n int) []int\n// readLengthAndSlice() []int\n\n// -----------------------------------------------------------------------------\n\nfunc main() {\n\tdefer stdout.Flush()\n\ta := readInt()\n\tb := readInt()\n\tc := readInt()\n\n\tprintln(minInt(b/a, c))\n}\n\n// -----------------------------------------------------------------------------\n\nfunc minInt(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minUint(a, b uint) uint {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minInt64(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minUint64(a, b uint64) uint64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc maxInt(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxUint(a, b uint) uint {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc maxInt64(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxUint64(a, b uint64) uint64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc absInt(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absInt64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n", "language": "Go", "metadata": {"date": 1551674756, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03105.html", "problem_id": "p03105", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03105/input.txt", "sample_output_relpath": "derived/input_output/data/p03105/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03105/Go/s427428835.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s427428835", "user_id": "u705974985"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = readInt()\n\t}\n\treturn b\n}\n\nfunc readLengthAndSlice() (int, []int) {\n\tn := readInt()\n\treturn n, readIntSlice(n)\n}\n\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(stdout, f, args...)\n}\n\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(stdout, args...)\n}\n\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\n// readString() string\n// readInt() int\n// readIntSlice(n int) []int\n// readLengthAndSlice() []int\n\n// -----------------------------------------------------------------------------\n\nfunc main() {\n\tdefer stdout.Flush()\n\ta := readInt()\n\tb := readInt()\n\tc := readInt()\n\n\tprintln(minInt(b/a, c))\n}\n\n// -----------------------------------------------------------------------------\n\nfunc minInt(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minUint(a, b uint) uint {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minInt64(a, b int64) int64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc minUint64(a, b uint64) uint64 {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc maxInt(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxUint(a, b uint) uint {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc maxInt64(a, b int64) int64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxUint64(a, b uint64) uint64 {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc absInt(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc absInt64(a int64) int64 {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi likes the sound when he buys a drink from a vending machine.\n\nThat sound can be heard by spending A yen (the currency of Japan) each time.\n\nTakahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time.\n\nHow many times will he hear the sound?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 100\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 Takahashi will hear his favorite sound.\n\nSample Input 1\n\n2 11 4\n\nSample Output 1\n\n4\n\nSince he has not less than 8 yen, he will hear the sound four times and be satisfied.\n\nSample Input 2\n\n3 9 5\n\nSample Output 2\n\n3\n\nHe may not be able to be satisfied.\n\nSample Input 3\n\n100 1 10\n\nSample Output 3\n\n0", "sample_input": "2 11 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03105", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi likes the sound when he buys a drink from a vending machine.\n\nThat sound can be heard by spending A yen (the currency of Japan) each time.\n\nTakahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time.\n\nHow many times will he hear the sound?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 100\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 Takahashi will hear his favorite sound.\n\nSample Input 1\n\n2 11 4\n\nSample Output 1\n\n4\n\nSince he has not less than 8 yen, he will hear the sound four times and be satisfied.\n\nSample Input 2\n\n3 9 5\n\nSample Output 2\n\n3\n\nHe may not be able to be satisfied.\n\nSample Input 3\n\n100 1 10\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2205, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s667986390", "group_id": "codeNet:p03105", "input_text": "package main\n/*\nN A B\n*/\nimport (\n \"bufio\"\n \"fmt\"\n // \"log\"\n \"os\"\n \"strconv\"\n \"strings\"\n)\n\nfunc main() {\n stdin := bufio.NewScanner(os.Stdin)\n stdin.Scan()\n line := strings.Split(stdin.Text(), \" \")\n a, _ := strconv.Atoi(line[0])\n b, _ := strconv.Atoi(line[1])\n c, _ := strconv.Atoi(line[2])\n\tn:=0\n\tfor i:=1;i*a <= b;i++ {\n\tif i <= c {\n\tn++\n\t}\n\t\n\t}\n\tfmt.Println(n)\n\n}\n", "language": "Go", "metadata": {"date": 1551657423, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03105.html", "problem_id": "p03105", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03105/input.txt", "sample_output_relpath": "derived/input_output/data/p03105/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03105/Go/s667986390.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s667986390", "user_id": "u456086981"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n/*\nN A B\n*/\nimport (\n \"bufio\"\n \"fmt\"\n // \"log\"\n \"os\"\n \"strconv\"\n \"strings\"\n)\n\nfunc main() {\n stdin := bufio.NewScanner(os.Stdin)\n stdin.Scan()\n line := strings.Split(stdin.Text(), \" \")\n a, _ := strconv.Atoi(line[0])\n b, _ := strconv.Atoi(line[1])\n c, _ := strconv.Atoi(line[2])\n\tn:=0\n\tfor i:=1;i*a <= b;i++ {\n\tif i <= c {\n\tn++\n\t}\n\t\n\t}\n\tfmt.Println(n)\n\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi likes the sound when he buys a drink from a vending machine.\n\nThat sound can be heard by spending A yen (the currency of Japan) each time.\n\nTakahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time.\n\nHow many times will he hear the sound?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 100\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 Takahashi will hear his favorite sound.\n\nSample Input 1\n\n2 11 4\n\nSample Output 1\n\n4\n\nSince he has not less than 8 yen, he will hear the sound four times and be satisfied.\n\nSample Input 2\n\n3 9 5\n\nSample Output 2\n\n3\n\nHe may not be able to be satisfied.\n\nSample Input 3\n\n100 1 10\n\nSample Output 3\n\n0", "sample_input": "2 11 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03105", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi likes the sound when he buys a drink from a vending machine.\n\nThat sound can be heard by spending A yen (the currency of Japan) each time.\n\nTakahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time.\n\nHow many times will he hear the sound?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 100\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 Takahashi will hear his favorite sound.\n\nSample Input 1\n\n2 11 4\n\nSample Output 1\n\n4\n\nSince he has not less than 8 yen, he will hear the sound four times and be satisfied.\n\nSample Input 2\n\n3 9 5\n\nSample Output 2\n\n3\n\nHe may not be able to be satisfied.\n\nSample Input 3\n\n100 1 10\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s862313293", "group_id": "codeNet:p03105", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var A, B, C int\n fmt.Scan(&A, &B, &C)\n \n var c int\n for i := 1; i*A <= B; i++ {\n c++\n if c == C {\n break\n }\n }\n fmt.Println(c)\n}", "language": "Go", "metadata": {"date": 1551644039, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03105.html", "problem_id": "p03105", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03105/input.txt", "sample_output_relpath": "derived/input_output/data/p03105/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03105/Go/s862313293.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s862313293", "user_id": "u649037611"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var A, B, C int\n fmt.Scan(&A, &B, &C)\n \n var c int\n for i := 1; i*A <= B; i++ {\n c++\n if c == C {\n break\n }\n }\n fmt.Println(c)\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi likes the sound when he buys a drink from a vending machine.\n\nThat sound can be heard by spending A yen (the currency of Japan) each time.\n\nTakahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time.\n\nHow many times will he hear the sound?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 100\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 Takahashi will hear his favorite sound.\n\nSample Input 1\n\n2 11 4\n\nSample Output 1\n\n4\n\nSince he has not less than 8 yen, he will hear the sound four times and be satisfied.\n\nSample Input 2\n\n3 9 5\n\nSample Output 2\n\n3\n\nHe may not be able to be satisfied.\n\nSample Input 3\n\n100 1 10\n\nSample Output 3\n\n0", "sample_input": "2 11 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03105", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi likes the sound when he buys a drink from a vending machine.\n\nThat sound can be heard by spending A yen (the currency of Japan) each time.\n\nTakahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time.\n\nHow many times will he hear the sound?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 100\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 Takahashi will hear his favorite sound.\n\nSample Input 1\n\n2 11 4\n\nSample Output 1\n\n4\n\nSince he has not less than 8 yen, he will hear the sound four times and be satisfied.\n\nSample Input 2\n\n3 9 5\n\nSample Output 2\n\n3\n\nHe may not be able to be satisfied.\n\nSample Input 3\n\n100 1 10\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s667287590", "group_id": "codeNet:p03105", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scan(&a, &b, &c)\n\td := b/a\n\tif d > c {\n\t\tfmt.Println(c)\n\t} else {\n\t\tfmt.Println(d)\n\t}\n}", "language": "Go", "metadata": {"date": 1551643924, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03105.html", "problem_id": "p03105", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03105/input.txt", "sample_output_relpath": "derived/input_output/data/p03105/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03105/Go/s667287590.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s667287590", "user_id": "u900303768"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scan(&a, &b, &c)\n\td := b/a\n\tif d > c {\n\t\tfmt.Println(c)\n\t} else {\n\t\tfmt.Println(d)\n\t}\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi likes the sound when he buys a drink from a vending machine.\n\nThat sound can be heard by spending A yen (the currency of Japan) each time.\n\nTakahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time.\n\nHow many times will he hear the sound?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 100\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 Takahashi will hear his favorite sound.\n\nSample Input 1\n\n2 11 4\n\nSample Output 1\n\n4\n\nSince he has not less than 8 yen, he will hear the sound four times and be satisfied.\n\nSample Input 2\n\n3 9 5\n\nSample Output 2\n\n3\n\nHe may not be able to be satisfied.\n\nSample Input 3\n\n100 1 10\n\nSample Output 3\n\n0", "sample_input": "2 11 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03105", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi likes the sound when he buys a drink from a vending machine.\n\nThat sound can be heard by spending A yen (the currency of Japan) each time.\n\nTakahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time.\n\nHow many times will he hear the sound?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 100\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 Takahashi will hear his favorite sound.\n\nSample Input 1\n\n2 11 4\n\nSample Output 1\n\n4\n\nSince he has not less than 8 yen, he will hear the sound four times and be satisfied.\n\nSample Input 2\n\n3 9 5\n\nSample Output 2\n\n3\n\nHe may not be able to be satisfied.\n\nSample Input 3\n\n100 1 10\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s412429225", "group_id": "codeNet:p03105", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n////////////////////////////////////////\n/// templates ///\n////////////////////////////////////////\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc readBigLine() string {\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc strSprit(str string) []string {\n\tcols := strings.Split(str, \" \")\n\treturn cols\n}\n\nfunc parseInt(str string) int {\n\tn, _ := strconv.Atoi(str)\n\treturn n\n}\n\nfunc intSprit(str string) []int {\n\tstrs := strSprit(str)\n\tcols := make([]int, len(strs))\n\tfor i, v := range strs {\n\t\tcols[i] = parseInt(v)\n\t}\n\treturn cols\n}\n\nfunc bitCount(n uint) int {\n\n\tx := uint64(n)\n\n\tconst m = 1<<64 - 1\n\tconst m0 = 0x5555555555555555\n\tconst m1 = 0x3333333333333333\n\tconst m2 = 0x0f0f0f0f0f0f0f0f\n\n\tx = x>>1&(m0&m) + x&(m0&m)\n\tx = x>>2&(m1&m) + x&(m1&m)\n\tx = (x>>4 + x) & (m2 & m)\n\tx += x >> 8\n\tx += x >> 16\n\tx += x >> 32\n\n\treturn int(x) & (1<<7 - 1)\n}\n\nfunc bitExist(n, i int) bool {\n\treturn ((n >> uint(i)) & 1) == 1\n}\n\nfunc setBit(d, n int) int {\n\tt := 1 << uint(n)\n\treturn d | t\n}\n\nfunc intAbs(n int) int {\n\treturn int(math.Abs(float64(n)))\n}\n\n////////////////////////////////////////\n/// end templates ///\n////////////////////////////////////////\n\nfunc main() {\n\tline := nextLine()\n\n\tspl := intSprit(line)\n\n\tt := spl[1] / spl[0]\n\n\tif t >= spl[2] {\n\t\tfmt.Println(spl[2])\n\t} else {\n\t\tfmt.Println(t)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1551643385, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03105.html", "problem_id": "p03105", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03105/input.txt", "sample_output_relpath": "derived/input_output/data/p03105/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03105/Go/s412429225.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s412429225", "user_id": "u925392563"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n////////////////////////////////////////\n/// templates ///\n////////////////////////////////////////\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc readBigLine() string {\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc strSprit(str string) []string {\n\tcols := strings.Split(str, \" \")\n\treturn cols\n}\n\nfunc parseInt(str string) int {\n\tn, _ := strconv.Atoi(str)\n\treturn n\n}\n\nfunc intSprit(str string) []int {\n\tstrs := strSprit(str)\n\tcols := make([]int, len(strs))\n\tfor i, v := range strs {\n\t\tcols[i] = parseInt(v)\n\t}\n\treturn cols\n}\n\nfunc bitCount(n uint) int {\n\n\tx := uint64(n)\n\n\tconst m = 1<<64 - 1\n\tconst m0 = 0x5555555555555555\n\tconst m1 = 0x3333333333333333\n\tconst m2 = 0x0f0f0f0f0f0f0f0f\n\n\tx = x>>1&(m0&m) + x&(m0&m)\n\tx = x>>2&(m1&m) + x&(m1&m)\n\tx = (x>>4 + x) & (m2 & m)\n\tx += x >> 8\n\tx += x >> 16\n\tx += x >> 32\n\n\treturn int(x) & (1<<7 - 1)\n}\n\nfunc bitExist(n, i int) bool {\n\treturn ((n >> uint(i)) & 1) == 1\n}\n\nfunc setBit(d, n int) int {\n\tt := 1 << uint(n)\n\treturn d | t\n}\n\nfunc intAbs(n int) int {\n\treturn int(math.Abs(float64(n)))\n}\n\n////////////////////////////////////////\n/// end templates ///\n////////////////////////////////////////\n\nfunc main() {\n\tline := nextLine()\n\n\tspl := intSprit(line)\n\n\tt := spl[1] / spl[0]\n\n\tif t >= spl[2] {\n\t\tfmt.Println(spl[2])\n\t} else {\n\t\tfmt.Println(t)\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi likes the sound when he buys a drink from a vending machine.\n\nThat sound can be heard by spending A yen (the currency of Japan) each time.\n\nTakahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time.\n\nHow many times will he hear the sound?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 100\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 Takahashi will hear his favorite sound.\n\nSample Input 1\n\n2 11 4\n\nSample Output 1\n\n4\n\nSince he has not less than 8 yen, he will hear the sound four times and be satisfied.\n\nSample Input 2\n\n3 9 5\n\nSample Output 2\n\n3\n\nHe may not be able to be satisfied.\n\nSample Input 3\n\n100 1 10\n\nSample Output 3\n\n0", "sample_input": "2 11 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03105", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi likes the sound when he buys a drink from a vending machine.\n\nThat sound can be heard by spending A yen (the currency of Japan) each time.\n\nTakahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time.\n\nHow many times will he hear the sound?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 100\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 Takahashi will hear his favorite sound.\n\nSample Input 1\n\n2 11 4\n\nSample Output 1\n\n4\n\nSince he has not less than 8 yen, he will hear the sound four times and be satisfied.\n\nSample Input 2\n\n3 9 5\n\nSample Output 2\n\n3\n\nHe may not be able to be satisfied.\n\nSample Input 3\n\n100 1 10\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1654, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s719471406", "group_id": "codeNet:p03105", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scan(&a, &b, &c)\n\td := b / a\n\tif c < d {\n\t\tfmt.Println(c)\n\t} else {\n\t\tfmt.Println(d)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1551643346, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03105.html", "problem_id": "p03105", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03105/input.txt", "sample_output_relpath": "derived/input_output/data/p03105/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03105/Go/s719471406.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s719471406", "user_id": "u375977529"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b, c int\n\tfmt.Scan(&a, &b, &c)\n\td := b / a\n\tif c < d {\n\t\tfmt.Println(c)\n\t} else {\n\t\tfmt.Println(d)\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi likes the sound when he buys a drink from a vending machine.\n\nThat sound can be heard by spending A yen (the currency of Japan) each time.\n\nTakahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time.\n\nHow many times will he hear the sound?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 100\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 Takahashi will hear his favorite sound.\n\nSample Input 1\n\n2 11 4\n\nSample Output 1\n\n4\n\nSince he has not less than 8 yen, he will hear the sound four times and be satisfied.\n\nSample Input 2\n\n3 9 5\n\nSample Output 2\n\n3\n\nHe may not be able to be satisfied.\n\nSample Input 3\n\n100 1 10\n\nSample Output 3\n\n0", "sample_input": "2 11 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03105", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi likes the sound when he buys a drink from a vending machine.\n\nThat sound can be heard by spending A yen (the currency of Japan) each time.\n\nTakahashi has B yen. He will hear the sound as many times as he can with that money, but at most C times, as he would be satisfied at that time.\n\nHow many times will he hear the sound?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 100\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 Takahashi will hear his favorite sound.\n\nSample Input 1\n\n2 11 4\n\nSample Output 1\n\n4\n\nSince he has not less than 8 yen, he will hear the sound four times and be satisfied.\n\nSample Input 2\n\n3 9 5\n\nSample Output 2\n\n3\n\nHe may not be able to be satisfied.\n\nSample Input 3\n\n100 1 10\n\nSample Output 3\n\n0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s971914911", "group_id": "codeNet:p03160", "input_text": "//go:generate echo \"https://atcoder.jp/contests/dp/tasks/dp_a\"\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype scanner struct{ *bufio.Scanner }\n\nfunc newScanner(r io.Reader) *scanner {\n\ts := bufio.NewScanner(r)\n\ts.Split(bufio.ScanWords)\n\ts.Buffer(nil, 100000000)\n\treturn &scanner{s}\n}\n\nfunc (s *scanner) Int() int {\n\ts.Scan()\n\tn, _ := strconv.Atoi(s.Text())\n\treturn n\n}\n\nfunc (s *scanner) IntSlice(l int) []int {\n\tif l == 0 {\n\t\treturn []int{}\n\t}\n\tsl := make([]int, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.Int()\n\t}\n\treturn sl\n}\n\nfunc iabs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc solve(n int, heights []int) int {\n\tt := make([]int, n+1, n+1)\n\tfor i := range t {\n\t\tt[i] = math.MaxInt64\n\t}\n\n\tt[0] = 0\n\tfor i := 1; i < n; i++ {\n\t\tif v := t[i-1] + iabs(heights[i]-heights[i-1]); v < t[i] {\n\t\t\tt[i] = v\n\t\t}\n\t\tif 1 < i {\n\t\t\tif v := t[i-2] + iabs(heights[i]-heights[i-2]); v < t[i] {\n\t\t\t\tt[i] = v\n\t\t\t}\n\t\t}\n\t}\n\n\treturn t[n-1]\n}\n\nfunc main() {\n\tsc := newScanner(os.Stdin)\n\tn := sc.Int()\n\theights := sc.IntSlice(n)\n\tans := solve(n, heights)\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1599170103, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03160.html", "problem_id": "p03160", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03160/input.txt", "sample_output_relpath": "derived/input_output/data/p03160/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03160/Go/s971914911.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s971914911", "user_id": "u890085018"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "//go:generate echo \"https://atcoder.jp/contests/dp/tasks/dp_a\"\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype scanner struct{ *bufio.Scanner }\n\nfunc newScanner(r io.Reader) *scanner {\n\ts := bufio.NewScanner(r)\n\ts.Split(bufio.ScanWords)\n\ts.Buffer(nil, 100000000)\n\treturn &scanner{s}\n}\n\nfunc (s *scanner) Int() int {\n\ts.Scan()\n\tn, _ := strconv.Atoi(s.Text())\n\treturn n\n}\n\nfunc (s *scanner) IntSlice(l int) []int {\n\tif l == 0 {\n\t\treturn []int{}\n\t}\n\tsl := make([]int, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.Int()\n\t}\n\treturn sl\n}\n\nfunc iabs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc solve(n int, heights []int) int {\n\tt := make([]int, n+1, n+1)\n\tfor i := range t {\n\t\tt[i] = math.MaxInt64\n\t}\n\n\tt[0] = 0\n\tfor i := 1; i < n; i++ {\n\t\tif v := t[i-1] + iabs(heights[i]-heights[i-1]); v < t[i] {\n\t\t\tt[i] = v\n\t\t}\n\t\tif 1 < i {\n\t\t\tif v := t[i-2] + iabs(heights[i]-heights[i-2]); v < t[i] {\n\t\t\t\tt[i] = v\n\t\t\t}\n\t\t}\n\t}\n\n\treturn t[n-1]\n}\n\nfunc main() {\n\tsc := newScanner(os.Stdin)\n\tn := sc.Int()\n\theights := sc.IntSlice(n)\n\tans := solve(n, heights)\n\tfmt.Println(ans)\n}\n", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "sample_input": "4\n10 30 40 20\n"}, "reference_outputs": ["30\n"], "source_document_id": "p03160", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1096, "cpu_time_ms": 24, "memory_kb": 3800}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s927341999", "group_id": "codeNet:p03160", "input_text": "//go:generate echo \"https://atcoder.jp/contests/dp/tasks/dp_a\"\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype scanner struct{ *bufio.Scanner }\n\nfunc newScanner(r io.Reader) *scanner {\n\ts := bufio.NewScanner(r)\n\ts.Split(bufio.ScanWords)\n\ts.Buffer(nil, 100000000)\n\treturn &scanner{s}\n}\n\nfunc (s *scanner) Int() int {\n\ts.Scan()\n\tn, _ := strconv.Atoi(s.Text())\n\treturn n\n}\n\nfunc (s *scanner) IntSlice(l int) []int {\n\tif l == 0 {\n\t\treturn []int{}\n\t}\n\tsl := make([]int, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.Int()\n\t}\n\treturn sl\n}\n\nfunc iabs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc solve(n int, heights []int) int {\n\tt := make([]int, n+1, n+1)\n\tfor i := range t {\n\t\tt[i] = math.MaxInt64\n\t}\n\n\tt[0] = 0\n\tfor i := 1; i < n; i++ {\n\t\tif v := t[i-1] + iabs(heights[i]-heights[i-1]); v < t[i] {\n\t\t\tt[i] = v\n\t\t}\n\t\tif 1 < i {\n\t\t\tif v := t[i-2] + iabs(heights[i]-heights[i-2]); v < t[i] {\n\t\t\t\tt[i] = v\n\t\t\t}\n\t\t}\n\t}\n\n\treturn t[n-1]\n}\n\nfunc main() {\n\tsc := newScanner(os.Stdin)\n\tn := sc.Int()\n\theights := sc.IntSlice(n)\n\tans := solve(n, heights)\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1599169843, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03160.html", "problem_id": "p03160", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03160/input.txt", "sample_output_relpath": "derived/input_output/data/p03160/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03160/Go/s927341999.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s927341999", "user_id": "u890085018"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "//go:generate echo \"https://atcoder.jp/contests/dp/tasks/dp_a\"\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype scanner struct{ *bufio.Scanner }\n\nfunc newScanner(r io.Reader) *scanner {\n\ts := bufio.NewScanner(r)\n\ts.Split(bufio.ScanWords)\n\ts.Buffer(nil, 100000000)\n\treturn &scanner{s}\n}\n\nfunc (s *scanner) Int() int {\n\ts.Scan()\n\tn, _ := strconv.Atoi(s.Text())\n\treturn n\n}\n\nfunc (s *scanner) IntSlice(l int) []int {\n\tif l == 0 {\n\t\treturn []int{}\n\t}\n\tsl := make([]int, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.Int()\n\t}\n\treturn sl\n}\n\nfunc iabs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc solve(n int, heights []int) int {\n\tt := make([]int, n+1, n+1)\n\tfor i := range t {\n\t\tt[i] = math.MaxInt64\n\t}\n\n\tt[0] = 0\n\tfor i := 1; i < n; i++ {\n\t\tif v := t[i-1] + iabs(heights[i]-heights[i-1]); v < t[i] {\n\t\t\tt[i] = v\n\t\t}\n\t\tif 1 < i {\n\t\t\tif v := t[i-2] + iabs(heights[i]-heights[i-2]); v < t[i] {\n\t\t\t\tt[i] = v\n\t\t\t}\n\t\t}\n\t}\n\n\treturn t[n-1]\n}\n\nfunc main() {\n\tsc := newScanner(os.Stdin)\n\tn := sc.Int()\n\theights := sc.IntSlice(n)\n\tans := solve(n, heights)\n\tfmt.Println(ans)\n}\n", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "sample_input": "4\n10 30 40 20\n"}, "reference_outputs": ["30\n"], "source_document_id": "p03160", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1096, "cpu_time_ms": 23, "memory_kb": 3800}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s239483477", "group_id": "codeNet:p03160", "input_text": "//go:generate echo \"https://atcoder.jp/contests/dp/tasks/dp_a\"\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype scanner struct{ *bufio.Scanner }\n\nfunc newScanner(r io.Reader) *scanner {\n\ts := bufio.NewScanner(r)\n\ts.Split(bufio.ScanWords)\n\ts.Buffer(nil, 100000000)\n\treturn &scanner{s}\n}\n\nfunc (s *scanner) Int() int {\n\ts.Scan()\n\tn, _ := strconv.Atoi(s.Text())\n\treturn n\n}\n\nfunc (s *scanner) IntSlice(l int) []int {\n\tif l == 0 {\n\t\treturn []int{}\n\t}\n\tsl := make([]int, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.Int()\n\t}\n\treturn sl\n}\n\nfunc iabs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc solve(n int, heights []int) int {\n\tt := make([]int, n+1, n+1)\n\tfor i := range t {\n\t\tt[i] = math.MaxInt64\n\t}\n\n\tt[0] = 0\n\tfor i := 1; i < n; i++ {\n\t\tif v := t[i-1] + iabs(heights[i]-heights[i-1]); v < t[i] {\n\t\t\tt[i] = v\n\t\t}\n\t\tif 1 < i {\n\t\t\tif v := t[i-2] + iabs(heights[i]-heights[i-2]); v < t[i] {\n\t\t\t\tt[i] = v\n\t\t\t}\n\t\t}\n\t}\n\n\treturn t[n-1]\n}\n\nfunc main() {\n\tsc := newScanner(os.Stdin)\n\tn := sc.Int()\n\theights := sc.IntSlice(n)\n\tans := solve(n, heights)\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1599169669, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03160.html", "problem_id": "p03160", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03160/input.txt", "sample_output_relpath": "derived/input_output/data/p03160/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03160/Go/s239483477.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s239483477", "user_id": "u890085018"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "//go:generate echo \"https://atcoder.jp/contests/dp/tasks/dp_a\"\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype scanner struct{ *bufio.Scanner }\n\nfunc newScanner(r io.Reader) *scanner {\n\ts := bufio.NewScanner(r)\n\ts.Split(bufio.ScanWords)\n\ts.Buffer(nil, 100000000)\n\treturn &scanner{s}\n}\n\nfunc (s *scanner) Int() int {\n\ts.Scan()\n\tn, _ := strconv.Atoi(s.Text())\n\treturn n\n}\n\nfunc (s *scanner) IntSlice(l int) []int {\n\tif l == 0 {\n\t\treturn []int{}\n\t}\n\tsl := make([]int, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.Int()\n\t}\n\treturn sl\n}\n\nfunc iabs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc solve(n int, heights []int) int {\n\tt := make([]int, n+1, n+1)\n\tfor i := range t {\n\t\tt[i] = math.MaxInt64\n\t}\n\n\tt[0] = 0\n\tfor i := 1; i < n; i++ {\n\t\tif v := t[i-1] + iabs(heights[i]-heights[i-1]); v < t[i] {\n\t\t\tt[i] = v\n\t\t}\n\t\tif 1 < i {\n\t\t\tif v := t[i-2] + iabs(heights[i]-heights[i-2]); v < t[i] {\n\t\t\t\tt[i] = v\n\t\t\t}\n\t\t}\n\t}\n\n\treturn t[n-1]\n}\n\nfunc main() {\n\tsc := newScanner(os.Stdin)\n\tn := sc.Int()\n\theights := sc.IntSlice(n)\n\tans := solve(n, heights)\n\tfmt.Println(ans)\n}\n", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "sample_input": "4\n10 30 40 20\n"}, "reference_outputs": ["30\n"], "source_document_id": "p03160", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1096, "cpu_time_ms": 27, "memory_kb": 3784}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s239628563", "group_id": "codeNet:p03160", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tscanInit()\n\n\tn := nextInt()\n\th := make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\th[i] = nextInt()\n\t}\n\n\tdp := make([]int, n)\n\tdp[0] = 0\n\tfor i := 1; i < n; i++ {\n\t\tif i == 1 {\n\t\t\tdp[i] = abs(h[i] - h[i-1])\n\t\t\tcontinue\n\t\t}\n\t\tb1 := dp[i-1] + abs(h[i]-h[i-1])\n\t\tb2 := dp[i-2] + abs(h[i]-h[i-2])\n\t\tdp[i] = min(b2, b1)\n\t}\n\n\tfmt.Println(dp[n-1])\n\n}\nfunc min(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// ---- readfunc\nfunc scanInit() {\n\tconst cap = 200 * 1024 // Default=64\n\tvar buf = make([]byte, cap)\n\tsc.Buffer(buf, cap)\n\tsc.Split(bufio.ScanWords)\n\treturn\n}\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "language": "Go", "metadata": {"date": 1596741651, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03160.html", "problem_id": "p03160", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03160/input.txt", "sample_output_relpath": "derived/input_output/data/p03160/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03160/Go/s239628563.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s239628563", "user_id": "u756000295"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tscanInit()\n\n\tn := nextInt()\n\th := make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\th[i] = nextInt()\n\t}\n\n\tdp := make([]int, n)\n\tdp[0] = 0\n\tfor i := 1; i < n; i++ {\n\t\tif i == 1 {\n\t\t\tdp[i] = abs(h[i] - h[i-1])\n\t\t\tcontinue\n\t\t}\n\t\tb1 := dp[i-1] + abs(h[i]-h[i-1])\n\t\tb2 := dp[i-2] + abs(h[i]-h[i-2])\n\t\tdp[i] = min(b2, b1)\n\t}\n\n\tfmt.Println(dp[n-1])\n\n}\nfunc min(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// ---- readfunc\nfunc scanInit() {\n\tconst cap = 200 * 1024 // Default=64\n\tvar buf = make([]byte, cap)\n\tsc.Buffer(buf, cap)\n\tsc.Split(bufio.ScanWords)\n\treturn\n}\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "sample_input": "4\n10 30 40 20\n"}, "reference_outputs": ["30\n"], "source_document_id": "p03160", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 896, "cpu_time_ms": 22, "memory_kb": 3980}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s546182630", "group_id": "codeNet:p03160", "input_text": "package main\nimport \"fmt\"\nvar n int\nvar A []int\nfunc min(a, b int) int {\n\tif a < b { return a }\n\treturn b\n}\nfunc abs(a int) int {\n\tif a < 0 { return -a }\n\treturn a\n}\nfunc main() {\n\t_,e := fmt.Scanf(\"%d\", &n)\n\tif e!= nil { return }\n\tif n<=1 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tA = make([]int, n+1)\n\tfor i:=1; i<=n; i++ {\n\t\t_,e := fmt.Scanf(\"%d\", &A[i])\n\t\tif e != nil { return }\n\t}\n\tif n == 2 {\n\t\tfmt.Println(abs(A[2]-A[1]))\n\t\treturn\n\t}\n\tdp := make([]int, n+1)\n\tdp[1] = 0\n\tdp[2] = abs(A[2]-A[1])\n\tfor i:=3; i<=n; i++ {\n\t\tdp[i] = min(dp[i-1] + abs(A[i] - A[i-1]), dp[i-2]+abs(A[i] - A[i-2]))\n\t}\n\tfmt.Println(dp[n])\n}\n", "language": "Go", "metadata": {"date": 1596664732, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03160.html", "problem_id": "p03160", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03160/input.txt", "sample_output_relpath": "derived/input_output/data/p03160/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03160/Go/s546182630.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s546182630", "user_id": "u064438560"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "package main\nimport \"fmt\"\nvar n int\nvar A []int\nfunc min(a, b int) int {\n\tif a < b { return a }\n\treturn b\n}\nfunc abs(a int) int {\n\tif a < 0 { return -a }\n\treturn a\n}\nfunc main() {\n\t_,e := fmt.Scanf(\"%d\", &n)\n\tif e!= nil { return }\n\tif n<=1 {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tA = make([]int, n+1)\n\tfor i:=1; i<=n; i++ {\n\t\t_,e := fmt.Scanf(\"%d\", &A[i])\n\t\tif e != nil { return }\n\t}\n\tif n == 2 {\n\t\tfmt.Println(abs(A[2]-A[1]))\n\t\treturn\n\t}\n\tdp := make([]int, n+1)\n\tdp[1] = 0\n\tdp[2] = abs(A[2]-A[1])\n\tfor i:=3; i<=n; i++ {\n\t\tdp[i] = min(dp[i-1] + abs(A[i] - A[i-1]), dp[i-2]+abs(A[i] - A[i-2]))\n\t}\n\tfmt.Println(dp[n])\n}\n", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "sample_input": "4\n10 30 40 20\n"}, "reference_outputs": ["30\n"], "source_document_id": "p03160", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 610, "cpu_time_ms": 453, "memory_kb": 6320}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s832178114", "group_id": "codeNet:p03160", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\n// 貰うDP(動的計画法)\n\nfunc main() {\n\n\tvar n int\n\tfmt.Scan(&n)\n\n\th := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&h[i])\n\t}\n\n\tdp := make([]int, 100010)\n\tdp[1] = abs(h[1] - h[0])\n\t// 初期化(最小化問題なのでINF尼初期化)\n\tfor i := 2; i < n; i++ {\n\t\tdp[i] = abs(h[1] - h[0])\n\n\t\tb1:= dp[i-1] + abs(h[i] - h[i-1])\n\t\tb2 := dp[i-2] + abs(h[i] - h[i-2])\n\t\tif b1 < b2 {\n\t\t\tdp[i] = b1\n\t\t} else {\n\t\t\tdp[i] = b2\n\t\t}\n\t}\n\tfmt.Println(dp[n-1])\n}\n\nfunc abs(n int) int {\n\ty := n >> 63\n\treturn (n ^ y) - y\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n", "language": "Go", "metadata": {"date": 1596494513, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03160.html", "problem_id": "p03160", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03160/input.txt", "sample_output_relpath": "derived/input_output/data/p03160/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03160/Go/s832178114.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s832178114", "user_id": "u769765274"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\n// 貰うDP(動的計画法)\n\nfunc main() {\n\n\tvar n int\n\tfmt.Scan(&n)\n\n\th := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&h[i])\n\t}\n\n\tdp := make([]int, 100010)\n\tdp[1] = abs(h[1] - h[0])\n\t// 初期化(最小化問題なのでINF尼初期化)\n\tfor i := 2; i < n; i++ {\n\t\tdp[i] = abs(h[1] - h[0])\n\n\t\tb1:= dp[i-1] + abs(h[i] - h[i-1])\n\t\tb2 := dp[i-2] + abs(h[i] - h[i-2])\n\t\tif b1 < b2 {\n\t\t\tdp[i] = b1\n\t\t} else {\n\t\t\tdp[i] = b2\n\t\t}\n\t}\n\tfmt.Println(dp[n-1])\n}\n\nfunc abs(n int) int {\n\ty := n >> 63\n\treturn (n ^ y) - y\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "sample_input": "4\n10 30 40 20\n"}, "reference_outputs": ["30\n"], "source_document_id": "p03160", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 792, "cpu_time_ms": 433, "memory_kb": 6312}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s800968251", "group_id": "codeNet:p03160", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\n// A - Frog 1\n// https://atcoder.jp/contests/dp/tasks/dp_a\n\nfunc Abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc main() {\n\tvar n int\n\tvar cost int\n\tvar tmp1 int\n\tvar tmp2 int\n\tvar currentPos int\n\tfmt.Scanf(\"%d\", &n)\n\th := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &h[i])\n\t}\n\tfor i := 1; i < n-1; i++ {\n\t\ttmp1 = Abs(h[i] - h[currentPos])\n\t\tif currentPos == n-2 {\n\t\t\tcost += tmp1\n\t\t\tcurrentPos = n - 1\n\t\t\tbreak\n\t\t}\n\t\ttmp2 = Abs(h[i+1] - h[currentPos])\n\t\tif tmp1 > tmp2 {\n\t\t\tcost += tmp1\n\t\t\tcurrentPos = i\n\t\t\tcontinue\n\t\t}\n\t\tcost += tmp2\n\t\tcurrentPos = i + 1\n\t\ti = i + 2\n\t}\n\tif currentPos == n-2 {\n\t\tcost += Abs(h[n-1] - h[currentPos])\n\t}\n\tfmt.Printf(\"%d\\n\", cost)\n}\n", "language": "Go", "metadata": {"date": 1594145267, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03160.html", "problem_id": "p03160", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03160/input.txt", "sample_output_relpath": "derived/input_output/data/p03160/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03160/Go/s800968251.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s800968251", "user_id": "u624782787"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\n// A - Frog 1\n// https://atcoder.jp/contests/dp/tasks/dp_a\n\nfunc Abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc main() {\n\tvar n int\n\tvar cost int\n\tvar tmp1 int\n\tvar tmp2 int\n\tvar currentPos int\n\tfmt.Scanf(\"%d\", &n)\n\th := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &h[i])\n\t}\n\tfor i := 1; i < n-1; i++ {\n\t\ttmp1 = Abs(h[i] - h[currentPos])\n\t\tif currentPos == n-2 {\n\t\t\tcost += tmp1\n\t\t\tcurrentPos = n - 1\n\t\t\tbreak\n\t\t}\n\t\ttmp2 = Abs(h[i+1] - h[currentPos])\n\t\tif tmp1 > tmp2 {\n\t\t\tcost += tmp1\n\t\t\tcurrentPos = i\n\t\t\tcontinue\n\t\t}\n\t\tcost += tmp2\n\t\tcurrentPos = i + 1\n\t\ti = i + 2\n\t}\n\tif currentPos == n-2 {\n\t\tcost += Abs(h[n-1] - h[currentPos])\n\t}\n\tfmt.Printf(\"%d\\n\", cost)\n}\n", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "sample_input": "4\n10 30 40 20\n"}, "reference_outputs": ["30\n"], "source_document_id": "p03160", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 727, "cpu_time_ms": 431, "memory_kb": 6328}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s933996769", "group_id": "codeNet:p03160", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nvar (\n\tn int\n\th []int\n\tdp []int\n)\n\nfunc solve(idx int) int {\n\tif dp[idx] != -1 {\n\t\treturn dp[idx]\n\t}\n\n\tif idx == 0 {\n\t\tdp[idx] = 0\n\t} else if idx == 1 {\n\t\tdp[idx] = int(math.Abs(float64(h[idx] - h[idx-1])))\n\t} else {\n\t\tvar (\n\t\t\tc1, c2 int\n\t\t)\n\t\tc1 = solve(idx - 1) + int(math.Abs(float64(h[idx] - h[idx-1])))\n\t\tc2 = solve(idx - 2) + int(math.Abs(float64(h[idx] - h[idx-2])))\n\n\t\tdp[idx] = int(math.Min(float64(c1), float64(c2)))\n\t}\n\n\treturn dp[idx]\n}\n\nfunc main() {\n\tfmt.Scan(&n)\n\th = make([]int, n)\n\tdp = make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&h[i])\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tdp[i] = -1\n\t}\n\n\t//fmt.Println(h)\n\n\tvar ans int = solve(n-1)\n\tfmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1592082231, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03160.html", "problem_id": "p03160", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03160/input.txt", "sample_output_relpath": "derived/input_output/data/p03160/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03160/Go/s933996769.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s933996769", "user_id": "u600195339"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nvar (\n\tn int\n\th []int\n\tdp []int\n)\n\nfunc solve(idx int) int {\n\tif dp[idx] != -1 {\n\t\treturn dp[idx]\n\t}\n\n\tif idx == 0 {\n\t\tdp[idx] = 0\n\t} else if idx == 1 {\n\t\tdp[idx] = int(math.Abs(float64(h[idx] - h[idx-1])))\n\t} else {\n\t\tvar (\n\t\t\tc1, c2 int\n\t\t)\n\t\tc1 = solve(idx - 1) + int(math.Abs(float64(h[idx] - h[idx-1])))\n\t\tc2 = solve(idx - 2) + int(math.Abs(float64(h[idx] - h[idx-2])))\n\n\t\tdp[idx] = int(math.Min(float64(c1), float64(c2)))\n\t}\n\n\treturn dp[idx]\n}\n\nfunc main() {\n\tfmt.Scan(&n)\n\th = make([]int, n)\n\tdp = make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&h[i])\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tdp[i] = -1\n\t}\n\n\t//fmt.Println(h)\n\n\tvar ans int = solve(n-1)\n\tfmt.Println(ans)\n}", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "sample_input": "4\n10 30 40 20\n"}, "reference_outputs": ["30\n"], "source_document_id": "p03160", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 717, "cpu_time_ms": 397, "memory_kb": 10752}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s013479349", "group_id": "codeNet:p03160", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn := nextInt()\n\n\th := make([]int, n+1)\n\tfor i := 0; i < n; i++ {\n\t\th[i] = nextInt()\n\t}\n\tdp := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tdp[i] = -1\n\t}\n\n\tans := dfs(0, n, h, dp)\n\tfmt.Println(ans)\n}\n\n// posからゴールまでの最小コストを返す関数\nfunc dfs(pos int, n int, h []int, dp []int) int {\n\t// オーバーしていた場合は十分に大きいコストを返す\n\tif pos >= n {\n\t\treturn 99999999\n\t}\n\t// ゴールしていたらこれ以上コストは掛からないので0\n\tif pos == n-1 {\n\t\treturn 0\n\t}\n\t// すでにdfsの結果を計算済みであればそれを返す\n\tif dp[pos] != -1 {\n\t\treturn dp[pos]\n\t}\n\t// 1つ進む場合と2つ進む場合を比較して小さい方を採用\n\tstep1 := dfs(pos+1, n, h, dp) + int(math.Abs(float64(h[pos+1]-h[pos])))\n\tstep2 := dfs(pos+2, n, h, dp) + int(math.Abs(float64(h[pos+2]-h[pos])))\n\t// 答えをメモしておく\n\tdp[pos] = int(math.Min(float64(step1), float64(step2)))\n\treturn dp[pos]\n}\n", "language": "Go", "metadata": {"date": 1591562359, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03160.html", "problem_id": "p03160", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03160/input.txt", "sample_output_relpath": "derived/input_output/data/p03160/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03160/Go/s013479349.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s013479349", "user_id": "u835544897"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn := nextInt()\n\n\th := make([]int, n+1)\n\tfor i := 0; i < n; i++ {\n\t\th[i] = nextInt()\n\t}\n\tdp := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tdp[i] = -1\n\t}\n\n\tans := dfs(0, n, h, dp)\n\tfmt.Println(ans)\n}\n\n// posからゴールまでの最小コストを返す関数\nfunc dfs(pos int, n int, h []int, dp []int) int {\n\t// オーバーしていた場合は十分に大きいコストを返す\n\tif pos >= n {\n\t\treturn 99999999\n\t}\n\t// ゴールしていたらこれ以上コストは掛からないので0\n\tif pos == n-1 {\n\t\treturn 0\n\t}\n\t// すでにdfsの結果を計算済みであればそれを返す\n\tif dp[pos] != -1 {\n\t\treturn dp[pos]\n\t}\n\t// 1つ進む場合と2つ進む場合を比較して小さい方を採用\n\tstep1 := dfs(pos+1, n, h, dp) + int(math.Abs(float64(h[pos+1]-h[pos])))\n\tstep2 := dfs(pos+2, n, h, dp) + int(math.Abs(float64(h[pos+2]-h[pos])))\n\t// 答えをメモしておく\n\tdp[pos] = int(math.Min(float64(step1), float64(step2)))\n\treturn dp[pos]\n}\n", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "sample_input": "4\n10 30 40 20\n"}, "reference_outputs": ["30\n"], "source_document_id": "p03160", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1216, "cpu_time_ms": 65, "memory_kb": 29696}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s845947959", "group_id": "codeNet:p03160", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn := nextInt()\n\n\th := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\th[i] = nextInt()\n\t}\n\n\t//dp[i] = iマス目にたどりつくための最小コスト\n\tdp := make([]int, n)\n\n\t// 1マス目は0\n\tdp[0] = 0\n\t// 2マス目はh[1]-h[0]\n\tdp[1] = h[1] - h[0]\n\n\tfor i := 2; i < n; i++ {\n\t\t// 1マス前から移動したときの最小コスト\n\t\tstep1 := dp[i-1] + int(math.Abs(float64(h[i]-h[i-1])))\n\t\t// 2マス前から移動したときの最小コスト\n\t\tstep2 := dp[i-2] + int(math.Abs(float64(h[i]-h[i-2])))\n\t\t// 小さい方をdp[i]として採用する\n\t\tdp[i] = int(math.Min(float64(step1), float64(step2)))\n\t}\n\n\tfmt.Println(dp[n-1])\n}\n", "language": "Go", "metadata": {"date": 1591555762, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03160.html", "problem_id": "p03160", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03160/input.txt", "sample_output_relpath": "derived/input_output/data/p03160/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03160/Go/s845947959.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s845947959", "user_id": "u835544897"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tn := nextInt()\n\n\th := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\th[i] = nextInt()\n\t}\n\n\t//dp[i] = iマス目にたどりつくための最小コスト\n\tdp := make([]int, n)\n\n\t// 1マス目は0\n\tdp[0] = 0\n\t// 2マス目はh[1]-h[0]\n\tdp[1] = h[1] - h[0]\n\n\tfor i := 2; i < n; i++ {\n\t\t// 1マス前から移動したときの最小コスト\n\t\tstep1 := dp[i-1] + int(math.Abs(float64(h[i]-h[i-1])))\n\t\t// 2マス前から移動したときの最小コスト\n\t\tstep2 := dp[i-2] + int(math.Abs(float64(h[i]-h[i-2])))\n\t\t// 小さい方をdp[i]として採用する\n\t\tdp[i] = int(math.Min(float64(step1), float64(step2)))\n\t}\n\n\tfmt.Println(dp[n-1])\n}\n", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "sample_input": "4\n10 30 40 20\n"}, "reference_outputs": ["30\n"], "source_document_id": "p03160", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 893, "cpu_time_ms": 20, "memory_kb": 2688}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s721609739", "group_id": "codeNet:p03160", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc readInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc readInt64() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nconst INF = int(1e4) + 1\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := readInt()\n\th := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\th[i] = readInt64()\n\t}\n\n\tdp := make([]int, n)\n\tfor i := 1; i < n; i++ {\n\t\tdp[i] = INF\n\t}\n\n\tdp[0] = 0\n\tdp[1] = abs(h[1] - h[0])\n\tfor i := 2; i < n; i++ {\n\t\tdp[i] = min(dp[i-1]+abs(h[i]-h[i-1]), dp[i-2]+abs(h[i]-h[i-2]))\n\t}\n\tfmt.Println(dp[n-1])\n}\n\nfunc min(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -1 * a\n\t}\n\treturn a\n}\n", "language": "Go", "metadata": {"date": 1587974095, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03160.html", "problem_id": "p03160", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03160/input.txt", "sample_output_relpath": "derived/input_output/data/p03160/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03160/Go/s721609739.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s721609739", "user_id": "u309370374"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc readInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc readInt64() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nconst INF = int(1e4) + 1\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := readInt()\n\th := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\th[i] = readInt64()\n\t}\n\n\tdp := make([]int, n)\n\tfor i := 1; i < n; i++ {\n\t\tdp[i] = INF\n\t}\n\n\tdp[0] = 0\n\tdp[1] = abs(h[1] - h[0])\n\tfor i := 2; i < n; i++ {\n\t\tdp[i] = min(dp[i-1]+abs(h[i]-h[i-1]), dp[i-2]+abs(h[i]-h[i-2]))\n\t}\n\tfmt.Println(dp[n-1])\n}\n\nfunc min(a int, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -1 * a\n\t}\n\treturn a\n}\n", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "sample_input": "4\n10 30 40 20\n"}, "reference_outputs": ["30\n"], "source_document_id": "p03160", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 835, "cpu_time_ms": 19, "memory_kb": 2688}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s141422871", "group_id": "codeNet:p03160", "input_text": "package main\nimport \"fmt\"\nfunc main() {\n var N int\n fmt.Scanf(\"%d\", &N)\n stones := make([]int, N)\n for i:=0;i v2 {\n\t\t*v1 = v2\n\t}\n}\n", "language": "Go", "metadata": {"date": 1581872561, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03160.html", "problem_id": "p03160", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03160/input.txt", "sample_output_relpath": "derived/input_output/data/p03160/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03160/Go/s099891392.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s099891392", "user_id": "u162326103"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N int\n\tfmt.Scanf(\"%d\", &N)\n\th := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scanf(\"%d\", &h[i])\n\t}\n\tc := make([]int, N)\n\tc[0] = 0\n\tc[1] = abs(h[1] - h[0])\n\tfor i := 0; i < N-2; i++ {\n\t\tc[i+2] = c[i] + abs(h[i+2]-h[i])\n\t\tchmin(&c[i+2], c[i+1]+abs(h[i+2]-h[i+1]))\n\t}\n\tfmt.Println(c[N-1])\n}\n\nfunc abs(v int) int {\n\tif v < 0 {\n\t\treturn -v\n\t}\n\treturn v\n}\n\nfunc chmin(v1 *int, v2 int) {\n\tif *v1 > v2 {\n\t\t*v1 = v2\n\t}\n}\n", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "sample_input": "4\n10 30 40 20\n"}, "reference_outputs": ["30\n"], "source_document_id": "p03160", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 462, "cpu_time_ms": 381, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s428515928", "group_id": "codeNet:p03160", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main(){\n\tvar n int\n\tfmt.Scan(&n)\n\th := make([]int, n)\n\tdp := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&h[i])\n\t}\n\tdp[0] = 0\n\tdp[1] = abs(h[0] - h[1])\n\tfor i := 2; i < n; i++ {\n\t\tdp[i] = min(\n\t\t\tdp[i-2] + abs(h[i] - h[i-2]),\n\t\t\tdp[i-1] + abs(h[i] - h[i-1]))\n\t}\n\tfmt.Println(dp[n-1])\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}", "language": "Go", "metadata": {"date": 1581344414, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03160.html", "problem_id": "p03160", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03160/input.txt", "sample_output_relpath": "derived/input_output/data/p03160/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03160/Go/s428515928.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s428515928", "user_id": "u068177169"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main(){\n\tvar n int\n\tfmt.Scan(&n)\n\th := make([]int, n)\n\tdp := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&h[i])\n\t}\n\tdp[0] = 0\n\tdp[1] = abs(h[0] - h[1])\n\tfor i := 2; i < n; i++ {\n\t\tdp[i] = min(\n\t\t\tdp[i-2] + abs(h[i] - h[i-2]),\n\t\t\tdp[i-1] + abs(h[i] - h[i-1]))\n\t}\n\tfmt.Println(dp[n-1])\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "sample_input": "4\n10 30 40 20\n"}, "reference_outputs": ["30\n"], "source_document_id": "p03160", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 395, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s672913014", "group_id": "codeNet:p03160", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main(){\n\tvar n int\n\tfmt.Scan(&n)\n\th := make([]float64, n+2)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&h[i])\n\t}\n\t// 足場 i にいるとき\n\t// 最小コスト j\n\tdp := make([]float64, n+2)\n\tdp[0] = 0\n\tfor i := 1; i < n; i++ {\n\t\tdp[i] = math.Pow(10, 9)\n\t}\n\tfor i := 0; i < n-1; i++ {\n\t\tfor j := i + 1; j <= i + 2; j++ {\n\t\t\tdp[j] = math.Min(dp[j], dp[i] + math.Abs(h[i] - h[j]))\n\t\t}\n\t}\n\tans := dp[n-1]\n\tfmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1581342001, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03160.html", "problem_id": "p03160", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03160/input.txt", "sample_output_relpath": "derived/input_output/data/p03160/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03160/Go/s672913014.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s672913014", "user_id": "u068177169"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main(){\n\tvar n int\n\tfmt.Scan(&n)\n\th := make([]float64, n+2)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&h[i])\n\t}\n\t// 足場 i にいるとき\n\t// 最小コスト j\n\tdp := make([]float64, n+2)\n\tdp[0] = 0\n\tfor i := 1; i < n; i++ {\n\t\tdp[i] = math.Pow(10, 9)\n\t}\n\tfor i := 0; i < n-1; i++ {\n\t\tfor j := i + 1; j <= i + 2; j++ {\n\t\t\tdp[j] = math.Min(dp[j], dp[i] + math.Abs(h[i] - h[j]))\n\t\t}\n\t}\n\tans := dp[n-1]\n\tfmt.Println(ans)\n}", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "sample_input": "4\n10 30 40 20\n"}, "reference_outputs": ["30\n"], "source_document_id": "p03160", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 462, "cpu_time_ms": 406, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s253946394", "group_id": "codeNet:p03160", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main(){\n\tvar n int\n\tfmt.Scan(&n)\n\th := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&h[i])\n\t}\n\t// 足場 i にいるとき\n\t// 最小コスト j\n\tvar dp[100001] float64\n\tdp[0] = 0\n\tfor i := 0; i < n; i++ {\n\t\tfor j := i + 1; j <= i + 2; j++ {\n\t\t\tif j > n - 1 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif dp[j] == float64(0) || dp[i] + math.Abs(h[i] - h[j]) < dp[j] {\n\t\t\t\tdp[j] = dp[i] + math.Abs(h[i] - h[j])\n\t\t\t}\n\t\t}\n\t}\n\tans := dp[n-1]\n\tfmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1581340574, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03160.html", "problem_id": "p03160", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03160/input.txt", "sample_output_relpath": "derived/input_output/data/p03160/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03160/Go/s253946394.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s253946394", "user_id": "u068177169"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main(){\n\tvar n int\n\tfmt.Scan(&n)\n\th := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&h[i])\n\t}\n\t// 足場 i にいるとき\n\t// 最小コスト j\n\tvar dp[100001] float64\n\tdp[0] = 0\n\tfor i := 0; i < n; i++ {\n\t\tfor j := i + 1; j <= i + 2; j++ {\n\t\t\tif j > n - 1 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif dp[j] == float64(0) || dp[i] + math.Abs(h[i] - h[j]) < dp[j] {\n\t\t\t\tdp[j] = dp[i] + math.Abs(h[i] - h[j])\n\t\t\t}\n\t\t}\n\t}\n\tans := dp[n-1]\n\tfmt.Println(ans)\n}", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "sample_input": "4\n10 30 40 20\n"}, "reference_outputs": ["30\n"], "source_document_id": "p03160", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 493, "cpu_time_ms": 389, "memory_kb": 6272}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s539257283", "group_id": "codeNet:p03160", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nconst INF = 1 << 29\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\th := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&h[i])\n\t}\n\n\tdp := make([]int, n)\n\tdp[0] = 0\n\tfor i := 1; i < n; i++ {\n\t\tdp[i] = INF\n\t}\n\n\tfor i := 0; i < n-1; i++ {\n\t\t// +1\n\t\tcost1 := dp[i] + int(math.Abs(float64(h[i]-h[i+1])))\n\t\tif cost1 < dp[i+1] {\n\t\t\tdp[i+1] = cost1\n\t\t}\n\n\t\t// +2\n\t\tif i < n-2 {\n\t\t\tcost2 := dp[i] + int(math.Abs(float64(h[i]-h[i+2])))\n\t\t\tif cost2 < dp[i+2] {\n\t\t\t\tdp[i+2] = cost2\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(dp[n-1])\n}\n", "language": "Go", "metadata": {"date": 1579710554, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03160.html", "problem_id": "p03160", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03160/input.txt", "sample_output_relpath": "derived/input_output/data/p03160/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03160/Go/s539257283.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s539257283", "user_id": "u029587648"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nconst INF = 1 << 29\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\th := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&h[i])\n\t}\n\n\tdp := make([]int, n)\n\tdp[0] = 0\n\tfor i := 1; i < n; i++ {\n\t\tdp[i] = INF\n\t}\n\n\tfor i := 0; i < n-1; i++ {\n\t\t// +1\n\t\tcost1 := dp[i] + int(math.Abs(float64(h[i]-h[i+1])))\n\t\tif cost1 < dp[i+1] {\n\t\t\tdp[i+1] = cost1\n\t\t}\n\n\t\t// +2\n\t\tif i < n-2 {\n\t\t\tcost2 := dp[i] + int(math.Abs(float64(h[i]-h[i+2])))\n\t\t\tif cost2 < dp[i+2] {\n\t\t\t\tdp[i+2] = cost2\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(dp[n-1])\n}\n", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "sample_input": "4\n10 30 40 20\n"}, "reference_outputs": ["30\n"], "source_document_id": "p03160", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 544, "cpu_time_ms": 390, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s657604313", "group_id": "codeNet:p03160", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner\n\nfunc maxInt(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc knap(count, weightLimit int, weights []int, vals []int) int {\n\tvalues := make([][]int, count + 1)\n\tfor i := 0; i < count + 1; i++ {\n\t\tvalues[i] = make([]int, weightLimit + 1)\n\t}\n\n\tfor i := 1; i <= count; i++ {\n\t\tfor j := 0; j <= weightLimit; j++ {\n\t\t\tvalues[i][j] = values[i - 1][j]\n\t\t\tif weights[i - 1] <= j {\n\t\t\t\tvalues[i][j] = maxInt(values[i][j], values[i-1][j-weights[i - 1]] + vals[i - 1])\n\t\t\t}\n\t\t}\n\t}\n\treturn values[count][weightLimit]\n}\n\nfunc ScanInt() int {\n\tsc.Scan()\n\tres, _ := strconv.Atoi(sc.Text())\n\treturn res\n}\n\nfunc ScanIntArray(size int) []int {\n\tres := make([]int, size)\n\tfor i := 0; i < size; i++ {\n\t\tsc.Scan()\n\t\tres[i], _ = strconv.Atoi(sc.Text())\n\t}\n\treturn res\n}\n\nfunc main() {\n\tsc = bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tcount := ScanInt()\n\tweightLimit := ScanInt()\n\tweights := make([]int, count)\n\tvals := make([]int, count)\n\tfor i := 0; i < count; i++ {\n\t\tweights[i] = ScanInt()\n\t\tvals[i] = ScanInt()\n\t}\n\tfmt.Println(knap(count, weightLimit, weights, vals))\n}\n", "language": "Go", "metadata": {"date": 1578158128, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03160.html", "problem_id": "p03160", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03160/input.txt", "sample_output_relpath": "derived/input_output/data/p03160/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03160/Go/s657604313.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s657604313", "user_id": "u060788586"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner\n\nfunc maxInt(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc knap(count, weightLimit int, weights []int, vals []int) int {\n\tvalues := make([][]int, count + 1)\n\tfor i := 0; i < count + 1; i++ {\n\t\tvalues[i] = make([]int, weightLimit + 1)\n\t}\n\n\tfor i := 1; i <= count; i++ {\n\t\tfor j := 0; j <= weightLimit; j++ {\n\t\t\tvalues[i][j] = values[i - 1][j]\n\t\t\tif weights[i - 1] <= j {\n\t\t\t\tvalues[i][j] = maxInt(values[i][j], values[i-1][j-weights[i - 1]] + vals[i - 1])\n\t\t\t}\n\t\t}\n\t}\n\treturn values[count][weightLimit]\n}\n\nfunc ScanInt() int {\n\tsc.Scan()\n\tres, _ := strconv.Atoi(sc.Text())\n\treturn res\n}\n\nfunc ScanIntArray(size int) []int {\n\tres := make([]int, size)\n\tfor i := 0; i < size; i++ {\n\t\tsc.Scan()\n\t\tres[i], _ = strconv.Atoi(sc.Text())\n\t}\n\treturn res\n}\n\nfunc main() {\n\tsc = bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tcount := ScanInt()\n\tweightLimit := ScanInt()\n\tweights := make([]int, count)\n\tvals := make([]int, count)\n\tfor i := 0; i < count; i++ {\n\t\tweights[i] = ScanInt()\n\t\tvals[i] = ScanInt()\n\t}\n\tfmt.Println(knap(count, weightLimit, weights, vals))\n}\n", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "sample_input": "4\n10 30 40 20\n"}, "reference_outputs": ["30\n"], "source_document_id": "p03160", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1156, "cpu_time_ms": 2139, "memory_kb": 1765896}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s291392315", "group_id": "codeNet:p03160", "input_text": "package main\n\nimport \"fmt\"\n\nimport \"math\"\n\n/*\nN 個の足場があって、i番目の足場の高さは hi です。\n最初、足場 1 にカエルがいて、ぴょんぴょん跳ねながら足場 N へと向かいます。カエルは足場 i にいるときに\n\n足場 i から足場 i+1 へと移動する (そのコストは |h(i)−h(i+1)|)\n足場 i から足場 i+2 へと移動する (そのコストは |h(i)−h(i+2)|)\nのいずれかの行動を選べます。カエルが足場 1 から足場 N へと移動するのに必要な最小コストを求めよ。\n\n[input]\n4\n10 30 40 20\n\n[output]\n30\n*/\n\nfunc min(a int, b int) int {\n\tif a <= b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\th := make([]int, n+1)\n\tdp := make([]int, n+1)\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&h[i])\n\t\tdp[i] = int(math.Pow(10, 5))\n\t}\n\n\tdp[0] = 0\n\tfor i := 0; i < n-1; i++ {\n\t\tdp[i+1] = min(dp[i]+int(math.Abs(float64(h[i]-h[i+1]))), dp[i+1])\n\t\tdp[i+2] = min(dp[i]+int(math.Abs(float64(h[i]-h[i+2]))), dp[i+2])\n\t}\n\n\tfmt.Println(dp[n-1])\n}\n", "language": "Go", "metadata": {"date": 1575722734, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03160.html", "problem_id": "p03160", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03160/input.txt", "sample_output_relpath": "derived/input_output/data/p03160/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03160/Go/s291392315.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s291392315", "user_id": "u475329018"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nimport \"math\"\n\n/*\nN 個の足場があって、i番目の足場の高さは hi です。\n最初、足場 1 にカエルがいて、ぴょんぴょん跳ねながら足場 N へと向かいます。カエルは足場 i にいるときに\n\n足場 i から足場 i+1 へと移動する (そのコストは |h(i)−h(i+1)|)\n足場 i から足場 i+2 へと移動する (そのコストは |h(i)−h(i+2)|)\nのいずれかの行動を選べます。カエルが足場 1 から足場 N へと移動するのに必要な最小コストを求めよ。\n\n[input]\n4\n10 30 40 20\n\n[output]\n30\n*/\n\nfunc min(a int, b int) int {\n\tif a <= b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\th := make([]int, n+1)\n\tdp := make([]int, n+1)\n\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&h[i])\n\t\tdp[i] = int(math.Pow(10, 5))\n\t}\n\n\tdp[0] = 0\n\tfor i := 0; i < n-1; i++ {\n\t\tdp[i+1] = min(dp[i]+int(math.Abs(float64(h[i]-h[i+1]))), dp[i+1])\n\t\tdp[i+2] = min(dp[i]+int(math.Abs(float64(h[i]-h[i+2]))), dp[i+2])\n\t}\n\n\tfmt.Println(dp[n-1])\n}\n", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "sample_input": "4\n10 30 40 20\n"}, "reference_outputs": ["30\n"], "source_document_id": "p03160", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1061, "cpu_time_ms": 397, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s896328003", "group_id": "codeNet:p03160", "input_text": "package main\n\nimport(\n \"fmt\"\n \"bufio\"\n \"os\"\n \"sort\"\n \"strings\"\n \"strconv\"\n)\n\n\n\nfunc main() {\n var n int\n fmt.Scan(&n)\n h := readOneLineNums(n)\n dp := make([]int, n+1)\n for i:=1;i<=n;i++{\n dp[i] = 1000000000\n }\n for i:=0;i= b {\n return b\n }\n return a\n}\n\nfunc max32(a, b int) int {\n if a >= b {\n return a\n }\n return b\n}\n\nfunc min64(a, b int64) int64 {\n if a >= b {\n return b\n }\n return a\n}\n\nfunc max64(a, b int64) int64 {\n if a >= b {\n return a\n }\n return b\n}\n\nfunc gcd64(a, b int64) int64 {\n if a % b == 0 {\n return b\n } else {\n return gcd64(b, a%b)\n }\n}\n\nfunc lcm64(a, b int64) int64 {\n return a / gcd64(a, b) * b\n}\n\n// 入力処理\nvar sc = bufio.NewScanner(os.Stdin)\nfunc nextLine() string {\n sc.Scan()\n return sc.Text()\n}\nfunc nextInt() int {\n sc.Scan()\n i, e := strconv.Atoi(sc.Text())\n if e != nil {\n panic(e)\n }\n return i\n}\n\nfunc readLineNums(len int) (nums []int){\n for i:=0; i=0 && h=0 && w= b {\n return b\n }\n return a\n}\n\nfunc max32(a, b int) int {\n if a >= b {\n return a\n }\n return b\n}\n\nfunc min64(a, b int64) int64 {\n if a >= b {\n return b\n }\n return a\n}\n\nfunc max64(a, b int64) int64 {\n if a >= b {\n return a\n }\n return b\n}\n\nfunc gcd64(a, b int64) int64 {\n if a % b == 0 {\n return b\n } else {\n return gcd64(b, a%b)\n }\n}\n\nfunc lcm64(a, b int64) int64 {\n return a / gcd64(a, b) * b\n}\n\n// 入力処理\nvar sc = bufio.NewScanner(os.Stdin)\nfunc nextLine() string {\n sc.Scan()\n return sc.Text()\n}\nfunc nextInt() int {\n sc.Scan()\n i, e := strconv.Atoi(sc.Text())\n if e != nil {\n panic(e)\n }\n return i\n}\n\nfunc readLineNums(len int) (nums []int){\n for i:=0; i=0 && h=0 && w>1&(m0&m) + x&(m0&m)\n x = x>>2&(m1&m) + x&(m1&m)\n x = (x>>4 + x) & (m2 & m)\n x += x >> 8\n x += x >> 16\n x += x >> 32\n\n return int(x) & (1<<7 - 1)\n}\n\nfunc bitExist(n, i int) bool {\n return ((n >> uint(i)) & 1) == 1\n}\n\n////////////////////////////////////////\n/// end templates ///\n////////////////////////////////////////\nfunc abs(a, b int) int {\n return int(math.Abs(float64(a - b)))\n}\n\nfunc chmin(dp []int, idx, n int) {\n fmt.Println(dp[idx], n, idx)\n if dp[idx] > n {\n dp[idx] = n\n }\n}\nfunc main() {\n line := readBigLine()\n N := parseInt(line)\n\n l := readBigLine()\n h := intSprit(l)\n\n INF := 1 << 30\n\n dp := make([]int, N+1000)\n for i := 0; i < N+1000; i++ {\n dp[i] = INF\n }\n dp[0] = 0\n\n for i := 0; i < N; i++ {\n if N > i+1 {\n chmin(dp, i+1, dp[i]+abs(h[i], h[i+1]))\n }\n if N > i+2 {\n chmin(dp, i+2, dp[i]+abs(h[i], h[i+2]))\n }\n }\n fmt.Println(dp[N-1])\n}", "language": "Go", "metadata": {"date": 1550419681, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03160.html", "problem_id": "p03160", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03160/input.txt", "sample_output_relpath": "derived/input_output/data/p03160/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03160/Go/s778322050.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s778322050", "user_id": "u925392563"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"fmt\"\n \"math\"\n \"os\"\n \"strconv\"\n \"strings\"\n)\n\n////////////////////////////////////////\n/// templates ///\n////////////////////////////////////////\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextLine() string {\n sc.Scan()\n return sc.Text()\n}\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc readBigLine() string {\n buf := make([]byte, 0, 1000000)\n for {\n l, p, e := rdr.ReadLine()\n if e != nil {\n panic(e)\n }\n buf = append(buf, l...)\n if !p {\n break\n }\n }\n return string(buf)\n}\n\nfunc strSprit(str string) []string {\n cols := strings.Split(str, \" \")\n return cols\n}\n\nfunc parseInt(str string) int {\n n, _ := strconv.Atoi(str)\n return n\n}\n\nfunc intSprit(str string) []int {\n strs := strSprit(str)\n cols := make([]int, len(strs))\n for i, v := range strs {\n cols[i] = parseInt(v)\n }\n return cols\n}\n\nfunc bitCount(n uint) int {\n\n x := uint64(n)\n\n const m = 1<<64 - 1\n const m0 = 0x5555555555555555\n const m1 = 0x3333333333333333\n const m2 = 0x0f0f0f0f0f0f0f0f\n\n x = x>>1&(m0&m) + x&(m0&m)\n x = x>>2&(m1&m) + x&(m1&m)\n x = (x>>4 + x) & (m2 & m)\n x += x >> 8\n x += x >> 16\n x += x >> 32\n\n return int(x) & (1<<7 - 1)\n}\n\nfunc bitExist(n, i int) bool {\n return ((n >> uint(i)) & 1) == 1\n}\n\n////////////////////////////////////////\n/// end templates ///\n////////////////////////////////////////\nfunc abs(a, b int) int {\n return int(math.Abs(float64(a - b)))\n}\n\nfunc chmin(dp []int, idx, n int) {\n fmt.Println(dp[idx], n, idx)\n if dp[idx] > n {\n dp[idx] = n\n }\n}\nfunc main() {\n line := readBigLine()\n N := parseInt(line)\n\n l := readBigLine()\n h := intSprit(l)\n\n INF := 1 << 30\n\n dp := make([]int, N+1000)\n for i := 0; i < N+1000; i++ {\n dp[i] = INF\n }\n dp[0] = 0\n\n for i := 0; i < N; i++ {\n if N > i+1 {\n chmin(dp, i+1, dp[i]+abs(h[i], h[i+1]))\n }\n if N > i+2 {\n chmin(dp, i+2, dp[i]+abs(h[i], h[i+2]))\n }\n }\n fmt.Println(dp[N-1])\n}", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "sample_input": "4\n10 30 40 20\n"}, "reference_outputs": ["30\n"], "source_document_id": "p03160", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2535, "cpu_time_ms": 485, "memory_kb": 10624}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s429925312", "group_id": "codeNet:p03160", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nvar n, m int\nvar l [][]int\nvar r []int\n\nfunc main() {\n fmt.Scan(&n)\n fmt.Scan(&m)\n l = make([][]int, n)\n r = make([]int, n)\n for i := 0; i < m; i++ {\n var x, y int\n fmt.Scan(&x, &y)\n l[x-1] = append(l[x-1], y-1)\n }\n for i := range l {\n r[i] = -1\n }\n\n fmt.Println(l)\n\n var max int\n for i := 0; i < n; i++ {\n res := calc(i)\n if res > max {\n max = res\n }\n }\n\n fmt.Println(max)\n}\n\nfunc calc(k int) int {\n if r[k] != -1 {\n return r[k]\n }\n if len(l[k]) == 0 {\n return 0\n }\n var max int\n for _, i := range l[k] {\n res := calc(i)\n if res > max {\n max = res\n }\n }\n r[k] = max + 1\n return r[k]\n}\n", "language": "Go", "metadata": {"date": 1548702513, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03160.html", "problem_id": "p03160", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03160/input.txt", "sample_output_relpath": "derived/input_output/data/p03160/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03160/Go/s429925312.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s429925312", "user_id": "u282164747"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nvar n, m int\nvar l [][]int\nvar r []int\n\nfunc main() {\n fmt.Scan(&n)\n fmt.Scan(&m)\n l = make([][]int, n)\n r = make([]int, n)\n for i := 0; i < m; i++ {\n var x, y int\n fmt.Scan(&x, &y)\n l[x-1] = append(l[x-1], y-1)\n }\n for i := range l {\n r[i] = -1\n }\n\n fmt.Println(l)\n\n var max int\n for i := 0; i < n; i++ {\n res := calc(i)\n if res > max {\n max = res\n }\n }\n\n fmt.Println(max)\n}\n\nfunc calc(k int) int {\n if r[k] != -1 {\n return r[k]\n }\n if len(l[k]) == 0 {\n return 0\n }\n var max int\n for _, i := range l[k] {\n res := calc(i)\n if res > max {\n max = res\n }\n }\n r[k] = max + 1\n return r[k]\n}\n", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "sample_input": "4\n10 30 40 20\n"}, "reference_outputs": ["30\n"], "source_document_id": "p03160", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 794, "cpu_time_ms": 1474, "memory_kb": 1055488}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s799640616", "group_id": "codeNet:p03160", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\n\ths := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&hs[i])\n\t}\n\n\tcosts := make([]int, N)\n\tcosts[0] = 0\n\tcosts[1] = abs(hs[1] - hs[0])\n\n\tfor i := 2; i < N; i++ {\n\t\tc1 := costs[i-1] + abs(hs[i]-hs[i-1])\n\t\tc2 := costs[i-2] + abs(hs[i]-hs[i-2])\n\t\tcosts[i] = min(c1, c2)\n\t}\n\n\tfmt.Println(costs[N-1])\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n", "language": "Go", "metadata": {"date": 1546865043, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03160.html", "problem_id": "p03160", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03160/input.txt", "sample_output_relpath": "derived/input_output/data/p03160/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03160/Go/s799640616.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s799640616", "user_id": "u864667985"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\n\ths := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&hs[i])\n\t}\n\n\tcosts := make([]int, N)\n\tcosts[0] = 0\n\tcosts[1] = abs(hs[1] - hs[0])\n\n\tfor i := 2; i < N; i++ {\n\t\tc1 := costs[i-1] + abs(hs[i]-hs[i-1])\n\t\tc2 := costs[i-2] + abs(hs[i]-hs[i-2])\n\t\tcosts[i] = min(c1, c2)\n\t}\n\n\tfmt.Println(costs[N-1])\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "sample_input": "4\n10 30 40 20\n"}, "reference_outputs": ["30\n"], "source_document_id": "p03160", "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.\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 Stone i + 1 or Stone i + 2. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq h_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nh_1 h_2 \\ldots h_N\n\nOutput\n\nPrint the minimum possible total cost incurred.\n\nSample Input 1\n\n4\n10 30 40 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 4, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n2\n10 10\n\nSample Output 2\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 3\n\n6\n30 10 60 10 60 50\n\nSample Output 3\n\n40\n\nIf we follow the path 1 → 3 → 5 → 6, the total cost incurred would be |30 - 60| + |60 - 60| + |60 - 50| = 40.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 394, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s550547363", "group_id": "codeNet:p03161", "input_text": "package main\n\nimport \"fmt\"\n\nfunc min(x, y int) int {\n\tif x > y {\n\t\treturn y\n\t} else {\n\t\treturn x\n\t}\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t} else {\n\t\treturn x\n\t}\n}\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scanf(\"%d %d\", &n, &k)\n\n\th := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &h[i])\n\t}\n\n\tdp := make([]int, n)\n\tfor i := range dp {\n\t\tdp[i] = 10000000000000 // +Inf\n\t}\n\tdp[0] = 0\n\n\tfor i := 0; i < n; i++ {\n\t\tfor j := i + 1; j <= i+k && j < n; j++ {\n\t\t\tdp[j] = min(dp[j], abs(h[i]-h[j])+dp[i])\n\t\t}\n\t}\n\n\tfmt.Println(dp[len(dp)-1])\n}\n", "language": "Go", "metadata": {"date": 1600199667, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03161.html", "problem_id": "p03161", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03161/input.txt", "sample_output_relpath": "derived/input_output/data/p03161/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03161/Go/s550547363.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s550547363", "user_id": "u998286277"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc min(x, y int) int {\n\tif x > y {\n\t\treturn y\n\t} else {\n\t\treturn x\n\t}\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t} else {\n\t\treturn x\n\t}\n}\n\nfunc main() {\n\tvar n, k int\n\tfmt.Scanf(\"%d %d\", &n, &k)\n\n\th := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d\", &h[i])\n\t}\n\n\tdp := make([]int, n)\n\tfor i := range dp {\n\t\tdp[i] = 10000000000000 // +Inf\n\t}\n\tdp[0] = 0\n\n\tfor i := 0; i < n; i++ {\n\t\tfor j := i + 1; j <= i+k && j < n; j++ {\n\t\t\tdp[j] = min(dp[j], abs(h[i]-h[j])+dp[i])\n\t\t}\n\t}\n\n\tfmt.Println(dp[len(dp)-1])\n}\n", "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.\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, i + K. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq K \\leq 100\n\n1 \\leq h_i \\leq 10^4\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 minimum possible total cost incurred.\n\nSample Input 1\n\n5 3\n10 30 40 50 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 5, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n3 1\n10 20 10\n\nSample Output 2\n\n20\n\nIf we follow the path 1 → 2 → 3, the total cost incurred would be |10 - 20| + |20 - 10| = 20.\n\nSample Input 3\n\n2 100\n10 10\n\nSample Output 3\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 4\n\n10 4\n40 10 20 70 80 10 20 70 80 60\n\nSample Output 4\n\n40\n\nIf we follow the path 1 → 4 → 8 → 10, the total cost incurred would be |40 - 70| + |70 - 70| + |70 - 60| = 40.", "sample_input": "5 3\n10 30 40 50 20\n"}, "reference_outputs": ["30\n"], "source_document_id": "p03161", "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.\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, i + K. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq K \\leq 100\n\n1 \\leq h_i \\leq 10^4\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 minimum possible total cost incurred.\n\nSample Input 1\n\n5 3\n10 30 40 50 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 5, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n3 1\n10 20 10\n\nSample Output 2\n\n20\n\nIf we follow the path 1 → 2 → 3, the total cost incurred would be |10 - 20| + |20 - 10| = 20.\n\nSample Input 3\n\n2 100\n10 10\n\nSample Output 3\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 4\n\n10 4\n40 10 20 70 80 10 20 70 80 60\n\nSample Output 4\n\n40\n\nIf we follow the path 1 → 4 → 8 → 10, the total cost incurred would be |40 - 70| + |70 - 70| + |70 - 60| = 40.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 551, "cpu_time_ms": 532, "memory_kb": 6320}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s343766862", "group_id": "codeNet:p03161", "input_text": "//go:generate echo \"https://atcoder.jp/contests/dp/tasks/dp_b\"\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype scanner struct{ *bufio.Scanner }\n\nfunc newScanner(r io.Reader) *scanner {\n\ts := bufio.NewScanner(r)\n\ts.Split(bufio.ScanWords)\n\ts.Buffer(nil, 100000000)\n\treturn &scanner{s}\n}\n\nfunc (s *scanner) Int() int {\n\ts.Scan()\n\tn, _ := strconv.Atoi(s.Text())\n\treturn n\n}\n\nfunc (s *scanner) IntSlice(l int) []int {\n\tif l == 0 {\n\t\treturn []int{}\n\t}\n\tsl := make([]int, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.Int()\n\t}\n\treturn sl\n}\n\nfunc iabs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc solve(n, k int, h []int) int {\n\tt := make([]int, n+k+1, n+k+1)\n\tfor i := range t {\n\t\tt[i] = math.MaxInt64\n\t}\n\tt[0] = 0\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j <= k; j++ {\n\t\t\tif v := t[i] + iabs(h[i+j]-h[i]); v < t[i+j] {\n\t\t\t\tt[i+j] = v\n\t\t\t}\n\t\t}\n\t}\n\treturn t[n-1]\n}\n\nfunc main() {\n\tscan := newScanner(os.Stdin)\n\tn, k := scan.Int(), scan.Int()\n\th := make([]int, n+k+1, n+k+1)\n\tfor i := 0; i < n; i++ {\n\t\th[i] = scan.Int()\n\t}\n\ta := solve(n, k, h)\n\tfmt.Println(a)\n}\n", "language": "Go", "metadata": {"date": 1599612836, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03161.html", "problem_id": "p03161", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03161/input.txt", "sample_output_relpath": "derived/input_output/data/p03161/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03161/Go/s343766862.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s343766862", "user_id": "u890085018"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "//go:generate echo \"https://atcoder.jp/contests/dp/tasks/dp_b\"\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype scanner struct{ *bufio.Scanner }\n\nfunc newScanner(r io.Reader) *scanner {\n\ts := bufio.NewScanner(r)\n\ts.Split(bufio.ScanWords)\n\ts.Buffer(nil, 100000000)\n\treturn &scanner{s}\n}\n\nfunc (s *scanner) Int() int {\n\ts.Scan()\n\tn, _ := strconv.Atoi(s.Text())\n\treturn n\n}\n\nfunc (s *scanner) IntSlice(l int) []int {\n\tif l == 0 {\n\t\treturn []int{}\n\t}\n\tsl := make([]int, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.Int()\n\t}\n\treturn sl\n}\n\nfunc iabs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc solve(n, k int, h []int) int {\n\tt := make([]int, n+k+1, n+k+1)\n\tfor i := range t {\n\t\tt[i] = math.MaxInt64\n\t}\n\tt[0] = 0\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j <= k; j++ {\n\t\t\tif v := t[i] + iabs(h[i+j]-h[i]); v < t[i+j] {\n\t\t\t\tt[i+j] = v\n\t\t\t}\n\t\t}\n\t}\n\treturn t[n-1]\n}\n\nfunc main() {\n\tscan := newScanner(os.Stdin)\n\tn, k := scan.Int(), scan.Int()\n\th := make([]int, n+k+1, n+k+1)\n\tfor i := 0; i < n; i++ {\n\t\th[i] = scan.Int()\n\t}\n\ta := solve(n, k, h)\n\tfmt.Println(a)\n}\n", "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.\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, i + K. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq K \\leq 100\n\n1 \\leq h_i \\leq 10^4\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 minimum possible total cost incurred.\n\nSample Input 1\n\n5 3\n10 30 40 50 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 5, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n3 1\n10 20 10\n\nSample Output 2\n\n20\n\nIf we follow the path 1 → 2 → 3, the total cost incurred would be |10 - 20| + |20 - 10| = 20.\n\nSample Input 3\n\n2 100\n10 10\n\nSample Output 3\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 4\n\n10 4\n40 10 20 70 80 10 20 70 80 60\n\nSample Output 4\n\n40\n\nIf we follow the path 1 → 4 → 8 → 10, the total cost incurred would be |40 - 70| + |70 - 70| + |70 - 60| = 40.", "sample_input": "5 3\n10 30 40 50 20\n"}, "reference_outputs": ["30\n"], "source_document_id": "p03161", "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.\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, i + K. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq K \\leq 100\n\n1 \\leq h_i \\leq 10^4\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 minimum possible total cost incurred.\n\nSample Input 1\n\n5 3\n10 30 40 50 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 5, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n3 1\n10 20 10\n\nSample Output 2\n\n20\n\nIf we follow the path 1 → 2 → 3, the total cost incurred would be |10 - 20| + |20 - 10| = 20.\n\nSample Input 3\n\n2 100\n10 10\n\nSample Output 3\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 4\n\n10 4\n40 10 20 70 80 10 20 70 80 60\n\nSample Output 4\n\n40\n\nIf we follow the path 1 → 4 → 8 → 10, the total cost incurred would be |40 - 70| + |70 - 70| + |70 - 60| = 40.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1089, "cpu_time_ms": 55, "memory_kb": 3940}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s608018999", "group_id": "codeNet:p03161", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tscanInit()\n\n\tn := nextInt()\n\tk := nextInt()\n\th := make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\th[i] = nextInt()\n\t}\n\n\tdp := make([]int, n)\n\tdp[0] = 0\n\tfor i := 1; i < n; i++ {\n\t\tmincost := 10000000000\n\t\tfor j := max(i-k, 0); j < i; j++ {\n\t\t\tcostnow := dp[j] + abs(h[i]-h[j])\n\t\t\t//fmt.Println(\"i,j=\", i, j, \" dp[j]=\", dp[j], \" abs=\", abs(h[i]-h[j]))\n\t\t\tmincost = min(mincost, costnow)\n\t\t}\n\t\tdp[i] = mincost\n\n\t}\n\n\tfmt.Println(dp[n-1])\n\n}\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc min(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// ---- readfunc\nfunc scanInit() {\n\tconst cap = 200 * 1024 // Default=64\n\tvar buf = make([]byte, cap)\n\tsc.Buffer(buf, cap)\n\tsc.Split(bufio.ScanWords)\n\treturn\n}\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "language": "Go", "metadata": {"date": 1596744298, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03161.html", "problem_id": "p03161", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03161/input.txt", "sample_output_relpath": "derived/input_output/data/p03161/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03161/Go/s608018999.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s608018999", "user_id": "u756000295"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tscanInit()\n\n\tn := nextInt()\n\tk := nextInt()\n\th := make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\th[i] = nextInt()\n\t}\n\n\tdp := make([]int, n)\n\tdp[0] = 0\n\tfor i := 1; i < n; i++ {\n\t\tmincost := 10000000000\n\t\tfor j := max(i-k, 0); j < i; j++ {\n\t\t\tcostnow := dp[j] + abs(h[i]-h[j])\n\t\t\t//fmt.Println(\"i,j=\", i, j, \" dp[j]=\", dp[j], \" abs=\", abs(h[i]-h[j]))\n\t\t\tmincost = min(mincost, costnow)\n\t\t}\n\t\tdp[i] = mincost\n\n\t}\n\n\tfmt.Println(dp[n-1])\n\n}\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc min(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// ---- readfunc\nfunc scanInit() {\n\tconst cap = 200 * 1024 // Default=64\n\tvar buf = make([]byte, cap)\n\tsc.Buffer(buf, cap)\n\tsc.Split(bufio.ScanWords)\n\treturn\n}\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "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.\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, i + K. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq K \\leq 100\n\n1 \\leq h_i \\leq 10^4\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 minimum possible total cost incurred.\n\nSample Input 1\n\n5 3\n10 30 40 50 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 5, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n3 1\n10 20 10\n\nSample Output 2\n\n20\n\nIf we follow the path 1 → 2 → 3, the total cost incurred would be |10 - 20| + |20 - 10| = 20.\n\nSample Input 3\n\n2 100\n10 10\n\nSample Output 3\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 4\n\n10 4\n40 10 20 70 80 10 20 70 80 60\n\nSample Output 4\n\n40\n\nIf we follow the path 1 → 4 → 8 → 10, the total cost incurred would be |40 - 70| + |70 - 70| + |70 - 60| = 40.", "sample_input": "5 3\n10 30 40 50 20\n"}, "reference_outputs": ["30\n"], "source_document_id": "p03161", "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.\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, i + K. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq K \\leq 100\n\n1 \\leq h_i \\leq 10^4\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 minimum possible total cost incurred.\n\nSample Input 1\n\n5 3\n10 30 40 50 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 5, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n3 1\n10 20 10\n\nSample Output 2\n\n20\n\nIf we follow the path 1 → 2 → 3, the total cost incurred would be |10 - 20| + |20 - 10| = 20.\n\nSample Input 3\n\n2 100\n10 10\n\nSample Output 3\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 4\n\n10 4\n40 10 20 70 80 10 20 70 80 60\n\nSample Output 4\n\n40\n\nIf we follow the path 1 → 4 → 8 → 10, the total cost incurred would be |40 - 70| + |70 - 70| + |70 - 60| = 40.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 38, "memory_kb": 4120}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s065495508", "group_id": "codeNet:p03161", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tscanInit()\n\n\tn := nextInt()\n\tk := nextInt()\n\th := make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\th[i] = nextInt()\n\t}\n\n\tdp := make([]int, n)\n\tdp[0] = 0\n\tfor i := 1; i < n; i++ {\n\t\tmincost := 100000\n\t\tfor j := max(i-k, 0); j < i; j++ {\n\t\t\tcostnow := dp[j] + abs(h[i]-h[j])\n\t\t\tmincost = min(mincost, costnow)\n\t\t}\n\t\tdp[i] = mincost\n\t}\n\n\tfmt.Println(dp[n-1])\n\n}\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc min(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// ---- readfunc\nfunc scanInit() {\n\tconst cap = 200 * 1024 // Default=64\n\tvar buf = make([]byte, cap)\n\tsc.Buffer(buf, cap)\n\tsc.Split(bufio.ScanWords)\n\treturn\n}\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "language": "Go", "metadata": {"date": 1596743201, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03161.html", "problem_id": "p03161", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03161/input.txt", "sample_output_relpath": "derived/input_output/data/p03161/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03161/Go/s065495508.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s065495508", "user_id": "u756000295"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tscanInit()\n\n\tn := nextInt()\n\tk := nextInt()\n\th := make([]int, n)\n\n\tfor i := 0; i < n; i++ {\n\t\th[i] = nextInt()\n\t}\n\n\tdp := make([]int, n)\n\tdp[0] = 0\n\tfor i := 1; i < n; i++ {\n\t\tmincost := 100000\n\t\tfor j := max(i-k, 0); j < i; j++ {\n\t\t\tcostnow := dp[j] + abs(h[i]-h[j])\n\t\t\tmincost = min(mincost, costnow)\n\t\t}\n\t\tdp[i] = mincost\n\t}\n\n\tfmt.Println(dp[n-1])\n\n}\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc min(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t}\n\treturn a\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// ---- readfunc\nfunc scanInit() {\n\tconst cap = 200 * 1024 // Default=64\n\tvar buf = make([]byte, cap)\n\tsc.Buffer(buf, cap)\n\tsc.Split(bufio.ScanWords)\n\treturn\n}\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "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.\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, i + K. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq K \\leq 100\n\n1 \\leq h_i \\leq 10^4\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 minimum possible total cost incurred.\n\nSample Input 1\n\n5 3\n10 30 40 50 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 5, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n3 1\n10 20 10\n\nSample Output 2\n\n20\n\nIf we follow the path 1 → 2 → 3, the total cost incurred would be |10 - 20| + |20 - 10| = 20.\n\nSample Input 3\n\n2 100\n10 10\n\nSample Output 3\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 4\n\n10 4\n40 10 20 70 80 10 20 70 80 60\n\nSample Output 4\n\n40\n\nIf we follow the path 1 → 4 → 8 → 10, the total cost incurred would be |40 - 70| + |70 - 70| + |70 - 60| = 40.", "sample_input": "5 3\n10 30 40 50 20\n"}, "reference_outputs": ["30\n"], "source_document_id": "p03161", "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.\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, i + K. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq K \\leq 100\n\n1 \\leq h_i \\leq 10^4\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 minimum possible total cost incurred.\n\nSample Input 1\n\n5 3\n10 30 40 50 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 5, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n3 1\n10 20 10\n\nSample Output 2\n\n20\n\nIf we follow the path 1 → 2 → 3, the total cost incurred would be |10 - 20| + |20 - 10| = 20.\n\nSample Input 3\n\n2 100\n10 10\n\nSample Output 3\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 4\n\n10 4\n40 10 20 70 80 10 20 70 80 60\n\nSample Output 4\n\n40\n\nIf we follow the path 1 → 4 → 8 → 10, the total cost incurred would be |40 - 70| + |70 - 70| + |70 - 60| = 40.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 974, "cpu_time_ms": 36, "memory_kb": 4120}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s506517383", "group_id": "codeNet:p03161", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tn, k := scInt2()\n\thlist := ints(n)\n\tdp := make([]int, n)\n\tinf := 100000\n\tfor i := 0; i < n; i++ {\n\t\tdp[i] = inf\n\t}\n\tdp[0] = 0\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 1; j <= k; j++ {\n\t\t\tif i+j < n {\n\t\t\t\tdiff := abs(hlist[i+j]-hlist[i]) + dp[i]\n\t\t\t\tdp[i+j] = min(diff, dp[i+j])\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(dp[n-1])\n}\n\nfunc scStr() string {\n\tvar s string\n\tfmt.Scan(&s)\n\treturn s\n}\n\nfunc scInt() int {\n\tvar x int\n\tfmt.Scan(&x)\n\treturn x\n}\n\nfunc scInt2() (int, int) {\n\tvar x, y int\n\tfmt.Scan(&x, &y)\n\treturn x, y\n}\n\nfunc scInt3() (int, int, int) {\n\tvar x, y, z int\n\tfmt.Scan(&x, &y, &z)\n\treturn x, y, z\n}\n\nfunc ints(n int) (slice []int) {\n\tslice = make([]int, n)\n\tfor i := range slice {\n\t\tfmt.Scan(&slice[i])\n\t}\n\treturn slice\n}\n\nfunc sum(slice []int) (sum int) {\n\tsum = 0\n\tfor i := range slice {\n\t\tsum += slice[i]\n\t}\n\treturn\n}\n\nfunc unique(strs []string) (unique []string) {\n\tm := map[string]bool{}\n\tfor _, v := range strs {\n\t\tif !m[v] {\n\t\t\tm[v] = true\n\t\t\tunique = append(unique, v)\n\t\t}\n\t}\n\treturn unique\n}\n\nfunc min(x, y int) int {\n\tif x > y {\n\t\treturn y\n\t}\n\treturn x\n}\n\nfunc powi(x, pow int) int {\n\treturn int(math.Pow(float64(x), float64(pow)))\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n", "language": "Go", "metadata": {"date": 1593720844, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03161.html", "problem_id": "p03161", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03161/input.txt", "sample_output_relpath": "derived/input_output/data/p03161/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03161/Go/s506517383.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s506517383", "user_id": "u370977023"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tn, k := scInt2()\n\thlist := ints(n)\n\tdp := make([]int, n)\n\tinf := 100000\n\tfor i := 0; i < n; i++ {\n\t\tdp[i] = inf\n\t}\n\tdp[0] = 0\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 1; j <= k; j++ {\n\t\t\tif i+j < n {\n\t\t\t\tdiff := abs(hlist[i+j]-hlist[i]) + dp[i]\n\t\t\t\tdp[i+j] = min(diff, dp[i+j])\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(dp[n-1])\n}\n\nfunc scStr() string {\n\tvar s string\n\tfmt.Scan(&s)\n\treturn s\n}\n\nfunc scInt() int {\n\tvar x int\n\tfmt.Scan(&x)\n\treturn x\n}\n\nfunc scInt2() (int, int) {\n\tvar x, y int\n\tfmt.Scan(&x, &y)\n\treturn x, y\n}\n\nfunc scInt3() (int, int, int) {\n\tvar x, y, z int\n\tfmt.Scan(&x, &y, &z)\n\treturn x, y, z\n}\n\nfunc ints(n int) (slice []int) {\n\tslice = make([]int, n)\n\tfor i := range slice {\n\t\tfmt.Scan(&slice[i])\n\t}\n\treturn slice\n}\n\nfunc sum(slice []int) (sum int) {\n\tsum = 0\n\tfor i := range slice {\n\t\tsum += slice[i]\n\t}\n\treturn\n}\n\nfunc unique(strs []string) (unique []string) {\n\tm := map[string]bool{}\n\tfor _, v := range strs {\n\t\tif !m[v] {\n\t\t\tm[v] = true\n\t\t\tunique = append(unique, v)\n\t\t}\n\t}\n\treturn unique\n}\n\nfunc min(x, y int) int {\n\tif x > y {\n\t\treturn y\n\t}\n\treturn x\n}\n\nfunc powi(x, pow int) int {\n\treturn int(math.Pow(float64(x), float64(pow)))\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n", "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.\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, i + K. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq K \\leq 100\n\n1 \\leq h_i \\leq 10^4\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 minimum possible total cost incurred.\n\nSample Input 1\n\n5 3\n10 30 40 50 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 5, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n3 1\n10 20 10\n\nSample Output 2\n\n20\n\nIf we follow the path 1 → 2 → 3, the total cost incurred would be |10 - 20| + |20 - 10| = 20.\n\nSample Input 3\n\n2 100\n10 10\n\nSample Output 3\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 4\n\n10 4\n40 10 20 70 80 10 20 70 80 60\n\nSample Output 4\n\n40\n\nIf we follow the path 1 → 4 → 8 → 10, the total cost incurred would be |40 - 70| + |70 - 70| + |70 - 60| = 40.", "sample_input": "5 3\n10 30 40 50 20\n"}, "reference_outputs": ["30\n"], "source_document_id": "p03161", "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.\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, i + K. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq K \\leq 100\n\n1 \\leq h_i \\leq 10^4\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 minimum possible total cost incurred.\n\nSample Input 1\n\n5 3\n10 30 40 50 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 5, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n3 1\n10 20 10\n\nSample Output 2\n\n20\n\nIf we follow the path 1 → 2 → 3, the total cost incurred would be |10 - 20| + |20 - 10| = 20.\n\nSample Input 3\n\n2 100\n10 10\n\nSample Output 3\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 4\n\n10 4\n40 10 20 70 80 10 20 70 80 60\n\nSample Output 4\n\n40\n\nIf we follow the path 1 → 4 → 8 → 10, the total cost incurred would be |40 - 70| + |70 - 70| + |70 - 60| = 40.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1258, "cpu_time_ms": 492, "memory_kb": 6312}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s021490476", "group_id": "codeNet:p03161", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tnum, _ := strconv.Atoi(scanString())\n\treturn num\n}\n\nfunc scanString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc scanInts(n int) []int {\n\tsl := make([]int, n)\n\tfor i := range sl {\n\t\tsl[i] = scanInt()\n\t}\n\treturn sl\n}\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc main() {\n\tn, k := scanInt(), scanInt()\n\th := scanInts(n)\n\n\tdp := make([]int, n)\n\tfor i := range dp {\n\t\tdp[i] = math.MaxInt32\n\t}\n\tdp[0] = 0\n\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 1; j <= k; j++ {\n\t\t\tif i+j >= n {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tdp[i+j] = min(dp[i+j], dp[i]+abs(h[i]-h[i+j]))\n\t\t}\n\t}\n\tfmt.Println(dp[n-1])\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\treturn n\n}\n", "language": "Go", "metadata": {"date": 1588527225, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03161.html", "problem_id": "p03161", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03161/input.txt", "sample_output_relpath": "derived/input_output/data/p03161/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03161/Go/s021490476.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s021490476", "user_id": "u367908963"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tnum, _ := strconv.Atoi(scanString())\n\treturn num\n}\n\nfunc scanString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc scanInts(n int) []int {\n\tsl := make([]int, n)\n\tfor i := range sl {\n\t\tsl[i] = scanInt()\n\t}\n\treturn sl\n}\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc main() {\n\tn, k := scanInt(), scanInt()\n\th := scanInts(n)\n\n\tdp := make([]int, n)\n\tfor i := range dp {\n\t\tdp[i] = math.MaxInt32\n\t}\n\tdp[0] = 0\n\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 1; j <= k; j++ {\n\t\t\tif i+j >= n {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tdp[i+j] = min(dp[i+j], dp[i]+abs(h[i]-h[i+j]))\n\t\t}\n\t}\n\tfmt.Println(dp[n-1])\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc abs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\treturn n\n}\n", "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.\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, i + K. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq K \\leq 100\n\n1 \\leq h_i \\leq 10^4\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 minimum possible total cost incurred.\n\nSample Input 1\n\n5 3\n10 30 40 50 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 5, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n3 1\n10 20 10\n\nSample Output 2\n\n20\n\nIf we follow the path 1 → 2 → 3, the total cost incurred would be |10 - 20| + |20 - 10| = 20.\n\nSample Input 3\n\n2 100\n10 10\n\nSample Output 3\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 4\n\n10 4\n40 10 20 70 80 10 20 70 80 60\n\nSample Output 4\n\n40\n\nIf we follow the path 1 → 4 → 8 → 10, the total cost incurred would be |40 - 70| + |70 - 70| + |70 - 60| = 40.", "sample_input": "5 3\n10 30 40 50 20\n"}, "reference_outputs": ["30\n"], "source_document_id": "p03161", "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.\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, i + K. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq K \\leq 100\n\n1 \\leq h_i \\leq 10^4\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 minimum possible total cost incurred.\n\nSample Input 1\n\n5 3\n10 30 40 50 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 5, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n3 1\n10 20 10\n\nSample Output 2\n\n20\n\nIf we follow the path 1 → 2 → 3, the total cost incurred would be |10 - 20| + |20 - 10| = 20.\n\nSample Input 3\n\n2 100\n10 10\n\nSample Output 3\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 4\n\n10 4\n40 10 20 70 80 10 20 70 80 60\n\nSample Output 4\n\n40\n\nIf we follow the path 1 → 4 → 8 → 10, the total cost incurred would be |40 - 70| + |70 - 70| + |70 - 60| = 40.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 831, "cpu_time_ms": 76, "memory_kb": 2816}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s255573663", "group_id": "codeNet:p03161", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 1024\n\tmaxBufSize = 1e6\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\t// writer = bufio.NewWriterSize(os.Stdout, 1000000)\n)\n\nfunc main() {\n\tscanner.Split(bufio.ScanWords)\n\t// scanner.Buffer(make([]byte, initialBufSize), maxBufSize)\n\t// defer writer.Flush()\n\tn, k := scanInt(), scanInt()\n\th := scanInts(n)\n\n\tmin := func(x, y int) int {\n\t\tif x < y {\n\t\t\treturn x\n\t\t}\n\t\treturn y\n\t}\n\n\tdp := make([]int, n)\n\tfor i := 1; i < n; i++ {\n\t\tdp[i] = math.MaxInt64\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 1; j <= k; j++ {\n\t\t\tif (i + j) >= n {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tt1, t2 := dp[i+j], dp[i]+abs(h[i]-h[i+j])\n\t\t\tdp[i+j] = min(t1, t2)\n\t\t}\n\t}\n\n\tfmt.Println(dp[n-1])\n}\n\nfunc scanInt() int {\n\ti, _ := strconv.Atoi(scanString())\n\treturn i\n}\n\nfunc scanInts(size int) []int {\n\tints := make([]int, size)\n\tfor i := 0; i < size; i++ {\n\t\tints[i] = scanInt()\n\t}\n\treturn ints\n}\n\nfunc scanFloat64() float64 {\n\tf, _ := strconv.ParseFloat(scanString(), 64)\n\treturn f\n}\n\nfunc scanFloat64s(size int) []float64 {\n\tf := make([]float64, size)\n\tfor i := 0; i < size; i++ {\n\t\tf[i] = scanFloat64()\n\t}\n\treturn f\n}\n\nfunc scanString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc scanStrings(size int) []string {\n\ts := make([]string, size)\n\tfor i := 0; i < size; i++ {\n\t\ts[i] = scanString()\n\t}\n\treturn s\n}\n\nfunc abs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\treturn n\n}\n\nfunc pow(x, y int) int {\n\treturn int(math.Pow(float64(x), float64(y)))\n}\n\n// greatest common divisor(最大公約数)\nfunc gcd(a, b int) int {\n\tfor {\n\t\tmod := a % b\n\t\tif mod == 0 {\n\t\t\treturn b\n\t\t}\n\t\ta, b = b, mod\n\t}\n}\n\n// latest common multiple(最小公倍数)\nfunc lcm(a, b int) int {\n\treturn (a / gcd(a, b)) * b\n}\n\nfunc fact(n int) int {\n\tret := 1\n\tfor i := 1; i <= n; i++ {\n\t\tret *= i\n\t}\n\treturn ret\n}\n\nfunc perm(n, r int) int {\n\tret := 1\n\tfor i := 0; i < r; i++ {\n\t\tret *= n\n\t\tn--\n\t}\n\treturn ret\n}\n\nfunc isPrimeNum(n int) bool {\n\n\tif n <= 1 {\n\t\treturn false\n\t}\n\n\tl := int(math.Sqrt(float64(n)) + 1.)\n\tfor i := 2; i < l; i++ {\n\t\tif n%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n", "language": "Go", "metadata": {"date": 1587068042, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03161.html", "problem_id": "p03161", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03161/input.txt", "sample_output_relpath": "derived/input_output/data/p03161/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03161/Go/s255573663.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s255573663", "user_id": "u550884590"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 1024\n\tmaxBufSize = 1e6\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\t// writer = bufio.NewWriterSize(os.Stdout, 1000000)\n)\n\nfunc main() {\n\tscanner.Split(bufio.ScanWords)\n\t// scanner.Buffer(make([]byte, initialBufSize), maxBufSize)\n\t// defer writer.Flush()\n\tn, k := scanInt(), scanInt()\n\th := scanInts(n)\n\n\tmin := func(x, y int) int {\n\t\tif x < y {\n\t\t\treturn x\n\t\t}\n\t\treturn y\n\t}\n\n\tdp := make([]int, n)\n\tfor i := 1; i < n; i++ {\n\t\tdp[i] = math.MaxInt64\n\t}\n\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 1; j <= k; j++ {\n\t\t\tif (i + j) >= n {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tt1, t2 := dp[i+j], dp[i]+abs(h[i]-h[i+j])\n\t\t\tdp[i+j] = min(t1, t2)\n\t\t}\n\t}\n\n\tfmt.Println(dp[n-1])\n}\n\nfunc scanInt() int {\n\ti, _ := strconv.Atoi(scanString())\n\treturn i\n}\n\nfunc scanInts(size int) []int {\n\tints := make([]int, size)\n\tfor i := 0; i < size; i++ {\n\t\tints[i] = scanInt()\n\t}\n\treturn ints\n}\n\nfunc scanFloat64() float64 {\n\tf, _ := strconv.ParseFloat(scanString(), 64)\n\treturn f\n}\n\nfunc scanFloat64s(size int) []float64 {\n\tf := make([]float64, size)\n\tfor i := 0; i < size; i++ {\n\t\tf[i] = scanFloat64()\n\t}\n\treturn f\n}\n\nfunc scanString() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc scanStrings(size int) []string {\n\ts := make([]string, size)\n\tfor i := 0; i < size; i++ {\n\t\ts[i] = scanString()\n\t}\n\treturn s\n}\n\nfunc abs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\treturn n\n}\n\nfunc pow(x, y int) int {\n\treturn int(math.Pow(float64(x), float64(y)))\n}\n\n// greatest common divisor(最大公約数)\nfunc gcd(a, b int) int {\n\tfor {\n\t\tmod := a % b\n\t\tif mod == 0 {\n\t\t\treturn b\n\t\t}\n\t\ta, b = b, mod\n\t}\n}\n\n// latest common multiple(最小公倍数)\nfunc lcm(a, b int) int {\n\treturn (a / gcd(a, b)) * b\n}\n\nfunc fact(n int) int {\n\tret := 1\n\tfor i := 1; i <= n; i++ {\n\t\tret *= i\n\t}\n\treturn ret\n}\n\nfunc perm(n, r int) int {\n\tret := 1\n\tfor i := 0; i < r; i++ {\n\t\tret *= n\n\t\tn--\n\t}\n\treturn ret\n}\n\nfunc isPrimeNum(n int) bool {\n\n\tif n <= 1 {\n\t\treturn false\n\t}\n\n\tl := int(math.Sqrt(float64(n)) + 1.)\n\tfor i := 2; i < l; i++ {\n\t\tif n%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n", "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.\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, i + K. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq K \\leq 100\n\n1 \\leq h_i \\leq 10^4\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 minimum possible total cost incurred.\n\nSample Input 1\n\n5 3\n10 30 40 50 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 5, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n3 1\n10 20 10\n\nSample Output 2\n\n20\n\nIf we follow the path 1 → 2 → 3, the total cost incurred would be |10 - 20| + |20 - 10| = 20.\n\nSample Input 3\n\n2 100\n10 10\n\nSample Output 3\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 4\n\n10 4\n40 10 20 70 80 10 20 70 80 60\n\nSample Output 4\n\n40\n\nIf we follow the path 1 → 4 → 8 → 10, the total cost incurred would be |40 - 70| + |70 - 70| + |70 - 60| = 40.", "sample_input": "5 3\n10 30 40 50 20\n"}, "reference_outputs": ["30\n"], "source_document_id": "p03161", "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.\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, i + K. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq K \\leq 100\n\n1 \\leq h_i \\leq 10^4\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 minimum possible total cost incurred.\n\nSample Input 1\n\n5 3\n10 30 40 50 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 5, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n3 1\n10 20 10\n\nSample Output 2\n\n20\n\nIf we follow the path 1 → 2 → 3, the total cost incurred would be |10 - 20| + |20 - 10| = 20.\n\nSample Input 3\n\n2 100\n10 10\n\nSample Output 3\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 4\n\n10 4\n40 10 20 70 80 10 20 70 80 60\n\nSample Output 4\n\n40\n\nIf we follow the path 1 → 4 → 8 → 10, the total cost incurred would be |40 - 70| + |70 - 70| + |70 - 60| = 40.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2119, "cpu_time_ms": 102, "memory_kb": 2816}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s403383625", "group_id": "codeNet:p03161", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst pi = math.Pi\n\nvar mod int = pow(10, 9) + 7\nvar Umod uint64 = 1000000007\nvar ans, cnt, sum int = 0, 0, 0\n\nfunc main() {\n\treader.Split(bufio.ScanWords)\n\tN, _ := strconv.Atoi(read())\n\tK, _ := strconv.Atoi(read())\n\n\th := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\th[i], _ = strconv.Atoi(read())\n\t}\n\tdp := make([]int, N+5)\n\tfor i := 1; i < N+5; i++ {\n\t\tdp[i] = 1e9\n\t}\n\n\tfor i := 0; i < N; i++ {\n\t\tfor j := i + 1; j < min(i+K+1, N); j++ {\n\t\t\tt := dp[i] + abs(h[i]-h[j])\n\t\t\tdp[j] = min(dp[j], t)\n\t\t}\n\t}\n\tfmt.Println(dp[N-1])\n}\n\n/* ---------------------------------------- */\n\nvar reader = bufio.NewScanner(os.Stdin)\n\nfunc read() string {\n\treader.Scan()\n\treturn reader.Text()\n}\n\nfunc lcm(x, y int) int {\n\treturn (x / gcd(x, y)) * y\n}\n\nfunc gcd(x, y int) int {\n\tif x%y == 0 {\n\t\treturn y\n\t} else {\n\t\tr := x % y\n\t\treturn gcd(y, r)\n\t}\n}\n\nvar fac [1000000]int\nvar finv [1000000]int\nvar inv [1000000]int\n\nfunc combination_init() {\n\tfac[0], fac[1] = 1, 1\n\tfinv[0], finv[1] = 1, 1\n\tinv[1] = 1\n\n\t// invは a^(-1) mod p\n\t// pをaで割ることを考える\n\n\t// p/a*(a) + p%a = p\n\t// p/a*(a) + p%a = 0 (mod p)\n\t// -p%a = p/a*(a) (mod p)\n\t// -p%a *a^(-1)= p/a (mod p)\n\t// a^(-1)= p/a * (-p%a)^(-1) (mod p)\n\t// a^(-1) =\n\n\tfor i := 2; i < 1000000; i++ {\n\t\tfac[i] = fac[i-1] * i % mod\n\t\tinv[i] = mod - inv[mod%i]*(mod/i)%mod\n\t\tfinv[i] = finv[i-1] * inv[i] % mod\n\t}\n}\n\nfunc combination(x, y int) int {\n\tif x < y {\n\t\treturn 0\n\t}\n\tif fac[0] != 1 {\n\t\tcombination_init()\n\t}\n\treturn fac[x] * (finv[y] * finv[x-y] % mod) % mod\n\t//return fac[x] / (fac[y] * fac[x-y])\n}\n\nfunc permutation(x, y int) int {\n\tif x < y {\n\t\treturn 0\n\t}\n\tif fac[0] != 1 {\n\t\tcombination_init()\n\t}\n\treturn fac[x] * (finv[x-y] % mod) % mod\n\t//return fac[x] / fac[x-y]\n}\n\nfunc max(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Max(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\n\nfunc min(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Min(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\nfunc pow(x, y int) int { return int(math.Pow(float64(x), float64(y))) }\nfunc abs(x int) int { return int(math.Abs(float64(x))) }\nfunc floor(x int) int { return int(math.Floor(float64(x))) }\nfunc ceil(x int) int { return int(math.Ceil(float64(x))) }\n\ntype SortBy []int\n\nfunc (a SortBy) Len() int { return len(a) }\nfunc (a SortBy) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a SortBy) Less(i, j int) bool { return a[i] < a[j] }\n\ntype PriorityQueue []int\n\nfunc (h PriorityQueue) Len() int { return len(h) }\nfunc (h PriorityQueue) Less(i, j int) bool { return h[i] > h[j] }\nfunc (h PriorityQueue) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\nfunc (h *PriorityQueue) Push(x interface{}) { *h = append(*h, x.(int)) }\nfunc (h *PriorityQueue) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n", "language": "Go", "metadata": {"date": 1568821807, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03161.html", "problem_id": "p03161", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03161/input.txt", "sample_output_relpath": "derived/input_output/data/p03161/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03161/Go/s403383625.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s403383625", "user_id": "u266742706"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst pi = math.Pi\n\nvar mod int = pow(10, 9) + 7\nvar Umod uint64 = 1000000007\nvar ans, cnt, sum int = 0, 0, 0\n\nfunc main() {\n\treader.Split(bufio.ScanWords)\n\tN, _ := strconv.Atoi(read())\n\tK, _ := strconv.Atoi(read())\n\n\th := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\th[i], _ = strconv.Atoi(read())\n\t}\n\tdp := make([]int, N+5)\n\tfor i := 1; i < N+5; i++ {\n\t\tdp[i] = 1e9\n\t}\n\n\tfor i := 0; i < N; i++ {\n\t\tfor j := i + 1; j < min(i+K+1, N); j++ {\n\t\t\tt := dp[i] + abs(h[i]-h[j])\n\t\t\tdp[j] = min(dp[j], t)\n\t\t}\n\t}\n\tfmt.Println(dp[N-1])\n}\n\n/* ---------------------------------------- */\n\nvar reader = bufio.NewScanner(os.Stdin)\n\nfunc read() string {\n\treader.Scan()\n\treturn reader.Text()\n}\n\nfunc lcm(x, y int) int {\n\treturn (x / gcd(x, y)) * y\n}\n\nfunc gcd(x, y int) int {\n\tif x%y == 0 {\n\t\treturn y\n\t} else {\n\t\tr := x % y\n\t\treturn gcd(y, r)\n\t}\n}\n\nvar fac [1000000]int\nvar finv [1000000]int\nvar inv [1000000]int\n\nfunc combination_init() {\n\tfac[0], fac[1] = 1, 1\n\tfinv[0], finv[1] = 1, 1\n\tinv[1] = 1\n\n\t// invは a^(-1) mod p\n\t// pをaで割ることを考える\n\n\t// p/a*(a) + p%a = p\n\t// p/a*(a) + p%a = 0 (mod p)\n\t// -p%a = p/a*(a) (mod p)\n\t// -p%a *a^(-1)= p/a (mod p)\n\t// a^(-1)= p/a * (-p%a)^(-1) (mod p)\n\t// a^(-1) =\n\n\tfor i := 2; i < 1000000; i++ {\n\t\tfac[i] = fac[i-1] * i % mod\n\t\tinv[i] = mod - inv[mod%i]*(mod/i)%mod\n\t\tfinv[i] = finv[i-1] * inv[i] % mod\n\t}\n}\n\nfunc combination(x, y int) int {\n\tif x < y {\n\t\treturn 0\n\t}\n\tif fac[0] != 1 {\n\t\tcombination_init()\n\t}\n\treturn fac[x] * (finv[y] * finv[x-y] % mod) % mod\n\t//return fac[x] / (fac[y] * fac[x-y])\n}\n\nfunc permutation(x, y int) int {\n\tif x < y {\n\t\treturn 0\n\t}\n\tif fac[0] != 1 {\n\t\tcombination_init()\n\t}\n\treturn fac[x] * (finv[x-y] % mod) % mod\n\t//return fac[x] / fac[x-y]\n}\n\nfunc max(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Max(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\n\nfunc min(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Min(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\nfunc pow(x, y int) int { return int(math.Pow(float64(x), float64(y))) }\nfunc abs(x int) int { return int(math.Abs(float64(x))) }\nfunc floor(x int) int { return int(math.Floor(float64(x))) }\nfunc ceil(x int) int { return int(math.Ceil(float64(x))) }\n\ntype SortBy []int\n\nfunc (a SortBy) Len() int { return len(a) }\nfunc (a SortBy) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a SortBy) Less(i, j int) bool { return a[i] < a[j] }\n\ntype PriorityQueue []int\n\nfunc (h PriorityQueue) Len() int { return len(h) }\nfunc (h PriorityQueue) Less(i, j int) bool { return h[i] > h[j] }\nfunc (h PriorityQueue) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\nfunc (h *PriorityQueue) Push(x interface{}) { *h = append(*h, x.(int)) }\nfunc (h *PriorityQueue) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n", "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.\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, i + K. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq K \\leq 100\n\n1 \\leq h_i \\leq 10^4\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 minimum possible total cost incurred.\n\nSample Input 1\n\n5 3\n10 30 40 50 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 5, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n3 1\n10 20 10\n\nSample Output 2\n\n20\n\nIf we follow the path 1 → 2 → 3, the total cost incurred would be |10 - 20| + |20 - 10| = 20.\n\nSample Input 3\n\n2 100\n10 10\n\nSample Output 3\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 4\n\n10 4\n40 10 20 70 80 10 20 70 80 60\n\nSample Output 4\n\n40\n\nIf we follow the path 1 → 4 → 8 → 10, the total cost incurred would be |40 - 70| + |70 - 70| + |70 - 60| = 40.", "sample_input": "5 3\n10 30 40 50 20\n"}, "reference_outputs": ["30\n"], "source_document_id": "p03161", "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.\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, i + K. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq K \\leq 100\n\n1 \\leq h_i \\leq 10^4\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 minimum possible total cost incurred.\n\nSample Input 1\n\n5 3\n10 30 40 50 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 5, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n3 1\n10 20 10\n\nSample Output 2\n\n20\n\nIf we follow the path 1 → 2 → 3, the total cost incurred would be |10 - 20| + |20 - 10| = 20.\n\nSample Input 3\n\n2 100\n10 10\n\nSample Output 3\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 4\n\n10 4\n40 10 20 70 80 10 20 70 80 60\n\nSample Output 4\n\n40\n\nIf we follow the path 1 → 4 → 8 → 10, the total cost incurred would be |40 - 70| + |70 - 70| + |70 - 60| = 40.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2977, "cpu_time_ms": 272, "memory_kb": 2816}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s306183023", "group_id": "codeNet:p03161", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tINF := 100000 * 10000\n\tvar N, K int\n\tfmt.Scan(&N)\n\tfmt.Scan(&K)\n\tH := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&(H[i]))\n\t}\n\n\tdp := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tdp[i] = INF\n\t}\n\tdp[0] = 0\n\n\tfor i := 1; i < N; i++ {\n\t\t//dp[i] = (1..K).map{|k| i-k < 0 ? INF : dp[i-k] + (H[i] - H[i-k]).abs }.min\n\t\tvalue := INF\n\t\tfor k := 1; k <= K; k++ {\n\t\t\tvar tmp int\n\t\t\tif i-k < 0 {\n\t\t\t\ttmp = INF\n\t\t\t} else {\n\t\t\t\ttmp2 := H[i] - H[i-k]\n\t\t\t\tif tmp2 < 0 {\n\t\t\t\t\ttmp2 = tmp2 * -1\n\t\t\t\t}\n\t\t\t\ttmp = dp[i-k] + tmp2\n\t\t\t}\n\n\t\t\tif tmp < value {\n\t\t\t\tvalue = tmp\n\t\t\t}\n\t\t}\n\t\tdp[i] = value\n\t}\n\n\tfmt.Println(dp[N-1])\n}\n", "language": "Go", "metadata": {"date": 1557260134, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03161.html", "problem_id": "p03161", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03161/input.txt", "sample_output_relpath": "derived/input_output/data/p03161/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03161/Go/s306183023.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s306183023", "user_id": "u041550672"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tINF := 100000 * 10000\n\tvar N, K int\n\tfmt.Scan(&N)\n\tfmt.Scan(&K)\n\tH := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&(H[i]))\n\t}\n\n\tdp := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tdp[i] = INF\n\t}\n\tdp[0] = 0\n\n\tfor i := 1; i < N; i++ {\n\t\t//dp[i] = (1..K).map{|k| i-k < 0 ? INF : dp[i-k] + (H[i] - H[i-k]).abs }.min\n\t\tvalue := INF\n\t\tfor k := 1; k <= K; k++ {\n\t\t\tvar tmp int\n\t\t\tif i-k < 0 {\n\t\t\t\ttmp = INF\n\t\t\t} else {\n\t\t\t\ttmp2 := H[i] - H[i-k]\n\t\t\t\tif tmp2 < 0 {\n\t\t\t\t\ttmp2 = tmp2 * -1\n\t\t\t\t}\n\t\t\t\ttmp = dp[i-k] + tmp2\n\t\t\t}\n\n\t\t\tif tmp < value {\n\t\t\t\tvalue = tmp\n\t\t\t}\n\t\t}\n\t\tdp[i] = value\n\t}\n\n\tfmt.Println(dp[N-1])\n}\n", "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.\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, i + K. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq K \\leq 100\n\n1 \\leq h_i \\leq 10^4\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 minimum possible total cost incurred.\n\nSample Input 1\n\n5 3\n10 30 40 50 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 5, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n3 1\n10 20 10\n\nSample Output 2\n\n20\n\nIf we follow the path 1 → 2 → 3, the total cost incurred would be |10 - 20| + |20 - 10| = 20.\n\nSample Input 3\n\n2 100\n10 10\n\nSample Output 3\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 4\n\n10 4\n40 10 20 70 80 10 20 70 80 60\n\nSample Output 4\n\n40\n\nIf we follow the path 1 → 4 → 8 → 10, the total cost incurred would be |40 - 70| + |70 - 70| + |70 - 60| = 40.", "sample_input": "5 3\n10 30 40 50 20\n"}, "reference_outputs": ["30\n"], "source_document_id": "p03161", "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.\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, i + K. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq K \\leq 100\n\n1 \\leq h_i \\leq 10^4\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 minimum possible total cost incurred.\n\nSample Input 1\n\n5 3\n10 30 40 50 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 5, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n3 1\n10 20 10\n\nSample Output 2\n\n20\n\nIf we follow the path 1 → 2 → 3, the total cost incurred would be |10 - 20| + |20 - 10| = 20.\n\nSample Input 3\n\n2 100\n10 10\n\nSample Output 3\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 4\n\n10 4\n40 10 20 70 80 10 20 70 80 60\n\nSample Output 4\n\n40\n\nIf we follow the path 1 → 4 → 8 → 10, the total cost incurred would be |40 - 70| + |70 - 70| + |70 - 60| = 40.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 657, "cpu_time_ms": 452, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s518146573", "group_id": "codeNet:p03161", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tstdin := bufio.NewScanner(os.Stdin)\n\tstdin.Scan()\n\tinputs := strings.Split(stdin.Text(), \" \")\n\tvar n, k, i, j int\n\tn, _ = strconv.Atoi(inputs[0])\n\tk, _ = strconv.Atoi(inputs[1])\n\tvar dp [100000]int\n\tvar hList [10000]int\n\tvar diff int\n\tstdin.Scan()\n\thInput := strings.Split(stdin.Text(), \" \")\n\tfor i = 0; i < 1000 && i < n; i++ {\n\t\thList[i], _ = strconv.Atoi(hInput[i])\n\t\tdp[i] = 0\n\t\tfor j = 1; j <= i && j <= k; j++ {\n\t\t\tif hList[i] > hList[i-j] {\n\t\t\t\tdiff = hList[i] - hList[i-j]\n\t\t\t} else {\n\t\t\t\tdiff = hList[i-j] - hList[i]\n\t\t\t}\n\t\t\tif dp[i] == 0 {\n\t\t\t\tdp[i] = diff + dp[i-j]\n\t\t\t}\n\t\t\tif dp[i-j]+diff < dp[i] {\n\t\t\t\tdp[i] = dp[i-j] + diff\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(dp[n-1])\n}\n", "language": "Go", "metadata": {"date": 1552766332, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03161.html", "problem_id": "p03161", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03161/input.txt", "sample_output_relpath": "derived/input_output/data/p03161/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03161/Go/s518146573.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s518146573", "user_id": "u150542210"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tstdin := bufio.NewScanner(os.Stdin)\n\tstdin.Scan()\n\tinputs := strings.Split(stdin.Text(), \" \")\n\tvar n, k, i, j int\n\tn, _ = strconv.Atoi(inputs[0])\n\tk, _ = strconv.Atoi(inputs[1])\n\tvar dp [100000]int\n\tvar hList [10000]int\n\tvar diff int\n\tstdin.Scan()\n\thInput := strings.Split(stdin.Text(), \" \")\n\tfor i = 0; i < 1000 && i < n; i++ {\n\t\thList[i], _ = strconv.Atoi(hInput[i])\n\t\tdp[i] = 0\n\t\tfor j = 1; j <= i && j <= k; j++ {\n\t\t\tif hList[i] > hList[i-j] {\n\t\t\t\tdiff = hList[i] - hList[i-j]\n\t\t\t} else {\n\t\t\t\tdiff = hList[i-j] - hList[i]\n\t\t\t}\n\t\t\tif dp[i] == 0 {\n\t\t\t\tdp[i] = diff + dp[i-j]\n\t\t\t}\n\t\t\tif dp[i-j]+diff < dp[i] {\n\t\t\t\tdp[i] = dp[i-j] + diff\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(dp[n-1])\n}\n", "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.\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, i + K. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq K \\leq 100\n\n1 \\leq h_i \\leq 10^4\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 minimum possible total cost incurred.\n\nSample Input 1\n\n5 3\n10 30 40 50 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 5, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n3 1\n10 20 10\n\nSample Output 2\n\n20\n\nIf we follow the path 1 → 2 → 3, the total cost incurred would be |10 - 20| + |20 - 10| = 20.\n\nSample Input 3\n\n2 100\n10 10\n\nSample Output 3\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 4\n\n10 4\n40 10 20 70 80 10 20 70 80 60\n\nSample Output 4\n\n40\n\nIf we follow the path 1 → 4 → 8 → 10, the total cost incurred would be |40 - 70| + |70 - 70| + |70 - 60| = 40.", "sample_input": "5 3\n10 30 40 50 20\n"}, "reference_outputs": ["30\n"], "source_document_id": "p03161", "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.\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, i + K. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq K \\leq 100\n\n1 \\leq h_i \\leq 10^4\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 minimum possible total cost incurred.\n\nSample Input 1\n\n5 3\n10 30 40 50 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 5, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n3 1\n10 20 10\n\nSample Output 2\n\n20\n\nIf we follow the path 1 → 2 → 3, the total cost incurred would be |10 - 20| + |20 - 10| = 20.\n\nSample Input 3\n\n2 100\n10 10\n\nSample Output 3\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 4\n\n10 4\n40 10 20 70 80 10 20 70 80 60\n\nSample Output 4\n\n40\n\nIf we follow the path 1 → 4 → 8 → 10, the total cost incurred would be |40 - 70| + |70 - 70| + |70 - 60| = 40.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 759, "cpu_time_ms": 4, "memory_kb": 1664}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s382569880", "group_id": "codeNet:p03161", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tstdin := bufio.NewScanner(os.Stdin)\n\tstdin.Scan()\n\tinputs := strings.Split(stdin.Text(), \" \")\n\tvar n, k int\n\tn, _ = strconv.Atoi(inputs[0])\n\tk, _ = strconv.Atoi(inputs[1])\n\tvar dp [100000]int\n\tvar hList [10000]int\n\tstdin.Scan()\n\thInput := strings.Split(stdin.Text(), \" \")\n\tfor i := 0; i < n; i++ {\n\t\thList[i], _ = strconv.Atoi(hInput[i])\n\t\tdp[i] = 0\n\t\tfor j := 1; j <= i && j <= k; j++ {\n\t\t}\n\t}\n\tfmt.Println(dp[n-1])\n}\n", "language": "Go", "metadata": {"date": 1552765212, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03161.html", "problem_id": "p03161", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03161/input.txt", "sample_output_relpath": "derived/input_output/data/p03161/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03161/Go/s382569880.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s382569880", "user_id": "u150542210"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tstdin := bufio.NewScanner(os.Stdin)\n\tstdin.Scan()\n\tinputs := strings.Split(stdin.Text(), \" \")\n\tvar n, k int\n\tn, _ = strconv.Atoi(inputs[0])\n\tk, _ = strconv.Atoi(inputs[1])\n\tvar dp [100000]int\n\tvar hList [10000]int\n\tstdin.Scan()\n\thInput := strings.Split(stdin.Text(), \" \")\n\tfor i := 0; i < n; i++ {\n\t\thList[i], _ = strconv.Atoi(hInput[i])\n\t\tdp[i] = 0\n\t\tfor j := 1; j <= i && j <= k; j++ {\n\t\t}\n\t}\n\tfmt.Println(dp[n-1])\n}\n", "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.\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, i + K. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq K \\leq 100\n\n1 \\leq h_i \\leq 10^4\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 minimum possible total cost incurred.\n\nSample Input 1\n\n5 3\n10 30 40 50 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 5, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n3 1\n10 20 10\n\nSample Output 2\n\n20\n\nIf we follow the path 1 → 2 → 3, the total cost incurred would be |10 - 20| + |20 - 10| = 20.\n\nSample Input 3\n\n2 100\n10 10\n\nSample Output 3\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 4\n\n10 4\n40 10 20 70 80 10 20 70 80 60\n\nSample Output 4\n\n40\n\nIf we follow the path 1 → 4 → 8 → 10, the total cost incurred would be |40 - 70| + |70 - 70| + |70 - 60| = 40.", "sample_input": "5 3\n10 30 40 50 20\n"}, "reference_outputs": ["30\n"], "source_document_id": "p03161", "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.\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, i + K. Here, a cost of |h_i - h_j| 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 10^5\n\n1 \\leq K \\leq 100\n\n1 \\leq h_i \\leq 10^4\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 minimum possible total cost incurred.\n\nSample Input 1\n\n5 3\n10 30 40 50 20\n\nSample Output 1\n\n30\n\nIf we follow the path 1 → 2 → 5, the total cost incurred would be |10 - 30| + |30 - 20| = 30.\n\nSample Input 2\n\n3 1\n10 20 10\n\nSample Output 2\n\n20\n\nIf we follow the path 1 → 2 → 3, the total cost incurred would be |10 - 20| + |20 - 10| = 20.\n\nSample Input 3\n\n2 100\n10 10\n\nSample Output 3\n\n0\n\nIf we follow the path 1 → 2, the total cost incurred would be |10 - 10| = 0.\n\nSample Input 4\n\n10 4\n40 10 20 70 80 10 20 70 80 60\n\nSample Output 4\n\n40\n\nIf we follow the path 1 → 4 → 8 → 10, the total cost incurred would be |40 - 70| + |70 - 70| + |70 - 60| = 40.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 504, "cpu_time_ms": 4, "memory_kb": 1664}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s578203360", "group_id": "codeNet:p03163", "input_text": "//go:generate echo \"https://atcoder.jp/contests/dp/tasks/dp_d\"\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype scanner struct{ *bufio.Scanner }\n\nfunc newScanner(r io.Reader) *scanner {\n\ts := bufio.NewScanner(r)\n\ts.Split(bufio.ScanWords)\n\ts.Buffer(nil, 100000000)\n\treturn &scanner{s}\n}\n\nfunc (s *scanner) Int() int {\n\ts.Scan()\n\tn, _ := strconv.Atoi(s.Text())\n\treturn n\n}\n\nfunc (s *scanner) IntSlice(l int) []int {\n\tif l == 0 {\n\t\treturn []int{}\n\t}\n\tsl := make([]int, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.Int()\n\t}\n\treturn sl\n}\n\nfunc chmax(x *int, v int) {\n\tif *x < v {\n\t\t*x = v\n\t}\n}\n\nfunc solve(N, W int, wvs [][]int) int {\n\tt := make([][]int, N+1, N+1) // t[item_index][weight]\n\tfor i := range t {\n\t\tt[i] = make([]int, W+1, W+1)\n\t}\n\tfor i, wv := range wvs {\n\t\tweight, value := wv[0], wv[1]\n\t\tfor sumWeight := 0; sumWeight <= W; sumWeight++ {\n\t\t\tif sumWeight-weight >= 0 {\n\t\t\t\tchmax(&t[i+1][sumWeight], t[i][sumWeight-weight]+value)\n\t\t\t}\n\t\t\tchmax(&t[i+1][sumWeight], t[i][sumWeight])\n\t\t}\n\t}\n\treturn t[N][W]\n}\n\nfunc main() {\n\tfor {\n\n\t}\n\tscan := newScanner(os.Stdin)\n\tN, W := scan.Int(), scan.Int()\n\twvs := make([][]int, N, N)\n\tfor i := 0; i < N; i++ {\n\t\twvs[i] = []int{scan.Int(), scan.Int()}\n\t}\n\tfmt.Println(solve(N, W, wvs))\n}\n", "language": "Go", "metadata": {"date": 1599753328, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03163.html", "problem_id": "p03163", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03163/input.txt", "sample_output_relpath": "derived/input_output/data/p03163/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03163/Go/s578203360.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s578203360", "user_id": "u890085018"}, "prompt_components": {"gold_output": "90\n", "input_to_evaluate": "//go:generate echo \"https://atcoder.jp/contests/dp/tasks/dp_d\"\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype scanner struct{ *bufio.Scanner }\n\nfunc newScanner(r io.Reader) *scanner {\n\ts := bufio.NewScanner(r)\n\ts.Split(bufio.ScanWords)\n\ts.Buffer(nil, 100000000)\n\treturn &scanner{s}\n}\n\nfunc (s *scanner) Int() int {\n\ts.Scan()\n\tn, _ := strconv.Atoi(s.Text())\n\treturn n\n}\n\nfunc (s *scanner) IntSlice(l int) []int {\n\tif l == 0 {\n\t\treturn []int{}\n\t}\n\tsl := make([]int, l, l)\n\tfor i := range sl {\n\t\tsl[i] = s.Int()\n\t}\n\treturn sl\n}\n\nfunc chmax(x *int, v int) {\n\tif *x < v {\n\t\t*x = v\n\t}\n}\n\nfunc solve(N, W int, wvs [][]int) int {\n\tt := make([][]int, N+1, N+1) // t[item_index][weight]\n\tfor i := range t {\n\t\tt[i] = make([]int, W+1, W+1)\n\t}\n\tfor i, wv := range wvs {\n\t\tweight, value := wv[0], wv[1]\n\t\tfor sumWeight := 0; sumWeight <= W; sumWeight++ {\n\t\t\tif sumWeight-weight >= 0 {\n\t\t\t\tchmax(&t[i+1][sumWeight], t[i][sumWeight-weight]+value)\n\t\t\t}\n\t\t\tchmax(&t[i+1][sumWeight], t[i][sumWeight])\n\t\t}\n\t}\n\treturn t[N][W]\n}\n\nfunc main() {\n\tfor {\n\n\t}\n\tscan := newScanner(os.Stdin)\n\tN, W := scan.Int(), scan.Int()\n\twvs := make([][]int, N, N)\n\tfor i := 0; i < N; i++ {\n\t\twvs[i] = []int{scan.Int(), scan.Int()}\n\t}\n\tfmt.Println(solve(N, W, wvs))\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are N items, numbered 1, 2, \\ldots, N.\nFor each i (1 \\leq i \\leq N), Item i has a weight of w_i and a value of v_i.\n\nTaro has decided to choose some of the N items and carry them home in a knapsack.\nThe capacity of the knapsack is W, which means that the sum of the weights of items taken must be at most W.\n\nFind the maximum possible sum of the values of items that Taro takes home.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq W \\leq 10^5\n\n1 \\leq w_i \\leq W\n\n1 \\leq v_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN W\nw_1 v_1\nw_2 v_2\n:\nw_N v_N\n\nOutput\n\nPrint the maximum possible sum of the values of items that Taro takes home.\n\nSample Input 1\n\n3 8\n3 30\n4 50\n5 60\n\nSample Output 1\n\n90\n\nItems 1 and 3 should be taken.\nThen, the sum of the weights is 3 + 5 = 8, and the sum of the values is 30 + 60 = 90.\n\nSample Input 2\n\n5 5\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n\nSample Output 2\n\n5000000000\n\nThe answer may not fit into a 32-bit integer type.\n\nSample Input 3\n\n6 15\n6 5\n5 6\n6 4\n6 6\n3 5\n7 2\n\nSample Output 3\n\n17\n\nItems 2, 4 and 5 should be taken.\nThen, the sum of the weights is 5 + 6 + 3 = 14, and the sum of the values is 6 + 6 + 5 = 17.", "sample_input": "3 8\n3 30\n4 50\n5 60\n"}, "reference_outputs": ["90\n"], "source_document_id": "p03163", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are N items, numbered 1, 2, \\ldots, N.\nFor each i (1 \\leq i \\leq N), Item i has a weight of w_i and a value of v_i.\n\nTaro has decided to choose some of the N items and carry them home in a knapsack.\nThe capacity of the knapsack is W, which means that the sum of the weights of items taken must be at most W.\n\nFind the maximum possible sum of the values of items that Taro takes home.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq W \\leq 10^5\n\n1 \\leq w_i \\leq W\n\n1 \\leq v_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN W\nw_1 v_1\nw_2 v_2\n:\nw_N v_N\n\nOutput\n\nPrint the maximum possible sum of the values of items that Taro takes home.\n\nSample Input 1\n\n3 8\n3 30\n4 50\n5 60\n\nSample Output 1\n\n90\n\nItems 1 and 3 should be taken.\nThen, the sum of the weights is 3 + 5 = 8, and the sum of the values is 30 + 60 = 90.\n\nSample Input 2\n\n5 5\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n\nSample Output 2\n\n5000000000\n\nThe answer may not fit into a 32-bit integer type.\n\nSample Input 3\n\n6 15\n6 5\n5 6\n6 4\n6 6\n3 5\n7 2\n\nSample Output 3\n\n17\n\nItems 2, 4 and 5 should be taken.\nThen, the sum of the weights is 5 + 6 + 3 = 14, and the sum of the values is 6 + 6 + 5 = 17.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1249, "cpu_time_ms": 2205, "memory_kb": 1656}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s069297737", "group_id": "codeNet:p03163", "input_text": "package main\n\nimport \"fmt\"\nvar N, W, w,v int\nvar A [][]int\nvar dp [][]int\n\nfunc max(a, b int) int {\n\tif a > b { return a }\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b { return a }\n\treturn b\n}\n\nfunc abs(a int) int {\n\tif a < 0 { return -a }\n\treturn a\n}\n\nfunc main() {\n\t_,e := fmt.Scanf(\"%d%d\", &N, &W)\n\tif e != nil { return }\n\tA = make([][]int, 0)\n\tfor i:=0; i j {\n\t\t\t\tdp[i][j] = dp[i-1][j]\n\t\t\t} else {\n\t\t\t\tdp[i][j] = max(dp[i-1][j], dp[i-1][j-A[i-1][0]] + A[i-1][1])\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(dp[N][W])\n}\n", "language": "Go", "metadata": {"date": 1596677488, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03163.html", "problem_id": "p03163", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03163/input.txt", "sample_output_relpath": "derived/input_output/data/p03163/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03163/Go/s069297737.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s069297737", "user_id": "u064438560"}, "prompt_components": {"gold_output": "90\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\nvar N, W, w,v int\nvar A [][]int\nvar dp [][]int\n\nfunc max(a, b int) int {\n\tif a > b { return a }\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b { return a }\n\treturn b\n}\n\nfunc abs(a int) int {\n\tif a < 0 { return -a }\n\treturn a\n}\n\nfunc main() {\n\t_,e := fmt.Scanf(\"%d%d\", &N, &W)\n\tif e != nil { return }\n\tA = make([][]int, 0)\n\tfor i:=0; i j {\n\t\t\t\tdp[i][j] = dp[i-1][j]\n\t\t\t} else {\n\t\t\t\tdp[i][j] = max(dp[i-1][j], dp[i-1][j-A[i-1][0]] + A[i-1][1])\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(dp[N][W])\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are N items, numbered 1, 2, \\ldots, N.\nFor each i (1 \\leq i \\leq N), Item i has a weight of w_i and a value of v_i.\n\nTaro has decided to choose some of the N items and carry them home in a knapsack.\nThe capacity of the knapsack is W, which means that the sum of the weights of items taken must be at most W.\n\nFind the maximum possible sum of the values of items that Taro takes home.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq W \\leq 10^5\n\n1 \\leq w_i \\leq W\n\n1 \\leq v_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN W\nw_1 v_1\nw_2 v_2\n:\nw_N v_N\n\nOutput\n\nPrint the maximum possible sum of the values of items that Taro takes home.\n\nSample Input 1\n\n3 8\n3 30\n4 50\n5 60\n\nSample Output 1\n\n90\n\nItems 1 and 3 should be taken.\nThen, the sum of the weights is 3 + 5 = 8, and the sum of the values is 30 + 60 = 90.\n\nSample Input 2\n\n5 5\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n\nSample Output 2\n\n5000000000\n\nThe answer may not fit into a 32-bit integer type.\n\nSample Input 3\n\n6 15\n6 5\n5 6\n6 4\n6 6\n3 5\n7 2\n\nSample Output 3\n\n17\n\nItems 2, 4 and 5 should be taken.\nThen, the sum of the weights is 5 + 6 + 3 = 14, and the sum of the values is 6 + 6 + 5 = 17.", "sample_input": "3 8\n3 30\n4 50\n5 60\n"}, "reference_outputs": ["90\n"], "source_document_id": "p03163", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are N items, numbered 1, 2, \\ldots, N.\nFor each i (1 \\leq i \\leq N), Item i has a weight of w_i and a value of v_i.\n\nTaro has decided to choose some of the N items and carry them home in a knapsack.\nThe capacity of the knapsack is W, which means that the sum of the weights of items taken must be at most W.\n\nFind the maximum possible sum of the values of items that Taro takes home.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq W \\leq 10^5\n\n1 \\leq w_i \\leq W\n\n1 \\leq v_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN W\nw_1 v_1\nw_2 v_2\n:\nw_N v_N\n\nOutput\n\nPrint the maximum possible sum of the values of items that Taro takes home.\n\nSample Input 1\n\n3 8\n3 30\n4 50\n5 60\n\nSample Output 1\n\n90\n\nItems 1 and 3 should be taken.\nThen, the sum of the weights is 3 + 5 = 8, and the sum of the values is 30 + 60 = 90.\n\nSample Input 2\n\n5 5\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n\nSample Output 2\n\n5000000000\n\nThe answer may not fit into a 32-bit integer type.\n\nSample Input 3\n\n6 15\n6 5\n5 6\n6 4\n6 6\n3 5\n7 2\n\nSample Output 3\n\n17\n\nItems 2, 4 and 5 should be taken.\nThen, the sum of the weights is 5 + 6 + 3 = 14, and the sum of the values is 6 + 6 + 5 = 17.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 103, "memory_kb": 83072}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s337114265", "group_id": "codeNet:p03163", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\ntype Item struct {\n\tValue float64\n\tWeight float64\n}\n\nfunc main() {\n\tvar ItemNumber int\n\tvar MaxWeight float64\n\tsack := []Item{}\n\n\tfmt.Scanln(&ItemNumber, &MaxWeight)\n\n\tfor i := 0; i < ItemNumber; i++ {\n\t\tX := Item{}\n\t\tfmt.Scanln(&X.Weight, &X.Value)\n\t\tsack = append(sack, X)\n\t}\n\tvalue, _ := Knapsack(sack,MaxWeight)\n\tfmt.Print(int64(value))\n}\n\n\nfunc combinations(items []Item, ch chan []Item) {\n\tdefer close(ch)\n\n\tp := int(math.Pow(2., float64(len(items))))\n\n\tfor i := 0; i < p; i++ {\n\t\tset := []Item{}\n\t\tfor j := 0; j < len(items); j++ {\n\t\t\tif (i>>uint(j))&1 == 1 {\n\t\t\t\tset = append(set, items[j])\n\t\t\t}\n\t\t}\n\t\tch <- set\n\t}\n}\n\nfunc getSackWeight(set []Item) (r float64) {\n\tfor _, i := range set {\n\t\tr += i.Weight\n\t}\n\treturn\n}\n\nfunc getSackValue(set []Item) (r float64) {\n\tfor _, i := range set {\n\t\tr += i.Value\n\t}\n\treturn\n}\n\nfunc Knapsack(items []Item, maxWeight float64) (float64, []Item) {\n\tbestVal := 0.\n\tbestSack := []Item{}\n\n\tch := make(chan []Item)\n\tgo combinations(items, ch)\n\n\tfor sack := range ch {\n\t\tif getSackWeight(sack) <= maxWeight {\n\t\t\tv := getSackValue(sack)\n\t\t\tif v > bestVal {\n\t\t\t\tbestVal = v\n\t\t\t\tbestSack = sack\n\t\t\t}\n\t\t}\n\t}\n\treturn bestVal, bestSack\n}\n", "language": "Go", "metadata": {"date": 1594215736, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03163.html", "problem_id": "p03163", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03163/input.txt", "sample_output_relpath": "derived/input_output/data/p03163/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03163/Go/s337114265.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s337114265", "user_id": "u929590046"}, "prompt_components": {"gold_output": "90\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\ntype Item struct {\n\tValue float64\n\tWeight float64\n}\n\nfunc main() {\n\tvar ItemNumber int\n\tvar MaxWeight float64\n\tsack := []Item{}\n\n\tfmt.Scanln(&ItemNumber, &MaxWeight)\n\n\tfor i := 0; i < ItemNumber; i++ {\n\t\tX := Item{}\n\t\tfmt.Scanln(&X.Weight, &X.Value)\n\t\tsack = append(sack, X)\n\t}\n\tvalue, _ := Knapsack(sack,MaxWeight)\n\tfmt.Print(int64(value))\n}\n\n\nfunc combinations(items []Item, ch chan []Item) {\n\tdefer close(ch)\n\n\tp := int(math.Pow(2., float64(len(items))))\n\n\tfor i := 0; i < p; i++ {\n\t\tset := []Item{}\n\t\tfor j := 0; j < len(items); j++ {\n\t\t\tif (i>>uint(j))&1 == 1 {\n\t\t\t\tset = append(set, items[j])\n\t\t\t}\n\t\t}\n\t\tch <- set\n\t}\n}\n\nfunc getSackWeight(set []Item) (r float64) {\n\tfor _, i := range set {\n\t\tr += i.Weight\n\t}\n\treturn\n}\n\nfunc getSackValue(set []Item) (r float64) {\n\tfor _, i := range set {\n\t\tr += i.Value\n\t}\n\treturn\n}\n\nfunc Knapsack(items []Item, maxWeight float64) (float64, []Item) {\n\tbestVal := 0.\n\tbestSack := []Item{}\n\n\tch := make(chan []Item)\n\tgo combinations(items, ch)\n\n\tfor sack := range ch {\n\t\tif getSackWeight(sack) <= maxWeight {\n\t\t\tv := getSackValue(sack)\n\t\t\tif v > bestVal {\n\t\t\t\tbestVal = v\n\t\t\t\tbestSack = sack\n\t\t\t}\n\t\t}\n\t}\n\treturn bestVal, bestSack\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are N items, numbered 1, 2, \\ldots, N.\nFor each i (1 \\leq i \\leq N), Item i has a weight of w_i and a value of v_i.\n\nTaro has decided to choose some of the N items and carry them home in a knapsack.\nThe capacity of the knapsack is W, which means that the sum of the weights of items taken must be at most W.\n\nFind the maximum possible sum of the values of items that Taro takes home.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq W \\leq 10^5\n\n1 \\leq w_i \\leq W\n\n1 \\leq v_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN W\nw_1 v_1\nw_2 v_2\n:\nw_N v_N\n\nOutput\n\nPrint the maximum possible sum of the values of items that Taro takes home.\n\nSample Input 1\n\n3 8\n3 30\n4 50\n5 60\n\nSample Output 1\n\n90\n\nItems 1 and 3 should be taken.\nThen, the sum of the weights is 3 + 5 = 8, and the sum of the values is 30 + 60 = 90.\n\nSample Input 2\n\n5 5\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n\nSample Output 2\n\n5000000000\n\nThe answer may not fit into a 32-bit integer type.\n\nSample Input 3\n\n6 15\n6 5\n5 6\n6 4\n6 6\n3 5\n7 2\n\nSample Output 3\n\n17\n\nItems 2, 4 and 5 should be taken.\nThen, the sum of the weights is 5 + 6 + 3 = 14, and the sum of the values is 6 + 6 + 5 = 17.", "sample_input": "3 8\n3 30\n4 50\n5 60\n"}, "reference_outputs": ["90\n"], "source_document_id": "p03163", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are N items, numbered 1, 2, \\ldots, N.\nFor each i (1 \\leq i \\leq N), Item i has a weight of w_i and a value of v_i.\n\nTaro has decided to choose some of the N items and carry them home in a knapsack.\nThe capacity of the knapsack is W, which means that the sum of the weights of items taken must be at most W.\n\nFind the maximum possible sum of the values of items that Taro takes home.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq W \\leq 10^5\n\n1 \\leq w_i \\leq W\n\n1 \\leq v_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN W\nw_1 v_1\nw_2 v_2\n:\nw_N v_N\n\nOutput\n\nPrint the maximum possible sum of the values of items that Taro takes home.\n\nSample Input 1\n\n3 8\n3 30\n4 50\n5 60\n\nSample Output 1\n\n90\n\nItems 1 and 3 should be taken.\nThen, the sum of the weights is 3 + 5 = 8, and the sum of the values is 30 + 60 = 90.\n\nSample Input 2\n\n5 5\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n\nSample Output 2\n\n5000000000\n\nThe answer may not fit into a 32-bit integer type.\n\nSample Input 3\n\n6 15\n6 5\n5 6\n6 4\n6 6\n3 5\n7 2\n\nSample Output 3\n\n17\n\nItems 2, 4 and 5 should be taken.\nThen, the sum of the weights is 5 + 6 + 3 = 14, and the sum of the values is 6 + 6 + 5 = 17.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1212, "cpu_time_ms": 8, "memory_kb": 1888}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s354278367", "group_id": "codeNet:p03163", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\ntype Item struct {\n\tValue float64\n\tWeight float64\n}\n\nfunc main() {\n\tvar ItemNumber int\n\tvar MaxWeight float64\n\tsack := []Item{}\n\n\tfmt.Scanln(&ItemNumber, &MaxWeight)\n\n\tfor i := 0; i < ItemNumber; i++ {\n\t\tX := Item{}\n\t\tfmt.Scanln(&X.Weight, &X.Value)\n\t\tsack = append(sack, X)\n\t}\n\tvalue, _ := Knapsack(sack,MaxWeight)\n\tfmt.Print(value)\n}\n\n\nfunc combinations(items []Item, ch chan []Item) {\n\tdefer close(ch)\n\n\tp := int(math.Pow(2., float64(len(items))))\n\n\tfor i := 0; i < p; i++ {\n\t\tset := []Item{}\n\t\tfor j := 0; j < len(items); j++ {\n\t\t\tif (i>>uint(j))&1 == 1 {\n\t\t\t\tset = append(set, items[j])\n\t\t\t}\n\t\t}\n\t\tch <- set\n\t}\n}\n\nfunc getSackWeight(set []Item) (r float64) {\n\tfor _, i := range set {\n\t\tr += i.Weight\n\t}\n\treturn\n}\n\nfunc getSackValue(set []Item) (r float64) {\n\tfor _, i := range set {\n\t\tr += i.Value\n\t}\n\treturn\n}\n\nfunc Knapsack(items []Item, maxWeight float64) (float64, []Item) {\n\tbestVal := 0.\n\tbestSack := []Item{}\n\n\tch := make(chan []Item)\n\tgo combinations(items, ch)\n\n\tfor sack := range ch {\n\t\tif getSackWeight(sack) <= maxWeight {\n\t\t\tv := getSackValue(sack)\n\t\t\tif v > bestVal {\n\t\t\t\tbestVal = v\n\t\t\t\tbestSack = sack\n\t\t\t}\n\t\t}\n\t}\n\treturn bestVal, bestSack\n}\n", "language": "Go", "metadata": {"date": 1594215450, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03163.html", "problem_id": "p03163", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03163/input.txt", "sample_output_relpath": "derived/input_output/data/p03163/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03163/Go/s354278367.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s354278367", "user_id": "u929590046"}, "prompt_components": {"gold_output": "90\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\ntype Item struct {\n\tValue float64\n\tWeight float64\n}\n\nfunc main() {\n\tvar ItemNumber int\n\tvar MaxWeight float64\n\tsack := []Item{}\n\n\tfmt.Scanln(&ItemNumber, &MaxWeight)\n\n\tfor i := 0; i < ItemNumber; i++ {\n\t\tX := Item{}\n\t\tfmt.Scanln(&X.Weight, &X.Value)\n\t\tsack = append(sack, X)\n\t}\n\tvalue, _ := Knapsack(sack,MaxWeight)\n\tfmt.Print(value)\n}\n\n\nfunc combinations(items []Item, ch chan []Item) {\n\tdefer close(ch)\n\n\tp := int(math.Pow(2., float64(len(items))))\n\n\tfor i := 0; i < p; i++ {\n\t\tset := []Item{}\n\t\tfor j := 0; j < len(items); j++ {\n\t\t\tif (i>>uint(j))&1 == 1 {\n\t\t\t\tset = append(set, items[j])\n\t\t\t}\n\t\t}\n\t\tch <- set\n\t}\n}\n\nfunc getSackWeight(set []Item) (r float64) {\n\tfor _, i := range set {\n\t\tr += i.Weight\n\t}\n\treturn\n}\n\nfunc getSackValue(set []Item) (r float64) {\n\tfor _, i := range set {\n\t\tr += i.Value\n\t}\n\treturn\n}\n\nfunc Knapsack(items []Item, maxWeight float64) (float64, []Item) {\n\tbestVal := 0.\n\tbestSack := []Item{}\n\n\tch := make(chan []Item)\n\tgo combinations(items, ch)\n\n\tfor sack := range ch {\n\t\tif getSackWeight(sack) <= maxWeight {\n\t\t\tv := getSackValue(sack)\n\t\t\tif v > bestVal {\n\t\t\t\tbestVal = v\n\t\t\t\tbestSack = sack\n\t\t\t}\n\t\t}\n\t}\n\treturn bestVal, bestSack\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are N items, numbered 1, 2, \\ldots, N.\nFor each i (1 \\leq i \\leq N), Item i has a weight of w_i and a value of v_i.\n\nTaro has decided to choose some of the N items and carry them home in a knapsack.\nThe capacity of the knapsack is W, which means that the sum of the weights of items taken must be at most W.\n\nFind the maximum possible sum of the values of items that Taro takes home.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq W \\leq 10^5\n\n1 \\leq w_i \\leq W\n\n1 \\leq v_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN W\nw_1 v_1\nw_2 v_2\n:\nw_N v_N\n\nOutput\n\nPrint the maximum possible sum of the values of items that Taro takes home.\n\nSample Input 1\n\n3 8\n3 30\n4 50\n5 60\n\nSample Output 1\n\n90\n\nItems 1 and 3 should be taken.\nThen, the sum of the weights is 3 + 5 = 8, and the sum of the values is 30 + 60 = 90.\n\nSample Input 2\n\n5 5\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n\nSample Output 2\n\n5000000000\n\nThe answer may not fit into a 32-bit integer type.\n\nSample Input 3\n\n6 15\n6 5\n5 6\n6 4\n6 6\n3 5\n7 2\n\nSample Output 3\n\n17\n\nItems 2, 4 and 5 should be taken.\nThen, the sum of the weights is 5 + 6 + 3 = 14, and the sum of the values is 6 + 6 + 5 = 17.", "sample_input": "3 8\n3 30\n4 50\n5 60\n"}, "reference_outputs": ["90\n"], "source_document_id": "p03163", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are N items, numbered 1, 2, \\ldots, N.\nFor each i (1 \\leq i \\leq N), Item i has a weight of w_i and a value of v_i.\n\nTaro has decided to choose some of the N items and carry them home in a knapsack.\nThe capacity of the knapsack is W, which means that the sum of the weights of items taken must be at most W.\n\nFind the maximum possible sum of the values of items that Taro takes home.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq W \\leq 10^5\n\n1 \\leq w_i \\leq W\n\n1 \\leq v_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN W\nw_1 v_1\nw_2 v_2\n:\nw_N v_N\n\nOutput\n\nPrint the maximum possible sum of the values of items that Taro takes home.\n\nSample Input 1\n\n3 8\n3 30\n4 50\n5 60\n\nSample Output 1\n\n90\n\nItems 1 and 3 should be taken.\nThen, the sum of the weights is 3 + 5 = 8, and the sum of the values is 30 + 60 = 90.\n\nSample Input 2\n\n5 5\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n\nSample Output 2\n\n5000000000\n\nThe answer may not fit into a 32-bit integer type.\n\nSample Input 3\n\n6 15\n6 5\n5 6\n6 4\n6 6\n3 5\n7 2\n\nSample Output 3\n\n17\n\nItems 2, 4 and 5 should be taken.\nThen, the sum of the weights is 5 + 6 + 3 = 14, and the sum of the values is 6 + 6 + 5 = 17.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1205, "cpu_time_ms": 7, "memory_kb": 1888}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s439616598", "group_id": "codeNet:p03163", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc lib_MaxInt64(values ...int64) (max int64, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\nfunc lib_MustMaxInt64(values ...int64) (max int64) {\n\tmax, err := lib_MaxInt64(values...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\nfunc lib_New2DimInt64Slice(row, col int) [][]int64 {\n\tret := make([][]int64, row)\n\tfor r := 0; r < row; r++ {\n\t\tret[r] = make([]int64, col, col)\n\t}\n\treturn ret\n}\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tconst initialBufSize = 4096\n\tconst maxBufSize = 1000000\n\tscanner.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tvar N int64\n\tscanner.Scan()\n\tN, _ = strconv.ParseInt(scanner.Text(), 10, 64)\n\tvar W int64\n\tscanner.Scan()\n\tW, _ = strconv.ParseInt(scanner.Text(), 10, 64)\n\tw := make([]int64, N)\n\tv := make([]int64, N)\n\tfor i := int64(0); i < N; i++ {\n\t\tscanner.Scan()\n\t\tw[i], _ = strconv.ParseInt(scanner.Text(), 10, 64)\n\t\tscanner.Scan()\n\t\tv[i], _ = strconv.ParseInt(scanner.Text(), 10, 64)\n\t}\n\tfmt.Println(solve(N, W, w, v))\n}\nfunc solve(N int64, W int64, w []int64, v []int64) int64 {\n\tdp := lib_New2DimInt64Slice(int(N)+1, int(W+1))\n\tfor i := 0; i < int(N); i++ {\n\t\tfor j := int64(0); j <= W; j++ {\n\t\t\tnewW := j + w[i]\n\t\t\tif newW <= W {\n\t\t\t\tdp[i+1][newW] = lib_MustMaxInt64(dp[i+1][newW], dp[i][j]+v[i])\n\t\t\t}\n\t\t\tdp[i+1][j] = lib_MustMaxInt64(dp[i+1][j], dp[i][j])\n\t\t}\n\t}\n\treturn lib_MustMaxInt64(dp[N]...)\n}\n", "language": "Go", "metadata": {"date": 1589071478, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03163.html", "problem_id": "p03163", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03163/input.txt", "sample_output_relpath": "derived/input_output/data/p03163/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03163/Go/s439616598.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s439616598", "user_id": "u562039972"}, "prompt_components": {"gold_output": "90\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc lib_MaxInt64(values ...int64) (max int64, err error) {\n\tif len(values) == 0 {\n\t\treturn 0, errors.New(\"empty slice is given\")\n\t}\n\tmax = values[0]\n\tfor _, value := range values {\n\t\tif max < value {\n\t\t\tmax = value\n\t\t}\n\t}\n\treturn\n}\nfunc lib_MustMaxInt64(values ...int64) (max int64) {\n\tmax, err := lib_MaxInt64(values...)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn max\n}\nfunc lib_New2DimInt64Slice(row, col int) [][]int64 {\n\tret := make([][]int64, row)\n\tfor r := 0; r < row; r++ {\n\t\tret[r] = make([]int64, col, col)\n\t}\n\treturn ret\n}\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tconst initialBufSize = 4096\n\tconst maxBufSize = 1000000\n\tscanner.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tvar N int64\n\tscanner.Scan()\n\tN, _ = strconv.ParseInt(scanner.Text(), 10, 64)\n\tvar W int64\n\tscanner.Scan()\n\tW, _ = strconv.ParseInt(scanner.Text(), 10, 64)\n\tw := make([]int64, N)\n\tv := make([]int64, N)\n\tfor i := int64(0); i < N; i++ {\n\t\tscanner.Scan()\n\t\tw[i], _ = strconv.ParseInt(scanner.Text(), 10, 64)\n\t\tscanner.Scan()\n\t\tv[i], _ = strconv.ParseInt(scanner.Text(), 10, 64)\n\t}\n\tfmt.Println(solve(N, W, w, v))\n}\nfunc solve(N int64, W int64, w []int64, v []int64) int64 {\n\tdp := lib_New2DimInt64Slice(int(N)+1, int(W+1))\n\tfor i := 0; i < int(N); i++ {\n\t\tfor j := int64(0); j <= W; j++ {\n\t\t\tnewW := j + w[i]\n\t\t\tif newW <= W {\n\t\t\t\tdp[i+1][newW] = lib_MustMaxInt64(dp[i+1][newW], dp[i][j]+v[i])\n\t\t\t}\n\t\t\tdp[i+1][j] = lib_MustMaxInt64(dp[i+1][j], dp[i][j])\n\t\t}\n\t}\n\treturn lib_MustMaxInt64(dp[N]...)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are N items, numbered 1, 2, \\ldots, N.\nFor each i (1 \\leq i \\leq N), Item i has a weight of w_i and a value of v_i.\n\nTaro has decided to choose some of the N items and carry them home in a knapsack.\nThe capacity of the knapsack is W, which means that the sum of the weights of items taken must be at most W.\n\nFind the maximum possible sum of the values of items that Taro takes home.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq W \\leq 10^5\n\n1 \\leq w_i \\leq W\n\n1 \\leq v_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN W\nw_1 v_1\nw_2 v_2\n:\nw_N v_N\n\nOutput\n\nPrint the maximum possible sum of the values of items that Taro takes home.\n\nSample Input 1\n\n3 8\n3 30\n4 50\n5 60\n\nSample Output 1\n\n90\n\nItems 1 and 3 should be taken.\nThen, the sum of the weights is 3 + 5 = 8, and the sum of the values is 30 + 60 = 90.\n\nSample Input 2\n\n5 5\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n\nSample Output 2\n\n5000000000\n\nThe answer may not fit into a 32-bit integer type.\n\nSample Input 3\n\n6 15\n6 5\n5 6\n6 4\n6 6\n3 5\n7 2\n\nSample Output 3\n\n17\n\nItems 2, 4 and 5 should be taken.\nThen, the sum of the weights is 5 + 6 + 3 = 14, and the sum of the values is 6 + 6 + 5 = 17.", "sample_input": "3 8\n3 30\n4 50\n5 60\n"}, "reference_outputs": ["90\n"], "source_document_id": "p03163", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are N items, numbered 1, 2, \\ldots, N.\nFor each i (1 \\leq i \\leq N), Item i has a weight of w_i and a value of v_i.\n\nTaro has decided to choose some of the N items and carry them home in a knapsack.\nThe capacity of the knapsack is W, which means that the sum of the weights of items taken must be at most W.\n\nFind the maximum possible sum of the values of items that Taro takes home.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq W \\leq 10^5\n\n1 \\leq w_i \\leq W\n\n1 \\leq v_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN W\nw_1 v_1\nw_2 v_2\n:\nw_N v_N\n\nOutput\n\nPrint the maximum possible sum of the values of items that Taro takes home.\n\nSample Input 1\n\n3 8\n3 30\n4 50\n5 60\n\nSample Output 1\n\n90\n\nItems 1 and 3 should be taken.\nThen, the sum of the weights is 3 + 5 = 8, and the sum of the values is 30 + 60 = 90.\n\nSample Input 2\n\n5 5\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n\nSample Output 2\n\n5000000000\n\nThe answer may not fit into a 32-bit integer type.\n\nSample Input 3\n\n6 15\n6 5\n5 6\n6 4\n6 6\n3 5\n7 2\n\nSample Output 3\n\n17\n\nItems 2, 4 and 5 should be taken.\nThen, the sum of the weights is 5 + 6 + 3 = 14, and the sum of the values is 6 + 6 + 5 = 17.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1596, "cpu_time_ms": 296, "memory_kb": 81792}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s355478958", "group_id": "codeNet:p03163", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype DP struct {\n\tw int\n\tv int\n}\n\nfunc main() {\n\tN := readi()\n\tW := readi()\n\tw := make([]int, N)\n\tv := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tw[i] = readi()\n\t\tv[i] = readi()\n\t}\n\n\tdp := make([][]DP, N)\n\tdp[0] = make([]DP, N)\n\tfor i := 0; i < N; i++ {\n\t\tif W >= w[i] {\n\t\t\tdp[0][i].w = w[i]\n\t\t\tdp[0][i].v = v[i]\n\t\t}\n\t}\n\tfor i := 1; i < N; i++ {\n\t\tdp[i] = make([]DP, N)\n\t\tfor ii := 0; ii < N; ii++ {\n\t\t\tfor iii := 0; iii < N; iii++ {\n\t\t\t\tif iii != ii {\n\t\t\t\t\tif W >= w[ii]+dp[i-1][iii].w {\n\t\t\t\t\t\tchmax(&dp[i][iii].w, w[ii]+dp[i-1][iii].w)\n\t\t\t\t\t\tchmax(&dp[i][iii].v, v[ii]+dp[i-1][iii].v)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tans := 0\n\tfor i := range dp {\n\t\tfor ii := range dp[i] {\n\t\t\tans = max(ans, dp[i][ii].v)\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\n/*-------------------utilities-------------------*/\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc chmin(x *int, y int) bool {\n\tif *x > y {\n\t\t*x = y\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc chmax(x *int, y int) bool {\n\tif *x < y {\n\t\t*x = y\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\n/*-------------------init-------------------*/\n\nconst (\n\tINF = 1000000000000000000\n\tMOD = 1e9 + 7\n)\n\nvar (\n\treadString func() string\n)\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n}\n\n/*-------------------inputs-------------------*/\n\nfunc readi() int {\n\treturn int(readi64())\n}\n\nfunc readi64() int64 {\n\ti, err := strconv.ParseInt(readString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n", "language": "Go", "metadata": {"date": 1587303996, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03163.html", "problem_id": "p03163", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03163/input.txt", "sample_output_relpath": "derived/input_output/data/p03163/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03163/Go/s355478958.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s355478958", "user_id": "u183912232"}, "prompt_components": {"gold_output": "90\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype DP struct {\n\tw int\n\tv int\n}\n\nfunc main() {\n\tN := readi()\n\tW := readi()\n\tw := make([]int, N)\n\tv := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tw[i] = readi()\n\t\tv[i] = readi()\n\t}\n\n\tdp := make([][]DP, N)\n\tdp[0] = make([]DP, N)\n\tfor i := 0; i < N; i++ {\n\t\tif W >= w[i] {\n\t\t\tdp[0][i].w = w[i]\n\t\t\tdp[0][i].v = v[i]\n\t\t}\n\t}\n\tfor i := 1; i < N; i++ {\n\t\tdp[i] = make([]DP, N)\n\t\tfor ii := 0; ii < N; ii++ {\n\t\t\tfor iii := 0; iii < N; iii++ {\n\t\t\t\tif iii != ii {\n\t\t\t\t\tif W >= w[ii]+dp[i-1][iii].w {\n\t\t\t\t\t\tchmax(&dp[i][iii].w, w[ii]+dp[i-1][iii].w)\n\t\t\t\t\t\tchmax(&dp[i][iii].v, v[ii]+dp[i-1][iii].v)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tans := 0\n\tfor i := range dp {\n\t\tfor ii := range dp[i] {\n\t\t\tans = max(ans, dp[i][ii].v)\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\n/*-------------------utilities-------------------*/\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc min(x, y int) int {\n\tif x < y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc chmin(x *int, y int) bool {\n\tif *x > y {\n\t\t*x = y\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc chmax(x *int, y int) bool {\n\tif *x < y {\n\t\t*x = y\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc gcd(a, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcd(b, a%b)\n}\n\n/*-------------------init-------------------*/\n\nconst (\n\tINF = 1000000000000000000\n\tMOD = 1e9 + 7\n)\n\nvar (\n\treadString func() string\n)\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n}\n\n/*-------------------inputs-------------------*/\n\nfunc readi() int {\n\treturn int(readi64())\n}\n\nfunc readi64() int64 {\n\ti, err := strconv.ParseInt(readString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(readString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are N items, numbered 1, 2, \\ldots, N.\nFor each i (1 \\leq i \\leq N), Item i has a weight of w_i and a value of v_i.\n\nTaro has decided to choose some of the N items and carry them home in a knapsack.\nThe capacity of the knapsack is W, which means that the sum of the weights of items taken must be at most W.\n\nFind the maximum possible sum of the values of items that Taro takes home.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq W \\leq 10^5\n\n1 \\leq w_i \\leq W\n\n1 \\leq v_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN W\nw_1 v_1\nw_2 v_2\n:\nw_N v_N\n\nOutput\n\nPrint the maximum possible sum of the values of items that Taro takes home.\n\nSample Input 1\n\n3 8\n3 30\n4 50\n5 60\n\nSample Output 1\n\n90\n\nItems 1 and 3 should be taken.\nThen, the sum of the weights is 3 + 5 = 8, and the sum of the values is 30 + 60 = 90.\n\nSample Input 2\n\n5 5\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n\nSample Output 2\n\n5000000000\n\nThe answer may not fit into a 32-bit integer type.\n\nSample Input 3\n\n6 15\n6 5\n5 6\n6 4\n6 6\n3 5\n7 2\n\nSample Output 3\n\n17\n\nItems 2, 4 and 5 should be taken.\nThen, the sum of the weights is 5 + 6 + 3 = 14, and the sum of the values is 6 + 6 + 5 = 17.", "sample_input": "3 8\n3 30\n4 50\n5 60\n"}, "reference_outputs": ["90\n"], "source_document_id": "p03163", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are N items, numbered 1, 2, \\ldots, N.\nFor each i (1 \\leq i \\leq N), Item i has a weight of w_i and a value of v_i.\n\nTaro has decided to choose some of the N items and carry them home in a knapsack.\nThe capacity of the knapsack is W, which means that the sum of the weights of items taken must be at most W.\n\nFind the maximum possible sum of the values of items that Taro takes home.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq W \\leq 10^5\n\n1 \\leq w_i \\leq W\n\n1 \\leq v_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN W\nw_1 v_1\nw_2 v_2\n:\nw_N v_N\n\nOutput\n\nPrint the maximum possible sum of the values of items that Taro takes home.\n\nSample Input 1\n\n3 8\n3 30\n4 50\n5 60\n\nSample Output 1\n\n90\n\nItems 1 and 3 should be taken.\nThen, the sum of the weights is 3 + 5 = 8, and the sum of the values is 30 + 60 = 90.\n\nSample Input 2\n\n5 5\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n\nSample Output 2\n\n5000000000\n\nThe answer may not fit into a 32-bit integer type.\n\nSample Input 3\n\n6 15\n6 5\n5 6\n6 4\n6 6\n3 5\n7 2\n\nSample Output 3\n\n17\n\nItems 2, 4 and 5 should be taken.\nThen, the sum of the weights is 5 + 6 + 3 = 14, and the sum of the values is 6 + 6 + 5 = 17.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2067, "cpu_time_ms": 12, "memory_kb": 768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s669748906", "group_id": "codeNet:p03163", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"sort\"\n\t\"math\"\n)\n\n// -----------------------------------------------------------------------------\n\n// IO helper functions\n\n// Returns next token from input. It must be initialized by SetInput()\n// before the first call.\nvar nextToken func() ([]byte, error)\nvar nextLine func() ([]byte, error)\n\n// Holds a buffer for output. It must be initialized by SetOutput().\n// All IO fucntions (read*() and [e]print*()) should write to OutputWriter\n// instead of this.\nvar OutputBuffer *bufio.Writer\n\n// Holds an io.Writer. It must be initialized by SetOutput()\nvar OutputWriter io.Writer\n\n// Set IO functions for interactive input/output.\nfunc SetInteractive(w io.Writer, r io.Reader) {\n\tSetUnbefferedInput(r)\n\tOutputBuffer = nil\n\tOutputWriter = w\n}\n\n// Setup OutputBuffer and OutputWriter.\nfunc SetOutput(w io.Writer) {\n\tOutputBuffer = bufio.NewWriter(w)\n\tOutputWriter = OutputBuffer\n}\n\n// Flushes OutputBuffer\nfunc Flush() {\n\tif OutputBuffer != nil {\n\t\tOutputBuffer.Flush()\n\t}\n}\n\n// Returns true if c is a white space\nfunc IsSpace(c byte) bool {\n\tswitch c {\n\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc IsNewLine(c byte) bool {\n\tswitch c {\n\tcase '\\n', '\\r':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Setup nextToken with input buffer.\nfunc SetInput(r io.Reader) {\n\tbuf := new(bytes.Buffer)\n\tvar b []byte\n\n\tvar i int\n\trest := func() ([]byte, error) {\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\tinitial := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextToken = rest\n\t\treturn rest()\n\t}\n\tnextToken = initial\n\n\trestLn := func() ([]byte, error) {\n\t\tfor i < len(b) && IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\n\tinitialLn := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextLine = restLn\n\t\treturn restLn()\n\t}\n\tnextLine = initialLn\n}\n\n// Setup nextToken without input buffer.\nfunc SetUnbefferedInput(r io.Reader) {\n\tbuf := bufio.NewReader(r)\n\tvar b []byte\n\n\tvar i int\n\tnextToken = func() ([]byte, error) {\n\t\tvar err error\n\t\tif i == len(b) {\n\t\t\tb, err = buf.ReadBytes('\\n')\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ti = 0\n\t\t\tj := len(b) - 1\n\t\t\tfor 0 <= j && IsSpace(b[j]) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tb = b[0 : j+1]\n\t\t}\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n}\n\n// -----------------------------------------------------------------------------\n\n// Reads next token and return it as string\nfunc reads() string {\n\tb, err := nextToken()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn string(b)\n}\n\n// Read next line as string\nfunc readsln() string {\n\tb, err := nextLine()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn string(b)\n}\n\n// Reads next token and return it as int\nfunc readi() int {\n\ti, err := strconv.ParseInt(reads(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\n\treturn int(i)\n}\n\n// Reads next token and return it as float64\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(reads(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc readislice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = readi()\n\t}\n\treturn b\n}\n\n// set up IO functions\nfunc init() {\n\t// for non-interactive\n\tSetInput(os.Stdin)\n\tSetOutput(os.Stdout)\n\n\t// Enable below when interactive. Its ok to leave above intact.\n\t// SetInteractive(os.Stdout, os.Stdin)\n}\n\n// -----------------------------------------------------------------------------\n\nconst (\n\tMOD = 1000000007\n\tINF = math.MaxInt64\n)\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc pow(p, q int) int {\n return int(math.Pow(float64(p), float64(q)))\n}\n\n// egcd(a, b) returns d, x, y:\n// d is gcd(a,b)\n// x, y are integers that satisfy ax + by = d\nfunc egcd(a, b int) (int, int, int) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcd(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc gcd(a, b int) int {\n\td, _, _ := egcd(a, b)\n\treturn d\n}\n\nfunc lcm(a,b int) int{\n return a * b / gcd(a, b)\n}\n\nfunc isInteger(x float64) bool {\n return math.Floor(x) == x\n}\n\n// lower_bound\nfunc bisectLeft(a []int, x int) int {\n return sort.SearchInts(a, x)\n}\n\n// upper_bound\nfunc bisectRight(a []int, x int) int {\n return sort.Search(len(a), func(i int) bool { return a[i] > x })\n}\n\nfunc main() {\n\tdefer Flush()\n\n\tN, W := readi(), readi()\n\tVs := make([]int, N+1)\n\tWs := make([]int, N+1)\n\n\n\tfor i := range Vs {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tWs[i] = readi()\n\t\tVs[i] = readi()\n\t}\n\n \t// DP テーブル\n\tdp := make([][]int, N+1)\n\n\t// DP テーブル全体を初期化 (最小化問題なので INF に初期化)\n\tfor i := range dp {\n\t\tdp[i] = make([]int, W+1)\n\n\t\tfor j := range dp[i] {\n\t\t\tdp[i][j] = 0\n\t\t}\n\t}\n\n\t// ループ\n\tfor i := 1; i <= N; i++ {\n\t\tfor j := 0; j <= W; j++{\n\t\t\tif j - Ws[i] >= 0 {\n\t\t\t\tif dp[i-1][j - Ws[i]] + Vs[i] >= dp[i][j] {\n\t\t\t\t\tdp[i][j] = dp[i-1][j - Ws[i]] + Vs[i]\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif dp[i-1][j] >= dp[i][j] {\n\t\t\t\tdp[i][j] = dp[i-1][j]\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(dp[N][W])\n}\n\n", "language": "Go", "metadata": {"date": 1584818852, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03163.html", "problem_id": "p03163", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03163/input.txt", "sample_output_relpath": "derived/input_output/data/p03163/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03163/Go/s669748906.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s669748906", "user_id": "u846185950"}, "prompt_components": {"gold_output": "90\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"sort\"\n\t\"math\"\n)\n\n// -----------------------------------------------------------------------------\n\n// IO helper functions\n\n// Returns next token from input. It must be initialized by SetInput()\n// before the first call.\nvar nextToken func() ([]byte, error)\nvar nextLine func() ([]byte, error)\n\n// Holds a buffer for output. It must be initialized by SetOutput().\n// All IO fucntions (read*() and [e]print*()) should write to OutputWriter\n// instead of this.\nvar OutputBuffer *bufio.Writer\n\n// Holds an io.Writer. It must be initialized by SetOutput()\nvar OutputWriter io.Writer\n\n// Set IO functions for interactive input/output.\nfunc SetInteractive(w io.Writer, r io.Reader) {\n\tSetUnbefferedInput(r)\n\tOutputBuffer = nil\n\tOutputWriter = w\n}\n\n// Setup OutputBuffer and OutputWriter.\nfunc SetOutput(w io.Writer) {\n\tOutputBuffer = bufio.NewWriter(w)\n\tOutputWriter = OutputBuffer\n}\n\n// Flushes OutputBuffer\nfunc Flush() {\n\tif OutputBuffer != nil {\n\t\tOutputBuffer.Flush()\n\t}\n}\n\n// Returns true if c is a white space\nfunc IsSpace(c byte) bool {\n\tswitch c {\n\tcase '\\t', '\\n', '\\v', '\\f', '\\r', ' ':\n\t\treturn true\n\t}\n\treturn false\n}\n\nfunc IsNewLine(c byte) bool {\n\tswitch c {\n\tcase '\\n', '\\r':\n\t\treturn true\n\t}\n\treturn false\n}\n\n// Setup nextToken with input buffer.\nfunc SetInput(r io.Reader) {\n\tbuf := new(bytes.Buffer)\n\tvar b []byte\n\n\tvar i int\n\trest := func() ([]byte, error) {\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\tinitial := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextToken = rest\n\t\treturn rest()\n\t}\n\tnextToken = initial\n\n\trestLn := func() ([]byte, error) {\n\t\tfor i < len(b) && IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == len(b) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsNewLine(b[i]) {\n\t\t\ti++\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n\n\tinitialLn := func() ([]byte, error) {\n\t\tio.Copy(buf, r)\n\t\tb = buf.Bytes()\n\t\tnextLine = restLn\n\t\treturn restLn()\n\t}\n\tnextLine = initialLn\n}\n\n// Setup nextToken without input buffer.\nfunc SetUnbefferedInput(r io.Reader) {\n\tbuf := bufio.NewReader(r)\n\tvar b []byte\n\n\tvar i int\n\tnextToken = func() ([]byte, error) {\n\t\tvar err error\n\t\tif i == len(b) {\n\t\t\tb, err = buf.ReadBytes('\\n')\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\ti = 0\n\t\t\tj := len(b) - 1\n\t\t\tfor 0 <= j && IsSpace(b[j]) {\n\t\t\t\tj--\n\t\t\t}\n\t\t\tb = b[0 : j+1]\n\t\t}\n\t\tfor i < len(b) && IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tj := i\n\t\tfor i < len(b) && !IsSpace(b[i]) {\n\t\t\ti++\n\t\t}\n\t\tif i == j {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\t\treturn b[j:i], nil\n\t}\n}\n\n// -----------------------------------------------------------------------------\n\n// Reads next token and return it as string\nfunc reads() string {\n\tb, err := nextToken()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn string(b)\n}\n\n// Read next line as string\nfunc readsln() string {\n\tb, err := nextLine()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\treturn string(b)\n}\n\n// Reads next token and return it as int\nfunc readi() int {\n\ti, err := strconv.ParseInt(reads(), 10, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\n\treturn int(i)\n}\n\n// Reads next token and return it as float64\nfunc readf() float64 {\n\tf, err := strconv.ParseFloat(reads(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc readislice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = readi()\n\t}\n\treturn b\n}\n\n// set up IO functions\nfunc init() {\n\t// for non-interactive\n\tSetInput(os.Stdin)\n\tSetOutput(os.Stdout)\n\n\t// Enable below when interactive. Its ok to leave above intact.\n\t// SetInteractive(os.Stdout, os.Stdin)\n}\n\n// -----------------------------------------------------------------------------\n\nconst (\n\tMOD = 1000000007\n\tINF = math.MaxInt64\n)\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nfunc pow(p, q int) int {\n return int(math.Pow(float64(p), float64(q)))\n}\n\n// egcd(a, b) returns d, x, y:\n// d is gcd(a,b)\n// x, y are integers that satisfy ax + by = d\nfunc egcd(a, b int) (int, int, int) {\n\tif b == 0 {\n\t\treturn a, 1, 0\n\t}\n\td, x, y := egcd(b, a%b)\n\treturn d, y, x - a/b*y\n}\n\nfunc gcd(a, b int) int {\n\td, _, _ := egcd(a, b)\n\treturn d\n}\n\nfunc lcm(a,b int) int{\n return a * b / gcd(a, b)\n}\n\nfunc isInteger(x float64) bool {\n return math.Floor(x) == x\n}\n\n// lower_bound\nfunc bisectLeft(a []int, x int) int {\n return sort.SearchInts(a, x)\n}\n\n// upper_bound\nfunc bisectRight(a []int, x int) int {\n return sort.Search(len(a), func(i int) bool { return a[i] > x })\n}\n\nfunc main() {\n\tdefer Flush()\n\n\tN, W := readi(), readi()\n\tVs := make([]int, N+1)\n\tWs := make([]int, N+1)\n\n\n\tfor i := range Vs {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tWs[i] = readi()\n\t\tVs[i] = readi()\n\t}\n\n \t// DP テーブル\n\tdp := make([][]int, N+1)\n\n\t// DP テーブル全体を初期化 (最小化問題なので INF に初期化)\n\tfor i := range dp {\n\t\tdp[i] = make([]int, W+1)\n\n\t\tfor j := range dp[i] {\n\t\t\tdp[i][j] = 0\n\t\t}\n\t}\n\n\t// ループ\n\tfor i := 1; i <= N; i++ {\n\t\tfor j := 0; j <= W; j++{\n\t\t\tif j - Ws[i] >= 0 {\n\t\t\t\tif dp[i-1][j - Ws[i]] + Vs[i] >= dp[i][j] {\n\t\t\t\t\tdp[i][j] = dp[i-1][j - Ws[i]] + Vs[i]\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif dp[i-1][j] >= dp[i][j] {\n\t\t\t\tdp[i][j] = dp[i-1][j]\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(dp[N][W])\n}\n\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are N items, numbered 1, 2, \\ldots, N.\nFor each i (1 \\leq i \\leq N), Item i has a weight of w_i and a value of v_i.\n\nTaro has decided to choose some of the N items and carry them home in a knapsack.\nThe capacity of the knapsack is W, which means that the sum of the weights of items taken must be at most W.\n\nFind the maximum possible sum of the values of items that Taro takes home.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq W \\leq 10^5\n\n1 \\leq w_i \\leq W\n\n1 \\leq v_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN W\nw_1 v_1\nw_2 v_2\n:\nw_N v_N\n\nOutput\n\nPrint the maximum possible sum of the values of items that Taro takes home.\n\nSample Input 1\n\n3 8\n3 30\n4 50\n5 60\n\nSample Output 1\n\n90\n\nItems 1 and 3 should be taken.\nThen, the sum of the weights is 3 + 5 = 8, and the sum of the values is 30 + 60 = 90.\n\nSample Input 2\n\n5 5\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n\nSample Output 2\n\n5000000000\n\nThe answer may not fit into a 32-bit integer type.\n\nSample Input 3\n\n6 15\n6 5\n5 6\n6 4\n6 6\n3 5\n7 2\n\nSample Output 3\n\n17\n\nItems 2, 4 and 5 should be taken.\nThen, the sum of the weights is 5 + 6 + 3 = 14, and the sum of the values is 6 + 6 + 5 = 17.", "sample_input": "3 8\n3 30\n4 50\n5 60\n"}, "reference_outputs": ["90\n"], "source_document_id": "p03163", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are N items, numbered 1, 2, \\ldots, N.\nFor each i (1 \\leq i \\leq N), Item i has a weight of w_i and a value of v_i.\n\nTaro has decided to choose some of the N items and carry them home in a knapsack.\nThe capacity of the knapsack is W, which means that the sum of the weights of items taken must be at most W.\n\nFind the maximum possible sum of the values of items that Taro takes home.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq W \\leq 10^5\n\n1 \\leq w_i \\leq W\n\n1 \\leq v_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN W\nw_1 v_1\nw_2 v_2\n:\nw_N v_N\n\nOutput\n\nPrint the maximum possible sum of the values of items that Taro takes home.\n\nSample Input 1\n\n3 8\n3 30\n4 50\n5 60\n\nSample Output 1\n\n90\n\nItems 1 and 3 should be taken.\nThen, the sum of the weights is 3 + 5 = 8, and the sum of the values is 30 + 60 = 90.\n\nSample Input 2\n\n5 5\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n\nSample Output 2\n\n5000000000\n\nThe answer may not fit into a 32-bit integer type.\n\nSample Input 3\n\n6 15\n6 5\n5 6\n6 4\n6 6\n3 5\n7 2\n\nSample Output 3\n\n17\n\nItems 2, 4 and 5 should be taken.\nThen, the sum of the weights is 5 + 6 + 3 = 14, and the sum of the values is 6 + 6 + 5 = 17.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5500, "cpu_time_ms": 160, "memory_kb": 82432}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s526862547", "group_id": "codeNet:p03163", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\trun()\n}\n\nfunc run() {\n\tsetSpace()\n\tn, limit := int(readN()), readN()\n\tdp := make([][]int, n+1)\n\t// dp[i][sum_w] = v の最大値\n\t// dp[i][j] = i 番目までの品物を、重さを j 以下になるように選んだときの価値の最大値\n\t// chmax(dp[i-1][sum_w], dp[i-1][sum_w - w[i]] + v[i])\n\tdp[0] = make([]int, limit+1)\n\tfor i := 0; i < n; i++ {\n\t\tw, v := readN(), readN()\n\t\tdp[i+1] = make([]int, limit+1)\n\t\tfor sumW := 0; sumW <= limit; sumW++ {\n\t\t\tif sumW-w >= 0 {\n\t\t\t\t// i 番目の重さ以上の j で、価値の最大値を選択する\n\t\t\t\tchmax(&dp[i+1][sumW], dp[i][sumW-w]+v)\n\t\t\t}\n\t\t\t// i 番目の品物は使えない\n\t\t\tchmax(&dp[i+1][sumW], dp[i][sumW])\n\t\t}\n\t}\n\n\tfmt.Println(dp[n][limit])\n}\n\nfunc chmax(a *int, b int) {\n\tif *a > b {\n\t\treturn\n\t}\n\t*a = b\n}\n\n// ------以下、ユーティリティ------\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc setSpace() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc read() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readN() int {\n\tn, err := strconv.Atoi(read())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n", "language": "Go", "metadata": {"date": 1581378471, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03163.html", "problem_id": "p03163", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03163/input.txt", "sample_output_relpath": "derived/input_output/data/p03163/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03163/Go/s526862547.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s526862547", "user_id": "u499497733"}, "prompt_components": {"gold_output": "90\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\trun()\n}\n\nfunc run() {\n\tsetSpace()\n\tn, limit := int(readN()), readN()\n\tdp := make([][]int, n+1)\n\t// dp[i][sum_w] = v の最大値\n\t// dp[i][j] = i 番目までの品物を、重さを j 以下になるように選んだときの価値の最大値\n\t// chmax(dp[i-1][sum_w], dp[i-1][sum_w - w[i]] + v[i])\n\tdp[0] = make([]int, limit+1)\n\tfor i := 0; i < n; i++ {\n\t\tw, v := readN(), readN()\n\t\tdp[i+1] = make([]int, limit+1)\n\t\tfor sumW := 0; sumW <= limit; sumW++ {\n\t\t\tif sumW-w >= 0 {\n\t\t\t\t// i 番目の重さ以上の j で、価値の最大値を選択する\n\t\t\t\tchmax(&dp[i+1][sumW], dp[i][sumW-w]+v)\n\t\t\t}\n\t\t\t// i 番目の品物は使えない\n\t\t\tchmax(&dp[i+1][sumW], dp[i][sumW])\n\t\t}\n\t}\n\n\tfmt.Println(dp[n][limit])\n}\n\nfunc chmax(a *int, b int) {\n\tif *a > b {\n\t\treturn\n\t}\n\t*a = b\n}\n\n// ------以下、ユーティリティ------\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc setSpace() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc read() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc readN() int {\n\tn, err := strconv.Atoi(read())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn n\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are N items, numbered 1, 2, \\ldots, N.\nFor each i (1 \\leq i \\leq N), Item i has a weight of w_i and a value of v_i.\n\nTaro has decided to choose some of the N items and carry them home in a knapsack.\nThe capacity of the knapsack is W, which means that the sum of the weights of items taken must be at most W.\n\nFind the maximum possible sum of the values of items that Taro takes home.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq W \\leq 10^5\n\n1 \\leq w_i \\leq W\n\n1 \\leq v_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN W\nw_1 v_1\nw_2 v_2\n:\nw_N v_N\n\nOutput\n\nPrint the maximum possible sum of the values of items that Taro takes home.\n\nSample Input 1\n\n3 8\n3 30\n4 50\n5 60\n\nSample Output 1\n\n90\n\nItems 1 and 3 should be taken.\nThen, the sum of the weights is 3 + 5 = 8, and the sum of the values is 30 + 60 = 90.\n\nSample Input 2\n\n5 5\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n\nSample Output 2\n\n5000000000\n\nThe answer may not fit into a 32-bit integer type.\n\nSample Input 3\n\n6 15\n6 5\n5 6\n6 4\n6 6\n3 5\n7 2\n\nSample Output 3\n\n17\n\nItems 2, 4 and 5 should be taken.\nThen, the sum of the weights is 5 + 6 + 3 = 14, and the sum of the values is 6 + 6 + 5 = 17.", "sample_input": "3 8\n3 30\n4 50\n5 60\n"}, "reference_outputs": ["90\n"], "source_document_id": "p03163", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are N items, numbered 1, 2, \\ldots, N.\nFor each i (1 \\leq i \\leq N), Item i has a weight of w_i and a value of v_i.\n\nTaro has decided to choose some of the N items and carry them home in a knapsack.\nThe capacity of the knapsack is W, which means that the sum of the weights of items taken must be at most W.\n\nFind the maximum possible sum of the values of items that Taro takes home.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq W \\leq 10^5\n\n1 \\leq w_i \\leq W\n\n1 \\leq v_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN W\nw_1 v_1\nw_2 v_2\n:\nw_N v_N\n\nOutput\n\nPrint the maximum possible sum of the values of items that Taro takes home.\n\nSample Input 1\n\n3 8\n3 30\n4 50\n5 60\n\nSample Output 1\n\n90\n\nItems 1 and 3 should be taken.\nThen, the sum of the weights is 3 + 5 = 8, and the sum of the values is 30 + 60 = 90.\n\nSample Input 2\n\n5 5\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n\nSample Output 2\n\n5000000000\n\nThe answer may not fit into a 32-bit integer type.\n\nSample Input 3\n\n6 15\n6 5\n5 6\n6 4\n6 6\n3 5\n7 2\n\nSample Output 3\n\n17\n\nItems 2, 4 and 5 should be taken.\nThen, the sum of the weights is 5 + 6 + 3 = 14, and the sum of the values is 6 + 6 + 5 = 17.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1137, "cpu_time_ms": 133, "memory_kb": 81536}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s037058888", "group_id": "codeNet:p03163", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tN, W := getInt(), getInt()\n\tw := make([]int, N)\n\tv := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tw[i], v[i] = getInt(), getInt()\n\t}\n\n\tvar dp [101][100001]int\n\tfor i := 0; i < N; i++ {\n\t\tfor k := 0; k <= W; k++ {\n\t\t\tif k-w[i] < 0 {\n\t\t\t\tdp[i+1][k] = dp[i][k]\n\t\t\t} else {\n\t\t\t\tdp[i+1][k] = max(dp[i][k], dp[i][k-w[i]]+v[i])\n\t\t\t}\n\t\t}\n\t}\n\n\tout(dp[N][W])\n}\n", "language": "Go", "metadata": {"date": 1581368108, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03163.html", "problem_id": "p03163", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03163/input.txt", "sample_output_relpath": "derived/input_output/data/p03163/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03163/Go/s037058888.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s037058888", "user_id": "u814575783"}, "prompt_components": {"gold_output": "90\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tN, W := getInt(), getInt()\n\tw := make([]int, N)\n\tv := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tw[i], v[i] = getInt(), getInt()\n\t}\n\n\tvar dp [101][100001]int\n\tfor i := 0; i < N; i++ {\n\t\tfor k := 0; k <= W; k++ {\n\t\t\tif k-w[i] < 0 {\n\t\t\t\tdp[i+1][k] = dp[i][k]\n\t\t\t} else {\n\t\t\t\tdp[i+1][k] = max(dp[i][k], dp[i][k-w[i]]+v[i])\n\t\t\t}\n\t\t}\n\t}\n\n\tout(dp[N][W])\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are N items, numbered 1, 2, \\ldots, N.\nFor each i (1 \\leq i \\leq N), Item i has a weight of w_i and a value of v_i.\n\nTaro has decided to choose some of the N items and carry them home in a knapsack.\nThe capacity of the knapsack is W, which means that the sum of the weights of items taken must be at most W.\n\nFind the maximum possible sum of the values of items that Taro takes home.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq W \\leq 10^5\n\n1 \\leq w_i \\leq W\n\n1 \\leq v_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN W\nw_1 v_1\nw_2 v_2\n:\nw_N v_N\n\nOutput\n\nPrint the maximum possible sum of the values of items that Taro takes home.\n\nSample Input 1\n\n3 8\n3 30\n4 50\n5 60\n\nSample Output 1\n\n90\n\nItems 1 and 3 should be taken.\nThen, the sum of the weights is 3 + 5 = 8, and the sum of the values is 30 + 60 = 90.\n\nSample Input 2\n\n5 5\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n\nSample Output 2\n\n5000000000\n\nThe answer may not fit into a 32-bit integer type.\n\nSample Input 3\n\n6 15\n6 5\n5 6\n6 4\n6 6\n3 5\n7 2\n\nSample Output 3\n\n17\n\nItems 2, 4 and 5 should be taken.\nThen, the sum of the weights is 5 + 6 + 3 = 14, and the sum of the values is 6 + 6 + 5 = 17.", "sample_input": "3 8\n3 30\n4 50\n5 60\n"}, "reference_outputs": ["90\n"], "source_document_id": "p03163", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are N items, numbered 1, 2, \\ldots, N.\nFor each i (1 \\leq i \\leq N), Item i has a weight of w_i and a value of v_i.\n\nTaro has decided to choose some of the N items and carry them home in a knapsack.\nThe capacity of the knapsack is W, which means that the sum of the weights of items taken must be at most W.\n\nFind the maximum possible sum of the values of items that Taro takes home.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq W \\leq 10^5\n\n1 \\leq w_i \\leq W\n\n1 \\leq v_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN W\nw_1 v_1\nw_2 v_2\n:\nw_N v_N\n\nOutput\n\nPrint the maximum possible sum of the values of items that Taro takes home.\n\nSample Input 1\n\n3 8\n3 30\n4 50\n5 60\n\nSample Output 1\n\n90\n\nItems 1 and 3 should be taken.\nThen, the sum of the weights is 3 + 5 = 8, and the sum of the values is 30 + 60 = 90.\n\nSample Input 2\n\n5 5\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n\nSample Output 2\n\n5000000000\n\nThe answer may not fit into a 32-bit integer type.\n\nSample Input 3\n\n6 15\n6 5\n5 6\n6 4\n6 6\n3 5\n7 2\n\nSample Output 3\n\n17\n\nItems 2, 4 and 5 should be taken.\nThen, the sum of the weights is 5 + 6 + 3 = 14, and the sum of the values is 6 + 6 + 5 = 17.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 767, "cpu_time_ms": 114, "memory_kb": 81792}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s952628651", "group_id": "codeNet:p03163", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N, W int\n\tfmt.Scan(&N, &W)\n\n\tweight := make([]int, N)\n\tvalue := make([]int64, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&weight[i], &value[i])\n\t}\n\n\tdp := make([][]int64, 1+N)\n\tfor i := 0; i <= N; i++ {\n\t\tdp[i] = make([]int64, 1+W)\n\t}\n\n\tfor i := 0; i < N; i++ {\n\t\tfor w := 0; w <= W; w++ {\n\t\t\tif dp[i+1][w] < dp[i][w] {\n\t\t\t\tdp[i+1][w] = dp[i][w]\n\t\t\t}\n\t\t\tif w+weight[i] <= W && dp[i+1][w+weight[i]] < dp[i][w]+value[i] {\n\t\t\t\tdp[i+1][w+weight[i]] = dp[i][w] + value[i]\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(dp[N][W])\n}\n", "language": "Go", "metadata": {"date": 1578725975, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03163.html", "problem_id": "p03163", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03163/input.txt", "sample_output_relpath": "derived/input_output/data/p03163/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03163/Go/s952628651.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s952628651", "user_id": "u875972329"}, "prompt_components": {"gold_output": "90\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N, W int\n\tfmt.Scan(&N, &W)\n\n\tweight := make([]int, N)\n\tvalue := make([]int64, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&weight[i], &value[i])\n\t}\n\n\tdp := make([][]int64, 1+N)\n\tfor i := 0; i <= N; i++ {\n\t\tdp[i] = make([]int64, 1+W)\n\t}\n\n\tfor i := 0; i < N; i++ {\n\t\tfor w := 0; w <= W; w++ {\n\t\t\tif dp[i+1][w] < dp[i][w] {\n\t\t\t\tdp[i+1][w] = dp[i][w]\n\t\t\t}\n\t\t\tif w+weight[i] <= W && dp[i+1][w+weight[i]] < dp[i][w]+value[i] {\n\t\t\t\tdp[i+1][w+weight[i]] = dp[i][w] + value[i]\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(dp[N][W])\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are N items, numbered 1, 2, \\ldots, N.\nFor each i (1 \\leq i \\leq N), Item i has a weight of w_i and a value of v_i.\n\nTaro has decided to choose some of the N items and carry them home in a knapsack.\nThe capacity of the knapsack is W, which means that the sum of the weights of items taken must be at most W.\n\nFind the maximum possible sum of the values of items that Taro takes home.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq W \\leq 10^5\n\n1 \\leq w_i \\leq W\n\n1 \\leq v_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN W\nw_1 v_1\nw_2 v_2\n:\nw_N v_N\n\nOutput\n\nPrint the maximum possible sum of the values of items that Taro takes home.\n\nSample Input 1\n\n3 8\n3 30\n4 50\n5 60\n\nSample Output 1\n\n90\n\nItems 1 and 3 should be taken.\nThen, the sum of the weights is 3 + 5 = 8, and the sum of the values is 30 + 60 = 90.\n\nSample Input 2\n\n5 5\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n\nSample Output 2\n\n5000000000\n\nThe answer may not fit into a 32-bit integer type.\n\nSample Input 3\n\n6 15\n6 5\n5 6\n6 4\n6 6\n3 5\n7 2\n\nSample Output 3\n\n17\n\nItems 2, 4 and 5 should be taken.\nThen, the sum of the weights is 5 + 6 + 3 = 14, and the sum of the values is 6 + 6 + 5 = 17.", "sample_input": "3 8\n3 30\n4 50\n5 60\n"}, "reference_outputs": ["90\n"], "source_document_id": "p03163", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are N items, numbered 1, 2, \\ldots, N.\nFor each i (1 \\leq i \\leq N), Item i has a weight of w_i and a value of v_i.\n\nTaro has decided to choose some of the N items and carry them home in a knapsack.\nThe capacity of the knapsack is W, which means that the sum of the weights of items taken must be at most W.\n\nFind the maximum possible sum of the values of items that Taro takes home.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq W \\leq 10^5\n\n1 \\leq w_i \\leq W\n\n1 \\leq v_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN W\nw_1 v_1\nw_2 v_2\n:\nw_N v_N\n\nOutput\n\nPrint the maximum possible sum of the values of items that Taro takes home.\n\nSample Input 1\n\n3 8\n3 30\n4 50\n5 60\n\nSample Output 1\n\n90\n\nItems 1 and 3 should be taken.\nThen, the sum of the weights is 3 + 5 = 8, and the sum of the values is 30 + 60 = 90.\n\nSample Input 2\n\n5 5\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n\nSample Output 2\n\n5000000000\n\nThe answer may not fit into a 32-bit integer type.\n\nSample Input 3\n\n6 15\n6 5\n5 6\n6 4\n6 6\n3 5\n7 2\n\nSample Output 3\n\n17\n\nItems 2, 4 and 5 should be taken.\nThen, the sum of the weights is 5 + 6 + 3 = 14, and the sum of the values is 6 + 6 + 5 = 17.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 554, "cpu_time_ms": 136, "memory_kb": 81792}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s603896719", "group_id": "codeNet:p03163", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextWord() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, e := strconv.Atoi(nextWord())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc max(v1, v2 int) int {\n\tif v1 > v2 {\n\t\treturn v1\n\t}\n\treturn v2\n}\n\nfunc main() {\n\tvar dp [105][100005]int\n\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tww := nextInt()\n\tvar w, v []int\n\tfor i := 0; i < n; i++ {\n\t\tw = append(w, nextInt())\n\t\tv = append(v, nextInt())\n\t}\n\n\t// i番目の品物\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j <= ww; j++ {\n\t\t\tif j >= w[i] {\n\t\t\t\tdp[i+1][j] = max(dp[i][j], dp[i][j-w[i]]+v[i])\n\t\t\t} else {\n\t\t\t\tdp[i+1][j] = dp[i][j]\n\t\t\t}\n\t\t}\n\t}\n\n\tans := dp[n][ww]\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1570311545, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03163.html", "problem_id": "p03163", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03163/input.txt", "sample_output_relpath": "derived/input_output/data/p03163/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03163/Go/s603896719.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s603896719", "user_id": "u443924743"}, "prompt_components": {"gold_output": "90\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextWord() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, e := strconv.Atoi(nextWord())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc max(v1, v2 int) int {\n\tif v1 > v2 {\n\t\treturn v1\n\t}\n\treturn v2\n}\n\nfunc main() {\n\tvar dp [105][100005]int\n\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tww := nextInt()\n\tvar w, v []int\n\tfor i := 0; i < n; i++ {\n\t\tw = append(w, nextInt())\n\t\tv = append(v, nextInt())\n\t}\n\n\t// i番目の品物\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j <= ww; j++ {\n\t\t\tif j >= w[i] {\n\t\t\t\tdp[i+1][j] = max(dp[i][j], dp[i][j-w[i]]+v[i])\n\t\t\t} else {\n\t\t\t\tdp[i+1][j] = dp[i][j]\n\t\t\t}\n\t\t}\n\t}\n\n\tans := dp[n][ww]\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are N items, numbered 1, 2, \\ldots, N.\nFor each i (1 \\leq i \\leq N), Item i has a weight of w_i and a value of v_i.\n\nTaro has decided to choose some of the N items and carry them home in a knapsack.\nThe capacity of the knapsack is W, which means that the sum of the weights of items taken must be at most W.\n\nFind the maximum possible sum of the values of items that Taro takes home.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq W \\leq 10^5\n\n1 \\leq w_i \\leq W\n\n1 \\leq v_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN W\nw_1 v_1\nw_2 v_2\n:\nw_N v_N\n\nOutput\n\nPrint the maximum possible sum of the values of items that Taro takes home.\n\nSample Input 1\n\n3 8\n3 30\n4 50\n5 60\n\nSample Output 1\n\n90\n\nItems 1 and 3 should be taken.\nThen, the sum of the weights is 3 + 5 = 8, and the sum of the values is 30 + 60 = 90.\n\nSample Input 2\n\n5 5\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n\nSample Output 2\n\n5000000000\n\nThe answer may not fit into a 32-bit integer type.\n\nSample Input 3\n\n6 15\n6 5\n5 6\n6 4\n6 6\n3 5\n7 2\n\nSample Output 3\n\n17\n\nItems 2, 4 and 5 should be taken.\nThen, the sum of the weights is 5 + 6 + 3 = 14, and the sum of the values is 6 + 6 + 5 = 17.", "sample_input": "3 8\n3 30\n4 50\n5 60\n"}, "reference_outputs": ["90\n"], "source_document_id": "p03163", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are N items, numbered 1, 2, \\ldots, N.\nFor each i (1 \\leq i \\leq N), Item i has a weight of w_i and a value of v_i.\n\nTaro has decided to choose some of the N items and carry them home in a knapsack.\nThe capacity of the knapsack is W, which means that the sum of the weights of items taken must be at most W.\n\nFind the maximum possible sum of the values of items that Taro takes home.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq W \\leq 10^5\n\n1 \\leq w_i \\leq W\n\n1 \\leq v_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN W\nw_1 v_1\nw_2 v_2\n:\nw_N v_N\n\nOutput\n\nPrint the maximum possible sum of the values of items that Taro takes home.\n\nSample Input 1\n\n3 8\n3 30\n4 50\n5 60\n\nSample Output 1\n\n90\n\nItems 1 and 3 should be taken.\nThen, the sum of the weights is 3 + 5 = 8, and the sum of the values is 30 + 60 = 90.\n\nSample Input 2\n\n5 5\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n\nSample Output 2\n\n5000000000\n\nThe answer may not fit into a 32-bit integer type.\n\nSample Input 3\n\n6 15\n6 5\n5 6\n6 4\n6 6\n3 5\n7 2\n\nSample Output 3\n\n17\n\nItems 2, 4 and 5 should be taken.\nThen, the sum of the weights is 5 + 6 + 3 = 14, and the sum of the values is 6 + 6 + 5 = 17.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 754, "cpu_time_ms": 58, "memory_kb": 81920}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s132888842", "group_id": "codeNet:p03163", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner = bufio.NewScanner(os.Stdin)\n\nfunc next() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc nextInt() int {\n\tnum, _ := strconv.Atoi(next())\n\treturn num\n}\n\nfunc nextInts(n int) [][]int {\n\tints := make([][]int, n)\n\tfor i := range ints {\n\t\tints[i] = make([]int, 2)\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tints[i][0], ints[i][1] = nextInt(), nextInt()\n\t}\n\treturn ints\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\n\tscanner.Split(bufio.ScanWords)\n\tn, w := nextInt(), nextInt()\n\ta := nextInts(n)\n\n\tdp := make([]int, w+1)\n\n\tfor i := 1; i <= n; i++ {\n\t\tweight := a[i-1][0]\n\t\tvalue := a[i-1][1]\n\t\tfor j := w; j >= weight; j-- {\n\t\t\tdontChoose := dp[j]\n\t\t\tchoose := 0\n\t\t\tif j-weight >= 0 {\n\t\t\t\tchoose = value + dp[j-weight]\n\t\t\t}\n\t\t\tdp[j] = max(dontChoose, choose)\n\t\t}\n\t}\n\n\tfmt.Println(dp[w])\n}\n", "language": "Go", "metadata": {"date": 1568751321, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03163.html", "problem_id": "p03163", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03163/input.txt", "sample_output_relpath": "derived/input_output/data/p03163/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03163/Go/s132888842.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s132888842", "user_id": "u955046805"}, "prompt_components": {"gold_output": "90\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner = bufio.NewScanner(os.Stdin)\n\nfunc next() string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc nextInt() int {\n\tnum, _ := strconv.Atoi(next())\n\treturn num\n}\n\nfunc nextInts(n int) [][]int {\n\tints := make([][]int, n)\n\tfor i := range ints {\n\t\tints[i] = make([]int, 2)\n\t}\n\tfor i := 0; i < n; i++ {\n\t\tints[i][0], ints[i][1] = nextInt(), nextInt()\n\t}\n\treturn ints\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\n\tscanner.Split(bufio.ScanWords)\n\tn, w := nextInt(), nextInt()\n\ta := nextInts(n)\n\n\tdp := make([]int, w+1)\n\n\tfor i := 1; i <= n; i++ {\n\t\tweight := a[i-1][0]\n\t\tvalue := a[i-1][1]\n\t\tfor j := w; j >= weight; j-- {\n\t\t\tdontChoose := dp[j]\n\t\t\tchoose := 0\n\t\t\tif j-weight >= 0 {\n\t\t\t\tchoose = value + dp[j-weight]\n\t\t\t}\n\t\t\tdp[j] = max(dontChoose, choose)\n\t\t}\n\t}\n\n\tfmt.Println(dp[w])\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are N items, numbered 1, 2, \\ldots, N.\nFor each i (1 \\leq i \\leq N), Item i has a weight of w_i and a value of v_i.\n\nTaro has decided to choose some of the N items and carry them home in a knapsack.\nThe capacity of the knapsack is W, which means that the sum of the weights of items taken must be at most W.\n\nFind the maximum possible sum of the values of items that Taro takes home.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq W \\leq 10^5\n\n1 \\leq w_i \\leq W\n\n1 \\leq v_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN W\nw_1 v_1\nw_2 v_2\n:\nw_N v_N\n\nOutput\n\nPrint the maximum possible sum of the values of items that Taro takes home.\n\nSample Input 1\n\n3 8\n3 30\n4 50\n5 60\n\nSample Output 1\n\n90\n\nItems 1 and 3 should be taken.\nThen, the sum of the weights is 3 + 5 = 8, and the sum of the values is 30 + 60 = 90.\n\nSample Input 2\n\n5 5\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n\nSample Output 2\n\n5000000000\n\nThe answer may not fit into a 32-bit integer type.\n\nSample Input 3\n\n6 15\n6 5\n5 6\n6 4\n6 6\n3 5\n7 2\n\nSample Output 3\n\n17\n\nItems 2, 4 and 5 should be taken.\nThen, the sum of the weights is 5 + 6 + 3 = 14, and the sum of the values is 6 + 6 + 5 = 17.", "sample_input": "3 8\n3 30\n4 50\n5 60\n"}, "reference_outputs": ["90\n"], "source_document_id": "p03163", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are N items, numbered 1, 2, \\ldots, N.\nFor each i (1 \\leq i \\leq N), Item i has a weight of w_i and a value of v_i.\n\nTaro has decided to choose some of the N items and carry them home in a knapsack.\nThe capacity of the knapsack is W, which means that the sum of the weights of items taken must be at most W.\n\nFind the maximum possible sum of the values of items that Taro takes home.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq W \\leq 10^5\n\n1 \\leq w_i \\leq W\n\n1 \\leq v_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN W\nw_1 v_1\nw_2 v_2\n:\nw_N v_N\n\nOutput\n\nPrint the maximum possible sum of the values of items that Taro takes home.\n\nSample Input 1\n\n3 8\n3 30\n4 50\n5 60\n\nSample Output 1\n\n90\n\nItems 1 and 3 should be taken.\nThen, the sum of the weights is 3 + 5 = 8, and the sum of the values is 30 + 60 = 90.\n\nSample Input 2\n\n5 5\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n\nSample Output 2\n\n5000000000\n\nThe answer may not fit into a 32-bit integer type.\n\nSample Input 3\n\n6 15\n6 5\n5 6\n6 4\n6 6\n3 5\n7 2\n\nSample Output 3\n\n17\n\nItems 2, 4 and 5 should be taken.\nThen, the sum of the weights is 5 + 6 + 3 = 14, and the sum of the values is 6 + 6 + 5 = 17.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 887, "cpu_time_ms": 22, "memory_kb": 1408}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s635393095", "group_id": "codeNet:p03163", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nconst inf = 1 << 60\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc ri() (n int) {\n\tsc.Scan()\n\tfor _, v := range sc.Bytes() {\n\t\tn = n*10 + int(v-48)\n\t}\n\treturn\n}\n\nfunc larger(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn, wCap := ri(), ri()\n\tx := make([]int, wCap+1)\n\tfor i := 0; i < n; i++ {\n\t\tw, v := ri(), ri()\n\t\ty := make([]int, wCap+1)\n\t\tfor j := 0; j <= wCap; j++ {\n\t\t\tif j-w >= 0 {\n\t\t\t\ty[j] = larger(x[j], x[j-w]+v)\n\t\t\t} else {\n\t\t\t\ty[j] = x[j]\n\t\t\t}\n\t\t}\n\t\tx = y\n\t}\n\tfmt.Println(x[wCap])\n}\n", "language": "Go", "metadata": {"date": 1556870723, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03163.html", "problem_id": "p03163", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03163/input.txt", "sample_output_relpath": "derived/input_output/data/p03163/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03163/Go/s635393095.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s635393095", "user_id": "u554269352"}, "prompt_components": {"gold_output": "90\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nconst inf = 1 << 60\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc ri() (n int) {\n\tsc.Scan()\n\tfor _, v := range sc.Bytes() {\n\t\tn = n*10 + int(v-48)\n\t}\n\treturn\n}\n\nfunc larger(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn, wCap := ri(), ri()\n\tx := make([]int, wCap+1)\n\tfor i := 0; i < n; i++ {\n\t\tw, v := ri(), ri()\n\t\ty := make([]int, wCap+1)\n\t\tfor j := 0; j <= wCap; j++ {\n\t\t\tif j-w >= 0 {\n\t\t\t\ty[j] = larger(x[j], x[j-w]+v)\n\t\t\t} else {\n\t\t\t\ty[j] = x[j]\n\t\t\t}\n\t\t}\n\t\tx = y\n\t}\n\tfmt.Println(x[wCap])\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are N items, numbered 1, 2, \\ldots, N.\nFor each i (1 \\leq i \\leq N), Item i has a weight of w_i and a value of v_i.\n\nTaro has decided to choose some of the N items and carry them home in a knapsack.\nThe capacity of the knapsack is W, which means that the sum of the weights of items taken must be at most W.\n\nFind the maximum possible sum of the values of items that Taro takes home.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq W \\leq 10^5\n\n1 \\leq w_i \\leq W\n\n1 \\leq v_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN W\nw_1 v_1\nw_2 v_2\n:\nw_N v_N\n\nOutput\n\nPrint the maximum possible sum of the values of items that Taro takes home.\n\nSample Input 1\n\n3 8\n3 30\n4 50\n5 60\n\nSample Output 1\n\n90\n\nItems 1 and 3 should be taken.\nThen, the sum of the weights is 3 + 5 = 8, and the sum of the values is 30 + 60 = 90.\n\nSample Input 2\n\n5 5\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n\nSample Output 2\n\n5000000000\n\nThe answer may not fit into a 32-bit integer type.\n\nSample Input 3\n\n6 15\n6 5\n5 6\n6 4\n6 6\n3 5\n7 2\n\nSample Output 3\n\n17\n\nItems 2, 4 and 5 should be taken.\nThen, the sum of the weights is 5 + 6 + 3 = 14, and the sum of the values is 6 + 6 + 5 = 17.", "sample_input": "3 8\n3 30\n4 50\n5 60\n"}, "reference_outputs": ["90\n"], "source_document_id": "p03163", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are N items, numbered 1, 2, \\ldots, N.\nFor each i (1 \\leq i \\leq N), Item i has a weight of w_i and a value of v_i.\n\nTaro has decided to choose some of the N items and carry them home in a knapsack.\nThe capacity of the knapsack is W, which means that the sum of the weights of items taken must be at most W.\n\nFind the maximum possible sum of the values of items that Taro takes home.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq W \\leq 10^5\n\n1 \\leq w_i \\leq W\n\n1 \\leq v_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN W\nw_1 v_1\nw_2 v_2\n:\nw_N v_N\n\nOutput\n\nPrint the maximum possible sum of the values of items that Taro takes home.\n\nSample Input 1\n\n3 8\n3 30\n4 50\n5 60\n\nSample Output 1\n\n90\n\nItems 1 and 3 should be taken.\nThen, the sum of the weights is 3 + 5 = 8, and the sum of the values is 30 + 60 = 90.\n\nSample Input 2\n\n5 5\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n1 1000000000\n\nSample Output 2\n\n5000000000\n\nThe answer may not fit into a 32-bit integer type.\n\nSample Input 3\n\n6 15\n6 5\n5 6\n6 4\n6 6\n3 5\n7 2\n\nSample Output 3\n\n17\n\nItems 2, 4 and 5 should be taken.\nThen, the sum of the weights is 5 + 6 + 3 = 14, and the sum of the values is 6 + 6 + 5 = 17.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 591, "cpu_time_ms": 47, "memory_kb": 11520}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s298556519", "group_id": "codeNet:p03165", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar str1, str2 string\n\tfmt.Scanf(\"%s%s\", &str1, &str2)\n\tans := lcs(str1, str2)\n\tfmt.Println(ans)\n}\n\nfunc lcs(str1 string, str2 string) string {\n\tdp := createTable(len(str1), len(str2))\n\tfor i := 1; i <= len(str1); i++ {\n\t\tfor j := 1; j <= len(str2); j++ {\n\t\t\tif str1[i-1] == str2[j-1] {\n\t\t\t\tdp[i][j] = 1 + dp[i-1][j-1]\n\t\t\t} else {\n\t\t\t\tdp[i][j] = int(math.Max(float64(dp[i-1][j]), float64(dp[i][j-1])))\n\t\t\t}\n\t\t}\n\t}\n\tvar ans []rune\n\tj := len(str2)\n\tfor i := len(str1); i > 0 && j > 0; {\n\t\tif dp[i][j] == int(math.Max(float64(dp[i-1][j]), float64(dp[i][j-1]))) {\n\t\t\tif dp[i-1][j] >= dp[i][j-1] {\n\t\t\t\ti--\n\t\t\t} else {\n\t\t\t\tj--\n\t\t\t}\n\t\t} else if dp[i][j] == dp[i-1][j-1]+1 {\n\t\t\tans = append(ans, rune(str1[i-1]))\n\t\t\ti--\n\t\t\tj--\n\t\t}\n\t}\n\treturn reverse(string(ans))\n}\n\nfunc reverse(str string) string {\n\tif len(str) == 0 {\n\t\treturn \"\"\n\t}\n\treversed := make([]rune, len(str))\n\tfor i := 0; i <= len(str)/2; i++ {\n\t\treversed[i], reversed[len(str)-1-i] = rune(str[len(str)-i-1]), rune(str[i])\n\t}\n\treturn string(reversed)\n}\n\nfunc createTable(n int, m int) [][]int {\n\tdp := make([][]int, n+1)\n\tfor i := range dp {\n\t\tdp[i] = make([]int, m+1)\n\t}\n\tdp[0][0] = 0\n\treturn dp\n}\n", "language": "Go", "metadata": {"date": 1600567278, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03165.html", "problem_id": "p03165", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03165/input.txt", "sample_output_relpath": "derived/input_output/data/p03165/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03165/Go/s298556519.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s298556519", "user_id": "u964759651"}, "prompt_components": {"gold_output": "axb\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar str1, str2 string\n\tfmt.Scanf(\"%s%s\", &str1, &str2)\n\tans := lcs(str1, str2)\n\tfmt.Println(ans)\n}\n\nfunc lcs(str1 string, str2 string) string {\n\tdp := createTable(len(str1), len(str2))\n\tfor i := 1; i <= len(str1); i++ {\n\t\tfor j := 1; j <= len(str2); j++ {\n\t\t\tif str1[i-1] == str2[j-1] {\n\t\t\t\tdp[i][j] = 1 + dp[i-1][j-1]\n\t\t\t} else {\n\t\t\t\tdp[i][j] = int(math.Max(float64(dp[i-1][j]), float64(dp[i][j-1])))\n\t\t\t}\n\t\t}\n\t}\n\tvar ans []rune\n\tj := len(str2)\n\tfor i := len(str1); i > 0 && j > 0; {\n\t\tif dp[i][j] == int(math.Max(float64(dp[i-1][j]), float64(dp[i][j-1]))) {\n\t\t\tif dp[i-1][j] >= dp[i][j-1] {\n\t\t\t\ti--\n\t\t\t} else {\n\t\t\t\tj--\n\t\t\t}\n\t\t} else if dp[i][j] == dp[i-1][j-1]+1 {\n\t\t\tans = append(ans, rune(str1[i-1]))\n\t\t\ti--\n\t\t\tj--\n\t\t}\n\t}\n\treturn reverse(string(ans))\n}\n\nfunc reverse(str string) string {\n\tif len(str) == 0 {\n\t\treturn \"\"\n\t}\n\treversed := make([]rune, len(str))\n\tfor i := 0; i <= len(str)/2; i++ {\n\t\treversed[i], reversed[len(str)-1-i] = rune(str[len(str)-i-1]), rune(str[i])\n\t}\n\treturn string(reversed)\n}\n\nfunc createTable(n int, m int) [][]int {\n\tdp := make([][]int, n+1)\n\tfor i := range dp {\n\t\tdp[i] = make([]int, m+1)\n\t}\n\tdp[0][0] = 0\n\treturn dp\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given strings s and t.\nFind one longest string that is a subsequence of both s and t.\n\nNotes\n\nA subsequence of a string x is the string obtained by removing zero or more characters from x and concatenating the remaining characters without changing the order.\n\nConstraints\n\ns and t are strings consisting of lowercase English letters.\n\n1 \\leq |s|, |t| \\leq 3000\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nt\n\nOutput\n\nPrint one longest string that is a subsequence of both s and t.\nIf there are multiple such strings, any of them will be accepted.\n\nSample Input 1\n\naxyb\nabyxb\n\nSample Output 1\n\naxb\n\nThe answer is axb or ayb; either will be accepted.\n\nSample Input 2\n\naa\nxayaz\n\nSample Output 2\n\naa\n\nSample Input 3\n\na\nz\n\nSample Output 3\n\nThe answer is (an empty string).\n\nSample Input 4\n\nabracadabra\navadakedavra\n\nSample Output 4\n\naaadara", "sample_input": "axyb\nabyxb\n"}, "reference_outputs": ["axb\n"], "source_document_id": "p03165", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given strings s and t.\nFind one longest string that is a subsequence of both s and t.\n\nNotes\n\nA subsequence of a string x is the string obtained by removing zero or more characters from x and concatenating the remaining characters without changing the order.\n\nConstraints\n\ns and t are strings consisting of lowercase English letters.\n\n1 \\leq |s|, |t| \\leq 3000\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nt\n\nOutput\n\nPrint one longest string that is a subsequence of both s and t.\nIf there are multiple such strings, any of them will be accepted.\n\nSample Input 1\n\naxyb\nabyxb\n\nSample Output 1\n\naxb\n\nThe answer is axb or ayb; either will be accepted.\n\nSample Input 2\n\naa\nxayaz\n\nSample Output 2\n\naa\n\nSample Input 3\n\na\nz\n\nSample Output 3\n\nThe answer is (an empty string).\n\nSample Input 4\n\nabracadabra\navadakedavra\n\nSample Output 4\n\naaadara", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1209, "cpu_time_ms": 11, "memory_kb": 1996}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s578383088", "group_id": "codeNet:p03165", "input_text": "package main\n\nimport \"fmt\"\n\nvar A, B string\nvar dp [][]int\n\nfunc max(a, b int) int {\n\tif a > b { return a }\n\treturn b\n}\n\nfunc lcs(m, n int) int {\n\tdp = make([][]int, m+1)\n\tdp[0] = make([]int, n+1)\n\tfor i:=1; i 0 && j > 0 {\n\t\tif A[i-1] == B[j-1] {\n\t\t\ts = append([]rune{rune(A[i-1])}, s...)\n\t\t\ti--\n\t\t\tj--\n\t\t} else if dp[i-1][j] > dp[i][j-1] {\n\t\t\ti--\n\t\t} else {\n\t\t\tj--\n\t\t}\n\t}\n\tfmt.Println(string(s))\n}\n", "language": "Go", "metadata": {"date": 1596668749, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03165.html", "problem_id": "p03165", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03165/input.txt", "sample_output_relpath": "derived/input_output/data/p03165/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03165/Go/s578383088.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s578383088", "user_id": "u064438560"}, "prompt_components": {"gold_output": "axb\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nvar A, B string\nvar dp [][]int\n\nfunc max(a, b int) int {\n\tif a > b { return a }\n\treturn b\n}\n\nfunc lcs(m, n int) int {\n\tdp = make([][]int, m+1)\n\tdp[0] = make([]int, n+1)\n\tfor i:=1; i 0 && j > 0 {\n\t\tif A[i-1] == B[j-1] {\n\t\t\ts = append([]rune{rune(A[i-1])}, s...)\n\t\t\ti--\n\t\t\tj--\n\t\t} else if dp[i-1][j] > dp[i][j-1] {\n\t\t\ti--\n\t\t} else {\n\t\t\tj--\n\t\t}\n\t}\n\tfmt.Println(string(s))\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given strings s and t.\nFind one longest string that is a subsequence of both s and t.\n\nNotes\n\nA subsequence of a string x is the string obtained by removing zero or more characters from x and concatenating the remaining characters without changing the order.\n\nConstraints\n\ns and t are strings consisting of lowercase English letters.\n\n1 \\leq |s|, |t| \\leq 3000\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nt\n\nOutput\n\nPrint one longest string that is a subsequence of both s and t.\nIf there are multiple such strings, any of them will be accepted.\n\nSample Input 1\n\naxyb\nabyxb\n\nSample Output 1\n\naxb\n\nThe answer is axb or ayb; either will be accepted.\n\nSample Input 2\n\naa\nxayaz\n\nSample Output 2\n\naa\n\nSample Input 3\n\na\nz\n\nSample Output 3\n\nThe answer is (an empty string).\n\nSample Input 4\n\nabracadabra\navadakedavra\n\nSample Output 4\n\naaadara", "sample_input": "axyb\nabyxb\n"}, "reference_outputs": ["axb\n"], "source_document_id": "p03165", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given strings s and t.\nFind one longest string that is a subsequence of both s and t.\n\nNotes\n\nA subsequence of a string x is the string obtained by removing zero or more characters from x and concatenating the remaining characters without changing the order.\n\nConstraints\n\ns and t are strings consisting of lowercase English letters.\n\n1 \\leq |s|, |t| \\leq 3000\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nt\n\nOutput\n\nPrint one longest string that is a subsequence of both s and t.\nIf there are multiple such strings, any of them will be accepted.\n\nSample Input 1\n\naxyb\nabyxb\n\nSample Output 1\n\naxb\n\nThe answer is axb or ayb; either will be accepted.\n\nSample Input 2\n\naa\nxayaz\n\nSample Output 2\n\naa\n\nSample Input 3\n\na\nz\n\nSample Output 3\n\nThe answer is (an empty string).\n\nSample Input 4\n\nabracadabra\navadakedavra\n\nSample Output 4\n\naaadara", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 117, "memory_kb": 96568}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s918694496", "group_id": "codeNet:p03165", "input_text": "/*\nURL:\nhttps://atcoder.jp/contests/dp/tasks/dp_f\n*/\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n/********** FAU standard libraries **********/\n\n//fmt.Sprintf(\"%b\\n\", 255) \t// binary expression\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := ZeroPaddingRuneSlice(num, 32)\n//str := PrintIntsLine(X...)\n\n/*******************************************************************/\n\nconst (\n\t// General purpose\n\tMOD = 1000000000 + 7\n\tALPHABET_NUM = 26\n\tINF_INT64 = math.MaxInt64\n\tINF_BIT60 = 1 << 60\n\tINF_INT32 = math.MaxInt32\n\tINF_BIT30 = 1 << 30\n\tNIL = -1\n\n\t// for dijkstra, prim, and so on\n\tWHITE = 0\n\tGRAY = 1\n\tBLACK = 2\n)\n\nfunc init() {\n\t// bufio.ScanWords <---> bufio.ScanLines\n\tReadString = newReadString(os.Stdin, bufio.ScanWords)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nvar (\n\tS, T []rune\n)\n\nfunc main() {\n\tS, T = ReadRuneSlice(), ReadRuneSlice()\n\n\tans := LCS(S, T)\n\tPrintfDebug(\"length: %d\\n\", len(ans))\n\tfmt.Println(string(ans))\n}\n\nconst MAX_LENGTH = 5000\n\n// LCS returns one of the Longest Common Subsequence of S and T.\n// LCS only accepts len(S) and len(T) <= MAX_LENGTH.\nfunc LCS(S, T []rune) []rune {\n\tdp := [MAX_LENGTH + 1][MAX_LENGTH + 1]int{}\n\n\tfor i := 0; i <= len(S); i++ {\n\t\tfor j := 0; j <= len(T); j++ {\n\t\t\t// if S[i] == T[j] {\n\t\t\t// \tChMax(&dp[i+1][j+1], dp[i][j]+1)\n\t\t\t// }\n\t\t\t// ChMax(&dp[i+1][j+1], dp[i+1][j])\n\t\t\t// ChMax(&dp[i+1][j+1], dp[i][j+1])\n\n\t\t\tChMax(&dp[i+1][j], dp[i][j])\n\t\t\tChMax(&dp[i][j+1], dp[i][j])\n\t\t\tif i < len(S) && j < len(T) && S[i] == T[j] {\n\t\t\t\tChMax(&dp[i+1][j+1], dp[i][j]+1)\n\t\t\t}\n\t\t}\n\t}\n\n\t// for i := 0; i <= len(S); i++ {\n\t// \tPrintfDebug(\"%v\\n\", dp[i][:len(T)+1])\n\t// }\n\n\trevRes := make([]rune, 0, dp[len(S)][len(T)])\n\tsi, ti := len(S), len(T)\n\tfor si > 0 && ti > 0 {\n\t\tif dp[si][ti] == dp[si-1][ti] {\n\t\t\tsi--\n\t\t} else if dp[si][ti] == dp[si][ti-1] {\n\t\t\tti--\n\t\t} else {\n\t\t\trevRes = append(revRes, S[si-1])\n\t\t\tsi--\n\t\t\tti--\n\t\t}\n\t}\n\n\tres := make([]rune, len(revRes))\n\tfor i := len(revRes) - 1; i >= 0; i-- {\n\t\tres[len(revRes)-1-i] = revRes[i]\n\t}\n\n\treturn res\n}\n\n// ChMax accepts a pointer of integer and a target value.\n// If target value is LARGER than the first argument,\n//\tthen the first argument will be updated by the second argument.\nfunc ChMax(updatedValue *int, target int) bool {\n\tif *updatedValue < target {\n\t\t*updatedValue = target\n\t\treturn true\n\t}\n\treturn false\n}\n\n/*******************************************************************/\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\n\tr.Split(sf)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\nfunc ReadInt2() (int, int) {\n\treturn int(readInt64()), int(readInt64())\n}\nfunc ReadInt3() (int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64())\n}\nfunc ReadInt4() (int, int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())\n}\n\n// ReadInt64 returns as integer as int64.\nfunc ReadInt64() int64 {\n\treturn readInt64()\n}\nfunc ReadInt64_2() (int64, int64) {\n\treturn readInt64(), readInt64()\n}\nfunc ReadInt64_3() (int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64()\n}\nfunc ReadInt64_4() (int64, int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64(), readInt64()\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadInt64Slice returns as int64 slice that has n integers.\nfunc ReadInt64Slice(n int) []int64 {\n\tb := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt64()\n\t}\n\treturn b\n}\n\n// ReadFloat64 returns an float64.\nfunc ReadFloat64() float64 {\n\treturn float64(readFloat64())\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(ReadString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// ReadFloatSlice returns an float64 slice that has n float64.\nfunc ReadFloat64Slice(n int) []float64 {\n\tb := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadFloat64()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n/*********** Debugging ***********/\n\n// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.\n// For debugging use.\nfunc ZeroPaddingRuneSlice(n, digitsNum int) []rune {\n\tsn := fmt.Sprintf(\"%b\", n)\n\n\tresidualLength := digitsNum - len(sn)\n\tif residualLength <= 0 {\n\t\treturn []rune(sn)\n\t}\n\n\tzeros := make([]rune, residualLength)\n\tfor i := 0; i < len(zeros); i++ {\n\t\tzeros[i] = '0'\n\t}\n\n\tres := []rune{}\n\tres = append(res, zeros...)\n\tres = append(res, []rune(sn)...)\n\n\treturn res\n}\n\n// Strtoi is a wrapper of strconv.Atoi().\n// If strconv.Atoi() returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintIntsLine(A ...int) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.Itoa(A[i])\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintInts64Line(A ...int64) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.FormatInt(A[i], 10) // 64bit int version\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)\nfunc PrintfDebug(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\n}\n\n// PrintfBufStdout is function for output strings to buffered os.Stdout.\n// You may have to call stdout.Flush() finally.\nfunc PrintfBufStdout(format string, a ...interface{}) {\n\tfmt.Fprintf(stdout, format, a...)\n}\n", "language": "Go", "metadata": {"date": 1590096500, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03165.html", "problem_id": "p03165", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03165/input.txt", "sample_output_relpath": "derived/input_output/data/p03165/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03165/Go/s918694496.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s918694496", "user_id": "u103600314"}, "prompt_components": {"gold_output": "axb\n", "input_to_evaluate": "/*\nURL:\nhttps://atcoder.jp/contests/dp/tasks/dp_f\n*/\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n/********** FAU standard libraries **********/\n\n//fmt.Sprintf(\"%b\\n\", 255) \t// binary expression\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := ZeroPaddingRuneSlice(num, 32)\n//str := PrintIntsLine(X...)\n\n/*******************************************************************/\n\nconst (\n\t// General purpose\n\tMOD = 1000000000 + 7\n\tALPHABET_NUM = 26\n\tINF_INT64 = math.MaxInt64\n\tINF_BIT60 = 1 << 60\n\tINF_INT32 = math.MaxInt32\n\tINF_BIT30 = 1 << 30\n\tNIL = -1\n\n\t// for dijkstra, prim, and so on\n\tWHITE = 0\n\tGRAY = 1\n\tBLACK = 2\n)\n\nfunc init() {\n\t// bufio.ScanWords <---> bufio.ScanLines\n\tReadString = newReadString(os.Stdin, bufio.ScanWords)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nvar (\n\tS, T []rune\n)\n\nfunc main() {\n\tS, T = ReadRuneSlice(), ReadRuneSlice()\n\n\tans := LCS(S, T)\n\tPrintfDebug(\"length: %d\\n\", len(ans))\n\tfmt.Println(string(ans))\n}\n\nconst MAX_LENGTH = 5000\n\n// LCS returns one of the Longest Common Subsequence of S and T.\n// LCS only accepts len(S) and len(T) <= MAX_LENGTH.\nfunc LCS(S, T []rune) []rune {\n\tdp := [MAX_LENGTH + 1][MAX_LENGTH + 1]int{}\n\n\tfor i := 0; i <= len(S); i++ {\n\t\tfor j := 0; j <= len(T); j++ {\n\t\t\t// if S[i] == T[j] {\n\t\t\t// \tChMax(&dp[i+1][j+1], dp[i][j]+1)\n\t\t\t// }\n\t\t\t// ChMax(&dp[i+1][j+1], dp[i+1][j])\n\t\t\t// ChMax(&dp[i+1][j+1], dp[i][j+1])\n\n\t\t\tChMax(&dp[i+1][j], dp[i][j])\n\t\t\tChMax(&dp[i][j+1], dp[i][j])\n\t\t\tif i < len(S) && j < len(T) && S[i] == T[j] {\n\t\t\t\tChMax(&dp[i+1][j+1], dp[i][j]+1)\n\t\t\t}\n\t\t}\n\t}\n\n\t// for i := 0; i <= len(S); i++ {\n\t// \tPrintfDebug(\"%v\\n\", dp[i][:len(T)+1])\n\t// }\n\n\trevRes := make([]rune, 0, dp[len(S)][len(T)])\n\tsi, ti := len(S), len(T)\n\tfor si > 0 && ti > 0 {\n\t\tif dp[si][ti] == dp[si-1][ti] {\n\t\t\tsi--\n\t\t} else if dp[si][ti] == dp[si][ti-1] {\n\t\t\tti--\n\t\t} else {\n\t\t\trevRes = append(revRes, S[si-1])\n\t\t\tsi--\n\t\t\tti--\n\t\t}\n\t}\n\n\tres := make([]rune, len(revRes))\n\tfor i := len(revRes) - 1; i >= 0; i-- {\n\t\tres[len(revRes)-1-i] = revRes[i]\n\t}\n\n\treturn res\n}\n\n// ChMax accepts a pointer of integer and a target value.\n// If target value is LARGER than the first argument,\n//\tthen the first argument will be updated by the second argument.\nfunc ChMax(updatedValue *int, target int) bool {\n\tif *updatedValue < target {\n\t\t*updatedValue = target\n\t\treturn true\n\t}\n\treturn false\n}\n\n/*******************************************************************/\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\n\tr.Split(sf)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\nfunc ReadInt2() (int, int) {\n\treturn int(readInt64()), int(readInt64())\n}\nfunc ReadInt3() (int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64())\n}\nfunc ReadInt4() (int, int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())\n}\n\n// ReadInt64 returns as integer as int64.\nfunc ReadInt64() int64 {\n\treturn readInt64()\n}\nfunc ReadInt64_2() (int64, int64) {\n\treturn readInt64(), readInt64()\n}\nfunc ReadInt64_3() (int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64()\n}\nfunc ReadInt64_4() (int64, int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64(), readInt64()\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadInt64Slice returns as int64 slice that has n integers.\nfunc ReadInt64Slice(n int) []int64 {\n\tb := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt64()\n\t}\n\treturn b\n}\n\n// ReadFloat64 returns an float64.\nfunc ReadFloat64() float64 {\n\treturn float64(readFloat64())\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(ReadString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// ReadFloatSlice returns an float64 slice that has n float64.\nfunc ReadFloat64Slice(n int) []float64 {\n\tb := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadFloat64()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n/*********** Debugging ***********/\n\n// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.\n// For debugging use.\nfunc ZeroPaddingRuneSlice(n, digitsNum int) []rune {\n\tsn := fmt.Sprintf(\"%b\", n)\n\n\tresidualLength := digitsNum - len(sn)\n\tif residualLength <= 0 {\n\t\treturn []rune(sn)\n\t}\n\n\tzeros := make([]rune, residualLength)\n\tfor i := 0; i < len(zeros); i++ {\n\t\tzeros[i] = '0'\n\t}\n\n\tres := []rune{}\n\tres = append(res, zeros...)\n\tres = append(res, []rune(sn)...)\n\n\treturn res\n}\n\n// Strtoi is a wrapper of strconv.Atoi().\n// If strconv.Atoi() returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintIntsLine(A ...int) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.Itoa(A[i])\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintInts64Line(A ...int64) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.FormatInt(A[i], 10) // 64bit int version\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)\nfunc PrintfDebug(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\n}\n\n// PrintfBufStdout is function for output strings to buffered os.Stdout.\n// You may have to call stdout.Flush() finally.\nfunc PrintfBufStdout(format string, a ...interface{}) {\n\tfmt.Fprintf(stdout, format, a...)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given strings s and t.\nFind one longest string that is a subsequence of both s and t.\n\nNotes\n\nA subsequence of a string x is the string obtained by removing zero or more characters from x and concatenating the remaining characters without changing the order.\n\nConstraints\n\ns and t are strings consisting of lowercase English letters.\n\n1 \\leq |s|, |t| \\leq 3000\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nt\n\nOutput\n\nPrint one longest string that is a subsequence of both s and t.\nIf there are multiple such strings, any of them will be accepted.\n\nSample Input 1\n\naxyb\nabyxb\n\nSample Output 1\n\naxb\n\nThe answer is axb or ayb; either will be accepted.\n\nSample Input 2\n\naa\nxayaz\n\nSample Output 2\n\naa\n\nSample Input 3\n\na\nz\n\nSample Output 3\n\nThe answer is (an empty string).\n\nSample Input 4\n\nabracadabra\navadakedavra\n\nSample Output 4\n\naaadara", "sample_input": "axyb\nabyxb\n"}, "reference_outputs": ["axb\n"], "source_document_id": "p03165", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given strings s and t.\nFind one longest string that is a subsequence of both s and t.\n\nNotes\n\nA subsequence of a string x is the string obtained by removing zero or more characters from x and concatenating the remaining characters without changing the order.\n\nConstraints\n\ns and t are strings consisting of lowercase English letters.\n\n1 \\leq |s|, |t| \\leq 3000\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nt\n\nOutput\n\nPrint one longest string that is a subsequence of both s and t.\nIf there are multiple such strings, any of them will be accepted.\n\nSample Input 1\n\naxyb\nabyxb\n\nSample Output 1\n\naxb\n\nThe answer is axb or ayb; either will be accepted.\n\nSample Input 2\n\naa\nxayaz\n\nSample Output 2\n\naa\n\nSample Input 3\n\na\nz\n\nSample Output 3\n\nThe answer is (an empty string).\n\nSample Input 4\n\nabracadabra\navadakedavra\n\nSample Output 4\n\naaadara", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6509, "cpu_time_ms": 211, "memory_kb": 202496}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s155706265", "group_id": "codeNet:p03165", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"unicode/utf8\"\n)\n\nvar StringMapCapForIntToString2DMap = 0\n\ntype IntToString2DMap map[int]map[int]string\ntype IntToStringMap map[int]string\n\nfunc lib_NewIntToString2DMap(cap, cap2 int) IntToString2DMap {\n\tStringMapCapForIntToString2DMap = cap2\n\treturn make(map[int]map[int]string, cap)\n}\nfunc lib_NewIntToStringMap(cap int) IntToStringMap {\n\treturn make(map[int]string, cap)\n}\nfunc (m IntToString2DMap) ChBy(key1, key2 int, f func(cur, new string) bool, value string, values ...string) (replaced bool, valueAlreadyExist bool) {\n\tmaxBy := func(f func(cur, new string) bool, values ...string) string {\n\t\tmax := values[0]\n\t\tfor _, v := range values {\n\t\t\tif f(max, v) {\n\t\t\t\tmax = v\n\t\t\t}\n\t\t}\n\t\treturn max\n\t}\n\tmax := maxBy(f, append(values, value)...)\n\tif m.Has(key1, key2) {\n\t\tif f(m[key1][key2], max) {\n\t\t\tm.Set(key1, key2, max)\n\t\t\treturn true, true\n\t\t} else {\n\t\t\treturn false, true\n\t\t}\n\t}\n\tm.Set(key1, key2, max)\n\treturn true, false\n}\nfunc (m IntToString2DMap) Has(key1, key2 int) bool {\n\tv1, ok := m[key1]\n\tif !ok {\n\t\treturn false\n\t}\n\t_, ok = v1[key2]\n\tif !ok {\n\t\treturn false\n\t}\n\treturn true\n}\nfunc (m IntToString2DMap) MustGet(key1, key2 int) string {\n\tv1, ok := m[key1]\n\tif !ok {\n\t\tpanic(fmt.Sprintf(\"ivnalid key1 is specfied in AAAMap: %v\", key1))\n\t}\n\tv2, ok := v1[key2]\n\tif !ok {\n\t\tpanic(fmt.Sprintf(\"ivnalid key2 is specfied in AAAMap: %v\", key2))\n\t}\n\treturn v2\n}\nfunc (m IntToString2DMap) Set(key1, key2 int, value string) (isNewValue bool) {\n\tv1, ok := m[key1]\n\tif !ok {\n\t\tm[key1] = lib_NewIntToStringMap(StringMapCapForIntToString2DMap)\n\t\tv1 = m[key1]\n\t}\n\t_, ok = v1[key2]\n\tv1[key2] = value\n\treturn !ok\n}\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tconst initialBufSize = 4096\n\tconst maxBufSize = 1000000\n\tscanner.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tvar s string\n\tscanner.Scan()\n\ts = scanner.Text()\n\tvar t string\n\tscanner.Scan()\n\tt = scanner.Text()\n\tfmt.Println(solve(s, t))\n}\nfunc solve(s string, t string) string {\n\tslen, tlen := utf8.RuneCountInString(s), utf8.RuneCountInString(t)\n\tsm := lib_NewIntToString2DMap(slen, tlen)\n\tsm.Set(0, 0, \"\")\n\tcompare := func(cur, new string) bool {\n\t\treturn len(cur) < len(new)\n\t}\n\tfor si, sr := range s {\n\t\tfor ti, tr := range t {\n\t\t\tsm.ChBy(si+1, ti+1, compare, sm[si][ti], sm[si+1][ti], sm[si][ti+1])\n\t\t\tif sr == tr {\n\t\t\t\tsm.ChBy(si+1, ti+1, compare, sm[si][ti]+string(sr))\n\t\t\t}\n\t\t}\n\t}\n\treturn sm.MustGet(slen, tlen)\n}\n", "language": "Go", "metadata": {"date": 1589920768, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03165.html", "problem_id": "p03165", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03165/input.txt", "sample_output_relpath": "derived/input_output/data/p03165/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03165/Go/s155706265.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s155706265", "user_id": "u562039972"}, "prompt_components": {"gold_output": "axb\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"unicode/utf8\"\n)\n\nvar StringMapCapForIntToString2DMap = 0\n\ntype IntToString2DMap map[int]map[int]string\ntype IntToStringMap map[int]string\n\nfunc lib_NewIntToString2DMap(cap, cap2 int) IntToString2DMap {\n\tStringMapCapForIntToString2DMap = cap2\n\treturn make(map[int]map[int]string, cap)\n}\nfunc lib_NewIntToStringMap(cap int) IntToStringMap {\n\treturn make(map[int]string, cap)\n}\nfunc (m IntToString2DMap) ChBy(key1, key2 int, f func(cur, new string) bool, value string, values ...string) (replaced bool, valueAlreadyExist bool) {\n\tmaxBy := func(f func(cur, new string) bool, values ...string) string {\n\t\tmax := values[0]\n\t\tfor _, v := range values {\n\t\t\tif f(max, v) {\n\t\t\t\tmax = v\n\t\t\t}\n\t\t}\n\t\treturn max\n\t}\n\tmax := maxBy(f, append(values, value)...)\n\tif m.Has(key1, key2) {\n\t\tif f(m[key1][key2], max) {\n\t\t\tm.Set(key1, key2, max)\n\t\t\treturn true, true\n\t\t} else {\n\t\t\treturn false, true\n\t\t}\n\t}\n\tm.Set(key1, key2, max)\n\treturn true, false\n}\nfunc (m IntToString2DMap) Has(key1, key2 int) bool {\n\tv1, ok := m[key1]\n\tif !ok {\n\t\treturn false\n\t}\n\t_, ok = v1[key2]\n\tif !ok {\n\t\treturn false\n\t}\n\treturn true\n}\nfunc (m IntToString2DMap) MustGet(key1, key2 int) string {\n\tv1, ok := m[key1]\n\tif !ok {\n\t\tpanic(fmt.Sprintf(\"ivnalid key1 is specfied in AAAMap: %v\", key1))\n\t}\n\tv2, ok := v1[key2]\n\tif !ok {\n\t\tpanic(fmt.Sprintf(\"ivnalid key2 is specfied in AAAMap: %v\", key2))\n\t}\n\treturn v2\n}\nfunc (m IntToString2DMap) Set(key1, key2 int, value string) (isNewValue bool) {\n\tv1, ok := m[key1]\n\tif !ok {\n\t\tm[key1] = lib_NewIntToStringMap(StringMapCapForIntToString2DMap)\n\t\tv1 = m[key1]\n\t}\n\t_, ok = v1[key2]\n\tv1[key2] = value\n\treturn !ok\n}\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tconst initialBufSize = 4096\n\tconst maxBufSize = 1000000\n\tscanner.Buffer(make([]byte, initialBufSize), maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\tvar s string\n\tscanner.Scan()\n\ts = scanner.Text()\n\tvar t string\n\tscanner.Scan()\n\tt = scanner.Text()\n\tfmt.Println(solve(s, t))\n}\nfunc solve(s string, t string) string {\n\tslen, tlen := utf8.RuneCountInString(s), utf8.RuneCountInString(t)\n\tsm := lib_NewIntToString2DMap(slen, tlen)\n\tsm.Set(0, 0, \"\")\n\tcompare := func(cur, new string) bool {\n\t\treturn len(cur) < len(new)\n\t}\n\tfor si, sr := range s {\n\t\tfor ti, tr := range t {\n\t\t\tsm.ChBy(si+1, ti+1, compare, sm[si][ti], sm[si+1][ti], sm[si][ti+1])\n\t\t\tif sr == tr {\n\t\t\t\tsm.ChBy(si+1, ti+1, compare, sm[si][ti]+string(sr))\n\t\t\t}\n\t\t}\n\t}\n\treturn sm.MustGet(slen, tlen)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given strings s and t.\nFind one longest string that is a subsequence of both s and t.\n\nNotes\n\nA subsequence of a string x is the string obtained by removing zero or more characters from x and concatenating the remaining characters without changing the order.\n\nConstraints\n\ns and t are strings consisting of lowercase English letters.\n\n1 \\leq |s|, |t| \\leq 3000\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nt\n\nOutput\n\nPrint one longest string that is a subsequence of both s and t.\nIf there are multiple such strings, any of them will be accepted.\n\nSample Input 1\n\naxyb\nabyxb\n\nSample Output 1\n\naxb\n\nThe answer is axb or ayb; either will be accepted.\n\nSample Input 2\n\naa\nxayaz\n\nSample Output 2\n\naa\n\nSample Input 3\n\na\nz\n\nSample Output 3\n\nThe answer is (an empty string).\n\nSample Input 4\n\nabracadabra\navadakedavra\n\nSample Output 4\n\naaadara", "sample_input": "axyb\nabyxb\n"}, "reference_outputs": ["axb\n"], "source_document_id": "p03165", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given strings s and t.\nFind one longest string that is a subsequence of both s and t.\n\nNotes\n\nA subsequence of a string x is the string obtained by removing zero or more characters from x and concatenating the remaining characters without changing the order.\n\nConstraints\n\ns and t are strings consisting of lowercase English letters.\n\n1 \\leq |s|, |t| \\leq 3000\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nt\n\nOutput\n\nPrint one longest string that is a subsequence of both s and t.\nIf there are multiple such strings, any of them will be accepted.\n\nSample Input 1\n\naxyb\nabyxb\n\nSample Output 1\n\naxb\n\nThe answer is axb or ayb; either will be accepted.\n\nSample Input 2\n\naa\nxayaz\n\nSample Output 2\n\naa\n\nSample Input 3\n\na\nz\n\nSample Output 3\n\nThe answer is (an empty string).\n\nSample Input 4\n\nabracadabra\navadakedavra\n\nSample Output 4\n\naaadara", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2468, "cpu_time_ms": 2120, "memory_kb": 193388}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s946250766", "group_id": "codeNet:p03165", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tr := bufio.NewReaderSize(os.Stdin, 4000)\n\n\ts, _, _ := r.ReadLine()\n\tt, _, _ := r.ReadLine()\n\n\tvar dp [3001][3001]int\n\n\tn := len(s)\n\tm := len(t)\n\tfor i := 1; i <= n; i++ {\n\t\tfor j := 1; j <= m; j++ {\n\t\t\tif s[i-1] == t[j-1] {\n\t\t\t\tdp[i][j] = dp[i-1][j-1] + 1\n\t\t\t} else {\n\t\t\t\tdp[i][j] = max(dp[i-1][j], dp[i][j-1])\n\t\t\t}\n\t\t}\n\t}\n\n\t//\tout(dp[n][m])\n\n\tval := dp[n][m]\n\tp0 := n\n\tp1 := m\n\tans := \"\"\n\tfor {\n\t\tif val == 0 {\n\t\t\tbreak\n\t\t}\n\t\tif dp[p0-1][p1] == val {\n\t\t\tp0--\n\t\t} else if dp[p0][p1-1] == val {\n\t\t\tp1--\n\t\t} else {\n\t\t\tans = ans + string(s[p0-1])\n\t\t\tval--\n\t\t\tp0--\n\t\t\tp1--\n\t\t}\n\t}\n\n\tfor i := len(ans); i > 0; i-- {\n\t\tfmt.Print(string(ans[i-1]))\n\t}\n\tfmt.Println(\"\")\n\n}\n", "language": "Go", "metadata": {"date": 1581417991, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03165.html", "problem_id": "p03165", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03165/input.txt", "sample_output_relpath": "derived/input_output/data/p03165/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03165/Go/s946250766.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s946250766", "user_id": "u814575783"}, "prompt_components": {"gold_output": "axb\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc main() {\n\tr := bufio.NewReaderSize(os.Stdin, 4000)\n\n\ts, _, _ := r.ReadLine()\n\tt, _, _ := r.ReadLine()\n\n\tvar dp [3001][3001]int\n\n\tn := len(s)\n\tm := len(t)\n\tfor i := 1; i <= n; i++ {\n\t\tfor j := 1; j <= m; j++ {\n\t\t\tif s[i-1] == t[j-1] {\n\t\t\t\tdp[i][j] = dp[i-1][j-1] + 1\n\t\t\t} else {\n\t\t\t\tdp[i][j] = max(dp[i-1][j], dp[i][j-1])\n\t\t\t}\n\t\t}\n\t}\n\n\t//\tout(dp[n][m])\n\n\tval := dp[n][m]\n\tp0 := n\n\tp1 := m\n\tans := \"\"\n\tfor {\n\t\tif val == 0 {\n\t\t\tbreak\n\t\t}\n\t\tif dp[p0-1][p1] == val {\n\t\t\tp0--\n\t\t} else if dp[p0][p1-1] == val {\n\t\t\tp1--\n\t\t} else {\n\t\t\tans = ans + string(s[p0-1])\n\t\t\tval--\n\t\t\tp0--\n\t\t\tp1--\n\t\t}\n\t}\n\n\tfor i := len(ans); i > 0; i-- {\n\t\tfmt.Print(string(ans[i-1]))\n\t}\n\tfmt.Println(\"\")\n\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given strings s and t.\nFind one longest string that is a subsequence of both s and t.\n\nNotes\n\nA subsequence of a string x is the string obtained by removing zero or more characters from x and concatenating the remaining characters without changing the order.\n\nConstraints\n\ns and t are strings consisting of lowercase English letters.\n\n1 \\leq |s|, |t| \\leq 3000\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nt\n\nOutput\n\nPrint one longest string that is a subsequence of both s and t.\nIf there are multiple such strings, any of them will be accepted.\n\nSample Input 1\n\naxyb\nabyxb\n\nSample Output 1\n\naxb\n\nThe answer is axb or ayb; either will be accepted.\n\nSample Input 2\n\naa\nxayaz\n\nSample Output 2\n\naa\n\nSample Input 3\n\na\nz\n\nSample Output 3\n\nThe answer is (an empty string).\n\nSample Input 4\n\nabracadabra\navadakedavra\n\nSample Output 4\n\naaadara", "sample_input": "axyb\nabyxb\n"}, "reference_outputs": ["axb\n"], "source_document_id": "p03165", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given strings s and t.\nFind one longest string that is a subsequence of both s and t.\n\nNotes\n\nA subsequence of a string x is the string obtained by removing zero or more characters from x and concatenating the remaining characters without changing the order.\n\nConstraints\n\ns and t are strings consisting of lowercase English letters.\n\n1 \\leq |s|, |t| \\leq 3000\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nt\n\nOutput\n\nPrint one longest string that is a subsequence of both s and t.\nIf there are multiple such strings, any of them will be accepted.\n\nSample Input 1\n\naxyb\nabyxb\n\nSample Output 1\n\naxb\n\nThe answer is axb or ayb; either will be accepted.\n\nSample Input 2\n\naa\nxayaz\n\nSample Output 2\n\naa\n\nSample Input 3\n\na\nz\n\nSample Output 3\n\nThe answer is (an empty string).\n\nSample Input 4\n\nabracadabra\navadakedavra\n\nSample Output 4\n\naaadara", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 122, "memory_kb": 77440}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s046655586", "group_id": "codeNet:p03165", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextWord() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, e := strconv.Atoi(nextWord())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\ts := nextWord()\n\tt := nextWord()\n\n\tvar dp [3005][3005]string\n\tvar mstr string\n\tvar mlen = 0\n\ttlen := len(t)\n\tslen := len(s)\n\t// init\n\tif t[0] == s[0] {\n\t\tdp[0][0] = s[0:1]\n\t}\n\tfor i := 1; i < tlen; i++ {\n\t\tif t[i] == s[0] {\n\t\t\tdp[i][0] = s[0:1]\n\t\t} else {\n\t\t\tdp[i][0] = dp[i-1][0]\n\t\t}\n\t}\n\tfor j := 1; j < slen; j++ {\n\t\tif t[0] == s[j] {\n\t\t\tdp[0][j] = t[0:1]\n\t\t} else {\n\t\t\tdp[0][j] = dp[0][j-1]\n\t\t}\n\t}\n\n\tfor i := 1; i < tlen; i++ {\n\t\tfor j := 1; j < slen; j++ {\n\t\t\tif t[i] == s[j] {\n\t\t\t\tdp[i][j] = dp[i-1][j-1] + t[i:i+1]\n\t\t\t\tif len(dp[i][j]) > mlen {\n\t\t\t\t\tmlen = len(dp[i][j])\n\t\t\t\t\tmstr = dp[i][j]\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif len(dp[i-1][j]) > len(dp[i][j-1]) {\n\t\t\t\t\tdp[i][j] = dp[i-1][j]\n\t\t\t\t} else {\n\t\t\t\t\tdp[i][j] = dp[i][j-1]\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(mstr)\n}\n", "language": "Go", "metadata": {"date": 1571088640, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03165.html", "problem_id": "p03165", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03165/input.txt", "sample_output_relpath": "derived/input_output/data/p03165/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03165/Go/s046655586.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s046655586", "user_id": "u443924743"}, "prompt_components": {"gold_output": "axb\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextWord() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, e := strconv.Atoi(nextWord())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\ts := nextWord()\n\tt := nextWord()\n\n\tvar dp [3005][3005]string\n\tvar mstr string\n\tvar mlen = 0\n\ttlen := len(t)\n\tslen := len(s)\n\t// init\n\tif t[0] == s[0] {\n\t\tdp[0][0] = s[0:1]\n\t}\n\tfor i := 1; i < tlen; i++ {\n\t\tif t[i] == s[0] {\n\t\t\tdp[i][0] = s[0:1]\n\t\t} else {\n\t\t\tdp[i][0] = dp[i-1][0]\n\t\t}\n\t}\n\tfor j := 1; j < slen; j++ {\n\t\tif t[0] == s[j] {\n\t\t\tdp[0][j] = t[0:1]\n\t\t} else {\n\t\t\tdp[0][j] = dp[0][j-1]\n\t\t}\n\t}\n\n\tfor i := 1; i < tlen; i++ {\n\t\tfor j := 1; j < slen; j++ {\n\t\t\tif t[i] == s[j] {\n\t\t\t\tdp[i][j] = dp[i-1][j-1] + t[i:i+1]\n\t\t\t\tif len(dp[i][j]) > mlen {\n\t\t\t\t\tmlen = len(dp[i][j])\n\t\t\t\t\tmstr = dp[i][j]\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif len(dp[i-1][j]) > len(dp[i][j-1]) {\n\t\t\t\t\tdp[i][j] = dp[i-1][j]\n\t\t\t\t} else {\n\t\t\t\t\tdp[i][j] = dp[i][j-1]\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(mstr)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given strings s and t.\nFind one longest string that is a subsequence of both s and t.\n\nNotes\n\nA subsequence of a string x is the string obtained by removing zero or more characters from x and concatenating the remaining characters without changing the order.\n\nConstraints\n\ns and t are strings consisting of lowercase English letters.\n\n1 \\leq |s|, |t| \\leq 3000\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nt\n\nOutput\n\nPrint one longest string that is a subsequence of both s and t.\nIf there are multiple such strings, any of them will be accepted.\n\nSample Input 1\n\naxyb\nabyxb\n\nSample Output 1\n\naxb\n\nThe answer is axb or ayb; either will be accepted.\n\nSample Input 2\n\naa\nxayaz\n\nSample Output 2\n\naa\n\nSample Input 3\n\na\nz\n\nSample Output 3\n\nThe answer is (an empty string).\n\nSample Input 4\n\nabracadabra\navadakedavra\n\nSample Output 4\n\naaadara", "sample_input": "axyb\nabyxb\n"}, "reference_outputs": ["axb\n"], "source_document_id": "p03165", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given strings s and t.\nFind one longest string that is a subsequence of both s and t.\n\nNotes\n\nA subsequence of a string x is the string obtained by removing zero or more characters from x and concatenating the remaining characters without changing the order.\n\nConstraints\n\ns and t are strings consisting of lowercase English letters.\n\n1 \\leq |s|, |t| \\leq 3000\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nt\n\nOutput\n\nPrint one longest string that is a subsequence of both s and t.\nIf there are multiple such strings, any of them will be accepted.\n\nSample Input 1\n\naxyb\nabyxb\n\nSample Output 1\n\naxb\n\nThe answer is axb or ayb; either will be accepted.\n\nSample Input 2\n\naa\nxayaz\n\nSample Output 2\n\naa\n\nSample Input 3\n\na\nz\n\nSample Output 3\n\nThe answer is (an empty string).\n\nSample Input 4\n\nabracadabra\navadakedavra\n\nSample Output 4\n\naaadara", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1058, "cpu_time_ms": 2266, "memory_kb": 2067684}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s270397928", "group_id": "codeNet:p03165", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n)\n\nconst pi = math.Pi\n\nvar mod int = pow(10, 9) + 7\nvar Umod uint64 = 1000000007\nvar ans, cnt, sum int = 0, 0, 0\n\nfunc main() {\n\treader.Split(bufio.ScanWords)\n\tvar s, t string\n\tfmt.Scan(&s, &t)\n\n\t// i文字目とj文字目までで,最長の文字列\n\tvar dp = [3005][3005]string{}\n\n\tfor i := 1; i < len(s)+1; i++ {\n\t\tfor j := 1; j < len(t)+1; j++ {\n\t\t\tvar a, b, c string\n\t\t\tif string(s[i-1]) == string(t[j-1]) {\n\t\t\t\ta = dp[i-1][j-1] + string(s[i-1])\n\t\t\t\tb = dp[i-1][j]\n\t\t\t\tc = dp[i][j-1]\n\t\t\t} else {\n\t\t\t\tb = dp[i-1][j]\n\t\t\t\tc = dp[i][j-1]\n\t\t\t}\n\t\t\tnum := max(len(a), len(b), len(c))\n\t\t\tif num == len(a) {\n\t\t\t\tdp[i][j] = a\n\t\t\t} else if num == len(b) {\n\t\t\t\tdp[i][j] = b\n\t\t\t} else {\n\t\t\t\tdp[i][j] = c\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(dp[len(s)][len(t)])\n}\n\n/* ---------------------------------------- */\n\nvar reader = bufio.NewScanner(os.Stdin)\n\nfunc read() string {\n\treader.Scan()\n\treturn reader.Text()\n}\n\nfunc lcm(x, y int) int {\n\treturn (x / gcd(x, y)) * y\n}\n\nfunc gcd(x, y int) int {\n\tif x%y == 0 {\n\t\treturn y\n\t} else {\n\t\tr := x % y\n\t\treturn gcd(y, r)\n\t}\n}\n\nvar fac [1000000]int\nvar finv [1000000]int\nvar inv [1000000]int\n\nfunc combination_init() {\n\tfac[0], fac[1] = 1, 1\n\tfinv[0], finv[1] = 1, 1\n\tinv[1] = 1\n\n\t// invは a^(-1) mod p\n\t// pをaで割ることを考える\n\n\t// p/a*(a) + p%a = p\n\t// p/a*(a) + p%a = 0 (mod p)\n\t// -p%a = p/a*(a) (mod p)\n\t// -p%a *a^(-1)= p/a (mod p)\n\t// a^(-1)= p/a * (-p%a)^(-1) (mod p)\n\t// a^(-1) =\n\n\tfor i := 2; i < 1000000; i++ {\n\t\tfac[i] = fac[i-1] * i % mod\n\t\tinv[i] = mod - inv[mod%i]*(mod/i)%mod\n\t\tfinv[i] = finv[i-1] * inv[i] % mod\n\t}\n}\n\nfunc combination(x, y int) int {\n\tif x < y {\n\t\treturn 0\n\t}\n\tif fac[0] != 1 {\n\t\tcombination_init()\n\t}\n\treturn fac[x] * (finv[y] * finv[x-y] % mod) % mod\n\t//return fac[x] / (fac[y] * fac[x-y])\n}\n\nfunc permutation(x, y int) int {\n\tif x < y {\n\t\treturn 0\n\t}\n\tif fac[0] != 1 {\n\t\tcombination_init()\n\t}\n\treturn fac[x] * (finv[x-y] % mod) % mod\n\t//return fac[x] / fac[x-y]\n}\n\nfunc max(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Max(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\n\nfunc min(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Min(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\nfunc pow(x, y int) int { return int(math.Pow(float64(x), float64(y))) }\nfunc abs(x int) int { return int(math.Abs(float64(x))) }\nfunc floor(x int) int { return int(math.Floor(float64(x))) }\nfunc ceil(x int) int { return int(math.Ceil(float64(x))) }\n\ntype SortBy []int\n\nfunc (a SortBy) Len() int { return len(a) }\nfunc (a SortBy) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a SortBy) Less(i, j int) bool { return a[i] < a[j] }\n\ntype PriorityQueue []int\n\nfunc (h PriorityQueue) Len() int { return len(h) }\nfunc (h PriorityQueue) Less(i, j int) bool { return h[i] > h[j] }\nfunc (h PriorityQueue) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\nfunc (h *PriorityQueue) Push(x interface{}) { *h = append(*h, x.(int)) }\nfunc (h *PriorityQueue) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n", "language": "Go", "metadata": {"date": 1568908429, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03165.html", "problem_id": "p03165", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03165/input.txt", "sample_output_relpath": "derived/input_output/data/p03165/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03165/Go/s270397928.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s270397928", "user_id": "u266742706"}, "prompt_components": {"gold_output": "axb\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n)\n\nconst pi = math.Pi\n\nvar mod int = pow(10, 9) + 7\nvar Umod uint64 = 1000000007\nvar ans, cnt, sum int = 0, 0, 0\n\nfunc main() {\n\treader.Split(bufio.ScanWords)\n\tvar s, t string\n\tfmt.Scan(&s, &t)\n\n\t// i文字目とj文字目までで,最長の文字列\n\tvar dp = [3005][3005]string{}\n\n\tfor i := 1; i < len(s)+1; i++ {\n\t\tfor j := 1; j < len(t)+1; j++ {\n\t\t\tvar a, b, c string\n\t\t\tif string(s[i-1]) == string(t[j-1]) {\n\t\t\t\ta = dp[i-1][j-1] + string(s[i-1])\n\t\t\t\tb = dp[i-1][j]\n\t\t\t\tc = dp[i][j-1]\n\t\t\t} else {\n\t\t\t\tb = dp[i-1][j]\n\t\t\t\tc = dp[i][j-1]\n\t\t\t}\n\t\t\tnum := max(len(a), len(b), len(c))\n\t\t\tif num == len(a) {\n\t\t\t\tdp[i][j] = a\n\t\t\t} else if num == len(b) {\n\t\t\t\tdp[i][j] = b\n\t\t\t} else {\n\t\t\t\tdp[i][j] = c\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(dp[len(s)][len(t)])\n}\n\n/* ---------------------------------------- */\n\nvar reader = bufio.NewScanner(os.Stdin)\n\nfunc read() string {\n\treader.Scan()\n\treturn reader.Text()\n}\n\nfunc lcm(x, y int) int {\n\treturn (x / gcd(x, y)) * y\n}\n\nfunc gcd(x, y int) int {\n\tif x%y == 0 {\n\t\treturn y\n\t} else {\n\t\tr := x % y\n\t\treturn gcd(y, r)\n\t}\n}\n\nvar fac [1000000]int\nvar finv [1000000]int\nvar inv [1000000]int\n\nfunc combination_init() {\n\tfac[0], fac[1] = 1, 1\n\tfinv[0], finv[1] = 1, 1\n\tinv[1] = 1\n\n\t// invは a^(-1) mod p\n\t// pをaで割ることを考える\n\n\t// p/a*(a) + p%a = p\n\t// p/a*(a) + p%a = 0 (mod p)\n\t// -p%a = p/a*(a) (mod p)\n\t// -p%a *a^(-1)= p/a (mod p)\n\t// a^(-1)= p/a * (-p%a)^(-1) (mod p)\n\t// a^(-1) =\n\n\tfor i := 2; i < 1000000; i++ {\n\t\tfac[i] = fac[i-1] * i % mod\n\t\tinv[i] = mod - inv[mod%i]*(mod/i)%mod\n\t\tfinv[i] = finv[i-1] * inv[i] % mod\n\t}\n}\n\nfunc combination(x, y int) int {\n\tif x < y {\n\t\treturn 0\n\t}\n\tif fac[0] != 1 {\n\t\tcombination_init()\n\t}\n\treturn fac[x] * (finv[y] * finv[x-y] % mod) % mod\n\t//return fac[x] / (fac[y] * fac[x-y])\n}\n\nfunc permutation(x, y int) int {\n\tif x < y {\n\t\treturn 0\n\t}\n\tif fac[0] != 1 {\n\t\tcombination_init()\n\t}\n\treturn fac[x] * (finv[x-y] % mod) % mod\n\t//return fac[x] / fac[x-y]\n}\n\nfunc max(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Max(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\n\nfunc min(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Min(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\nfunc pow(x, y int) int { return int(math.Pow(float64(x), float64(y))) }\nfunc abs(x int) int { return int(math.Abs(float64(x))) }\nfunc floor(x int) int { return int(math.Floor(float64(x))) }\nfunc ceil(x int) int { return int(math.Ceil(float64(x))) }\n\ntype SortBy []int\n\nfunc (a SortBy) Len() int { return len(a) }\nfunc (a SortBy) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a SortBy) Less(i, j int) bool { return a[i] < a[j] }\n\ntype PriorityQueue []int\n\nfunc (h PriorityQueue) Len() int { return len(h) }\nfunc (h PriorityQueue) Less(i, j int) bool { return h[i] > h[j] }\nfunc (h PriorityQueue) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\nfunc (h *PriorityQueue) Push(x interface{}) { *h = append(*h, x.(int)) }\nfunc (h *PriorityQueue) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given strings s and t.\nFind one longest string that is a subsequence of both s and t.\n\nNotes\n\nA subsequence of a string x is the string obtained by removing zero or more characters from x and concatenating the remaining characters without changing the order.\n\nConstraints\n\ns and t are strings consisting of lowercase English letters.\n\n1 \\leq |s|, |t| \\leq 3000\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nt\n\nOutput\n\nPrint one longest string that is a subsequence of both s and t.\nIf there are multiple such strings, any of them will be accepted.\n\nSample Input 1\n\naxyb\nabyxb\n\nSample Output 1\n\naxb\n\nThe answer is axb or ayb; either will be accepted.\n\nSample Input 2\n\naa\nxayaz\n\nSample Output 2\n\naa\n\nSample Input 3\n\na\nz\n\nSample Output 3\n\nThe answer is (an empty string).\n\nSample Input 4\n\nabracadabra\navadakedavra\n\nSample Output 4\n\naaadara", "sample_input": "axyb\nabyxb\n"}, "reference_outputs": ["axb\n"], "source_document_id": "p03165", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given strings s and t.\nFind one longest string that is a subsequence of both s and t.\n\nNotes\n\nA subsequence of a string x is the string obtained by removing zero or more characters from x and concatenating the remaining characters without changing the order.\n\nConstraints\n\ns and t are strings consisting of lowercase English letters.\n\n1 \\leq |s|, |t| \\leq 3000\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nt\n\nOutput\n\nPrint one longest string that is a subsequence of both s and t.\nIf there are multiple such strings, any of them will be accepted.\n\nSample Input 1\n\naxyb\nabyxb\n\nSample Output 1\n\naxb\n\nThe answer is axb or ayb; either will be accepted.\n\nSample Input 2\n\naa\nxayaz\n\nSample Output 2\n\naa\n\nSample Input 3\n\na\nz\n\nSample Output 3\n\nThe answer is (an empty string).\n\nSample Input 4\n\nabracadabra\navadakedavra\n\nSample Output 4\n\naaadara", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3182, "cpu_time_ms": 2210, "memory_kb": 1813660}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s974677411", "group_id": "codeNet:p03165", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n)\n\nconst pi = math.Pi\n\nvar mod int = pow(10, 9) + 7\nvar Umod uint64 = 1000000007\nvar ans, cnt, sum int = 0, 0, 0\n\nfunc main() {\n\treader.Split(bufio.ScanWords)\n\ts := read()\n\tt := read()\n\n\t// i文字目とj文字目までで,最長の文字列\n\tvar dp = [3005][3005]string{}\n\n\tfor i := 1; i < len(s)+1; i++ {\n\t\tfor j := 1; j < len(t)+1; j++ {\n\t\t\tvar a, b, c string\n\t\t\tif string(s[i-1]) == string(t[j-1]) {\n\t\t\t\ta = dp[i-1][j-1] + string(s[i-1])\n\t\t\t\tb = dp[i-1][j]\n\t\t\t\tc = dp[i][j-1]\n\t\t\t} else {\n\t\t\t\tb = dp[i-1][j]\n\t\t\t\tc = dp[i][j-1]\n\t\t\t}\n\t\t\tnum := max(len(a), len(b), len(c))\n\t\t\tif num == len(a) {\n\t\t\t\tdp[i][j] = a\n\t\t\t} else if num == len(b) {\n\t\t\t\tdp[i][j] = b\n\t\t\t} else {\n\t\t\t\tdp[i][j] = c\n\t\t\t}\n\t\t}\n\t}\n\tvar str string\n\tfor i := 0; i < 3005; i++ {\n\t\tif len(str) < len(dp[len(s)][i]) {\n\t\t\tstr = dp[len(s)][i]\n\t\t}\n\t}\n\n\tfmt.Println(str)\n}\n\n/* ---------------------------------------- */\n\nvar reader = bufio.NewScanner(os.Stdin)\n\nfunc read() string {\n\treader.Scan()\n\treturn reader.Text()\n}\n\nfunc lcm(x, y int) int {\n\treturn (x / gcd(x, y)) * y\n}\n\nfunc gcd(x, y int) int {\n\tif x%y == 0 {\n\t\treturn y\n\t} else {\n\t\tr := x % y\n\t\treturn gcd(y, r)\n\t}\n}\n\nvar fac [1000000]int\nvar finv [1000000]int\nvar inv [1000000]int\n\nfunc combination_init() {\n\tfac[0], fac[1] = 1, 1\n\tfinv[0], finv[1] = 1, 1\n\tinv[1] = 1\n\n\t// invは a^(-1) mod p\n\t// pをaで割ることを考える\n\n\t// p/a*(a) + p%a = p\n\t// p/a*(a) + p%a = 0 (mod p)\n\t// -p%a = p/a*(a) (mod p)\n\t// -p%a *a^(-1)= p/a (mod p)\n\t// a^(-1)= p/a * (-p%a)^(-1) (mod p)\n\t// a^(-1) =\n\n\tfor i := 2; i < 1000000; i++ {\n\t\tfac[i] = fac[i-1] * i % mod\n\t\tinv[i] = mod - inv[mod%i]*(mod/i)%mod\n\t\tfinv[i] = finv[i-1] * inv[i] % mod\n\t}\n}\n\nfunc combination(x, y int) int {\n\tif x < y {\n\t\treturn 0\n\t}\n\tif fac[0] != 1 {\n\t\tcombination_init()\n\t}\n\treturn fac[x] * (finv[y] * finv[x-y] % mod) % mod\n\t//return fac[x] / (fac[y] * fac[x-y])\n}\n\nfunc permutation(x, y int) int {\n\tif x < y {\n\t\treturn 0\n\t}\n\tif fac[0] != 1 {\n\t\tcombination_init()\n\t}\n\treturn fac[x] * (finv[x-y] % mod) % mod\n\t//return fac[x] / fac[x-y]\n}\n\nfunc max(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Max(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\n\nfunc min(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Min(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\nfunc pow(x, y int) int { return int(math.Pow(float64(x), float64(y))) }\nfunc abs(x int) int { return int(math.Abs(float64(x))) }\nfunc floor(x int) int { return int(math.Floor(float64(x))) }\nfunc ceil(x int) int { return int(math.Ceil(float64(x))) }\n\ntype SortBy []int\n\nfunc (a SortBy) Len() int { return len(a) }\nfunc (a SortBy) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a SortBy) Less(i, j int) bool { return a[i] < a[j] }\n\ntype PriorityQueue []int\n\nfunc (h PriorityQueue) Len() int { return len(h) }\nfunc (h PriorityQueue) Less(i, j int) bool { return h[i] > h[j] }\nfunc (h PriorityQueue) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\nfunc (h *PriorityQueue) Push(x interface{}) { *h = append(*h, x.(int)) }\nfunc (h *PriorityQueue) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\n", "language": "Go", "metadata": {"date": 1568899302, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03165.html", "problem_id": "p03165", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03165/input.txt", "sample_output_relpath": "derived/input_output/data/p03165/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03165/Go/s974677411.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s974677411", "user_id": "u266742706"}, "prompt_components": {"gold_output": "axb\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n)\n\nconst pi = math.Pi\n\nvar mod int = pow(10, 9) + 7\nvar Umod uint64 = 1000000007\nvar ans, cnt, sum int = 0, 0, 0\n\nfunc main() {\n\treader.Split(bufio.ScanWords)\n\ts := read()\n\tt := read()\n\n\t// i文字目とj文字目までで,最長の文字列\n\tvar dp = [3005][3005]string{}\n\n\tfor i := 1; i < len(s)+1; i++ {\n\t\tfor j := 1; j < len(t)+1; j++ {\n\t\t\tvar a, b, c string\n\t\t\tif string(s[i-1]) == string(t[j-1]) {\n\t\t\t\ta = dp[i-1][j-1] + string(s[i-1])\n\t\t\t\tb = dp[i-1][j]\n\t\t\t\tc = dp[i][j-1]\n\t\t\t} else {\n\t\t\t\tb = dp[i-1][j]\n\t\t\t\tc = dp[i][j-1]\n\t\t\t}\n\t\t\tnum := max(len(a), len(b), len(c))\n\t\t\tif num == len(a) {\n\t\t\t\tdp[i][j] = a\n\t\t\t} else if num == len(b) {\n\t\t\t\tdp[i][j] = b\n\t\t\t} else {\n\t\t\t\tdp[i][j] = c\n\t\t\t}\n\t\t}\n\t}\n\tvar str string\n\tfor i := 0; i < 3005; i++ {\n\t\tif len(str) < len(dp[len(s)][i]) {\n\t\t\tstr = dp[len(s)][i]\n\t\t}\n\t}\n\n\tfmt.Println(str)\n}\n\n/* ---------------------------------------- */\n\nvar reader = bufio.NewScanner(os.Stdin)\n\nfunc read() string {\n\treader.Scan()\n\treturn reader.Text()\n}\n\nfunc lcm(x, y int) int {\n\treturn (x / gcd(x, y)) * y\n}\n\nfunc gcd(x, y int) int {\n\tif x%y == 0 {\n\t\treturn y\n\t} else {\n\t\tr := x % y\n\t\treturn gcd(y, r)\n\t}\n}\n\nvar fac [1000000]int\nvar finv [1000000]int\nvar inv [1000000]int\n\nfunc combination_init() {\n\tfac[0], fac[1] = 1, 1\n\tfinv[0], finv[1] = 1, 1\n\tinv[1] = 1\n\n\t// invは a^(-1) mod p\n\t// pをaで割ることを考える\n\n\t// p/a*(a) + p%a = p\n\t// p/a*(a) + p%a = 0 (mod p)\n\t// -p%a = p/a*(a) (mod p)\n\t// -p%a *a^(-1)= p/a (mod p)\n\t// a^(-1)= p/a * (-p%a)^(-1) (mod p)\n\t// a^(-1) =\n\n\tfor i := 2; i < 1000000; i++ {\n\t\tfac[i] = fac[i-1] * i % mod\n\t\tinv[i] = mod - inv[mod%i]*(mod/i)%mod\n\t\tfinv[i] = finv[i-1] * inv[i] % mod\n\t}\n}\n\nfunc combination(x, y int) int {\n\tif x < y {\n\t\treturn 0\n\t}\n\tif fac[0] != 1 {\n\t\tcombination_init()\n\t}\n\treturn fac[x] * (finv[y] * finv[x-y] % mod) % mod\n\t//return fac[x] / (fac[y] * fac[x-y])\n}\n\nfunc permutation(x, y int) int {\n\tif x < y {\n\t\treturn 0\n\t}\n\tif fac[0] != 1 {\n\t\tcombination_init()\n\t}\n\treturn fac[x] * (finv[x-y] % mod) % mod\n\t//return fac[x] / fac[x-y]\n}\n\nfunc max(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Max(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\n\nfunc min(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Min(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\nfunc pow(x, y int) int { return int(math.Pow(float64(x), float64(y))) }\nfunc abs(x int) int { return int(math.Abs(float64(x))) }\nfunc floor(x int) int { return int(math.Floor(float64(x))) }\nfunc ceil(x int) int { return int(math.Ceil(float64(x))) }\n\ntype SortBy []int\n\nfunc (a SortBy) Len() int { return len(a) }\nfunc (a SortBy) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a SortBy) Less(i, j int) bool { return a[i] < a[j] }\n\ntype PriorityQueue []int\n\nfunc (h PriorityQueue) Len() int { return len(h) }\nfunc (h PriorityQueue) Less(i, j int) bool { return h[i] > h[j] }\nfunc (h PriorityQueue) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\nfunc (h *PriorityQueue) Push(x interface{}) { *h = append(*h, x.(int)) }\nfunc (h *PriorityQueue) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given strings s and t.\nFind one longest string that is a subsequence of both s and t.\n\nNotes\n\nA subsequence of a string x is the string obtained by removing zero or more characters from x and concatenating the remaining characters without changing the order.\n\nConstraints\n\ns and t are strings consisting of lowercase English letters.\n\n1 \\leq |s|, |t| \\leq 3000\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nt\n\nOutput\n\nPrint one longest string that is a subsequence of both s and t.\nIf there are multiple such strings, any of them will be accepted.\n\nSample Input 1\n\naxyb\nabyxb\n\nSample Output 1\n\naxb\n\nThe answer is axb or ayb; either will be accepted.\n\nSample Input 2\n\naa\nxayaz\n\nSample Output 2\n\naa\n\nSample Input 3\n\na\nz\n\nSample Output 3\n\nThe answer is (an empty string).\n\nSample Input 4\n\nabracadabra\navadakedavra\n\nSample Output 4\n\naaadara", "sample_input": "axyb\nabyxb\n"}, "reference_outputs": ["axb\n"], "source_document_id": "p03165", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given strings s and t.\nFind one longest string that is a subsequence of both s and t.\n\nNotes\n\nA subsequence of a string x is the string obtained by removing zero or more characters from x and concatenating the remaining characters without changing the order.\n\nConstraints\n\ns and t are strings consisting of lowercase English letters.\n\n1 \\leq |s|, |t| \\leq 3000\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nt\n\nOutput\n\nPrint one longest string that is a subsequence of both s and t.\nIf there are multiple such strings, any of them will be accepted.\n\nSample Input 1\n\naxyb\nabyxb\n\nSample Output 1\n\naxb\n\nThe answer is axb or ayb; either will be accepted.\n\nSample Input 2\n\naa\nxayaz\n\nSample Output 2\n\naa\n\nSample Input 3\n\na\nz\n\nSample Output 3\n\nThe answer is (an empty string).\n\nSample Input 4\n\nabracadabra\navadakedavra\n\nSample Output 4\n\naaadara", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3272, "cpu_time_ms": 2213, "memory_kb": 1855516}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s999971548", "group_id": "codeNet:p03165", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = readInt()\n\t}\n\treturn b\n}\n\nfunc readLengthAndSlice() (int, []int) {\n\tn := readInt()\n\treturn n, readIntSlice(n)\n}\n\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(stdout, f, args...)\n}\n\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(stdout, args...)\n}\n\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// readString() string\n// readInt() int\n// readIntSlice(n int) []int\n// readLengthAndSlice() []int\n\n// -----------------------------------------------------------------------------\n\nfunc main() {\n\tdefer stdout.Flush()\n\ts := []byte(readString())\n\tt := []byte(readString())\n\tdp := make([][]string, len(s))\n\tfor i := range dp {\n\t\tdp[i] = make([]string, len(t))\n\t}\n\tfor i := range dp {\n\t\tfor j := range dp[i] {\n\t\t\tif 0 < i {\n\t\t\t\tdp[i][j] = dp[i-1][j]\n\t\t\t}\n\t\t\tif 0 < j {\n\t\t\t\tdp[i][j] = max(dp[i][j], dp[i][j-1])\n\t\t\t}\n\t\t\tif s[i] == t[j] {\n\t\t\t\tvar p string\n\t\t\t\tif 0 < i && 0 < j {\n\t\t\t\t\tp = dp[i-1][j-1]\n\t\t\t\t}\n\t\t\t\tp = p + string([]byte{s[i]})\n\t\t\t\tdp[i][j] = max(dp[i][j], p)\n\t\t\t}\n\t\t}\n\t}\n\n\tans := dp[len(s)-1][len(t)-1]\n\tif 0 < len(ans) {\n\t\tprintln(ans)\n\t}\n}\n\nfunc max(a, b string) string {\n\tif len(a) < len(b) {\n\t\treturn b\n\t}\n\treturn a\n}\n\n// -----------------------------------------------------------------------------\n", "language": "Go", "metadata": {"date": 1558080668, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03165.html", "problem_id": "p03165", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03165/input.txt", "sample_output_relpath": "derived/input_output/data/p03165/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03165/Go/s999971548.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s999971548", "user_id": "u705974985"}, "prompt_components": {"gold_output": "axb\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar (\n\treadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\treadString = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\nfunc readInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(readString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc readIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = readInt()\n\t}\n\treturn b\n}\n\nfunc readLengthAndSlice() (int, []int) {\n\tn := readInt()\n\treturn n, readIntSlice(n)\n}\n\nfunc printf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(stdout, f, args...)\n}\n\nfunc println(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(stdout, args...)\n}\n\nfunc eprintln(args ...interface{}) (int, error) {\n\treturn fmt.Fprintln(os.Stderr, args...)\n}\n\nfunc eprintf(f string, args ...interface{}) (int, error) {\n\treturn fmt.Fprintf(os.Stderr, f, args...)\n}\n\n// readString() string\n// readInt() int\n// readIntSlice(n int) []int\n// readLengthAndSlice() []int\n\n// -----------------------------------------------------------------------------\n\nfunc main() {\n\tdefer stdout.Flush()\n\ts := []byte(readString())\n\tt := []byte(readString())\n\tdp := make([][]string, len(s))\n\tfor i := range dp {\n\t\tdp[i] = make([]string, len(t))\n\t}\n\tfor i := range dp {\n\t\tfor j := range dp[i] {\n\t\t\tif 0 < i {\n\t\t\t\tdp[i][j] = dp[i-1][j]\n\t\t\t}\n\t\t\tif 0 < j {\n\t\t\t\tdp[i][j] = max(dp[i][j], dp[i][j-1])\n\t\t\t}\n\t\t\tif s[i] == t[j] {\n\t\t\t\tvar p string\n\t\t\t\tif 0 < i && 0 < j {\n\t\t\t\t\tp = dp[i-1][j-1]\n\t\t\t\t}\n\t\t\t\tp = p + string([]byte{s[i]})\n\t\t\t\tdp[i][j] = max(dp[i][j], p)\n\t\t\t}\n\t\t}\n\t}\n\n\tans := dp[len(s)-1][len(t)-1]\n\tif 0 < len(ans) {\n\t\tprintln(ans)\n\t}\n}\n\nfunc max(a, b string) string {\n\tif len(a) < len(b) {\n\t\treturn b\n\t}\n\treturn a\n}\n\n// -----------------------------------------------------------------------------\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given strings s and t.\nFind one longest string that is a subsequence of both s and t.\n\nNotes\n\nA subsequence of a string x is the string obtained by removing zero or more characters from x and concatenating the remaining characters without changing the order.\n\nConstraints\n\ns and t are strings consisting of lowercase English letters.\n\n1 \\leq |s|, |t| \\leq 3000\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nt\n\nOutput\n\nPrint one longest string that is a subsequence of both s and t.\nIf there are multiple such strings, any of them will be accepted.\n\nSample Input 1\n\naxyb\nabyxb\n\nSample Output 1\n\naxb\n\nThe answer is axb or ayb; either will be accepted.\n\nSample Input 2\n\naa\nxayaz\n\nSample Output 2\n\naa\n\nSample Input 3\n\na\nz\n\nSample Output 3\n\nThe answer is (an empty string).\n\nSample Input 4\n\nabracadabra\navadakedavra\n\nSample Output 4\n\naaadara", "sample_input": "axyb\nabyxb\n"}, "reference_outputs": ["axb\n"], "source_document_id": "p03165", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given strings s and t.\nFind one longest string that is a subsequence of both s and t.\n\nNotes\n\nA subsequence of a string x is the string obtained by removing zero or more characters from x and concatenating the remaining characters without changing the order.\n\nConstraints\n\ns and t are strings consisting of lowercase English letters.\n\n1 \\leq |s|, |t| \\leq 3000\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nt\n\nOutput\n\nPrint one longest string that is a subsequence of both s and t.\nIf there are multiple such strings, any of them will be accepted.\n\nSample Input 1\n\naxyb\nabyxb\n\nSample Output 1\n\naxb\n\nThe answer is axb or ayb; either will be accepted.\n\nSample Input 2\n\naa\nxayaz\n\nSample Output 2\n\naa\n\nSample Input 3\n\na\nz\n\nSample Output 3\n\nThe answer is (an empty string).\n\nSample Input 4\n\nabracadabra\navadakedavra\n\nSample Output 4\n\naaadara", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2139, "cpu_time_ms": 2153, "memory_kb": 828340}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s242373324", "group_id": "codeNet:p03165", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nconst (\n\tA = iota\n\tB\n\tC\n)\n\nfunc main() {\n\tvar s, t string\n\tfmt.Scan(&s, &t)\n\tS, T := len(s), len(t)\n\n\tdp := make([][]int, S+1)\n\tfor i := 0; i <= S; i++ {\n\t\tdp[i] = make([]int, T+1)\n\t}\n\n\tgrid := make([][]int, S+1)\n\tfor i := 0; i <= S; i++ {\n\t\tgrid[i] = make([]int, T+1)\n\t}\n\n\tfor i := 1; i <= S; i++ {\n\t\tfor j := 1; j <= T; j++ {\n\t\t\tif dp[i-1][j] > dp[i][j] {\n\t\t\t\tdp[i][j] = dp[i-1][j]\n\t\t\t\tgrid[i][j] = A\n\t\t\t}\n\t\t\tif dp[i][j-1] > dp[i][j] {\n\t\t\t\tdp[i][j] = dp[i][j-1]\n\t\t\t\tgrid[i][j] = B\n\t\t\t}\n\t\t\tif s[i-1] == t[j-1] {\n\t\t\t\tif dp[i-1][j-1]+1 > dp[i][j] {\n\t\t\t\t\tdp[i][j] = dp[i-1][j-1] + 1\n\t\t\t\t\tgrid[i][j] = C\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tvar i, j int\n\ti = S\n\tj = T\n\tout := \"\"\n\tfor i != 0 && j != 0 {\n\t\tswitch grid[i][j] {\n\t\tcase A:\n\t\t\ti--\n\t\tcase B:\n\t\t\tj--\n\t\tcase C:\n\t\t\tout += string(s[i-1])\n\t\t\ti--\n\t\t\tj--\n\t\t}\n\t}\n\tfor i := len(out) - 1; i >= 0; i-- {\n\t\tfmt.Printf(\"%c\", out[i])\n\t}\n\tfmt.Println()\n}", "language": "Go", "metadata": {"date": 1547758872, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03165.html", "problem_id": "p03165", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03165/input.txt", "sample_output_relpath": "derived/input_output/data/p03165/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03165/Go/s242373324.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s242373324", "user_id": "u875592584"}, "prompt_components": {"gold_output": "axb\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nconst (\n\tA = iota\n\tB\n\tC\n)\n\nfunc main() {\n\tvar s, t string\n\tfmt.Scan(&s, &t)\n\tS, T := len(s), len(t)\n\n\tdp := make([][]int, S+1)\n\tfor i := 0; i <= S; i++ {\n\t\tdp[i] = make([]int, T+1)\n\t}\n\n\tgrid := make([][]int, S+1)\n\tfor i := 0; i <= S; i++ {\n\t\tgrid[i] = make([]int, T+1)\n\t}\n\n\tfor i := 1; i <= S; i++ {\n\t\tfor j := 1; j <= T; j++ {\n\t\t\tif dp[i-1][j] > dp[i][j] {\n\t\t\t\tdp[i][j] = dp[i-1][j]\n\t\t\t\tgrid[i][j] = A\n\t\t\t}\n\t\t\tif dp[i][j-1] > dp[i][j] {\n\t\t\t\tdp[i][j] = dp[i][j-1]\n\t\t\t\tgrid[i][j] = B\n\t\t\t}\n\t\t\tif s[i-1] == t[j-1] {\n\t\t\t\tif dp[i-1][j-1]+1 > dp[i][j] {\n\t\t\t\t\tdp[i][j] = dp[i-1][j-1] + 1\n\t\t\t\t\tgrid[i][j] = C\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tvar i, j int\n\ti = S\n\tj = T\n\tout := \"\"\n\tfor i != 0 && j != 0 {\n\t\tswitch grid[i][j] {\n\t\tcase A:\n\t\t\ti--\n\t\tcase B:\n\t\t\tj--\n\t\tcase C:\n\t\t\tout += string(s[i-1])\n\t\t\ti--\n\t\t\tj--\n\t\t}\n\t}\n\tfor i := len(out) - 1; i >= 0; i-- {\n\t\tfmt.Printf(\"%c\", out[i])\n\t}\n\tfmt.Println()\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given strings s and t.\nFind one longest string that is a subsequence of both s and t.\n\nNotes\n\nA subsequence of a string x is the string obtained by removing zero or more characters from x and concatenating the remaining characters without changing the order.\n\nConstraints\n\ns and t are strings consisting of lowercase English letters.\n\n1 \\leq |s|, |t| \\leq 3000\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nt\n\nOutput\n\nPrint one longest string that is a subsequence of both s and t.\nIf there are multiple such strings, any of them will be accepted.\n\nSample Input 1\n\naxyb\nabyxb\n\nSample Output 1\n\naxb\n\nThe answer is axb or ayb; either will be accepted.\n\nSample Input 2\n\naa\nxayaz\n\nSample Output 2\n\naa\n\nSample Input 3\n\na\nz\n\nSample Output 3\n\nThe answer is (an empty string).\n\nSample Input 4\n\nabracadabra\navadakedavra\n\nSample Output 4\n\naaadara", "sample_input": "axyb\nabyxb\n"}, "reference_outputs": ["axb\n"], "source_document_id": "p03165", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given strings s and t.\nFind one longest string that is a subsequence of both s and t.\n\nNotes\n\nA subsequence of a string x is the string obtained by removing zero or more characters from x and concatenating the remaining characters without changing the order.\n\nConstraints\n\ns and t are strings consisting of lowercase English letters.\n\n1 \\leq |s|, |t| \\leq 3000\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\nt\n\nOutput\n\nPrint one longest string that is a subsequence of both s and t.\nIf there are multiple such strings, any of them will be accepted.\n\nSample Input 1\n\naxyb\nabyxb\n\nSample Output 1\n\naxb\n\nThe answer is axb or ayb; either will be accepted.\n\nSample Input 2\n\naa\nxayaz\n\nSample Output 2\n\naa\n\nSample Input 3\n\na\nz\n\nSample Output 3\n\nThe answer is (an empty string).\n\nSample Input 4\n\nabracadabra\navadakedavra\n\nSample Output 4\n\naaadara", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 975, "cpu_time_ms": 273, "memory_kb": 155264}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s696833140", "group_id": "codeNet:p03206", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar d int\n\tfmt.Scan(&d)\n\n\tif d == 25 {\n\t\tfmt.Println(\"Christmas\")\n\t} else if d == 24 {\n\t\tfmt.Println(\"Christmas Eve\")\n\t} else if d == 23 {\n\t\tfmt.Println(\"Christmas Eve Eve\")\n\t} else if d == 22 {\n\t\tfmt.Println(\"Christmas Eve Eve Eve\")\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1590269664, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03206.html", "problem_id": "p03206", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03206/input.txt", "sample_output_relpath": "derived/input_output/data/p03206/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03206/Go/s696833140.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s696833140", "user_id": "u346986631"}, "prompt_components": {"gold_output": "Christmas\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar d int\n\tfmt.Scan(&d)\n\n\tif d == 25 {\n\t\tfmt.Println(\"Christmas\")\n\t} else if d == 24 {\n\t\tfmt.Println(\"Christmas Eve\")\n\t} else if d == 23 {\n\t\tfmt.Println(\"Christmas Eve Eve\")\n\t} else if d == 22 {\n\t\tfmt.Println(\"Christmas Eve Eve Eve\")\n\t}\n\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIn some other world, today is December D-th.\n\nWrite a program that prints Christmas if D = 25, Christmas Eve if D = 24, Christmas Eve Eve if D = 23 and Christmas Eve Eve Eve if D = 22.\n\nConstraints\n\n22 \\leq D \\leq 25\n\nD is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD\n\nOutput\n\nPrint the specified string (case-sensitive).\n\nSample Input 1\n\n25\n\nSample Output 1\n\nChristmas\n\nSample Input 2\n\n22\n\nSample Output 2\n\nChristmas Eve Eve Eve\n\nBe sure to print spaces between the words.", "sample_input": "25\n"}, "reference_outputs": ["Christmas\n"], "source_document_id": "p03206", "source_text": "Score : 100 points\n\nProblem Statement\n\nIn some other world, today is December D-th.\n\nWrite a program that prints Christmas if D = 25, Christmas Eve if D = 24, Christmas Eve Eve if D = 23 and Christmas Eve Eve Eve if D = 22.\n\nConstraints\n\n22 \\leq D \\leq 25\n\nD is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD\n\nOutput\n\nPrint the specified string (case-sensitive).\n\nSample Input 1\n\n25\n\nSample Output 1\n\nChristmas\n\nSample Input 2\n\n22\n\nSample Output 2\n\nChristmas Eve Eve Eve\n\nBe sure to print spaces between the words.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s576709597", "group_id": "codeNet:p03206", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar D int\n\tfmt.Scan(&D)\n\t\n\tst := \"\"\n\tswitch D {\n\t\tcase 25:\n\t\t\tst = \"Christmas\"\n\t\tcase 24:\n\t\t\tst = \"Christmas Eve\"\n\t\tcase 23:\n\t\t\tst = \"Christmas Eve Eve\"\n\t\tcase 22:\n\t\t\tst = \"Christmas Eve Eve Eve\"\n\t}\n\tfmt.Println(st)\n\n}", "language": "Go", "metadata": {"date": 1575150764, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03206.html", "problem_id": "p03206", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03206/input.txt", "sample_output_relpath": "derived/input_output/data/p03206/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03206/Go/s576709597.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s576709597", "user_id": "u689167014"}, "prompt_components": {"gold_output": "Christmas\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar D int\n\tfmt.Scan(&D)\n\t\n\tst := \"\"\n\tswitch D {\n\t\tcase 25:\n\t\t\tst = \"Christmas\"\n\t\tcase 24:\n\t\t\tst = \"Christmas Eve\"\n\t\tcase 23:\n\t\t\tst = \"Christmas Eve Eve\"\n\t\tcase 22:\n\t\t\tst = \"Christmas Eve Eve Eve\"\n\t}\n\tfmt.Println(st)\n\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIn some other world, today is December D-th.\n\nWrite a program that prints Christmas if D = 25, Christmas Eve if D = 24, Christmas Eve Eve if D = 23 and Christmas Eve Eve Eve if D = 22.\n\nConstraints\n\n22 \\leq D \\leq 25\n\nD is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD\n\nOutput\n\nPrint the specified string (case-sensitive).\n\nSample Input 1\n\n25\n\nSample Output 1\n\nChristmas\n\nSample Input 2\n\n22\n\nSample Output 2\n\nChristmas Eve Eve Eve\n\nBe sure to print spaces between the words.", "sample_input": "25\n"}, "reference_outputs": ["Christmas\n"], "source_document_id": "p03206", "source_text": "Score : 100 points\n\nProblem Statement\n\nIn some other world, today is December D-th.\n\nWrite a program that prints Christmas if D = 25, Christmas Eve if D = 24, Christmas Eve Eve if D = 23 and Christmas Eve Eve Eve if D = 22.\n\nConstraints\n\n22 \\leq D \\leq 25\n\nD is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD\n\nOutput\n\nPrint the specified string (case-sensitive).\n\nSample Input 1\n\n25\n\nSample Output 1\n\nChristmas\n\nSample Input 2\n\n22\n\nSample Output 2\n\nChristmas Eve Eve Eve\n\nBe sure to print spaces between the words.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s483978645", "group_id": "codeNet:p03206", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var d int\n fmt.Scan(&d)\n \n switch d {\n case 22: fmt.Println(\"Christmas Eve Eve Eve\")\n case 23: fmt.Println(\"Christmas Eve Eve\")\n case 24: fmt.Println(\"Christmas Eve\")\n default: fmt.Println(\"Christmas\")\n }\n}", "language": "Go", "metadata": {"date": 1569890880, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03206.html", "problem_id": "p03206", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03206/input.txt", "sample_output_relpath": "derived/input_output/data/p03206/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03206/Go/s483978645.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s483978645", "user_id": "u195309147"}, "prompt_components": {"gold_output": "Christmas\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var d int\n fmt.Scan(&d)\n \n switch d {\n case 22: fmt.Println(\"Christmas Eve Eve Eve\")\n case 23: fmt.Println(\"Christmas Eve Eve\")\n case 24: fmt.Println(\"Christmas Eve\")\n default: fmt.Println(\"Christmas\")\n }\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIn some other world, today is December D-th.\n\nWrite a program that prints Christmas if D = 25, Christmas Eve if D = 24, Christmas Eve Eve if D = 23 and Christmas Eve Eve Eve if D = 22.\n\nConstraints\n\n22 \\leq D \\leq 25\n\nD is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD\n\nOutput\n\nPrint the specified string (case-sensitive).\n\nSample Input 1\n\n25\n\nSample Output 1\n\nChristmas\n\nSample Input 2\n\n22\n\nSample Output 2\n\nChristmas Eve Eve Eve\n\nBe sure to print spaces between the words.", "sample_input": "25\n"}, "reference_outputs": ["Christmas\n"], "source_document_id": "p03206", "source_text": "Score : 100 points\n\nProblem Statement\n\nIn some other world, today is December D-th.\n\nWrite a program that prints Christmas if D = 25, Christmas Eve if D = 24, Christmas Eve Eve if D = 23 and Christmas Eve Eve Eve if D = 22.\n\nConstraints\n\n22 \\leq D \\leq 25\n\nD is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD\n\nOutput\n\nPrint the specified string (case-sensitive).\n\nSample Input 1\n\n25\n\nSample Output 1\n\nChristmas\n\nSample Input 2\n\n22\n\nSample Output 2\n\nChristmas Eve Eve Eve\n\nBe sure to print spaces between the words.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s381088448", "group_id": "codeNet:p03206", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar D int\n\tfmt.Scan(&D)\n\tfmt.Println(\"Christmas\" , strings.Repeat(\"Eve \", 25-D))\n}", "language": "Go", "metadata": {"date": 1548859972, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03206.html", "problem_id": "p03206", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03206/input.txt", "sample_output_relpath": "derived/input_output/data/p03206/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03206/Go/s381088448.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s381088448", "user_id": "u513081876"}, "prompt_components": {"gold_output": "Christmas\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar D int\n\tfmt.Scan(&D)\n\tfmt.Println(\"Christmas\" , strings.Repeat(\"Eve \", 25-D))\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIn some other world, today is December D-th.\n\nWrite a program that prints Christmas if D = 25, Christmas Eve if D = 24, Christmas Eve Eve if D = 23 and Christmas Eve Eve Eve if D = 22.\n\nConstraints\n\n22 \\leq D \\leq 25\n\nD is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD\n\nOutput\n\nPrint the specified string (case-sensitive).\n\nSample Input 1\n\n25\n\nSample Output 1\n\nChristmas\n\nSample Input 2\n\n22\n\nSample Output 2\n\nChristmas Eve Eve Eve\n\nBe sure to print spaces between the words.", "sample_input": "25\n"}, "reference_outputs": ["Christmas\n"], "source_document_id": "p03206", "source_text": "Score : 100 points\n\nProblem Statement\n\nIn some other world, today is December D-th.\n\nWrite a program that prints Christmas if D = 25, Christmas Eve if D = 24, Christmas Eve Eve if D = 23 and Christmas Eve Eve Eve if D = 22.\n\nConstraints\n\n22 \\leq D \\leq 25\n\nD is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD\n\nOutput\n\nPrint the specified string (case-sensitive).\n\nSample Input 1\n\n25\n\nSample Output 1\n\nChristmas\n\nSample Input 2\n\n22\n\nSample Output 2\n\nChristmas Eve Eve Eve\n\nBe sure to print spaces between the words.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s272880455", "group_id": "codeNet:p03206", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a int\n\tfmt.Scan(&a)\n\n\tif a == 22 {\n\t\tfmt.Println(\"Christmas Eve Eve Eve\")\n\t} else if a == 23 {\n\t\tfmt.Println(\"Christmas Eve Eve\")\n\n\t} else if a == 24 {\n\t\tfmt.Println(\"Christmas Eve\")\n\t} else if a == 25 {\n\t\tfmt.Println(\"Christmas\")\n\t}\n\n\t// fmt.Println(a)\n}", "language": "Go", "metadata": {"date": 1546420590, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03206.html", "problem_id": "p03206", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03206/input.txt", "sample_output_relpath": "derived/input_output/data/p03206/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03206/Go/s272880455.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s272880455", "user_id": "u937018609"}, "prompt_components": {"gold_output": "Christmas\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a int\n\tfmt.Scan(&a)\n\n\tif a == 22 {\n\t\tfmt.Println(\"Christmas Eve Eve Eve\")\n\t} else if a == 23 {\n\t\tfmt.Println(\"Christmas Eve Eve\")\n\n\t} else if a == 24 {\n\t\tfmt.Println(\"Christmas Eve\")\n\t} else if a == 25 {\n\t\tfmt.Println(\"Christmas\")\n\t}\n\n\t// fmt.Println(a)\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIn some other world, today is December D-th.\n\nWrite a program that prints Christmas if D = 25, Christmas Eve if D = 24, Christmas Eve Eve if D = 23 and Christmas Eve Eve Eve if D = 22.\n\nConstraints\n\n22 \\leq D \\leq 25\n\nD is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD\n\nOutput\n\nPrint the specified string (case-sensitive).\n\nSample Input 1\n\n25\n\nSample Output 1\n\nChristmas\n\nSample Input 2\n\n22\n\nSample Output 2\n\nChristmas Eve Eve Eve\n\nBe sure to print spaces between the words.", "sample_input": "25\n"}, "reference_outputs": ["Christmas\n"], "source_document_id": "p03206", "source_text": "Score : 100 points\n\nProblem Statement\n\nIn some other world, today is December D-th.\n\nWrite a program that prints Christmas if D = 25, Christmas Eve if D = 24, Christmas Eve Eve if D = 23 and Christmas Eve Eve Eve if D = 22.\n\nConstraints\n\n22 \\leq D \\leq 25\n\nD is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD\n\nOutput\n\nPrint the specified string (case-sensitive).\n\nSample Input 1\n\n25\n\nSample Output 1\n\nChristmas\n\nSample Input 2\n\n22\n\nSample Output 2\n\nChristmas Eve Eve Eve\n\nBe sure to print spaces between the words.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 307, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s963004943", "group_id": "codeNet:p03206", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x int\n\tfmt.Scanf(\"%d\", &x)\n\tfmt.Print(\"Christmas\")\n\tfor i := 0; i < (25 - x); i++ {\n\t\tfmt.Print(\" Eve\")\n\t}\n\tfmt.Print(\"\\n\")\n}\n", "language": "Go", "metadata": {"date": 1545623953, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03206.html", "problem_id": "p03206", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03206/input.txt", "sample_output_relpath": "derived/input_output/data/p03206/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03206/Go/s963004943.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s963004943", "user_id": "u020892708"}, "prompt_components": {"gold_output": "Christmas\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar x int\n\tfmt.Scanf(\"%d\", &x)\n\tfmt.Print(\"Christmas\")\n\tfor i := 0; i < (25 - x); i++ {\n\t\tfmt.Print(\" Eve\")\n\t}\n\tfmt.Print(\"\\n\")\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIn some other world, today is December D-th.\n\nWrite a program that prints Christmas if D = 25, Christmas Eve if D = 24, Christmas Eve Eve if D = 23 and Christmas Eve Eve Eve if D = 22.\n\nConstraints\n\n22 \\leq D \\leq 25\n\nD is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD\n\nOutput\n\nPrint the specified string (case-sensitive).\n\nSample Input 1\n\n25\n\nSample Output 1\n\nChristmas\n\nSample Input 2\n\n22\n\nSample Output 2\n\nChristmas Eve Eve Eve\n\nBe sure to print spaces between the words.", "sample_input": "25\n"}, "reference_outputs": ["Christmas\n"], "source_document_id": "p03206", "source_text": "Score : 100 points\n\nProblem Statement\n\nIn some other world, today is December D-th.\n\nWrite a program that prints Christmas if D = 25, Christmas Eve if D = 24, Christmas Eve Eve if D = 23 and Christmas Eve Eve Eve if D = 22.\n\nConstraints\n\n22 \\leq D \\leq 25\n\nD is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD\n\nOutput\n\nPrint the specified string (case-sensitive).\n\nSample Input 1\n\n25\n\nSample Output 1\n\nChristmas\n\nSample Input 2\n\n22\n\nSample Output 2\n\nChristmas Eve Eve Eve\n\nBe sure to print spaces between the words.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s326266024", "group_id": "codeNet:p03206", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tb, _ := ioutil.ReadAll(os.Stdin)\n\td, _ := strconv.Atoi(string(b))\n\tfmt.Print(\"Christmas\")\n\tfor i := 0; i < 25-d; i++ {\n\t\tfmt.Print(\" Eve\")\n\t}\n fmt.Println()\n}\n", "language": "Go", "metadata": {"date": 1545446545, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03206.html", "problem_id": "p03206", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03206/input.txt", "sample_output_relpath": "derived/input_output/data/p03206/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03206/Go/s326266024.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s326266024", "user_id": "u284161468"}, "prompt_components": {"gold_output": "Christmas\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tb, _ := ioutil.ReadAll(os.Stdin)\n\td, _ := strconv.Atoi(string(b))\n\tfmt.Print(\"Christmas\")\n\tfor i := 0; i < 25-d; i++ {\n\t\tfmt.Print(\" Eve\")\n\t}\n fmt.Println()\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIn some other world, today is December D-th.\n\nWrite a program that prints Christmas if D = 25, Christmas Eve if D = 24, Christmas Eve Eve if D = 23 and Christmas Eve Eve Eve if D = 22.\n\nConstraints\n\n22 \\leq D \\leq 25\n\nD is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD\n\nOutput\n\nPrint the specified string (case-sensitive).\n\nSample Input 1\n\n25\n\nSample Output 1\n\nChristmas\n\nSample Input 2\n\n22\n\nSample Output 2\n\nChristmas Eve Eve Eve\n\nBe sure to print spaces between the words.", "sample_input": "25\n"}, "reference_outputs": ["Christmas\n"], "source_document_id": "p03206", "source_text": "Score : 100 points\n\nProblem Statement\n\nIn some other world, today is December D-th.\n\nWrite a program that prints Christmas if D = 25, Christmas Eve if D = 24, Christmas Eve Eve if D = 23 and Christmas Eve Eve Eve if D = 22.\n\nConstraints\n\n22 \\leq D \\leq 25\n\nD is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD\n\nOutput\n\nPrint the specified string (case-sensitive).\n\nSample Input 1\n\n25\n\nSample Output 1\n\nChristmas\n\nSample Input 2\n\n22\n\nSample Output 2\n\nChristmas Eve Eve Eve\n\nBe sure to print spaces between the words.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 238, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s750059221", "group_id": "codeNet:p03206", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar day int\n\tfmt.Scanf(\"%d\", &day)\n\tif day <= 25 && day > 0 {\n\t\tfmt.Printf(\"Christmas\")\n\t\tfor i := 0; 25-day > i; i++ {\n\t\t\tfmt.Printf(\" Eve\")\n\t\t}\n\t}\n\tfmt.Printf(\"\\n\")\n}\n", "language": "Go", "metadata": {"date": 1544331510, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03206.html", "problem_id": "p03206", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03206/input.txt", "sample_output_relpath": "derived/input_output/data/p03206/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03206/Go/s750059221.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s750059221", "user_id": "u150571231"}, "prompt_components": {"gold_output": "Christmas\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar day int\n\tfmt.Scanf(\"%d\", &day)\n\tif day <= 25 && day > 0 {\n\t\tfmt.Printf(\"Christmas\")\n\t\tfor i := 0; 25-day > i; i++ {\n\t\t\tfmt.Printf(\" Eve\")\n\t\t}\n\t}\n\tfmt.Printf(\"\\n\")\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIn some other world, today is December D-th.\n\nWrite a program that prints Christmas if D = 25, Christmas Eve if D = 24, Christmas Eve Eve if D = 23 and Christmas Eve Eve Eve if D = 22.\n\nConstraints\n\n22 \\leq D \\leq 25\n\nD is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD\n\nOutput\n\nPrint the specified string (case-sensitive).\n\nSample Input 1\n\n25\n\nSample Output 1\n\nChristmas\n\nSample Input 2\n\n22\n\nSample Output 2\n\nChristmas Eve Eve Eve\n\nBe sure to print spaces between the words.", "sample_input": "25\n"}, "reference_outputs": ["Christmas\n"], "source_document_id": "p03206", "source_text": "Score : 100 points\n\nProblem Statement\n\nIn some other world, today is December D-th.\n\nWrite a program that prints Christmas if D = 25, Christmas Eve if D = 24, Christmas Eve Eve if D = 23 and Christmas Eve Eve Eve if D = 22.\n\nConstraints\n\n22 \\leq D \\leq 25\n\nD is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD\n\nOutput\n\nPrint the specified string (case-sensitive).\n\nSample Input 1\n\n25\n\nSample Output 1\n\nChristmas\n\nSample Input 2\n\n22\n\nSample Output 2\n\nChristmas Eve Eve Eve\n\nBe sure to print spaces between the words.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s046294111", "group_id": "codeNet:p03206", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar day int\n\tfmt.Scanf(\"%d\", &day)\n\tif day <= 25 {\n\t\tfmt.Printf(\"Christmas\")\n\t\tfor i := 0; 25-day > i; i++ {\n\t\t\tfmt.Printf(\" eve\")\n\t\t}\n\t}\n\tfmt.Printf(\"\\n\")\n}\n", "language": "Go", "metadata": {"date": 1544331328, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03206.html", "problem_id": "p03206", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03206/input.txt", "sample_output_relpath": "derived/input_output/data/p03206/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03206/Go/s046294111.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s046294111", "user_id": "u150571231"}, "prompt_components": {"gold_output": "Christmas\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar day int\n\tfmt.Scanf(\"%d\", &day)\n\tif day <= 25 {\n\t\tfmt.Printf(\"Christmas\")\n\t\tfor i := 0; 25-day > i; i++ {\n\t\t\tfmt.Printf(\" eve\")\n\t\t}\n\t}\n\tfmt.Printf(\"\\n\")\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIn some other world, today is December D-th.\n\nWrite a program that prints Christmas if D = 25, Christmas Eve if D = 24, Christmas Eve Eve if D = 23 and Christmas Eve Eve Eve if D = 22.\n\nConstraints\n\n22 \\leq D \\leq 25\n\nD is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD\n\nOutput\n\nPrint the specified string (case-sensitive).\n\nSample Input 1\n\n25\n\nSample Output 1\n\nChristmas\n\nSample Input 2\n\n22\n\nSample Output 2\n\nChristmas Eve Eve Eve\n\nBe sure to print spaces between the words.", "sample_input": "25\n"}, "reference_outputs": ["Christmas\n"], "source_document_id": "p03206", "source_text": "Score : 100 points\n\nProblem Statement\n\nIn some other world, today is December D-th.\n\nWrite a program that prints Christmas if D = 25, Christmas Eve if D = 24, Christmas Eve Eve if D = 23 and Christmas Eve Eve Eve if D = 22.\n\nConstraints\n\n22 \\leq D \\leq 25\n\nD is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD\n\nOutput\n\nPrint the specified string (case-sensitive).\n\nSample Input 1\n\n25\n\nSample Output 1\n\nChristmas\n\nSample Input 2\n\n22\n\nSample Output 2\n\nChristmas Eve Eve Eve\n\nBe sure to print spaces between the words.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 206, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s422060002", "group_id": "codeNet:p03206", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar d int\n\tfmt.Scan(&d)\n\n\tswitch d {\n\tcase 25:\n\t\tfmt.Println(\"Christmas\")\n\tcase 24:\n\t\tfmt.Println(\"Christmas Eve\")\n\tcase 23:\n\t\tfmt.Println(\"Christmas Eve Eve\")\n\tcase 22:\n\t\tfmt.Println(\"Christmas Eve Eve Eve\")\n\t}\n}", "language": "Go", "metadata": {"date": 1544321507, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03206.html", "problem_id": "p03206", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03206/input.txt", "sample_output_relpath": "derived/input_output/data/p03206/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03206/Go/s422060002.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s422060002", "user_id": "u875592584"}, "prompt_components": {"gold_output": "Christmas\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar d int\n\tfmt.Scan(&d)\n\n\tswitch d {\n\tcase 25:\n\t\tfmt.Println(\"Christmas\")\n\tcase 24:\n\t\tfmt.Println(\"Christmas Eve\")\n\tcase 23:\n\t\tfmt.Println(\"Christmas Eve Eve\")\n\tcase 22:\n\t\tfmt.Println(\"Christmas Eve Eve Eve\")\n\t}\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIn some other world, today is December D-th.\n\nWrite a program that prints Christmas if D = 25, Christmas Eve if D = 24, Christmas Eve Eve if D = 23 and Christmas Eve Eve Eve if D = 22.\n\nConstraints\n\n22 \\leq D \\leq 25\n\nD is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD\n\nOutput\n\nPrint the specified string (case-sensitive).\n\nSample Input 1\n\n25\n\nSample Output 1\n\nChristmas\n\nSample Input 2\n\n22\n\nSample Output 2\n\nChristmas Eve Eve Eve\n\nBe sure to print spaces between the words.", "sample_input": "25\n"}, "reference_outputs": ["Christmas\n"], "source_document_id": "p03206", "source_text": "Score : 100 points\n\nProblem Statement\n\nIn some other world, today is December D-th.\n\nWrite a program that prints Christmas if D = 25, Christmas Eve if D = 24, Christmas Eve Eve if D = 23 and Christmas Eve Eve Eve if D = 22.\n\nConstraints\n\n22 \\leq D \\leq 25\n\nD is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD\n\nOutput\n\nPrint the specified string (case-sensitive).\n\nSample Input 1\n\n25\n\nSample Output 1\n\nChristmas\n\nSample Input 2\n\n22\n\nSample Output 2\n\nChristmas Eve Eve Eve\n\nBe sure to print spaces between the words.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s594746105", "group_id": "codeNet:p03240", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tscanner.Split(bufio.ScanWords)\n}\n\nfunc ScanInt() int {\n\tscanner.Scan()\n\ttxt := scanner.Text()\n\tn, _ := strconv.Atoi(txt)\n\treturn n\n}\n\nfunc IntMax(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc IntAbs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\ntype Info struct{ X, Y, H int }\n\nfunc main() {\n\tn := ScanInt()\n\tinfoList := make([]Info, n)\n\tfor i := 0; i < n; i++ {\n\t\tinfoList[i].X = ScanInt()\n\t\tinfoList[i].Y = ScanInt()\n\t\tinfoList[i].H = ScanInt()\n\t}\n\n\tfor cx := 0; cx <= 100; cx++ {\n\t\tfor cy := 0; cy <= 100; cy++ {\n\t\t\tvar h int\n\t\t\tfor _, info := range infoList {\n\t\t\t\tif info.H != 0 {\n\t\t\t\t\th = info.H + IntAbs(info.X-cx) + IntAbs(info.Y-cy)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tsuccess := true\n\t\t\tfor _, info := range infoList {\n\t\t\t\tif info.H != IntMax(h-IntAbs(info.X-cx)-IntAbs(info.Y-cy), 0) {\n\t\t\t\t\tsuccess = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif success {\n\t\t\t\tfmt.Printf(\"%d %d %d\\n\", cx, cy, h)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1592617787, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03240.html", "problem_id": "p03240", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03240/input.txt", "sample_output_relpath": "derived/input_output/data/p03240/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03240/Go/s594746105.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s594746105", "user_id": "u605983940"}, "prompt_components": {"gold_output": "2 2 6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar scanner = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tscanner.Split(bufio.ScanWords)\n}\n\nfunc ScanInt() int {\n\tscanner.Scan()\n\ttxt := scanner.Text()\n\tn, _ := strconv.Atoi(txt)\n\treturn n\n}\n\nfunc IntMax(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc IntAbs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\ntype Info struct{ X, Y, H int }\n\nfunc main() {\n\tn := ScanInt()\n\tinfoList := make([]Info, n)\n\tfor i := 0; i < n; i++ {\n\t\tinfoList[i].X = ScanInt()\n\t\tinfoList[i].Y = ScanInt()\n\t\tinfoList[i].H = ScanInt()\n\t}\n\n\tfor cx := 0; cx <= 100; cx++ {\n\t\tfor cy := 0; cy <= 100; cy++ {\n\t\t\tvar h int\n\t\t\tfor _, info := range infoList {\n\t\t\t\tif info.H != 0 {\n\t\t\t\t\th = info.H + IntAbs(info.X-cx) + IntAbs(info.Y-cy)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tsuccess := true\n\t\t\tfor _, info := range infoList {\n\t\t\t\tif info.H != IntMax(h-IntAbs(info.X-cx)-IntAbs(info.Y-cy), 0) {\n\t\t\t\t\tsuccess = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif success {\n\t\t\t\tfmt.Printf(\"%d %d %d\\n\", cx, cy, h)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nIn the Ancient Kingdom of Snuke, there was a pyramid to strengthen the authority of Takahashi, the president of AtCoder Inc.\n\nThe pyramid had center coordinates (C_X, C_Y) and height H. The altitude of coordinates (X, Y) is max(H - |X - C_X| - |Y - C_Y|, 0).\n\nAoki, an explorer, conducted a survey to identify the center coordinates and height of this pyramid. As a result, he obtained the following information:\n\nC_X, C_Y was integers between 0 and 100 (inclusive), and H was an integer not less than 1.\n\nAdditionally, he obtained N pieces of information. The i-th of them is: \"the altitude of point (x_i, y_i) is h_i.\"\n\nThis was enough to identify the center coordinates and the height of the pyramid. Find these values with the clues above.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\nx_i and y_i are integers between 0 and 100 (inclusive).\n\nh_i is an integer between 0 and 10^9 (inclusive).\n\nThe N coordinates (x_1, y_1), (x_2, y_2), (x_3, y_3), ..., (x_N, y_N) are all different.\n\nThe center coordinates and the height of the pyramid can be uniquely identified.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1 h_1\nx_2 y_2 h_2\nx_3 y_3 h_3\n:\nx_N y_N h_N\n\nOutput\n\nPrint values C_X, C_Y and H representing the center coordinates and the height of the pyramid in one line, with spaces in between.\n\nSample Input 1\n\n4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n\nSample Output 1\n\n2 2 6\n\nIn this case, the center coordinates and the height can be identified as (2, 2) and 6.\n\nSample Input 2\n\n2\n0 0 100\n1 1 98\n\nSample Output 2\n\n0 0 100\n\nIn this case, the center coordinates and the height can be identified as (0, 0) and 100.\n\nNote that C_X and C_Y are known to be integers between 0 and 100.\n\nSample Input 3\n\n3\n99 1 191\n100 1 192\n99 0 192\n\nSample Output 3\n\n100 0 193\n\nIn this case, the center coordinates and the height can be identified as (100, 0) and 193.", "sample_input": "4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n"}, "reference_outputs": ["2 2 6\n"], "source_document_id": "p03240", "source_text": "Score: 300 points\n\nProblem Statement\n\nIn the Ancient Kingdom of Snuke, there was a pyramid to strengthen the authority of Takahashi, the president of AtCoder Inc.\n\nThe pyramid had center coordinates (C_X, C_Y) and height H. The altitude of coordinates (X, Y) is max(H - |X - C_X| - |Y - C_Y|, 0).\n\nAoki, an explorer, conducted a survey to identify the center coordinates and height of this pyramid. As a result, he obtained the following information:\n\nC_X, C_Y was integers between 0 and 100 (inclusive), and H was an integer not less than 1.\n\nAdditionally, he obtained N pieces of information. The i-th of them is: \"the altitude of point (x_i, y_i) is h_i.\"\n\nThis was enough to identify the center coordinates and the height of the pyramid. Find these values with the clues above.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\nx_i and y_i are integers between 0 and 100 (inclusive).\n\nh_i is an integer between 0 and 10^9 (inclusive).\n\nThe N coordinates (x_1, y_1), (x_2, y_2), (x_3, y_3), ..., (x_N, y_N) are all different.\n\nThe center coordinates and the height of the pyramid can be uniquely identified.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1 h_1\nx_2 y_2 h_2\nx_3 y_3 h_3\n:\nx_N y_N h_N\n\nOutput\n\nPrint values C_X, C_Y and H representing the center coordinates and the height of the pyramid in one line, with spaces in between.\n\nSample Input 1\n\n4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n\nSample Output 1\n\n2 2 6\n\nIn this case, the center coordinates and the height can be identified as (2, 2) and 6.\n\nSample Input 2\n\n2\n0 0 100\n1 1 98\n\nSample Output 2\n\n0 0 100\n\nIn this case, the center coordinates and the height can be identified as (0, 0) and 100.\n\nNote that C_X and C_Y are known to be integers between 0 and 100.\n\nSample Input 3\n\n3\n99 1 191\n100 1 192\n99 0 192\n\nSample Output 3\n\n100 0 193\n\nIn this case, the center coordinates and the height can be identified as (100, 0) and 193.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1046, "cpu_time_ms": 6, "memory_kb": 1780}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s262565694", "group_id": "codeNet:p03240", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tN := getInt()\n\tX := make([]int, N)\n\tY := make([]int, N)\n\tH := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tX[i] = getInt()\n\t\tY[i] = getInt()\n\t\tH[i] = getInt()\n\t}\n\n\tresult := make([]int, 3)\n\tfor y := 0; y <= 100; y++ {\n\t\tvar flag bool\n\t\tfor x := 0; x <= 100; x++ {\n\t\t\tfor i := 0; i < N; i++ {\n\t\t\t\tflag = true\n\t\t\t\th := H[i] + abs(x-X[i]) + abs(y-Y[i])\n\n\t\t\t\tfor j := 0; j < N; j++ {\n\t\t\t\t\tif max(h-abs(x-X[j])-abs(y-Y[j]), 0) != H[j] {\n\t\t\t\t\t\tflag = false\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif flag {\n\t\t\t\t\tresult = []int{x, y, h}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif flag {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif flag {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfmt.Println(result[0], result[1], result[2])\n}\n\ntype Graph struct {\n\tn int\n\tedges [][]int\n}\n\nfunc NewGraph(n int) *Graph {\n\tg := &Graph{\n\t\tn: n,\n\t\tedges: make([][]int, n),\n\t}\n\treturn g\n}\n\nfunc (g *Graph) AddEdge(u, v int) {\n\tg.edges[v] = append(g.edges[v], u)\n\tg.edges[u] = append(g.edges[u], v)\n}\n\nfunc dfs(c int, edges [][]int, visited map[int]struct{}) {\n\tvisited[c] = struct{}{}\n\n\tfor _, v := range edges[c] {\n\t\t_, flag := visited[v]\n\t\tif flag {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(v, edges, visited)\n\t}\n}\n\nfunc bfs(c int, graph *Graph) {\n\tnext := make([]int, 0)\n\tnext = append(next, c)\n\tvisited := make(map[int]struct{})\n\n\tfor ; len(next) != 0; {\n\t\tu := next[0]\n\t\tnext = next[1:]\n\t\tvisited[u] = struct{}{}\n\n\t\tfor _, v := range graph.edges[u] {\n\t\t\t_, flag := visited[v]\n\t\t\tif flag {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// なにか処理\n\n\t\t\tnext = append(next, v)\n\t\t}\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getIntArray(n int) []int {\n\tarray := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getInt()\n\t}\n\treturn array\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc powMod(n, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 0 {\n\t\tt := powMod(n, p/2)\n\t\treturn calcMod(t * t)\n\t} else {\n\t\treturn calcMod(n * powMod(n, p-1))\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n % 2 == 0 {\n\t\treturn false\n\t}\n\n\tsqrtN := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sqrtN; i += 2 {\n\t\tif n % i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}\n\nfunc powerset2(nums []int) [][]int {\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tindex := 0\n\tresult[index] = []int{}\n\tindex++\n\n\tfor _, n := range nums {\n\t\tmax := index\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[index] = copyAndAppend(result[i], n)\n\t\t\tindex++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc calcGcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t} else if x >= y {\n\t\treturn calcGcd(y, x % y)\n\t} else {\n\t\treturn calcGcd(x, y % x)\n\t}\n}\n\nfunc getDivisor(n int) []int {\n\tvar divisor []int\n\tdivisor = append(divisor, 1)\n\tif n != 1 {\n\t\tdivisor = append(divisor, n)\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n % i == 0 {\n\t\t\tdivisor = append(divisor, i)\n\t\t\tdivisor = append(divisor, n/i)\n\t\t}\n\t}\n\treturn divisor\n}\n\ntype intHeap []int\n\nfunc (h intHeap) Len() int {\n\treturn len(h)\n}\n\nfunc (h intHeap) Less(i, j int) bool {\n\treturn h[i] > h[j]\n}\n\nfunc (h intHeap) Swap(i, j int) {\n\th[i], h[j] = h[j], h[i]\n}\n\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc initHeap() *intHeap {\n\tih := &intHeap{}\n\theap.Init(ih)\n\treturn ih\n}\n\nfunc (h *intHeap) pushHeap(n int) {\n\theap.Push(h, n)\n}\n\nfunc (h *intHeap) popHeap() int {\n\treturn heap.Pop(h).(int)\n}\n\nfunc factMod(n int) int {\n\tvalue := 1\n\tfor ; n > 1; n-- {\n\t\tvalue = calcMod(value * n)\n\t}\n\treturn value\n}\n\nfunc combinationMod(n, k int) int {\n\tfactN := factMod(n)\n\tfactK := factMod(k)\n\tfactNK := factMod(n - k)\n\tfactKR := powMod(factK, mod - 2)\n\tfactNKR := powMod(factNK, mod - 2)\n\treturn calcMod(factN * calcMod(factKR * factNKR))\n}\n", "language": "Go", "metadata": {"date": 1587245480, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03240.html", "problem_id": "p03240", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03240/input.txt", "sample_output_relpath": "derived/input_output/data/p03240/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03240/Go/s262565694.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s262565694", "user_id": "u964273035"}, "prompt_components": {"gold_output": "2 2 6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tN := getInt()\n\tX := make([]int, N)\n\tY := make([]int, N)\n\tH := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tX[i] = getInt()\n\t\tY[i] = getInt()\n\t\tH[i] = getInt()\n\t}\n\n\tresult := make([]int, 3)\n\tfor y := 0; y <= 100; y++ {\n\t\tvar flag bool\n\t\tfor x := 0; x <= 100; x++ {\n\t\t\tfor i := 0; i < N; i++ {\n\t\t\t\tflag = true\n\t\t\t\th := H[i] + abs(x-X[i]) + abs(y-Y[i])\n\n\t\t\t\tfor j := 0; j < N; j++ {\n\t\t\t\t\tif max(h-abs(x-X[j])-abs(y-Y[j]), 0) != H[j] {\n\t\t\t\t\t\tflag = false\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif flag {\n\t\t\t\t\tresult = []int{x, y, h}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif flag {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif flag {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfmt.Println(result[0], result[1], result[2])\n}\n\ntype Graph struct {\n\tn int\n\tedges [][]int\n}\n\nfunc NewGraph(n int) *Graph {\n\tg := &Graph{\n\t\tn: n,\n\t\tedges: make([][]int, n),\n\t}\n\treturn g\n}\n\nfunc (g *Graph) AddEdge(u, v int) {\n\tg.edges[v] = append(g.edges[v], u)\n\tg.edges[u] = append(g.edges[u], v)\n}\n\nfunc dfs(c int, edges [][]int, visited map[int]struct{}) {\n\tvisited[c] = struct{}{}\n\n\tfor _, v := range edges[c] {\n\t\t_, flag := visited[v]\n\t\tif flag {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(v, edges, visited)\n\t}\n}\n\nfunc bfs(c int, graph *Graph) {\n\tnext := make([]int, 0)\n\tnext = append(next, c)\n\tvisited := make(map[int]struct{})\n\n\tfor ; len(next) != 0; {\n\t\tu := next[0]\n\t\tnext = next[1:]\n\t\tvisited[u] = struct{}{}\n\n\t\tfor _, v := range graph.edges[u] {\n\t\t\t_, flag := visited[v]\n\t\t\tif flag {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// なにか処理\n\n\t\t\tnext = append(next, v)\n\t\t}\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getIntArray(n int) []int {\n\tarray := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getInt()\n\t}\n\treturn array\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc powMod(n, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 0 {\n\t\tt := powMod(n, p/2)\n\t\treturn calcMod(t * t)\n\t} else {\n\t\treturn calcMod(n * powMod(n, p-1))\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n % 2 == 0 {\n\t\treturn false\n\t}\n\n\tsqrtN := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sqrtN; i += 2 {\n\t\tif n % i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}\n\nfunc powerset2(nums []int) [][]int {\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tindex := 0\n\tresult[index] = []int{}\n\tindex++\n\n\tfor _, n := range nums {\n\t\tmax := index\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[index] = copyAndAppend(result[i], n)\n\t\t\tindex++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc calcGcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t} else if x >= y {\n\t\treturn calcGcd(y, x % y)\n\t} else {\n\t\treturn calcGcd(x, y % x)\n\t}\n}\n\nfunc getDivisor(n int) []int {\n\tvar divisor []int\n\tdivisor = append(divisor, 1)\n\tif n != 1 {\n\t\tdivisor = append(divisor, n)\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n % i == 0 {\n\t\t\tdivisor = append(divisor, i)\n\t\t\tdivisor = append(divisor, n/i)\n\t\t}\n\t}\n\treturn divisor\n}\n\ntype intHeap []int\n\nfunc (h intHeap) Len() int {\n\treturn len(h)\n}\n\nfunc (h intHeap) Less(i, j int) bool {\n\treturn h[i] > h[j]\n}\n\nfunc (h intHeap) Swap(i, j int) {\n\th[i], h[j] = h[j], h[i]\n}\n\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc initHeap() *intHeap {\n\tih := &intHeap{}\n\theap.Init(ih)\n\treturn ih\n}\n\nfunc (h *intHeap) pushHeap(n int) {\n\theap.Push(h, n)\n}\n\nfunc (h *intHeap) popHeap() int {\n\treturn heap.Pop(h).(int)\n}\n\nfunc factMod(n int) int {\n\tvalue := 1\n\tfor ; n > 1; n-- {\n\t\tvalue = calcMod(value * n)\n\t}\n\treturn value\n}\n\nfunc combinationMod(n, k int) int {\n\tfactN := factMod(n)\n\tfactK := factMod(k)\n\tfactNK := factMod(n - k)\n\tfactKR := powMod(factK, mod - 2)\n\tfactNKR := powMod(factNK, mod - 2)\n\treturn calcMod(factN * calcMod(factKR * factNKR))\n}\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nIn the Ancient Kingdom of Snuke, there was a pyramid to strengthen the authority of Takahashi, the president of AtCoder Inc.\n\nThe pyramid had center coordinates (C_X, C_Y) and height H. The altitude of coordinates (X, Y) is max(H - |X - C_X| - |Y - C_Y|, 0).\n\nAoki, an explorer, conducted a survey to identify the center coordinates and height of this pyramid. As a result, he obtained the following information:\n\nC_X, C_Y was integers between 0 and 100 (inclusive), and H was an integer not less than 1.\n\nAdditionally, he obtained N pieces of information. The i-th of them is: \"the altitude of point (x_i, y_i) is h_i.\"\n\nThis was enough to identify the center coordinates and the height of the pyramid. Find these values with the clues above.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\nx_i and y_i are integers between 0 and 100 (inclusive).\n\nh_i is an integer between 0 and 10^9 (inclusive).\n\nThe N coordinates (x_1, y_1), (x_2, y_2), (x_3, y_3), ..., (x_N, y_N) are all different.\n\nThe center coordinates and the height of the pyramid can be uniquely identified.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1 h_1\nx_2 y_2 h_2\nx_3 y_3 h_3\n:\nx_N y_N h_N\n\nOutput\n\nPrint values C_X, C_Y and H representing the center coordinates and the height of the pyramid in one line, with spaces in between.\n\nSample Input 1\n\n4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n\nSample Output 1\n\n2 2 6\n\nIn this case, the center coordinates and the height can be identified as (2, 2) and 6.\n\nSample Input 2\n\n2\n0 0 100\n1 1 98\n\nSample Output 2\n\n0 0 100\n\nIn this case, the center coordinates and the height can be identified as (0, 0) and 100.\n\nNote that C_X and C_Y are known to be integers between 0 and 100.\n\nSample Input 3\n\n3\n99 1 191\n100 1 192\n99 0 192\n\nSample Output 3\n\n100 0 193\n\nIn this case, the center coordinates and the height can be identified as (100, 0) and 193.", "sample_input": "4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n"}, "reference_outputs": ["2 2 6\n"], "source_document_id": "p03240", "source_text": "Score: 300 points\n\nProblem Statement\n\nIn the Ancient Kingdom of Snuke, there was a pyramid to strengthen the authority of Takahashi, the president of AtCoder Inc.\n\nThe pyramid had center coordinates (C_X, C_Y) and height H. The altitude of coordinates (X, Y) is max(H - |X - C_X| - |Y - C_Y|, 0).\n\nAoki, an explorer, conducted a survey to identify the center coordinates and height of this pyramid. As a result, he obtained the following information:\n\nC_X, C_Y was integers between 0 and 100 (inclusive), and H was an integer not less than 1.\n\nAdditionally, he obtained N pieces of information. The i-th of them is: \"the altitude of point (x_i, y_i) is h_i.\"\n\nThis was enough to identify the center coordinates and the height of the pyramid. Find these values with the clues above.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\nx_i and y_i are integers between 0 and 100 (inclusive).\n\nh_i is an integer between 0 and 10^9 (inclusive).\n\nThe N coordinates (x_1, y_1), (x_2, y_2), (x_3, y_3), ..., (x_N, y_N) are all different.\n\nThe center coordinates and the height of the pyramid can be uniquely identified.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1 h_1\nx_2 y_2 h_2\nx_3 y_3 h_3\n:\nx_N y_N h_N\n\nOutput\n\nPrint values C_X, C_Y and H representing the center coordinates and the height of the pyramid in one line, with spaces in between.\n\nSample Input 1\n\n4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n\nSample Output 1\n\n2 2 6\n\nIn this case, the center coordinates and the height can be identified as (2, 2) and 6.\n\nSample Input 2\n\n2\n0 0 100\n1 1 98\n\nSample Output 2\n\n0 0 100\n\nIn this case, the center coordinates and the height can be identified as (0, 0) and 100.\n\nNote that C_X and C_Y are known to be integers between 0 and 100.\n\nSample Input 3\n\n3\n99 1 191\n100 1 192\n99 0 192\n\nSample Output 3\n\n100 0 193\n\nIn this case, the center coordinates and the height can be identified as (100, 0) and 193.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5663, "cpu_time_ms": 450, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s562187838", "group_id": "codeNet:p03240", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\ntype pos struct {\n\tx, y, h int\n}\n\nfunc check(cx, cy int, p []pos) (int, bool) {\n\th := p[0].h + abs(p[0].x-cx) + abs(p[0].y-cy)\n\t// out(cx, cy, h, p[0])\n\tfor _, v := range p {\n\t\tx := max(h-abs(v.x-cx)-abs(v.y-cy), 0)\n\t\tif x != v.h {\n\t\t\treturn 0, false\n\t\t}\n\t}\n\treturn h, true\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tN := getInt()\n\tp := make([]pos, N+1)\n\tfor i := 1; i <= N; i++ {\n\t\tp[i].x, p[i].y, p[i].h = getInt(), getInt(), getInt()\n\t\tif p[i].h > 0 {\n\t\t\tp[0] = p[i]\n\t\t}\n\t}\n\n\tfor y := 0; y <= 100; y++ {\n\t\tfor x := 0; x <= 100; x++ {\n\t\t\th, ok := check(x, y, p)\n\t\t\tif ok {\n\t\t\t\tout(x, y, h)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1586224593, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03240.html", "problem_id": "p03240", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03240/input.txt", "sample_output_relpath": "derived/input_output/data/p03240/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03240/Go/s562187838.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s562187838", "user_id": "u814575783"}, "prompt_components": {"gold_output": "2 2 6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\ntype pos struct {\n\tx, y, h int\n}\n\nfunc check(cx, cy int, p []pos) (int, bool) {\n\th := p[0].h + abs(p[0].x-cx) + abs(p[0].y-cy)\n\t// out(cx, cy, h, p[0])\n\tfor _, v := range p {\n\t\tx := max(h-abs(v.x-cx)-abs(v.y-cy), 0)\n\t\tif x != v.h {\n\t\t\treturn 0, false\n\t\t}\n\t}\n\treturn h, true\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tN := getInt()\n\tp := make([]pos, N+1)\n\tfor i := 1; i <= N; i++ {\n\t\tp[i].x, p[i].y, p[i].h = getInt(), getInt(), getInt()\n\t\tif p[i].h > 0 {\n\t\t\tp[0] = p[i]\n\t\t}\n\t}\n\n\tfor y := 0; y <= 100; y++ {\n\t\tfor x := 0; x <= 100; x++ {\n\t\t\th, ok := check(x, y, p)\n\t\t\tif ok {\n\t\t\t\tout(x, y, h)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nIn the Ancient Kingdom of Snuke, there was a pyramid to strengthen the authority of Takahashi, the president of AtCoder Inc.\n\nThe pyramid had center coordinates (C_X, C_Y) and height H. The altitude of coordinates (X, Y) is max(H - |X - C_X| - |Y - C_Y|, 0).\n\nAoki, an explorer, conducted a survey to identify the center coordinates and height of this pyramid. As a result, he obtained the following information:\n\nC_X, C_Y was integers between 0 and 100 (inclusive), and H was an integer not less than 1.\n\nAdditionally, he obtained N pieces of information. The i-th of them is: \"the altitude of point (x_i, y_i) is h_i.\"\n\nThis was enough to identify the center coordinates and the height of the pyramid. Find these values with the clues above.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\nx_i and y_i are integers between 0 and 100 (inclusive).\n\nh_i is an integer between 0 and 10^9 (inclusive).\n\nThe N coordinates (x_1, y_1), (x_2, y_2), (x_3, y_3), ..., (x_N, y_N) are all different.\n\nThe center coordinates and the height of the pyramid can be uniquely identified.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1 h_1\nx_2 y_2 h_2\nx_3 y_3 h_3\n:\nx_N y_N h_N\n\nOutput\n\nPrint values C_X, C_Y and H representing the center coordinates and the height of the pyramid in one line, with spaces in between.\n\nSample Input 1\n\n4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n\nSample Output 1\n\n2 2 6\n\nIn this case, the center coordinates and the height can be identified as (2, 2) and 6.\n\nSample Input 2\n\n2\n0 0 100\n1 1 98\n\nSample Output 2\n\n0 0 100\n\nIn this case, the center coordinates and the height can be identified as (0, 0) and 100.\n\nNote that C_X and C_Y are known to be integers between 0 and 100.\n\nSample Input 3\n\n3\n99 1 191\n100 1 192\n99 0 192\n\nSample Output 3\n\n100 0 193\n\nIn this case, the center coordinates and the height can be identified as (100, 0) and 193.", "sample_input": "4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n"}, "reference_outputs": ["2 2 6\n"], "source_document_id": "p03240", "source_text": "Score: 300 points\n\nProblem Statement\n\nIn the Ancient Kingdom of Snuke, there was a pyramid to strengthen the authority of Takahashi, the president of AtCoder Inc.\n\nThe pyramid had center coordinates (C_X, C_Y) and height H. The altitude of coordinates (X, Y) is max(H - |X - C_X| - |Y - C_Y|, 0).\n\nAoki, an explorer, conducted a survey to identify the center coordinates and height of this pyramid. As a result, he obtained the following information:\n\nC_X, C_Y was integers between 0 and 100 (inclusive), and H was an integer not less than 1.\n\nAdditionally, he obtained N pieces of information. The i-th of them is: \"the altitude of point (x_i, y_i) is h_i.\"\n\nThis was enough to identify the center coordinates and the height of the pyramid. Find these values with the clues above.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\nx_i and y_i are integers between 0 and 100 (inclusive).\n\nh_i is an integer between 0 and 10^9 (inclusive).\n\nThe N coordinates (x_1, y_1), (x_2, y_2), (x_3, y_3), ..., (x_N, y_N) are all different.\n\nThe center coordinates and the height of the pyramid can be uniquely identified.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1 h_1\nx_2 y_2 h_2\nx_3 y_3 h_3\n:\nx_N y_N h_N\n\nOutput\n\nPrint values C_X, C_Y and H representing the center coordinates and the height of the pyramid in one line, with spaces in between.\n\nSample Input 1\n\n4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n\nSample Output 1\n\n2 2 6\n\nIn this case, the center coordinates and the height can be identified as (2, 2) and 6.\n\nSample Input 2\n\n2\n0 0 100\n1 1 98\n\nSample Output 2\n\n0 0 100\n\nIn this case, the center coordinates and the height can be identified as (0, 0) and 100.\n\nNote that C_X and C_Y are known to be integers between 0 and 100.\n\nSample Input 3\n\n3\n99 1 191\n100 1 192\n99 0 192\n\nSample Output 3\n\n100 0 193\n\nIn this case, the center coordinates and the height can be identified as (100, 0) and 193.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1236, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s361981962", "group_id": "codeNet:p03240", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\n// I/O\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextFloat() float64 {\n\tf, e := strconv.ParseFloat(s.nextStr(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc (s *Scanner) nextFloatSlice(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextFloat()\n\t}\n\treturn res\n}\n\n// Arithmetic\nfunc max(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m < i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m > i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc pow(x, y int) int {\n\tres := 1\n\tfor i := 0; i < y; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\n// Sort\ntype Val struct {\n\tid, num int\n}\ntype ByNum []Val\n\nfunc (a ByNum) Len() int { return len(a) }\nfunc (a ByNum) Less(i, j int) bool { return a[i].num < a[j].num }\nfunc (a ByNum) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\n\ntype Info struct {\n\tx, y, h int\n}\n\ntype ByH []Info\n\nfunc (a ByH) Len() int { return len(a) }\nfunc (a ByH) Less(i, j int) bool { return a[i].h > a[j].h }\nfunc (a ByH) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\n\nfunc main() {\n\tsc := NewScanner()\n\twtr := bufio.NewWriter(os.Stdout)\n\tN := sc.nextInt()\n\tinfo := make([]Info, N)\n\tfor i := 0; i < N; i++ {\n\t\tinfo[i] = Info{sc.nextInt(), sc.nextInt(), sc.nextInt()}\n\t}\n\tsort.Sort(ByH(info))\n\tfor x := 0; x <= 100; x++ {\n\t\tfor y := 0; y <= 100; y++ {\n\t\t\thDecided := false\n\t\t\tvar H int\n\t\t\tflag := true\n\t\t\tfor i := 0; i < N; i++ {\n\t\t\t\tin := info[i]\n\t\t\t\th, ok := f(x, y, in.x, in.y, in.h)\n\t\t\t\tif ok {\n\t\t\t\t\tif !hDecided {\n\t\t\t\t\t\thDecided = true\n\t\t\t\t\t\tH = h\n\t\t\t\t\t}\n\t\t\t\t\tif h != H || h < 1 {\n\t\t\t\t\t\tflag = false\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif H-abs(x-in.x)-abs(y-in.y) <= 0 {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t} else {\n\t\t\t\t\t\tflag = false\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif flag {\n\t\t\t\tfmt.Fprintln(wtr, x, y, H)\n\t\t\t\twtr.Flush()\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc f(X, Y, cx, cy, ch int) (int, bool) {\n\tif ch == 0 {\n\t\treturn 0, false\n\t}\n\treturn (ch + abs(X-cx) + abs(Y-cy)), true\n}\n", "language": "Go", "metadata": {"date": 1575753713, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03240.html", "problem_id": "p03240", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03240/input.txt", "sample_output_relpath": "derived/input_output/data/p03240/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03240/Go/s361981962.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s361981962", "user_id": "u924691798"}, "prompt_components": {"gold_output": "2 2 6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\n// I/O\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextFloat() float64 {\n\tf, e := strconv.ParseFloat(s.nextStr(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc (s *Scanner) nextFloatSlice(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextFloat()\n\t}\n\treturn res\n}\n\n// Arithmetic\nfunc max(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m < i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m > i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc pow(x, y int) int {\n\tres := 1\n\tfor i := 0; i < y; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\n// Sort\ntype Val struct {\n\tid, num int\n}\ntype ByNum []Val\n\nfunc (a ByNum) Len() int { return len(a) }\nfunc (a ByNum) Less(i, j int) bool { return a[i].num < a[j].num }\nfunc (a ByNum) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\n\ntype Info struct {\n\tx, y, h int\n}\n\ntype ByH []Info\n\nfunc (a ByH) Len() int { return len(a) }\nfunc (a ByH) Less(i, j int) bool { return a[i].h > a[j].h }\nfunc (a ByH) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\n\nfunc main() {\n\tsc := NewScanner()\n\twtr := bufio.NewWriter(os.Stdout)\n\tN := sc.nextInt()\n\tinfo := make([]Info, N)\n\tfor i := 0; i < N; i++ {\n\t\tinfo[i] = Info{sc.nextInt(), sc.nextInt(), sc.nextInt()}\n\t}\n\tsort.Sort(ByH(info))\n\tfor x := 0; x <= 100; x++ {\n\t\tfor y := 0; y <= 100; y++ {\n\t\t\thDecided := false\n\t\t\tvar H int\n\t\t\tflag := true\n\t\t\tfor i := 0; i < N; i++ {\n\t\t\t\tin := info[i]\n\t\t\t\th, ok := f(x, y, in.x, in.y, in.h)\n\t\t\t\tif ok {\n\t\t\t\t\tif !hDecided {\n\t\t\t\t\t\thDecided = true\n\t\t\t\t\t\tH = h\n\t\t\t\t\t}\n\t\t\t\t\tif h != H || h < 1 {\n\t\t\t\t\t\tflag = false\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif H-abs(x-in.x)-abs(y-in.y) <= 0 {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t} else {\n\t\t\t\t\t\tflag = false\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif flag {\n\t\t\t\tfmt.Fprintln(wtr, x, y, H)\n\t\t\t\twtr.Flush()\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc f(X, Y, cx, cy, ch int) (int, bool) {\n\tif ch == 0 {\n\t\treturn 0, false\n\t}\n\treturn (ch + abs(X-cx) + abs(Y-cy)), true\n}\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nIn the Ancient Kingdom of Snuke, there was a pyramid to strengthen the authority of Takahashi, the president of AtCoder Inc.\n\nThe pyramid had center coordinates (C_X, C_Y) and height H. The altitude of coordinates (X, Y) is max(H - |X - C_X| - |Y - C_Y|, 0).\n\nAoki, an explorer, conducted a survey to identify the center coordinates and height of this pyramid. As a result, he obtained the following information:\n\nC_X, C_Y was integers between 0 and 100 (inclusive), and H was an integer not less than 1.\n\nAdditionally, he obtained N pieces of information. The i-th of them is: \"the altitude of point (x_i, y_i) is h_i.\"\n\nThis was enough to identify the center coordinates and the height of the pyramid. Find these values with the clues above.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\nx_i and y_i are integers between 0 and 100 (inclusive).\n\nh_i is an integer between 0 and 10^9 (inclusive).\n\nThe N coordinates (x_1, y_1), (x_2, y_2), (x_3, y_3), ..., (x_N, y_N) are all different.\n\nThe center coordinates and the height of the pyramid can be uniquely identified.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1 h_1\nx_2 y_2 h_2\nx_3 y_3 h_3\n:\nx_N y_N h_N\n\nOutput\n\nPrint values C_X, C_Y and H representing the center coordinates and the height of the pyramid in one line, with spaces in between.\n\nSample Input 1\n\n4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n\nSample Output 1\n\n2 2 6\n\nIn this case, the center coordinates and the height can be identified as (2, 2) and 6.\n\nSample Input 2\n\n2\n0 0 100\n1 1 98\n\nSample Output 2\n\n0 0 100\n\nIn this case, the center coordinates and the height can be identified as (0, 0) and 100.\n\nNote that C_X and C_Y are known to be integers between 0 and 100.\n\nSample Input 3\n\n3\n99 1 191\n100 1 192\n99 0 192\n\nSample Output 3\n\n100 0 193\n\nIn this case, the center coordinates and the height can be identified as (100, 0) and 193.", "sample_input": "4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n"}, "reference_outputs": ["2 2 6\n"], "source_document_id": "p03240", "source_text": "Score: 300 points\n\nProblem Statement\n\nIn the Ancient Kingdom of Snuke, there was a pyramid to strengthen the authority of Takahashi, the president of AtCoder Inc.\n\nThe pyramid had center coordinates (C_X, C_Y) and height H. The altitude of coordinates (X, Y) is max(H - |X - C_X| - |Y - C_Y|, 0).\n\nAoki, an explorer, conducted a survey to identify the center coordinates and height of this pyramid. As a result, he obtained the following information:\n\nC_X, C_Y was integers between 0 and 100 (inclusive), and H was an integer not less than 1.\n\nAdditionally, he obtained N pieces of information. The i-th of them is: \"the altitude of point (x_i, y_i) is h_i.\"\n\nThis was enough to identify the center coordinates and the height of the pyramid. Find these values with the clues above.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\nx_i and y_i are integers between 0 and 100 (inclusive).\n\nh_i is an integer between 0 and 10^9 (inclusive).\n\nThe N coordinates (x_1, y_1), (x_2, y_2), (x_3, y_3), ..., (x_N, y_N) are all different.\n\nThe center coordinates and the height of the pyramid can be uniquely identified.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1 h_1\nx_2 y_2 h_2\nx_3 y_3 h_3\n:\nx_N y_N h_N\n\nOutput\n\nPrint values C_X, C_Y and H representing the center coordinates and the height of the pyramid in one line, with spaces in between.\n\nSample Input 1\n\n4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n\nSample Output 1\n\n2 2 6\n\nIn this case, the center coordinates and the height can be identified as (2, 2) and 6.\n\nSample Input 2\n\n2\n0 0 100\n1 1 98\n\nSample Output 2\n\n0 0 100\n\nIn this case, the center coordinates and the height can be identified as (0, 0) and 100.\n\nNote that C_X and C_Y are known to be integers between 0 and 100.\n\nSample Input 3\n\n3\n99 1 191\n100 1 192\n99 0 192\n\nSample Output 3\n\n100 0 193\n\nIn this case, the center coordinates and the height can be identified as (100, 0) and 193.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2691, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s662368187", "group_id": "codeNet:p03240", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.ParseInt(sc.Text(), 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn int(i)\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tn := nextInt()\n\n\txl := make([]int, n, n)\n\tyl := make([]int, n, n)\n\thl := make([]int, n, n)\n\tfor i := 0; i < n; i++ {\n\t\txl[i] = nextInt()\n\t\tyl[i] = nextInt()\n\t\thl[i] = nextInt()\n\t}\n\n\tmax := 100\n\tfor x := 0; x <= max; x++ {\n\t\tfor y := 0; y <= max; y++ {\n\t\t\tneedH := -1\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\tif hl[i] != 0 {\n\t\t\t\t\tdist := hl[i] + int(math.Abs(float64(x-xl[i]))) + int(math.Abs(float64(y-yl[i])))\n\t\t\t\t\tif needH == -1 {\n\t\t\t\t\t\tneedH = dist\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif dist != needH {\n\t\t\t\t\t\t\tneedH = -2\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif needH == -2 {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\tif hl[i] == 0 {\n\t\t\t\t\tdist := int(math.Abs(float64(x-xl[i]))) + int(math.Abs(float64(y-yl[i])))\n\t\t\t\t\tif dist > needH {\n\t\t\t\t\t\tneedH = -2\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif needH == -2 {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tfmt.Printf(\"%v %v %v\\n\", x, y, needH)\n\t\t\treturn\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1562532012, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03240.html", "problem_id": "p03240", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03240/input.txt", "sample_output_relpath": "derived/input_output/data/p03240/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03240/Go/s662368187.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s662368187", "user_id": "u317845566"}, "prompt_components": {"gold_output": "2 2 6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.ParseInt(sc.Text(), 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn int(i)\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tn := nextInt()\n\n\txl := make([]int, n, n)\n\tyl := make([]int, n, n)\n\thl := make([]int, n, n)\n\tfor i := 0; i < n; i++ {\n\t\txl[i] = nextInt()\n\t\tyl[i] = nextInt()\n\t\thl[i] = nextInt()\n\t}\n\n\tmax := 100\n\tfor x := 0; x <= max; x++ {\n\t\tfor y := 0; y <= max; y++ {\n\t\t\tneedH := -1\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\tif hl[i] != 0 {\n\t\t\t\t\tdist := hl[i] + int(math.Abs(float64(x-xl[i]))) + int(math.Abs(float64(y-yl[i])))\n\t\t\t\t\tif needH == -1 {\n\t\t\t\t\t\tneedH = dist\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif dist != needH {\n\t\t\t\t\t\t\tneedH = -2\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif needH == -2 {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\tif hl[i] == 0 {\n\t\t\t\t\tdist := int(math.Abs(float64(x-xl[i]))) + int(math.Abs(float64(y-yl[i])))\n\t\t\t\t\tif dist > needH {\n\t\t\t\t\t\tneedH = -2\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif needH == -2 {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tfmt.Printf(\"%v %v %v\\n\", x, y, needH)\n\t\t\treturn\n\t\t}\n\t}\n}\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nIn the Ancient Kingdom of Snuke, there was a pyramid to strengthen the authority of Takahashi, the president of AtCoder Inc.\n\nThe pyramid had center coordinates (C_X, C_Y) and height H. The altitude of coordinates (X, Y) is max(H - |X - C_X| - |Y - C_Y|, 0).\n\nAoki, an explorer, conducted a survey to identify the center coordinates and height of this pyramid. As a result, he obtained the following information:\n\nC_X, C_Y was integers between 0 and 100 (inclusive), and H was an integer not less than 1.\n\nAdditionally, he obtained N pieces of information. The i-th of them is: \"the altitude of point (x_i, y_i) is h_i.\"\n\nThis was enough to identify the center coordinates and the height of the pyramid. Find these values with the clues above.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\nx_i and y_i are integers between 0 and 100 (inclusive).\n\nh_i is an integer between 0 and 10^9 (inclusive).\n\nThe N coordinates (x_1, y_1), (x_2, y_2), (x_3, y_3), ..., (x_N, y_N) are all different.\n\nThe center coordinates and the height of the pyramid can be uniquely identified.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1 h_1\nx_2 y_2 h_2\nx_3 y_3 h_3\n:\nx_N y_N h_N\n\nOutput\n\nPrint values C_X, C_Y and H representing the center coordinates and the height of the pyramid in one line, with spaces in between.\n\nSample Input 1\n\n4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n\nSample Output 1\n\n2 2 6\n\nIn this case, the center coordinates and the height can be identified as (2, 2) and 6.\n\nSample Input 2\n\n2\n0 0 100\n1 1 98\n\nSample Output 2\n\n0 0 100\n\nIn this case, the center coordinates and the height can be identified as (0, 0) and 100.\n\nNote that C_X and C_Y are known to be integers between 0 and 100.\n\nSample Input 3\n\n3\n99 1 191\n100 1 192\n99 0 192\n\nSample Output 3\n\n100 0 193\n\nIn this case, the center coordinates and the height can be identified as (100, 0) and 193.", "sample_input": "4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n"}, "reference_outputs": ["2 2 6\n"], "source_document_id": "p03240", "source_text": "Score: 300 points\n\nProblem Statement\n\nIn the Ancient Kingdom of Snuke, there was a pyramid to strengthen the authority of Takahashi, the president of AtCoder Inc.\n\nThe pyramid had center coordinates (C_X, C_Y) and height H. The altitude of coordinates (X, Y) is max(H - |X - C_X| - |Y - C_Y|, 0).\n\nAoki, an explorer, conducted a survey to identify the center coordinates and height of this pyramid. As a result, he obtained the following information:\n\nC_X, C_Y was integers between 0 and 100 (inclusive), and H was an integer not less than 1.\n\nAdditionally, he obtained N pieces of information. The i-th of them is: \"the altitude of point (x_i, y_i) is h_i.\"\n\nThis was enough to identify the center coordinates and the height of the pyramid. Find these values with the clues above.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\nx_i and y_i are integers between 0 and 100 (inclusive).\n\nh_i is an integer between 0 and 10^9 (inclusive).\n\nThe N coordinates (x_1, y_1), (x_2, y_2), (x_3, y_3), ..., (x_N, y_N) are all different.\n\nThe center coordinates and the height of the pyramid can be uniquely identified.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1 h_1\nx_2 y_2 h_2\nx_3 y_3 h_3\n:\nx_N y_N h_N\n\nOutput\n\nPrint values C_X, C_Y and H representing the center coordinates and the height of the pyramid in one line, with spaces in between.\n\nSample Input 1\n\n4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n\nSample Output 1\n\n2 2 6\n\nIn this case, the center coordinates and the height can be identified as (2, 2) and 6.\n\nSample Input 2\n\n2\n0 0 100\n1 1 98\n\nSample Output 2\n\n0 0 100\n\nIn this case, the center coordinates and the height can be identified as (0, 0) and 100.\n\nNote that C_X and C_Y are known to be integers between 0 and 100.\n\nSample Input 3\n\n3\n99 1 191\n100 1 192\n99 0 192\n\nSample Output 3\n\n100 0 193\n\nIn this case, the center coordinates and the height can be identified as (100, 0) and 193.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1221, "cpu_time_ms": 3, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s847003452", "group_id": "codeNet:p03240", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.ParseInt(sc.Text(), 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn int(i)\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tn := nextInt()\n\n\txl := make([]int, n, n)\n\tyl := make([]int, n, n)\n\thl := make([]int, n, n)\n\tfor i := 0; i < n; i++ {\n\t\txl[i] = nextInt()\n\t\tyl[i] = nextInt()\n\t\thl[i] = nextInt()\n\t}\n\n\tmax := 100\n\tfor x := 0; x <= max; x++ {\n\t\tfor y := 0; y <= max; y++ {\n\t\t\tneedH := -1\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\tdist := hl[i] + int(math.Abs(float64(x-xl[i]))) + int(math.Abs(float64(y-yl[i])))\n\t\t\t\tif needH == -1 {\n\t\t\t\t\tneedH = dist\n\t\t\t\t} else {\n\t\t\t\t\tif dist != needH {\n\t\t\t\t\t\tneedH = -2\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif needH == -2 {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\tif hl[i] == 0 {\n\t\t\t\t\tdist := int(math.Abs(float64(x-xl[i]))) + int(math.Abs(float64(y-yl[i])))\n\t\t\t\t\tif dist != needH {\n\t\t\t\t\t\tneedH = -2\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif needH == -2 {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tfmt.Printf(\"%v %v %v\\n\", x, y, needH)\n\t\t\treturn\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1562527911, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03240.html", "problem_id": "p03240", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03240/input.txt", "sample_output_relpath": "derived/input_output/data/p03240/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03240/Go/s847003452.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s847003452", "user_id": "u317845566"}, "prompt_components": {"gold_output": "2 2 6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.ParseInt(sc.Text(), 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn int(i)\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tn := nextInt()\n\n\txl := make([]int, n, n)\n\tyl := make([]int, n, n)\n\thl := make([]int, n, n)\n\tfor i := 0; i < n; i++ {\n\t\txl[i] = nextInt()\n\t\tyl[i] = nextInt()\n\t\thl[i] = nextInt()\n\t}\n\n\tmax := 100\n\tfor x := 0; x <= max; x++ {\n\t\tfor y := 0; y <= max; y++ {\n\t\t\tneedH := -1\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\tdist := hl[i] + int(math.Abs(float64(x-xl[i]))) + int(math.Abs(float64(y-yl[i])))\n\t\t\t\tif needH == -1 {\n\t\t\t\t\tneedH = dist\n\t\t\t\t} else {\n\t\t\t\t\tif dist != needH {\n\t\t\t\t\t\tneedH = -2\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif needH == -2 {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\tif hl[i] == 0 {\n\t\t\t\t\tdist := int(math.Abs(float64(x-xl[i]))) + int(math.Abs(float64(y-yl[i])))\n\t\t\t\t\tif dist != needH {\n\t\t\t\t\t\tneedH = -2\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif needH == -2 {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tfmt.Printf(\"%v %v %v\\n\", x, y, needH)\n\t\t\treturn\n\t\t}\n\t}\n}\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nIn the Ancient Kingdom of Snuke, there was a pyramid to strengthen the authority of Takahashi, the president of AtCoder Inc.\n\nThe pyramid had center coordinates (C_X, C_Y) and height H. The altitude of coordinates (X, Y) is max(H - |X - C_X| - |Y - C_Y|, 0).\n\nAoki, an explorer, conducted a survey to identify the center coordinates and height of this pyramid. As a result, he obtained the following information:\n\nC_X, C_Y was integers between 0 and 100 (inclusive), and H was an integer not less than 1.\n\nAdditionally, he obtained N pieces of information. The i-th of them is: \"the altitude of point (x_i, y_i) is h_i.\"\n\nThis was enough to identify the center coordinates and the height of the pyramid. Find these values with the clues above.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\nx_i and y_i are integers between 0 and 100 (inclusive).\n\nh_i is an integer between 0 and 10^9 (inclusive).\n\nThe N coordinates (x_1, y_1), (x_2, y_2), (x_3, y_3), ..., (x_N, y_N) are all different.\n\nThe center coordinates and the height of the pyramid can be uniquely identified.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1 h_1\nx_2 y_2 h_2\nx_3 y_3 h_3\n:\nx_N y_N h_N\n\nOutput\n\nPrint values C_X, C_Y and H representing the center coordinates and the height of the pyramid in one line, with spaces in between.\n\nSample Input 1\n\n4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n\nSample Output 1\n\n2 2 6\n\nIn this case, the center coordinates and the height can be identified as (2, 2) and 6.\n\nSample Input 2\n\n2\n0 0 100\n1 1 98\n\nSample Output 2\n\n0 0 100\n\nIn this case, the center coordinates and the height can be identified as (0, 0) and 100.\n\nNote that C_X and C_Y are known to be integers between 0 and 100.\n\nSample Input 3\n\n3\n99 1 191\n100 1 192\n99 0 192\n\nSample Output 3\n\n100 0 193\n\nIn this case, the center coordinates and the height can be identified as (100, 0) and 193.", "sample_input": "4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n"}, "reference_outputs": ["2 2 6\n"], "source_document_id": "p03240", "source_text": "Score: 300 points\n\nProblem Statement\n\nIn the Ancient Kingdom of Snuke, there was a pyramid to strengthen the authority of Takahashi, the president of AtCoder Inc.\n\nThe pyramid had center coordinates (C_X, C_Y) and height H. The altitude of coordinates (X, Y) is max(H - |X - C_X| - |Y - C_Y|, 0).\n\nAoki, an explorer, conducted a survey to identify the center coordinates and height of this pyramid. As a result, he obtained the following information:\n\nC_X, C_Y was integers between 0 and 100 (inclusive), and H was an integer not less than 1.\n\nAdditionally, he obtained N pieces of information. The i-th of them is: \"the altitude of point (x_i, y_i) is h_i.\"\n\nThis was enough to identify the center coordinates and the height of the pyramid. Find these values with the clues above.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\nx_i and y_i are integers between 0 and 100 (inclusive).\n\nh_i is an integer between 0 and 10^9 (inclusive).\n\nThe N coordinates (x_1, y_1), (x_2, y_2), (x_3, y_3), ..., (x_N, y_N) are all different.\n\nThe center coordinates and the height of the pyramid can be uniquely identified.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1 h_1\nx_2 y_2 h_2\nx_3 y_3 h_3\n:\nx_N y_N h_N\n\nOutput\n\nPrint values C_X, C_Y and H representing the center coordinates and the height of the pyramid in one line, with spaces in between.\n\nSample Input 1\n\n4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n\nSample Output 1\n\n2 2 6\n\nIn this case, the center coordinates and the height can be identified as (2, 2) and 6.\n\nSample Input 2\n\n2\n0 0 100\n1 1 98\n\nSample Output 2\n\n0 0 100\n\nIn this case, the center coordinates and the height can be identified as (0, 0) and 100.\n\nNote that C_X and C_Y are known to be integers between 0 and 100.\n\nSample Input 3\n\n3\n99 1 191\n100 1 192\n99 0 192\n\nSample Output 3\n\n100 0 193\n\nIn this case, the center coordinates and the height can be identified as (100, 0) and 193.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1186, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s337960160", "group_id": "codeNet:p03240", "input_text": "package main\n\nimport \"fmt\"\n\ntype point struct {\n\tx int\n\ty int\n\th int\n}\n\nfunc abs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\treturn n\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxph(ps []point) int {\n\tans := ps[0].h\n\tfor _, p := range ps {\n\t\tif p.h > ans {\n\t\t\tans = p.h\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tps := make([]point, n)\n\tfor i := range ps {\n\t\tfmt.Scan(&ps[i].x, &ps[i].y, &ps[i].h)\n\t}\n\n\tfor ch := maxph(ps); ; ch++ {\n\t\tfor cx := 0; cx <= 100; cx++ {\n\t\tL:\n\t\t\tfor cy := 0; cy <= 100; cy++ {\n\t\t\t\tfor _, p := range ps {\n\t\t\t\t\tif p.h != max(ch-abs(p.x-cx)-abs(p.y-cy), 0) {\n\t\t\t\t\t\tcontinue L\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfmt.Println(cx, cy, ch)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1560955768, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03240.html", "problem_id": "p03240", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03240/input.txt", "sample_output_relpath": "derived/input_output/data/p03240/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03240/Go/s337960160.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s337960160", "user_id": "u102310764"}, "prompt_components": {"gold_output": "2 2 6\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\ntype point struct {\n\tx int\n\ty int\n\th int\n}\n\nfunc abs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\treturn n\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc maxph(ps []point) int {\n\tans := ps[0].h\n\tfor _, p := range ps {\n\t\tif p.h > ans {\n\t\t\tans = p.h\n\t\t}\n\t}\n\treturn ans\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\tps := make([]point, n)\n\tfor i := range ps {\n\t\tfmt.Scan(&ps[i].x, &ps[i].y, &ps[i].h)\n\t}\n\n\tfor ch := maxph(ps); ; ch++ {\n\t\tfor cx := 0; cx <= 100; cx++ {\n\t\tL:\n\t\t\tfor cy := 0; cy <= 100; cy++ {\n\t\t\t\tfor _, p := range ps {\n\t\t\t\t\tif p.h != max(ch-abs(p.x-cx)-abs(p.y-cy), 0) {\n\t\t\t\t\t\tcontinue L\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfmt.Println(cx, cy, ch)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nIn the Ancient Kingdom of Snuke, there was a pyramid to strengthen the authority of Takahashi, the president of AtCoder Inc.\n\nThe pyramid had center coordinates (C_X, C_Y) and height H. The altitude of coordinates (X, Y) is max(H - |X - C_X| - |Y - C_Y|, 0).\n\nAoki, an explorer, conducted a survey to identify the center coordinates and height of this pyramid. As a result, he obtained the following information:\n\nC_X, C_Y was integers between 0 and 100 (inclusive), and H was an integer not less than 1.\n\nAdditionally, he obtained N pieces of information. The i-th of them is: \"the altitude of point (x_i, y_i) is h_i.\"\n\nThis was enough to identify the center coordinates and the height of the pyramid. Find these values with the clues above.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\nx_i and y_i are integers between 0 and 100 (inclusive).\n\nh_i is an integer between 0 and 10^9 (inclusive).\n\nThe N coordinates (x_1, y_1), (x_2, y_2), (x_3, y_3), ..., (x_N, y_N) are all different.\n\nThe center coordinates and the height of the pyramid can be uniquely identified.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1 h_1\nx_2 y_2 h_2\nx_3 y_3 h_3\n:\nx_N y_N h_N\n\nOutput\n\nPrint values C_X, C_Y and H representing the center coordinates and the height of the pyramid in one line, with spaces in between.\n\nSample Input 1\n\n4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n\nSample Output 1\n\n2 2 6\n\nIn this case, the center coordinates and the height can be identified as (2, 2) and 6.\n\nSample Input 2\n\n2\n0 0 100\n1 1 98\n\nSample Output 2\n\n0 0 100\n\nIn this case, the center coordinates and the height can be identified as (0, 0) and 100.\n\nNote that C_X and C_Y are known to be integers between 0 and 100.\n\nSample Input 3\n\n3\n99 1 191\n100 1 192\n99 0 192\n\nSample Output 3\n\n100 0 193\n\nIn this case, the center coordinates and the height can be identified as (100, 0) and 193.", "sample_input": "4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n"}, "reference_outputs": ["2 2 6\n"], "source_document_id": "p03240", "source_text": "Score: 300 points\n\nProblem Statement\n\nIn the Ancient Kingdom of Snuke, there was a pyramid to strengthen the authority of Takahashi, the president of AtCoder Inc.\n\nThe pyramid had center coordinates (C_X, C_Y) and height H. The altitude of coordinates (X, Y) is max(H - |X - C_X| - |Y - C_Y|, 0).\n\nAoki, an explorer, conducted a survey to identify the center coordinates and height of this pyramid. As a result, he obtained the following information:\n\nC_X, C_Y was integers between 0 and 100 (inclusive), and H was an integer not less than 1.\n\nAdditionally, he obtained N pieces of information. The i-th of them is: \"the altitude of point (x_i, y_i) is h_i.\"\n\nThis was enough to identify the center coordinates and the height of the pyramid. Find these values with the clues above.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\nx_i and y_i are integers between 0 and 100 (inclusive).\n\nh_i is an integer between 0 and 10^9 (inclusive).\n\nThe N coordinates (x_1, y_1), (x_2, y_2), (x_3, y_3), ..., (x_N, y_N) are all different.\n\nThe center coordinates and the height of the pyramid can be uniquely identified.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1 h_1\nx_2 y_2 h_2\nx_3 y_3 h_3\n:\nx_N y_N h_N\n\nOutput\n\nPrint values C_X, C_Y and H representing the center coordinates and the height of the pyramid in one line, with spaces in between.\n\nSample Input 1\n\n4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n\nSample Output 1\n\n2 2 6\n\nIn this case, the center coordinates and the height can be identified as (2, 2) and 6.\n\nSample Input 2\n\n2\n0 0 100\n1 1 98\n\nSample Output 2\n\n0 0 100\n\nIn this case, the center coordinates and the height can be identified as (0, 0) and 100.\n\nNote that C_X and C_Y are known to be integers between 0 and 100.\n\nSample Input 3\n\n3\n99 1 191\n100 1 192\n99 0 192\n\nSample Output 3\n\n100 0 193\n\nIn this case, the center coordinates and the height can be identified as (100, 0) and 193.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 713, "cpu_time_ms": 4, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s399867892", "group_id": "codeNet:p03240", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\txl := make([]int, n)\n\tyl := make([]int, n)\n\thl := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d %d %d\", &xl[i], &yl[i], &hl[i])\n\t}\n\n\tfor x := 0; x <= 100; x++ {\n\t\tfor y := 0; y <= 100; y++ {\n\t\t\th := 0\n\t\t\tfor i := 0; ; i++ {\n\t\t\t\tif hl[i] > 0 {\n\t\t\t\t\th = hl[i] + abs(xl[i]-x) + abs(yl[i]-y)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\tif hl[i] != max(h-abs(xl[i]-x)-abs(yl[i]-y), 0) {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif i == n-1 {\n\t\t\t\t\tfmt.Println(x, y, h)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\n\nfunc max(x, y int) int {\n\tif x < y {\n\t\treturn y\n\t}\n\treturn x\n}\n", "language": "Go", "metadata": {"date": 1558746357, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03240.html", "problem_id": "p03240", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03240/input.txt", "sample_output_relpath": "derived/input_output/data/p03240/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03240/Go/s399867892.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s399867892", "user_id": "u889640107"}, "prompt_components": {"gold_output": "2 2 6\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\txl := make([]int, n)\n\tyl := make([]int, n)\n\thl := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d %d %d\", &xl[i], &yl[i], &hl[i])\n\t}\n\n\tfor x := 0; x <= 100; x++ {\n\t\tfor y := 0; y <= 100; y++ {\n\t\t\th := 0\n\t\t\tfor i := 0; ; i++ {\n\t\t\t\tif hl[i] > 0 {\n\t\t\t\t\th = hl[i] + abs(xl[i]-x) + abs(yl[i]-y)\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor i := 0; i < n; i++ {\n\t\t\t\tif hl[i] != max(h-abs(xl[i]-x)-abs(yl[i]-y), 0) {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif i == n-1 {\n\t\t\t\t\tfmt.Println(x, y, h)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\n\nfunc max(x, y int) int {\n\tif x < y {\n\t\treturn y\n\t}\n\treturn x\n}\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nIn the Ancient Kingdom of Snuke, there was a pyramid to strengthen the authority of Takahashi, the president of AtCoder Inc.\n\nThe pyramid had center coordinates (C_X, C_Y) and height H. The altitude of coordinates (X, Y) is max(H - |X - C_X| - |Y - C_Y|, 0).\n\nAoki, an explorer, conducted a survey to identify the center coordinates and height of this pyramid. As a result, he obtained the following information:\n\nC_X, C_Y was integers between 0 and 100 (inclusive), and H was an integer not less than 1.\n\nAdditionally, he obtained N pieces of information. The i-th of them is: \"the altitude of point (x_i, y_i) is h_i.\"\n\nThis was enough to identify the center coordinates and the height of the pyramid. Find these values with the clues above.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\nx_i and y_i are integers between 0 and 100 (inclusive).\n\nh_i is an integer between 0 and 10^9 (inclusive).\n\nThe N coordinates (x_1, y_1), (x_2, y_2), (x_3, y_3), ..., (x_N, y_N) are all different.\n\nThe center coordinates and the height of the pyramid can be uniquely identified.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1 h_1\nx_2 y_2 h_2\nx_3 y_3 h_3\n:\nx_N y_N h_N\n\nOutput\n\nPrint values C_X, C_Y and H representing the center coordinates and the height of the pyramid in one line, with spaces in between.\n\nSample Input 1\n\n4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n\nSample Output 1\n\n2 2 6\n\nIn this case, the center coordinates and the height can be identified as (2, 2) and 6.\n\nSample Input 2\n\n2\n0 0 100\n1 1 98\n\nSample Output 2\n\n0 0 100\n\nIn this case, the center coordinates and the height can be identified as (0, 0) and 100.\n\nNote that C_X and C_Y are known to be integers between 0 and 100.\n\nSample Input 3\n\n3\n99 1 191\n100 1 192\n99 0 192\n\nSample Output 3\n\n100 0 193\n\nIn this case, the center coordinates and the height can be identified as (100, 0) and 193.", "sample_input": "4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n"}, "reference_outputs": ["2 2 6\n"], "source_document_id": "p03240", "source_text": "Score: 300 points\n\nProblem Statement\n\nIn the Ancient Kingdom of Snuke, there was a pyramid to strengthen the authority of Takahashi, the president of AtCoder Inc.\n\nThe pyramid had center coordinates (C_X, C_Y) and height H. The altitude of coordinates (X, Y) is max(H - |X - C_X| - |Y - C_Y|, 0).\n\nAoki, an explorer, conducted a survey to identify the center coordinates and height of this pyramid. As a result, he obtained the following information:\n\nC_X, C_Y was integers between 0 and 100 (inclusive), and H was an integer not less than 1.\n\nAdditionally, he obtained N pieces of information. The i-th of them is: \"the altitude of point (x_i, y_i) is h_i.\"\n\nThis was enough to identify the center coordinates and the height of the pyramid. Find these values with the clues above.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\nx_i and y_i are integers between 0 and 100 (inclusive).\n\nh_i is an integer between 0 and 10^9 (inclusive).\n\nThe N coordinates (x_1, y_1), (x_2, y_2), (x_3, y_3), ..., (x_N, y_N) are all different.\n\nThe center coordinates and the height of the pyramid can be uniquely identified.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1 h_1\nx_2 y_2 h_2\nx_3 y_3 h_3\n:\nx_N y_N h_N\n\nOutput\n\nPrint values C_X, C_Y and H representing the center coordinates and the height of the pyramid in one line, with spaces in between.\n\nSample Input 1\n\n4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n\nSample Output 1\n\n2 2 6\n\nIn this case, the center coordinates and the height can be identified as (2, 2) and 6.\n\nSample Input 2\n\n2\n0 0 100\n1 1 98\n\nSample Output 2\n\n0 0 100\n\nIn this case, the center coordinates and the height can be identified as (0, 0) and 100.\n\nNote that C_X and C_Y are known to be integers between 0 and 100.\n\nSample Input 3\n\n3\n99 1 191\n100 1 192\n99 0 192\n\nSample Output 3\n\n100 0 193\n\nIn this case, the center coordinates and the height can be identified as (100, 0) and 193.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 687, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s088457197", "group_id": "codeNet:p03240", "input_text": "package main\n\nimport \"fmt\"\n\nvar xl, yl, hl []int\n\nfunc main() {\n\tvar n, xi, yi, hi int\n\tfmt.Scan(&n)\n\txl = make([]int, n)\n\tyl = make([]int, n)\n\thl = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d %d %d\", &xi, &yi, &hi)\n\t\txl[i] = xi\n\t\tyl[i] = yi\n\t\thl[i] = hi\n\t}\n\n\tfor x := 0; x <= 100; x++ {\n\t\tfor y := 0; y <= 100; y++ {\n\t\t\th := 0\n\t\t\tfor i := 0; ; i++ {\n\t\t\t\th = calcH(x, y, i)\n\t\t\t\tif h > 0 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor i := 1; i < n; i++ {\n\t\t\t\tif h != calcH(x, y, i) {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif i == n-1 {\n\t\t\t\t\tfmt.Println(x, y, h)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\n\nfunc calcH(x, y, i int) int {\n\treturn hl[i] + abs(x-xl[i]) + abs(y-yl[i])\n}\n", "language": "Go", "metadata": {"date": 1558744557, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03240.html", "problem_id": "p03240", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03240/input.txt", "sample_output_relpath": "derived/input_output/data/p03240/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03240/Go/s088457197.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s088457197", "user_id": "u889640107"}, "prompt_components": {"gold_output": "2 2 6\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nvar xl, yl, hl []int\n\nfunc main() {\n\tvar n, xi, yi, hi int\n\tfmt.Scan(&n)\n\txl = make([]int, n)\n\tyl = make([]int, n)\n\thl = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scanf(\"%d %d %d\", &xi, &yi, &hi)\n\t\txl[i] = xi\n\t\tyl[i] = yi\n\t\thl[i] = hi\n\t}\n\n\tfor x := 0; x <= 100; x++ {\n\t\tfor y := 0; y <= 100; y++ {\n\t\t\th := 0\n\t\t\tfor i := 0; ; i++ {\n\t\t\t\th = calcH(x, y, i)\n\t\t\t\tif h > 0 {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor i := 1; i < n; i++ {\n\t\t\t\tif h != calcH(x, y, i) {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif i == n-1 {\n\t\t\t\t\tfmt.Println(x, y, h)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\tx = -x\n\t}\n\treturn x\n}\n\nfunc calcH(x, y, i int) int {\n\treturn hl[i] + abs(x-xl[i]) + abs(y-yl[i])\n}\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nIn the Ancient Kingdom of Snuke, there was a pyramid to strengthen the authority of Takahashi, the president of AtCoder Inc.\n\nThe pyramid had center coordinates (C_X, C_Y) and height H. The altitude of coordinates (X, Y) is max(H - |X - C_X| - |Y - C_Y|, 0).\n\nAoki, an explorer, conducted a survey to identify the center coordinates and height of this pyramid. As a result, he obtained the following information:\n\nC_X, C_Y was integers between 0 and 100 (inclusive), and H was an integer not less than 1.\n\nAdditionally, he obtained N pieces of information. The i-th of them is: \"the altitude of point (x_i, y_i) is h_i.\"\n\nThis was enough to identify the center coordinates and the height of the pyramid. Find these values with the clues above.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\nx_i and y_i are integers between 0 and 100 (inclusive).\n\nh_i is an integer between 0 and 10^9 (inclusive).\n\nThe N coordinates (x_1, y_1), (x_2, y_2), (x_3, y_3), ..., (x_N, y_N) are all different.\n\nThe center coordinates and the height of the pyramid can be uniquely identified.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1 h_1\nx_2 y_2 h_2\nx_3 y_3 h_3\n:\nx_N y_N h_N\n\nOutput\n\nPrint values C_X, C_Y and H representing the center coordinates and the height of the pyramid in one line, with spaces in between.\n\nSample Input 1\n\n4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n\nSample Output 1\n\n2 2 6\n\nIn this case, the center coordinates and the height can be identified as (2, 2) and 6.\n\nSample Input 2\n\n2\n0 0 100\n1 1 98\n\nSample Output 2\n\n0 0 100\n\nIn this case, the center coordinates and the height can be identified as (0, 0) and 100.\n\nNote that C_X and C_Y are known to be integers between 0 and 100.\n\nSample Input 3\n\n3\n99 1 191\n100 1 192\n99 0 192\n\nSample Output 3\n\n100 0 193\n\nIn this case, the center coordinates and the height can be identified as (100, 0) and 193.", "sample_input": "4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n"}, "reference_outputs": ["2 2 6\n"], "source_document_id": "p03240", "source_text": "Score: 300 points\n\nProblem Statement\n\nIn the Ancient Kingdom of Snuke, there was a pyramid to strengthen the authority of Takahashi, the president of AtCoder Inc.\n\nThe pyramid had center coordinates (C_X, C_Y) and height H. The altitude of coordinates (X, Y) is max(H - |X - C_X| - |Y - C_Y|, 0).\n\nAoki, an explorer, conducted a survey to identify the center coordinates and height of this pyramid. As a result, he obtained the following information:\n\nC_X, C_Y was integers between 0 and 100 (inclusive), and H was an integer not less than 1.\n\nAdditionally, he obtained N pieces of information. The i-th of them is: \"the altitude of point (x_i, y_i) is h_i.\"\n\nThis was enough to identify the center coordinates and the height of the pyramid. Find these values with the clues above.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\nx_i and y_i are integers between 0 and 100 (inclusive).\n\nh_i is an integer between 0 and 10^9 (inclusive).\n\nThe N coordinates (x_1, y_1), (x_2, y_2), (x_3, y_3), ..., (x_N, y_N) are all different.\n\nThe center coordinates and the height of the pyramid can be uniquely identified.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1 h_1\nx_2 y_2 h_2\nx_3 y_3 h_3\n:\nx_N y_N h_N\n\nOutput\n\nPrint values C_X, C_Y and H representing the center coordinates and the height of the pyramid in one line, with spaces in between.\n\nSample Input 1\n\n4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n\nSample Output 1\n\n2 2 6\n\nIn this case, the center coordinates and the height can be identified as (2, 2) and 6.\n\nSample Input 2\n\n2\n0 0 100\n1 1 98\n\nSample Output 2\n\n0 0 100\n\nIn this case, the center coordinates and the height can be identified as (0, 0) and 100.\n\nNote that C_X and C_Y are known to be integers between 0 and 100.\n\nSample Input 3\n\n3\n99 1 191\n100 1 192\n99 0 192\n\nSample Output 3\n\n100 0 193\n\nIn this case, the center coordinates and the height can be identified as (100, 0) and 193.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 710, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s351591451", "group_id": "codeNet:p03240", "input_text": "package main\n\nimport \"fmt\"\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\txs, ys, hs := make([]int, n), make([]int, n), make([]int, n)\n\tfor i := range xs {\n\t\tfmt.Scan(&xs[i], &ys[i], &hs[i])\n\t}\n\n\tfor i := 0; i <= 100; i++ {\n\t\tfor j := 0; j <= 100; j++ {\n\t\t\tvar H int\n\t\t\tfor k := range xs {\n\t\t\t\tif hs[k] > 0 {\n\t\t\t\t\tH = hs[k] + abs(i-xs[k]) + abs(j-ys[k])\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor k := range xs {\n\t\t\t\tif newH := max(H-abs(i-xs[k])-abs(j-ys[k]), 0); hs[k] != newH {\n\t\t\t\t\tbreak\n\t\t\t\t} else if k == len(xs)-1 {\n\t\t\t\t\tfmt.Println(i, j, H)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1557621723, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03240.html", "problem_id": "p03240", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03240/input.txt", "sample_output_relpath": "derived/input_output/data/p03240/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03240/Go/s351591451.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s351591451", "user_id": "u461993794"}, "prompt_components": {"gold_output": "2 2 6\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\txs, ys, hs := make([]int, n), make([]int, n), make([]int, n)\n\tfor i := range xs {\n\t\tfmt.Scan(&xs[i], &ys[i], &hs[i])\n\t}\n\n\tfor i := 0; i <= 100; i++ {\n\t\tfor j := 0; j <= 100; j++ {\n\t\t\tvar H int\n\t\t\tfor k := range xs {\n\t\t\t\tif hs[k] > 0 {\n\t\t\t\t\tH = hs[k] + abs(i-xs[k]) + abs(j-ys[k])\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor k := range xs {\n\t\t\t\tif newH := max(H-abs(i-xs[k])-abs(j-ys[k]), 0); hs[k] != newH {\n\t\t\t\t\tbreak\n\t\t\t\t} else if k == len(xs)-1 {\n\t\t\t\t\tfmt.Println(i, j, H)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nIn the Ancient Kingdom of Snuke, there was a pyramid to strengthen the authority of Takahashi, the president of AtCoder Inc.\n\nThe pyramid had center coordinates (C_X, C_Y) and height H. The altitude of coordinates (X, Y) is max(H - |X - C_X| - |Y - C_Y|, 0).\n\nAoki, an explorer, conducted a survey to identify the center coordinates and height of this pyramid. As a result, he obtained the following information:\n\nC_X, C_Y was integers between 0 and 100 (inclusive), and H was an integer not less than 1.\n\nAdditionally, he obtained N pieces of information. The i-th of them is: \"the altitude of point (x_i, y_i) is h_i.\"\n\nThis was enough to identify the center coordinates and the height of the pyramid. Find these values with the clues above.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\nx_i and y_i are integers between 0 and 100 (inclusive).\n\nh_i is an integer between 0 and 10^9 (inclusive).\n\nThe N coordinates (x_1, y_1), (x_2, y_2), (x_3, y_3), ..., (x_N, y_N) are all different.\n\nThe center coordinates and the height of the pyramid can be uniquely identified.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1 h_1\nx_2 y_2 h_2\nx_3 y_3 h_3\n:\nx_N y_N h_N\n\nOutput\n\nPrint values C_X, C_Y and H representing the center coordinates and the height of the pyramid in one line, with spaces in between.\n\nSample Input 1\n\n4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n\nSample Output 1\n\n2 2 6\n\nIn this case, the center coordinates and the height can be identified as (2, 2) and 6.\n\nSample Input 2\n\n2\n0 0 100\n1 1 98\n\nSample Output 2\n\n0 0 100\n\nIn this case, the center coordinates and the height can be identified as (0, 0) and 100.\n\nNote that C_X and C_Y are known to be integers between 0 and 100.\n\nSample Input 3\n\n3\n99 1 191\n100 1 192\n99 0 192\n\nSample Output 3\n\n100 0 193\n\nIn this case, the center coordinates and the height can be identified as (100, 0) and 193.", "sample_input": "4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n"}, "reference_outputs": ["2 2 6\n"], "source_document_id": "p03240", "source_text": "Score: 300 points\n\nProblem Statement\n\nIn the Ancient Kingdom of Snuke, there was a pyramid to strengthen the authority of Takahashi, the president of AtCoder Inc.\n\nThe pyramid had center coordinates (C_X, C_Y) and height H. The altitude of coordinates (X, Y) is max(H - |X - C_X| - |Y - C_Y|, 0).\n\nAoki, an explorer, conducted a survey to identify the center coordinates and height of this pyramid. As a result, he obtained the following information:\n\nC_X, C_Y was integers between 0 and 100 (inclusive), and H was an integer not less than 1.\n\nAdditionally, he obtained N pieces of information. The i-th of them is: \"the altitude of point (x_i, y_i) is h_i.\"\n\nThis was enough to identify the center coordinates and the height of the pyramid. Find these values with the clues above.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\nx_i and y_i are integers between 0 and 100 (inclusive).\n\nh_i is an integer between 0 and 10^9 (inclusive).\n\nThe N coordinates (x_1, y_1), (x_2, y_2), (x_3, y_3), ..., (x_N, y_N) are all different.\n\nThe center coordinates and the height of the pyramid can be uniquely identified.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1 h_1\nx_2 y_2 h_2\nx_3 y_3 h_3\n:\nx_N y_N h_N\n\nOutput\n\nPrint values C_X, C_Y and H representing the center coordinates and the height of the pyramid in one line, with spaces in between.\n\nSample Input 1\n\n4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n\nSample Output 1\n\n2 2 6\n\nIn this case, the center coordinates and the height can be identified as (2, 2) and 6.\n\nSample Input 2\n\n2\n0 0 100\n1 1 98\n\nSample Output 2\n\n0 0 100\n\nIn this case, the center coordinates and the height can be identified as (0, 0) and 100.\n\nNote that C_X and C_Y are known to be integers between 0 and 100.\n\nSample Input 3\n\n3\n99 1 191\n100 1 192\n99 0 192\n\nSample Output 3\n\n100 0 193\n\nIn this case, the center coordinates and the height can be identified as (100, 0) and 193.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 687, "cpu_time_ms": 3, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s789216463", "group_id": "codeNet:p03240", "input_text": "// Package main provides\n//\n// File: c.go\n// Author: ymiyamoto\n//\n// Created on Wed Dec 19 22:03:02 2018\n//\npackage main\n\nimport \"fmt\"\n\ntype point struct {\n\tx, y, h int\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\n\treturn a\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\n\tarr := make([]point, N)\n\tfor i := range arr {\n\t\tfmt.Scan(&arr[i].x, &arr[i].y, &arr[i].h)\n\t}\n\n\tfor x := 0; x <= 100; x++ {\n\t\tfor y := 0; y <= 100; y++ {\n\t\t\tvalid := true\n\t\t\th := arr[0].h + abs(arr[0].x-x) + abs(arr[0].y-y)\n\t\t\tfor _, p := range arr {\n\t\t\t\tif max(h-abs(x-p.x)-abs(y-p.y), 0) != p.h {\n\t\t\t\t\tvalid = false\n\t\t\t\t}\n\t\t\t}\n\t\t\tif valid {\n\t\t\t\tfmt.Println(x, y, h)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1545275421, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03240.html", "problem_id": "p03240", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03240/input.txt", "sample_output_relpath": "derived/input_output/data/p03240/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03240/Go/s789216463.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s789216463", "user_id": "u802614675"}, "prompt_components": {"gold_output": "2 2 6\n", "input_to_evaluate": "// Package main provides\n//\n// File: c.go\n// Author: ymiyamoto\n//\n// Created on Wed Dec 19 22:03:02 2018\n//\npackage main\n\nimport \"fmt\"\n\ntype point struct {\n\tx, y, h int\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\n\treturn a\n}\n\nfunc max(a, b int) int {\n\tif a < b {\n\t\treturn b\n\t}\n\treturn a\n}\n\nfunc main() {\n\tvar N int\n\tfmt.Scan(&N)\n\n\tarr := make([]point, N)\n\tfor i := range arr {\n\t\tfmt.Scan(&arr[i].x, &arr[i].y, &arr[i].h)\n\t}\n\n\tfor x := 0; x <= 100; x++ {\n\t\tfor y := 0; y <= 100; y++ {\n\t\t\tvalid := true\n\t\t\th := arr[0].h + abs(arr[0].x-x) + abs(arr[0].y-y)\n\t\t\tfor _, p := range arr {\n\t\t\t\tif max(h-abs(x-p.x)-abs(y-p.y), 0) != p.h {\n\t\t\t\t\tvalid = false\n\t\t\t\t}\n\t\t\t}\n\t\t\tif valid {\n\t\t\t\tfmt.Println(x, y, h)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nIn the Ancient Kingdom of Snuke, there was a pyramid to strengthen the authority of Takahashi, the president of AtCoder Inc.\n\nThe pyramid had center coordinates (C_X, C_Y) and height H. The altitude of coordinates (X, Y) is max(H - |X - C_X| - |Y - C_Y|, 0).\n\nAoki, an explorer, conducted a survey to identify the center coordinates and height of this pyramid. As a result, he obtained the following information:\n\nC_X, C_Y was integers between 0 and 100 (inclusive), and H was an integer not less than 1.\n\nAdditionally, he obtained N pieces of information. The i-th of them is: \"the altitude of point (x_i, y_i) is h_i.\"\n\nThis was enough to identify the center coordinates and the height of the pyramid. Find these values with the clues above.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\nx_i and y_i are integers between 0 and 100 (inclusive).\n\nh_i is an integer between 0 and 10^9 (inclusive).\n\nThe N coordinates (x_1, y_1), (x_2, y_2), (x_3, y_3), ..., (x_N, y_N) are all different.\n\nThe center coordinates and the height of the pyramid can be uniquely identified.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1 h_1\nx_2 y_2 h_2\nx_3 y_3 h_3\n:\nx_N y_N h_N\n\nOutput\n\nPrint values C_X, C_Y and H representing the center coordinates and the height of the pyramid in one line, with spaces in between.\n\nSample Input 1\n\n4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n\nSample Output 1\n\n2 2 6\n\nIn this case, the center coordinates and the height can be identified as (2, 2) and 6.\n\nSample Input 2\n\n2\n0 0 100\n1 1 98\n\nSample Output 2\n\n0 0 100\n\nIn this case, the center coordinates and the height can be identified as (0, 0) and 100.\n\nNote that C_X and C_Y are known to be integers between 0 and 100.\n\nSample Input 3\n\n3\n99 1 191\n100 1 192\n99 0 192\n\nSample Output 3\n\n100 0 193\n\nIn this case, the center coordinates and the height can be identified as (100, 0) and 193.", "sample_input": "4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n"}, "reference_outputs": ["2 2 6\n"], "source_document_id": "p03240", "source_text": "Score: 300 points\n\nProblem Statement\n\nIn the Ancient Kingdom of Snuke, there was a pyramid to strengthen the authority of Takahashi, the president of AtCoder Inc.\n\nThe pyramid had center coordinates (C_X, C_Y) and height H. The altitude of coordinates (X, Y) is max(H - |X - C_X| - |Y - C_Y|, 0).\n\nAoki, an explorer, conducted a survey to identify the center coordinates and height of this pyramid. As a result, he obtained the following information:\n\nC_X, C_Y was integers between 0 and 100 (inclusive), and H was an integer not less than 1.\n\nAdditionally, he obtained N pieces of information. The i-th of them is: \"the altitude of point (x_i, y_i) is h_i.\"\n\nThis was enough to identify the center coordinates and the height of the pyramid. Find these values with the clues above.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\nx_i and y_i are integers between 0 and 100 (inclusive).\n\nh_i is an integer between 0 and 10^9 (inclusive).\n\nThe N coordinates (x_1, y_1), (x_2, y_2), (x_3, y_3), ..., (x_N, y_N) are all different.\n\nThe center coordinates and the height of the pyramid can be uniquely identified.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1 h_1\nx_2 y_2 h_2\nx_3 y_3 h_3\n:\nx_N y_N h_N\n\nOutput\n\nPrint values C_X, C_Y and H representing the center coordinates and the height of the pyramid in one line, with spaces in between.\n\nSample Input 1\n\n4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n\nSample Output 1\n\n2 2 6\n\nIn this case, the center coordinates and the height can be identified as (2, 2) and 6.\n\nSample Input 2\n\n2\n0 0 100\n1 1 98\n\nSample Output 2\n\n0 0 100\n\nIn this case, the center coordinates and the height can be identified as (0, 0) and 100.\n\nNote that C_X and C_Y are known to be integers between 0 and 100.\n\nSample Input 3\n\n3\n99 1 191\n100 1 192\n99 0 192\n\nSample Output 3\n\n100 0 193\n\nIn this case, the center coordinates and the height can be identified as (100, 0) and 193.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 733, "cpu_time_ms": 8, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s762685534", "group_id": "codeNet:p03240", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner\n\nfunc init() {\n\tsc = bufio.NewScanner(os.Stdin)\n\tbuffsize := 1000000\n\tbuff := make([]byte, buffsize)\n\tsc.Buffer(buff, buffsize)\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc loadint() (result int) {\n\tsc.Scan()\n\tresult, _ = strconv.Atoi(sc.Text())\n\treturn\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc check(N, x, y int, xs, ys, hs []int) int {\n\tresult := -1\n\tfor i := 0; i < N; i++ {\n\t\tif hs[i] > 0 {\n\t\t\td := abs(x-xs[i]) + abs(y-ys[i])\n\t\t\tif result > 0 && result != d+hs[i] {\n\t\t\t\treturn 0\n\t\t\t}\n\t\t\tresult = d + hs[i]\n\t\t}\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tif hs[i] == 0 {\n\t\t\td := abs(x-xs[i]) + abs(y-ys[i])\n\t\t\tif result > 0 && result > d+hs[i] {\n\t\t\t\treturn 0\n\t\t\t}\n\t\t}\n\t}\n\treturn result\n}\n\nfunc main() {\n\tN := loadint()\n\txs := make([]int, N)\n\tys := make([]int, N)\n\ths := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\txs[i] = loadint()\n\t\tys[i] = loadint()\n\t\ths[i] = loadint()\n\t}\n\tcx, cy, ch := 0, 0, 0\nLOOP:\n\tfor x := 0; x <= 100; x++ {\n\t\tfor y := 0; y <= 100; y++ {\n\t\t\th := check(N, x, y, xs, ys, hs)\n\t\t\tif h > 0 {\n\t\t\t\tcx, cy, ch = x, y, h\n\t\t\t\tbreak LOOP\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(cx, cy, ch)\n}\n", "language": "Go", "metadata": {"date": 1539321734, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03240.html", "problem_id": "p03240", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03240/input.txt", "sample_output_relpath": "derived/input_output/data/p03240/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03240/Go/s762685534.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s762685534", "user_id": "u808427016"}, "prompt_components": {"gold_output": "2 2 6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner\n\nfunc init() {\n\tsc = bufio.NewScanner(os.Stdin)\n\tbuffsize := 1000000\n\tbuff := make([]byte, buffsize)\n\tsc.Buffer(buff, buffsize)\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc loadint() (result int) {\n\tsc.Scan()\n\tresult, _ = strconv.Atoi(sc.Text())\n\treturn\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc check(N, x, y int, xs, ys, hs []int) int {\n\tresult := -1\n\tfor i := 0; i < N; i++ {\n\t\tif hs[i] > 0 {\n\t\t\td := abs(x-xs[i]) + abs(y-ys[i])\n\t\t\tif result > 0 && result != d+hs[i] {\n\t\t\t\treturn 0\n\t\t\t}\n\t\t\tresult = d + hs[i]\n\t\t}\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tif hs[i] == 0 {\n\t\t\td := abs(x-xs[i]) + abs(y-ys[i])\n\t\t\tif result > 0 && result > d+hs[i] {\n\t\t\t\treturn 0\n\t\t\t}\n\t\t}\n\t}\n\treturn result\n}\n\nfunc main() {\n\tN := loadint()\n\txs := make([]int, N)\n\tys := make([]int, N)\n\ths := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\txs[i] = loadint()\n\t\tys[i] = loadint()\n\t\ths[i] = loadint()\n\t}\n\tcx, cy, ch := 0, 0, 0\nLOOP:\n\tfor x := 0; x <= 100; x++ {\n\t\tfor y := 0; y <= 100; y++ {\n\t\t\th := check(N, x, y, xs, ys, hs)\n\t\t\tif h > 0 {\n\t\t\t\tcx, cy, ch = x, y, h\n\t\t\t\tbreak LOOP\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(cx, cy, ch)\n}\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nIn the Ancient Kingdom of Snuke, there was a pyramid to strengthen the authority of Takahashi, the president of AtCoder Inc.\n\nThe pyramid had center coordinates (C_X, C_Y) and height H. The altitude of coordinates (X, Y) is max(H - |X - C_X| - |Y - C_Y|, 0).\n\nAoki, an explorer, conducted a survey to identify the center coordinates and height of this pyramid. As a result, he obtained the following information:\n\nC_X, C_Y was integers between 0 and 100 (inclusive), and H was an integer not less than 1.\n\nAdditionally, he obtained N pieces of information. The i-th of them is: \"the altitude of point (x_i, y_i) is h_i.\"\n\nThis was enough to identify the center coordinates and the height of the pyramid. Find these values with the clues above.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\nx_i and y_i are integers between 0 and 100 (inclusive).\n\nh_i is an integer between 0 and 10^9 (inclusive).\n\nThe N coordinates (x_1, y_1), (x_2, y_2), (x_3, y_3), ..., (x_N, y_N) are all different.\n\nThe center coordinates and the height of the pyramid can be uniquely identified.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1 h_1\nx_2 y_2 h_2\nx_3 y_3 h_3\n:\nx_N y_N h_N\n\nOutput\n\nPrint values C_X, C_Y and H representing the center coordinates and the height of the pyramid in one line, with spaces in between.\n\nSample Input 1\n\n4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n\nSample Output 1\n\n2 2 6\n\nIn this case, the center coordinates and the height can be identified as (2, 2) and 6.\n\nSample Input 2\n\n2\n0 0 100\n1 1 98\n\nSample Output 2\n\n0 0 100\n\nIn this case, the center coordinates and the height can be identified as (0, 0) and 100.\n\nNote that C_X and C_Y are known to be integers between 0 and 100.\n\nSample Input 3\n\n3\n99 1 191\n100 1 192\n99 0 192\n\nSample Output 3\n\n100 0 193\n\nIn this case, the center coordinates and the height can be identified as (100, 0) and 193.", "sample_input": "4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n"}, "reference_outputs": ["2 2 6\n"], "source_document_id": "p03240", "source_text": "Score: 300 points\n\nProblem Statement\n\nIn the Ancient Kingdom of Snuke, there was a pyramid to strengthen the authority of Takahashi, the president of AtCoder Inc.\n\nThe pyramid had center coordinates (C_X, C_Y) and height H. The altitude of coordinates (X, Y) is max(H - |X - C_X| - |Y - C_Y|, 0).\n\nAoki, an explorer, conducted a survey to identify the center coordinates and height of this pyramid. As a result, he obtained the following information:\n\nC_X, C_Y was integers between 0 and 100 (inclusive), and H was an integer not less than 1.\n\nAdditionally, he obtained N pieces of information. The i-th of them is: \"the altitude of point (x_i, y_i) is h_i.\"\n\nThis was enough to identify the center coordinates and the height of the pyramid. Find these values with the clues above.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\nx_i and y_i are integers between 0 and 100 (inclusive).\n\nh_i is an integer between 0 and 10^9 (inclusive).\n\nThe N coordinates (x_1, y_1), (x_2, y_2), (x_3, y_3), ..., (x_N, y_N) are all different.\n\nThe center coordinates and the height of the pyramid can be uniquely identified.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1 h_1\nx_2 y_2 h_2\nx_3 y_3 h_3\n:\nx_N y_N h_N\n\nOutput\n\nPrint values C_X, C_Y and H representing the center coordinates and the height of the pyramid in one line, with spaces in between.\n\nSample Input 1\n\n4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n\nSample Output 1\n\n2 2 6\n\nIn this case, the center coordinates and the height can be identified as (2, 2) and 6.\n\nSample Input 2\n\n2\n0 0 100\n1 1 98\n\nSample Output 2\n\n0 0 100\n\nIn this case, the center coordinates and the height can be identified as (0, 0) and 100.\n\nNote that C_X and C_Y are known to be integers between 0 and 100.\n\nSample Input 3\n\n3\n99 1 191\n100 1 192\n99 0 192\n\nSample Output 3\n\n100 0 193\n\nIn this case, the center coordinates and the height can be identified as (100, 0) and 193.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1181, "cpu_time_ms": 3, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s044122475", "group_id": "codeNet:p03240", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner\n\nfunc init() {\n\tsc = bufio.NewScanner(os.Stdin)\n\tbuffsize := 1000000\n\tbuff := make([]byte, buffsize)\n\tsc.Buffer(buff, buffsize)\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc loadint() (result int) {\n\tsc.Scan()\n\tresult, _ = strconv.Atoi(sc.Text())\n\treturn\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc check(N, x, y int, xs, ys, hs []int) int {\n\tresult := -1\n\tfor i := 0; i < N; i++ {\n\t\tif hs[i] > 0 {\n\t\t\td := abs(x-xs[i]) + abs(y-ys[i])\n\t\t\tif result > 0 && result != d+hs[i] {\n\t\t\t\treturn 0\n\t\t\t}\n\t\t\tresult = d + hs[i]\n\t\t}\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tif hs[i] == 0 {\n\t\t\td := abs(x-xs[i]) + abs(y-ys[i])\n\t\t\tif result > 0 && result <= d+hs[i] {\n\t\t\t\treturn 0\n\t\t\t}\n\t\t}\n\t}\n\treturn result\n}\n\nfunc main() {\n\tN := loadint()\n\txs := make([]int, N)\n\tys := make([]int, N)\n\ths := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\txs[i] = loadint()\n\t\tys[i] = loadint()\n\t\ths[i] = loadint()\n\t}\n\tcx, cy, ch := 0, 0, 0\nLOOP:\n\tfor x := 0; x <= 100; x++ {\n\t\tfor y := 0; y <= 100; y++ {\n\t\t\th := check(N, x, y, xs, ys, hs)\n\t\t\tif h > 0 {\n\t\t\t\tcx, cy, ch = x, y, h\n\t\t\t\tbreak LOOP\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(cx, cy, ch)\n}\n", "language": "Go", "metadata": {"date": 1539320397, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03240.html", "problem_id": "p03240", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03240/input.txt", "sample_output_relpath": "derived/input_output/data/p03240/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03240/Go/s044122475.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s044122475", "user_id": "u808427016"}, "prompt_components": {"gold_output": "2 2 6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner\n\nfunc init() {\n\tsc = bufio.NewScanner(os.Stdin)\n\tbuffsize := 1000000\n\tbuff := make([]byte, buffsize)\n\tsc.Buffer(buff, buffsize)\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc loadint() (result int) {\n\tsc.Scan()\n\tresult, _ = strconv.Atoi(sc.Text())\n\treturn\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc check(N, x, y int, xs, ys, hs []int) int {\n\tresult := -1\n\tfor i := 0; i < N; i++ {\n\t\tif hs[i] > 0 {\n\t\t\td := abs(x-xs[i]) + abs(y-ys[i])\n\t\t\tif result > 0 && result != d+hs[i] {\n\t\t\t\treturn 0\n\t\t\t}\n\t\t\tresult = d + hs[i]\n\t\t}\n\t}\n\tfor i := 0; i < N; i++ {\n\t\tif hs[i] == 0 {\n\t\t\td := abs(x-xs[i]) + abs(y-ys[i])\n\t\t\tif result > 0 && result <= d+hs[i] {\n\t\t\t\treturn 0\n\t\t\t}\n\t\t}\n\t}\n\treturn result\n}\n\nfunc main() {\n\tN := loadint()\n\txs := make([]int, N)\n\tys := make([]int, N)\n\ths := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\txs[i] = loadint()\n\t\tys[i] = loadint()\n\t\ths[i] = loadint()\n\t}\n\tcx, cy, ch := 0, 0, 0\nLOOP:\n\tfor x := 0; x <= 100; x++ {\n\t\tfor y := 0; y <= 100; y++ {\n\t\t\th := check(N, x, y, xs, ys, hs)\n\t\t\tif h > 0 {\n\t\t\t\tcx, cy, ch = x, y, h\n\t\t\t\tbreak LOOP\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(cx, cy, ch)\n}\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nIn the Ancient Kingdom of Snuke, there was a pyramid to strengthen the authority of Takahashi, the president of AtCoder Inc.\n\nThe pyramid had center coordinates (C_X, C_Y) and height H. The altitude of coordinates (X, Y) is max(H - |X - C_X| - |Y - C_Y|, 0).\n\nAoki, an explorer, conducted a survey to identify the center coordinates and height of this pyramid. As a result, he obtained the following information:\n\nC_X, C_Y was integers between 0 and 100 (inclusive), and H was an integer not less than 1.\n\nAdditionally, he obtained N pieces of information. The i-th of them is: \"the altitude of point (x_i, y_i) is h_i.\"\n\nThis was enough to identify the center coordinates and the height of the pyramid. Find these values with the clues above.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\nx_i and y_i are integers between 0 and 100 (inclusive).\n\nh_i is an integer between 0 and 10^9 (inclusive).\n\nThe N coordinates (x_1, y_1), (x_2, y_2), (x_3, y_3), ..., (x_N, y_N) are all different.\n\nThe center coordinates and the height of the pyramid can be uniquely identified.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1 h_1\nx_2 y_2 h_2\nx_3 y_3 h_3\n:\nx_N y_N h_N\n\nOutput\n\nPrint values C_X, C_Y and H representing the center coordinates and the height of the pyramid in one line, with spaces in between.\n\nSample Input 1\n\n4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n\nSample Output 1\n\n2 2 6\n\nIn this case, the center coordinates and the height can be identified as (2, 2) and 6.\n\nSample Input 2\n\n2\n0 0 100\n1 1 98\n\nSample Output 2\n\n0 0 100\n\nIn this case, the center coordinates and the height can be identified as (0, 0) and 100.\n\nNote that C_X and C_Y are known to be integers between 0 and 100.\n\nSample Input 3\n\n3\n99 1 191\n100 1 192\n99 0 192\n\nSample Output 3\n\n100 0 193\n\nIn this case, the center coordinates and the height can be identified as (100, 0) and 193.", "sample_input": "4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n"}, "reference_outputs": ["2 2 6\n"], "source_document_id": "p03240", "source_text": "Score: 300 points\n\nProblem Statement\n\nIn the Ancient Kingdom of Snuke, there was a pyramid to strengthen the authority of Takahashi, the president of AtCoder Inc.\n\nThe pyramid had center coordinates (C_X, C_Y) and height H. The altitude of coordinates (X, Y) is max(H - |X - C_X| - |Y - C_Y|, 0).\n\nAoki, an explorer, conducted a survey to identify the center coordinates and height of this pyramid. As a result, he obtained the following information:\n\nC_X, C_Y was integers between 0 and 100 (inclusive), and H was an integer not less than 1.\n\nAdditionally, he obtained N pieces of information. The i-th of them is: \"the altitude of point (x_i, y_i) is h_i.\"\n\nThis was enough to identify the center coordinates and the height of the pyramid. Find these values with the clues above.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\nx_i and y_i are integers between 0 and 100 (inclusive).\n\nh_i is an integer between 0 and 10^9 (inclusive).\n\nThe N coordinates (x_1, y_1), (x_2, y_2), (x_3, y_3), ..., (x_N, y_N) are all different.\n\nThe center coordinates and the height of the pyramid can be uniquely identified.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1 h_1\nx_2 y_2 h_2\nx_3 y_3 h_3\n:\nx_N y_N h_N\n\nOutput\n\nPrint values C_X, C_Y and H representing the center coordinates and the height of the pyramid in one line, with spaces in between.\n\nSample Input 1\n\n4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n\nSample Output 1\n\n2 2 6\n\nIn this case, the center coordinates and the height can be identified as (2, 2) and 6.\n\nSample Input 2\n\n2\n0 0 100\n1 1 98\n\nSample Output 2\n\n0 0 100\n\nIn this case, the center coordinates and the height can be identified as (0, 0) and 100.\n\nNote that C_X and C_Y are known to be integers between 0 and 100.\n\nSample Input 3\n\n3\n99 1 191\n100 1 192\n99 0 192\n\nSample Output 3\n\n100 0 193\n\nIn this case, the center coordinates and the height can be identified as (100, 0) and 193.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1182, "cpu_time_ms": 3, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s708202343", "group_id": "codeNet:p03240", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math/rand\"\n\t\"os\"\n\t\"strconv\"\n\t\"time\"\n)\n\nfunc main() {\n\tlog.SetFlags(log.Lshortfile)\n\trand.Seed(time.Now().UnixNano())\n\tN := nextInt()\n\tx := make([]int, N)\n\ty := make([]int, N)\n\th := make([]int, N)\n\tidx := 0\n\tfor i := 0; i < N; i++ {\n\t\tx[i] = nextInt()\n\t\ty[i] = nextInt()\n\t\th[i] = nextInt()\n\t\tif h[i] != 0 {\n\t\t\tidx = i\n\t\t}\n\t}\n\tidx = rand.Intn(N)\n\tfor cx := 0; cx <= 100; cx++ {\n\t\tfor cy := 0; cy <= 100; cy++ {\n\t\t\tcheck := true\n\t\t\thypothesis := abs(x[idx]-cx) + abs(y[idx]-cy) + h[idx]\n\t\t\tfor i := 0; i < N; i++ {\n\t\t\t\tif h[i] == 0 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\th := abs(x[i]-cx) + abs(y[i]-cy) + h[i]\n\t\t\t\tif hypothesis != h {\n\t\t\t\t\tcheck = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif check {\n\t\t\t\ttrueHigh := abs(cx-x[idx]) + abs(cy-y[idx]) + h[idx]\n\t\t\t\tfor i := 0; i < N; i++ {\n\t\t\t\t\tif h[i] == 0 {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tif h[i] != max(trueHigh-abs(x[i]-cx)-abs(y[i]-cy), 0) {\n\t\t\t\t\t\t// log.Println(cx, cy, \"gotoNEXT\")\n\t\t\t\t\t\tgoto NEXT\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfmt.Println(cx, cy, trueHigh)\n\t\t\t\treturn\n\t\t\t}\n\t\tNEXT:\n\t\t}\n\t}\n\tz := nextInt()\n\tlog.Println(z)\n}\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc minmax(a, b int) (int, int) {\n\tif a > b {\n\t\treturn b, a\n\t}\n\treturn a, b\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\ntype Pair struct {\n\ta, b int\n}\n\ntype Pairs []Pair\n\nfunc (p Pairs) Len() int {\n\treturn len(p)\n}\nfunc (p Pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p Pairs) Less(i, j int) bool {\n\treturn p[i].b < p[j].b\n}\n\nvar nextReader func() string\n\nfunc init() {\n\tnextReader = NewScanner()\n}\n\nfunc NewScanner() func() string {\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\treturn func() string {\n\t\tr.Scan()\n\t\treturn r.Text()\n\t}\n}\nfunc nextString() string {\n\treturn nextReader()\n}\nfunc nextInt64() int64 {\n\tv, _ := strconv.ParseInt(nextReader(), 10, 64)\n\treturn v\n}\nfunc nextInt() int {\n\tv, _ := strconv.Atoi(nextReader())\n\treturn v\n}\nfunc nextInts(n int) []int {\n\tr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt()\n\t}\n\treturn r\n}\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(nextReader(), 64)\n\treturn f\n}\n", "language": "Go", "metadata": {"date": 1538877744, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03240.html", "problem_id": "p03240", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03240/input.txt", "sample_output_relpath": "derived/input_output/data/p03240/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03240/Go/s708202343.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s708202343", "user_id": "u696272993"}, "prompt_components": {"gold_output": "2 2 6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"math/rand\"\n\t\"os\"\n\t\"strconv\"\n\t\"time\"\n)\n\nfunc main() {\n\tlog.SetFlags(log.Lshortfile)\n\trand.Seed(time.Now().UnixNano())\n\tN := nextInt()\n\tx := make([]int, N)\n\ty := make([]int, N)\n\th := make([]int, N)\n\tidx := 0\n\tfor i := 0; i < N; i++ {\n\t\tx[i] = nextInt()\n\t\ty[i] = nextInt()\n\t\th[i] = nextInt()\n\t\tif h[i] != 0 {\n\t\t\tidx = i\n\t\t}\n\t}\n\tidx = rand.Intn(N)\n\tfor cx := 0; cx <= 100; cx++ {\n\t\tfor cy := 0; cy <= 100; cy++ {\n\t\t\tcheck := true\n\t\t\thypothesis := abs(x[idx]-cx) + abs(y[idx]-cy) + h[idx]\n\t\t\tfor i := 0; i < N; i++ {\n\t\t\t\tif h[i] == 0 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\th := abs(x[i]-cx) + abs(y[i]-cy) + h[i]\n\t\t\t\tif hypothesis != h {\n\t\t\t\t\tcheck = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif check {\n\t\t\t\ttrueHigh := abs(cx-x[idx]) + abs(cy-y[idx]) + h[idx]\n\t\t\t\tfor i := 0; i < N; i++ {\n\t\t\t\t\tif h[i] == 0 {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tif h[i] != max(trueHigh-abs(x[i]-cx)-abs(y[i]-cy), 0) {\n\t\t\t\t\t\t// log.Println(cx, cy, \"gotoNEXT\")\n\t\t\t\t\t\tgoto NEXT\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfmt.Println(cx, cy, trueHigh)\n\t\t\t\treturn\n\t\t\t}\n\t\tNEXT:\n\t\t}\n\t}\n\tz := nextInt()\n\tlog.Println(z)\n}\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc minmax(a, b int) (int, int) {\n\tif a > b {\n\t\treturn b, a\n\t}\n\treturn a, b\n}\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\ntype Pair struct {\n\ta, b int\n}\n\ntype Pairs []Pair\n\nfunc (p Pairs) Len() int {\n\treturn len(p)\n}\nfunc (p Pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p Pairs) Less(i, j int) bool {\n\treturn p[i].b < p[j].b\n}\n\nvar nextReader func() string\n\nfunc init() {\n\tnextReader = NewScanner()\n}\n\nfunc NewScanner() func() string {\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\treturn func() string {\n\t\tr.Scan()\n\t\treturn r.Text()\n\t}\n}\nfunc nextString() string {\n\treturn nextReader()\n}\nfunc nextInt64() int64 {\n\tv, _ := strconv.ParseInt(nextReader(), 10, 64)\n\treturn v\n}\nfunc nextInt() int {\n\tv, _ := strconv.Atoi(nextReader())\n\treturn v\n}\nfunc nextInts(n int) []int {\n\tr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt()\n\t}\n\treturn r\n}\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(nextReader(), 64)\n\treturn f\n}\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nIn the Ancient Kingdom of Snuke, there was a pyramid to strengthen the authority of Takahashi, the president of AtCoder Inc.\n\nThe pyramid had center coordinates (C_X, C_Y) and height H. The altitude of coordinates (X, Y) is max(H - |X - C_X| - |Y - C_Y|, 0).\n\nAoki, an explorer, conducted a survey to identify the center coordinates and height of this pyramid. As a result, he obtained the following information:\n\nC_X, C_Y was integers between 0 and 100 (inclusive), and H was an integer not less than 1.\n\nAdditionally, he obtained N pieces of information. The i-th of them is: \"the altitude of point (x_i, y_i) is h_i.\"\n\nThis was enough to identify the center coordinates and the height of the pyramid. Find these values with the clues above.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\nx_i and y_i are integers between 0 and 100 (inclusive).\n\nh_i is an integer between 0 and 10^9 (inclusive).\n\nThe N coordinates (x_1, y_1), (x_2, y_2), (x_3, y_3), ..., (x_N, y_N) are all different.\n\nThe center coordinates and the height of the pyramid can be uniquely identified.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1 h_1\nx_2 y_2 h_2\nx_3 y_3 h_3\n:\nx_N y_N h_N\n\nOutput\n\nPrint values C_X, C_Y and H representing the center coordinates and the height of the pyramid in one line, with spaces in between.\n\nSample Input 1\n\n4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n\nSample Output 1\n\n2 2 6\n\nIn this case, the center coordinates and the height can be identified as (2, 2) and 6.\n\nSample Input 2\n\n2\n0 0 100\n1 1 98\n\nSample Output 2\n\n0 0 100\n\nIn this case, the center coordinates and the height can be identified as (0, 0) and 100.\n\nNote that C_X and C_Y are known to be integers between 0 and 100.\n\nSample Input 3\n\n3\n99 1 191\n100 1 192\n99 0 192\n\nSample Output 3\n\n100 0 193\n\nIn this case, the center coordinates and the height can be identified as (100, 0) and 193.", "sample_input": "4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n"}, "reference_outputs": ["2 2 6\n"], "source_document_id": "p03240", "source_text": "Score: 300 points\n\nProblem Statement\n\nIn the Ancient Kingdom of Snuke, there was a pyramid to strengthen the authority of Takahashi, the president of AtCoder Inc.\n\nThe pyramid had center coordinates (C_X, C_Y) and height H. The altitude of coordinates (X, Y) is max(H - |X - C_X| - |Y - C_Y|, 0).\n\nAoki, an explorer, conducted a survey to identify the center coordinates and height of this pyramid. As a result, he obtained the following information:\n\nC_X, C_Y was integers between 0 and 100 (inclusive), and H was an integer not less than 1.\n\nAdditionally, he obtained N pieces of information. The i-th of them is: \"the altitude of point (x_i, y_i) is h_i.\"\n\nThis was enough to identify the center coordinates and the height of the pyramid. Find these values with the clues above.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\nx_i and y_i are integers between 0 and 100 (inclusive).\n\nh_i is an integer between 0 and 10^9 (inclusive).\n\nThe N coordinates (x_1, y_1), (x_2, y_2), (x_3, y_3), ..., (x_N, y_N) are all different.\n\nThe center coordinates and the height of the pyramid can be uniquely identified.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1 h_1\nx_2 y_2 h_2\nx_3 y_3 h_3\n:\nx_N y_N h_N\n\nOutput\n\nPrint values C_X, C_Y and H representing the center coordinates and the height of the pyramid in one line, with spaces in between.\n\nSample Input 1\n\n4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n\nSample Output 1\n\n2 2 6\n\nIn this case, the center coordinates and the height can be identified as (2, 2) and 6.\n\nSample Input 2\n\n2\n0 0 100\n1 1 98\n\nSample Output 2\n\n0 0 100\n\nIn this case, the center coordinates and the height can be identified as (0, 0) and 100.\n\nNote that C_X and C_Y are known to be integers between 0 and 100.\n\nSample Input 3\n\n3\n99 1 191\n100 1 192\n99 0 192\n\nSample Output 3\n\n100 0 193\n\nIn this case, the center coordinates and the height can be identified as (100, 0) and 193.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2412, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s064914292", "group_id": "codeNet:p03240", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype Num struct {\n\tX int\n\tY int\n\tH int\n}\n\nfunc main() {\n\ts := IOInitialize()\n\ts.Buffer([]byte{}, math.MaxInt64)\n\tN := Int(s)\n\tnums := scanNums(s, N)\n\tresX := 0\n\tresY := 0\n\tresH := 0\n\thasRes := false\n\tminH := 10000000000\n\tfor _, num := range nums {\n\t\tif num.H < minH {\n\t\t\tminH = num.H\n\t\t}\n\t}\n\tfor cy := 0; cy < 101; cy++ {\n\t\tfor cx := 0; cx < 101; cx++ {\n\t\t\tfor h := minH; h < minH+203; h++ {\n\t\t\t\tfor i, num := range nums {\n\t\t\t\t\tif h-abs(num.X-cx)-abs(num.Y-cy) == num.H {\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t\tfmt.Println(\"hoge\")\n\t\t\t\t\t\t\tfmt.Println(i)\n\t\t\t\t\t\t\tfmt.Println(num.X, cx, num.Y, cy, num.H, minH)\n\t\t\t\t\t\t\tfmt.Println(len(nums))\n\t\t\t\t\t\t*/\n\t\t\t\t\t\tif i == len(nums)-1 {\n\t\t\t\t\t\t\t//fmt.Println(\"fuga\")\n\t\t\t\t\t\t\thasRes = true\n\t\t\t\t\t\t\tresX = cx\n\t\t\t\t\t\t\tresY = cy\n\t\t\t\t\t\t\tresH = abs(num.X-cx) + abs(num.Y-cy) + num.H\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif hasRes {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif hasRes {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(resX, resY, resH)\n\t//cx := 0\n\t//cy := 0\n\t/*\n\t\tfor _, num := range nums {\n\t\t\tsumX += num.X\n\t\t\tsumY += num.Y\n\t\t}\n\t\tl := len(nums)\n\t\tcX := sumX / l\n\t\tcY := sumY / l\n\t\tnum := nums[0]\n\t\tx0 := num.X\n\t\ty0 := num.Y\n\t\th0 := num.H\n\t\tcH := abs(x0-cX) + abs(y0-cY) + h0\n\t\tfmt.Println(cX)\n\t\tfmt.Println(cY)\n\t\tfmt.Println(cH)\n\t*/\n}\n\n/*\nfunc isOK(cX int, cY int, nums []Nums) bool {\n\n}\n*/\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc IOInitialize() *bufio.Scanner {\n\ts := bufio.NewScanner(os.Stdin)\n\ts.Split(bufio.ScanWords)\n\treturn s\n}\n\nfunc Int(s *bufio.Scanner) int {\n\tif !s.Scan() {\n\t\tpanic(\"scan error\")\n\t}\n\n\tvalue, err := strconv.Atoi(s.Text())\n\tif err != nil {\n\t\tpanic(\"text to int error\")\n\t}\n\treturn value\n}\n\nfunc String(s *bufio.Scanner) string {\n\tif !s.Scan() {\n\t\tpanic(\"scan error\")\n\t}\n\n\treturn s.Text()\n}\n\nfunc scanNums(s *bufio.Scanner, len int) (nums []Num) {\n\tfor i := 0; i < len; i++ {\n\t\tx := Int(s)\n\t\ty := Int(s)\n\t\th := Int(s)\n\t\tnums = append(nums, Num{X: x, Y: y, H: h})\n\t}\n\treturn\n}\n\nfunc scanstrings(s *bufio.Scanner, len int) (strs []string) {\n\tfor i := 0; i < len; i++ {\n\t\tstr := String(s)\n\t\tstrs = append(strs, str)\n\t}\n\treturn\n}\n", "language": "Go", "metadata": {"date": 1538876652, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03240.html", "problem_id": "p03240", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03240/input.txt", "sample_output_relpath": "derived/input_output/data/p03240/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03240/Go/s064914292.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s064914292", "user_id": "u029329478"}, "prompt_components": {"gold_output": "2 2 6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\ntype Num struct {\n\tX int\n\tY int\n\tH int\n}\n\nfunc main() {\n\ts := IOInitialize()\n\ts.Buffer([]byte{}, math.MaxInt64)\n\tN := Int(s)\n\tnums := scanNums(s, N)\n\tresX := 0\n\tresY := 0\n\tresH := 0\n\thasRes := false\n\tminH := 10000000000\n\tfor _, num := range nums {\n\t\tif num.H < minH {\n\t\t\tminH = num.H\n\t\t}\n\t}\n\tfor cy := 0; cy < 101; cy++ {\n\t\tfor cx := 0; cx < 101; cx++ {\n\t\t\tfor h := minH; h < minH+203; h++ {\n\t\t\t\tfor i, num := range nums {\n\t\t\t\t\tif h-abs(num.X-cx)-abs(num.Y-cy) == num.H {\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t\tfmt.Println(\"hoge\")\n\t\t\t\t\t\t\tfmt.Println(i)\n\t\t\t\t\t\t\tfmt.Println(num.X, cx, num.Y, cy, num.H, minH)\n\t\t\t\t\t\t\tfmt.Println(len(nums))\n\t\t\t\t\t\t*/\n\t\t\t\t\t\tif i == len(nums)-1 {\n\t\t\t\t\t\t\t//fmt.Println(\"fuga\")\n\t\t\t\t\t\t\thasRes = true\n\t\t\t\t\t\t\tresX = cx\n\t\t\t\t\t\t\tresY = cy\n\t\t\t\t\t\t\tresH = abs(num.X-cx) + abs(num.Y-cy) + num.H\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif hasRes {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif hasRes {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(resX, resY, resH)\n\t//cx := 0\n\t//cy := 0\n\t/*\n\t\tfor _, num := range nums {\n\t\t\tsumX += num.X\n\t\t\tsumY += num.Y\n\t\t}\n\t\tl := len(nums)\n\t\tcX := sumX / l\n\t\tcY := sumY / l\n\t\tnum := nums[0]\n\t\tx0 := num.X\n\t\ty0 := num.Y\n\t\th0 := num.H\n\t\tcH := abs(x0-cX) + abs(y0-cY) + h0\n\t\tfmt.Println(cX)\n\t\tfmt.Println(cY)\n\t\tfmt.Println(cH)\n\t*/\n}\n\n/*\nfunc isOK(cX int, cY int, nums []Nums) bool {\n\n}\n*/\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc IOInitialize() *bufio.Scanner {\n\ts := bufio.NewScanner(os.Stdin)\n\ts.Split(bufio.ScanWords)\n\treturn s\n}\n\nfunc Int(s *bufio.Scanner) int {\n\tif !s.Scan() {\n\t\tpanic(\"scan error\")\n\t}\n\n\tvalue, err := strconv.Atoi(s.Text())\n\tif err != nil {\n\t\tpanic(\"text to int error\")\n\t}\n\treturn value\n}\n\nfunc String(s *bufio.Scanner) string {\n\tif !s.Scan() {\n\t\tpanic(\"scan error\")\n\t}\n\n\treturn s.Text()\n}\n\nfunc scanNums(s *bufio.Scanner, len int) (nums []Num) {\n\tfor i := 0; i < len; i++ {\n\t\tx := Int(s)\n\t\ty := Int(s)\n\t\th := Int(s)\n\t\tnums = append(nums, Num{X: x, Y: y, H: h})\n\t}\n\treturn\n}\n\nfunc scanstrings(s *bufio.Scanner, len int) (strs []string) {\n\tfor i := 0; i < len; i++ {\n\t\tstr := String(s)\n\t\tstrs = append(strs, str)\n\t}\n\treturn\n}\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nIn the Ancient Kingdom of Snuke, there was a pyramid to strengthen the authority of Takahashi, the president of AtCoder Inc.\n\nThe pyramid had center coordinates (C_X, C_Y) and height H. The altitude of coordinates (X, Y) is max(H - |X - C_X| - |Y - C_Y|, 0).\n\nAoki, an explorer, conducted a survey to identify the center coordinates and height of this pyramid. As a result, he obtained the following information:\n\nC_X, C_Y was integers between 0 and 100 (inclusive), and H was an integer not less than 1.\n\nAdditionally, he obtained N pieces of information. The i-th of them is: \"the altitude of point (x_i, y_i) is h_i.\"\n\nThis was enough to identify the center coordinates and the height of the pyramid. Find these values with the clues above.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\nx_i and y_i are integers between 0 and 100 (inclusive).\n\nh_i is an integer between 0 and 10^9 (inclusive).\n\nThe N coordinates (x_1, y_1), (x_2, y_2), (x_3, y_3), ..., (x_N, y_N) are all different.\n\nThe center coordinates and the height of the pyramid can be uniquely identified.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1 h_1\nx_2 y_2 h_2\nx_3 y_3 h_3\n:\nx_N y_N h_N\n\nOutput\n\nPrint values C_X, C_Y and H representing the center coordinates and the height of the pyramid in one line, with spaces in between.\n\nSample Input 1\n\n4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n\nSample Output 1\n\n2 2 6\n\nIn this case, the center coordinates and the height can be identified as (2, 2) and 6.\n\nSample Input 2\n\n2\n0 0 100\n1 1 98\n\nSample Output 2\n\n0 0 100\n\nIn this case, the center coordinates and the height can be identified as (0, 0) and 100.\n\nNote that C_X and C_Y are known to be integers between 0 and 100.\n\nSample Input 3\n\n3\n99 1 191\n100 1 192\n99 0 192\n\nSample Output 3\n\n100 0 193\n\nIn this case, the center coordinates and the height can be identified as (100, 0) and 193.", "sample_input": "4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n"}, "reference_outputs": ["2 2 6\n"], "source_document_id": "p03240", "source_text": "Score: 300 points\n\nProblem Statement\n\nIn the Ancient Kingdom of Snuke, there was a pyramid to strengthen the authority of Takahashi, the president of AtCoder Inc.\n\nThe pyramid had center coordinates (C_X, C_Y) and height H. The altitude of coordinates (X, Y) is max(H - |X - C_X| - |Y - C_Y|, 0).\n\nAoki, an explorer, conducted a survey to identify the center coordinates and height of this pyramid. As a result, he obtained the following information:\n\nC_X, C_Y was integers between 0 and 100 (inclusive), and H was an integer not less than 1.\n\nAdditionally, he obtained N pieces of information. The i-th of them is: \"the altitude of point (x_i, y_i) is h_i.\"\n\nThis was enough to identify the center coordinates and the height of the pyramid. Find these values with the clues above.\n\nConstraints\n\nN is an integer between 1 and 100 (inclusive).\n\nx_i and y_i are integers between 0 and 100 (inclusive).\n\nh_i is an integer between 0 and 10^9 (inclusive).\n\nThe N coordinates (x_1, y_1), (x_2, y_2), (x_3, y_3), ..., (x_N, y_N) are all different.\n\nThe center coordinates and the height of the pyramid can be uniquely identified.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1 h_1\nx_2 y_2 h_2\nx_3 y_3 h_3\n:\nx_N y_N h_N\n\nOutput\n\nPrint values C_X, C_Y and H representing the center coordinates and the height of the pyramid in one line, with spaces in between.\n\nSample Input 1\n\n4\n2 3 5\n2 1 5\n1 2 5\n3 2 5\n\nSample Output 1\n\n2 2 6\n\nIn this case, the center coordinates and the height can be identified as (2, 2) and 6.\n\nSample Input 2\n\n2\n0 0 100\n1 1 98\n\nSample Output 2\n\n0 0 100\n\nIn this case, the center coordinates and the height can be identified as (0, 0) and 100.\n\nNote that C_X and C_Y are known to be integers between 0 and 100.\n\nSample Input 3\n\n3\n99 1 191\n100 1 192\n99 0 192\n\nSample Output 3\n\n100 0 193\n\nIn this case, the center coordinates and the height can be identified as (100, 0) and 193.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2144, "cpu_time_ms": 18, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s351665802", "group_id": "codeNet:p03250", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar s1, s2, s3 int\n\tfmt.Scan(&s1, &s2, &s3)\n\ts := []int{s1, s2, s3}\n\tsort.Ints(s)\n\tfmt.Println(s[2]*10 + s[0] + s[1])\n}\n", "language": "Go", "metadata": {"date": 1593347554, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03250.html", "problem_id": "p03250", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03250/input.txt", "sample_output_relpath": "derived/input_output/data/p03250/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03250/Go/s351665802.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s351665802", "user_id": "u055687574"}, "prompt_components": {"gold_output": "53\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar s1, s2, s3 int\n\tfmt.Scan(&s1, &s2, &s3)\n\ts := []int{s1, s2, s3}\n\tsort.Ints(s)\n\tfmt.Println(s[2]*10 + s[0] + s[1])\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou have decided to give an allowance to your child depending on the outcome of the game that he will play now.\n\nThe game is played as follows:\n\nThere are three \"integer panels\", each with a digit between 1 and 9 (inclusive) printed on it, and one \"operator panel\" with a + printed on it.\n\nThe player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)\n\nThen, the amount of the allowance will be equal to the resulting value of the formula.\n\nGiven the values A, B and C printed on the integer panels used in the game, find the maximum possible amount of the allowance.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the maximum possible amount of the allowance.\n\nSample Input 1\n\n1 5 2\n\nSample Output 1\n\n53\n\nThe amount of the allowance will be 53 when the panels are arranged as 52+1, and this is the maximum possible amount.\n\nSample Input 2\n\n9 9 9\n\nSample Output 2\n\n108\n\nSample Input 3\n\n6 6 7\n\nSample Output 3\n\n82", "sample_input": "1 5 2\n"}, "reference_outputs": ["53\n"], "source_document_id": "p03250", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou have decided to give an allowance to your child depending on the outcome of the game that he will play now.\n\nThe game is played as follows:\n\nThere are three \"integer panels\", each with a digit between 1 and 9 (inclusive) printed on it, and one \"operator panel\" with a + printed on it.\n\nThe player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)\n\nThen, the amount of the allowance will be equal to the resulting value of the formula.\n\nGiven the values A, B and C printed on the integer panels used in the game, find the maximum possible amount of the allowance.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the maximum possible amount of the allowance.\n\nSample Input 1\n\n1 5 2\n\nSample Output 1\n\n53\n\nThe amount of the allowance will be 53 when the panels are arranged as 52+1, and this is the maximum possible amount.\n\nSample Input 2\n\n9 9 9\n\nSample Output 2\n\n108\n\nSample Input 3\n\n6 6 7\n\nSample Output 3\n\n82", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 7, "memory_kb": 1840}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s224783374", "group_id": "codeNet:p03250", "input_text": "package main\nimport (\n\t\"fmt\"\n\t//\"math\"\n\t//\"math/rand\"\n)\nfunc main() {\n\tvar A,B,C int\n\tfmt.Scan(&A,&B,&C)\n\tvar p = A*10+B+C\n\tvar q = B*10+A+C\n\tvar r = C*10+A+B\n\tif p>=q && p>=r{\n\t\tfmt.Println(p)\n\t}else if q>=p && q>=r{\n\t\tfmt.Println(q)\n\t}else{\n\t\tfmt.Println(r)\n\t}\n}", "language": "Go", "metadata": {"date": 1592966609, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03250.html", "problem_id": "p03250", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03250/input.txt", "sample_output_relpath": "derived/input_output/data/p03250/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03250/Go/s224783374.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s224783374", "user_id": "u916974091"}, "prompt_components": {"gold_output": "53\n", "input_to_evaluate": "package main\nimport (\n\t\"fmt\"\n\t//\"math\"\n\t//\"math/rand\"\n)\nfunc main() {\n\tvar A,B,C int\n\tfmt.Scan(&A,&B,&C)\n\tvar p = A*10+B+C\n\tvar q = B*10+A+C\n\tvar r = C*10+A+B\n\tif p>=q && p>=r{\n\t\tfmt.Println(p)\n\t}else if q>=p && q>=r{\n\t\tfmt.Println(q)\n\t}else{\n\t\tfmt.Println(r)\n\t}\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou have decided to give an allowance to your child depending on the outcome of the game that he will play now.\n\nThe game is played as follows:\n\nThere are three \"integer panels\", each with a digit between 1 and 9 (inclusive) printed on it, and one \"operator panel\" with a + printed on it.\n\nThe player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)\n\nThen, the amount of the allowance will be equal to the resulting value of the formula.\n\nGiven the values A, B and C printed on the integer panels used in the game, find the maximum possible amount of the allowance.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the maximum possible amount of the allowance.\n\nSample Input 1\n\n1 5 2\n\nSample Output 1\n\n53\n\nThe amount of the allowance will be 53 when the panels are arranged as 52+1, and this is the maximum possible amount.\n\nSample Input 2\n\n9 9 9\n\nSample Output 2\n\n108\n\nSample Input 3\n\n6 6 7\n\nSample Output 3\n\n82", "sample_input": "1 5 2\n"}, "reference_outputs": ["53\n"], "source_document_id": "p03250", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou have decided to give an allowance to your child depending on the outcome of the game that he will play now.\n\nThe game is played as follows:\n\nThere are three \"integer panels\", each with a digit between 1 and 9 (inclusive) printed on it, and one \"operator panel\" with a + printed on it.\n\nThe player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)\n\nThen, the amount of the allowance will be equal to the resulting value of the formula.\n\nGiven the values A, B and C printed on the integer panels used in the game, find the maximum possible amount of the allowance.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the maximum possible amount of the allowance.\n\nSample Input 1\n\n1 5 2\n\nSample Output 1\n\n53\n\nThe amount of the allowance will be 53 when the panels are arranged as 52+1, and this is the maximum possible amount.\n\nSample Input 2\n\n9 9 9\n\nSample Output 2\n\n108\n\nSample Input 3\n\n6 6 7\n\nSample Output 3\n\n82", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 264, "cpu_time_ms": 6, "memory_kb": 1772}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s223246076", "group_id": "codeNet:p03250", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar (\n\tfinv, inv, fac [MAX]int\n)\n\nfunc COM(n, k int) int {\n\tif n < k {\n\t\treturn 0\n\t}\n\tif n < 0 || k < 0 {\n\t\treturn 0\n\t}\n\treturn fac[n] * (finv[k] * finv[n-k] % MOD) % MOD\n}\n\nfunc init() {\n\tfac[0] = 1\n\tfac[1] = 1\n\tfinv[0] = 1\n\tfinv[1] = 1\n\tinv[1] = 1\n\tfor i := 2; i < MAX; i++ {\n\t\tfac[i] = fac[i-1] * i % MOD\n\t\tinv[i] = MOD - inv[MOD%i]*(MOD/i)%MOD\n\t\tfinv[i] = finv[i-1] * inv[i] % MOD\n\t}\n\t//sc.Split(bufio.ScanLines)\n\tsc.Split(bufio.ScanWords)\n\t//sc.Buffer([]byte{}, 100100)\n}\n\nconst (\n\tMOD = 1000000007\n\tMAX = 510000\n)\n\nfunc ModAdd(a, b int64) int64 {\n\treturn (a + b) % MOD\n}\n\nfunc ModMul(a, b int64) int64 {\n\treturn a * b % MOD\n}\n\nfunc ModSub(a, b int64) int64 {\n\tr := (a%MOD - b%MOD) % MOD\n\tif r < 0 {\n\t\tr += MOD\n\t}\n\treturn r\n}\n\nfunc ModDiv(a, b int64) int64 {\n\treturn a % MOD * ModInv(b) % MOD\n}\n\nfunc ModPow(a, n int64) int64 {\n\tvar r int64 = 1\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tr = r * a % MOD\n\t\t}\n\t\ta = a * a % MOD\n\t\tn >>= 1\n\t}\n\treturn r\n}\n\nfunc ModInv(a int64) int64 {\n\tvar b, u, v int64 = MOD, 1, 0\n\tfor b > 0 {\n\t\tt := a / b\n\t\ta -= t * b\n\t\ta, b = b, a\n\t\tu -= t * v\n\t\tu, v = v, u\n\t}\n\tu %= MOD\n\tif u < 0 {\n\t\tu += MOD\n\t}\n\treturn u\n}\n\ntype Q struct {\n\tvalue int\n\tindex int\n\tA, B int\n}\n\ntype QS []*Q\n\nfunc (p QS) Len() int { return len(p) }\nfunc (p QS) Less(i, j int) bool { return p[i].value > p[j].value }\nfunc (pq QS) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n\tpq[i].index = i\n\tpq[j].index = j\n}\n\nfunc (pq *QS) Push(x interface{}) {\n\tn := len(*pq)\n\titem := x.(*Q)\n\titem.index = n\n\t*pq = append(*pq, item)\n}\n\nfunc (pq *QS) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\told[n-1] = nil // avoid memory leak\n\titem.index = -1 // for safety\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\nfunc FactoredPrimeNumber(num int) map[int]int {\n\tm := map[int]int{}\n\treturn factor(m, num, 2)\n}\n\nfunc factor(result map[int]int, num, pnum int) map[int]int {\n\tif pnum*pnum > num {\n\t\tif num != 1 {\n\t\t\tresult[num] += 1\n\t\t}\n\t\treturn result\n\t}\n\n\tif num%pnum == 0 {\n\t\tnum /= pnum\n\t\tresult[pnum]++\n\t} else {\n\t\tpnum++\n\t}\n\treturn factor(result, num, pnum)\n}\n\nfunc GCD(a, b int64) int64 {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn GCD(b, a%b)\n}\n\nfunc LCM(a, b int64) int64 {\n\treturn a * b / GCD(a, b)\n}\n\ntype UnionFind struct {\n\tpar []int\n\tsize []int\n}\n\nfunc NewUnionFind(size int) *UnionFind {\n\treturn new(UnionFind).init(size)\n}\n\nfunc (uf *UnionFind) init(size int) *UnionFind {\n\tuf.par = make([]int, size)\n\tuf.size = make([]int, size)\n\n\tfor i := 0; i < size; i++ {\n\t\tuf.par[i] = i\n\t\tuf.size[i] = 1\n\t}\n\treturn uf\n}\n\nfunc (uf *UnionFind) Unite(p int, q int) {\n\trp := uf.Root(p)\n\trq := uf.Root(q)\n\tif rp == rq {\n\t\treturn\n\t}\n\tif uf.size[rp] < uf.size[rq] {\n\t\tuf.par[rp] = uf.par[rq]\n\t\tuf.size[rq] += uf.size[rp]\n\t} else {\n\t\tuf.par[rq] = uf.par[rp]\n\t\tuf.size[rp] += uf.size[rq]\n\t}\n}\n\nfunc (uf *UnionFind) Root(p int) int {\n\tfor uf.par[p] == p {\n\t\treturn p\n\t}\n\tuf.par[p] = uf.Root(uf.par[p])\n\treturn uf.par[p]\n}\n\nfunc (uf *UnionFind) Size(p int) int {\n\treturn uf.size[uf.Root(p)]\n}\n\nfunc (uf *UnionFind) Same(p int, q int) bool {\n\treturn uf.Root(p) == uf.Root(q)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tn, _ := strconv.Atoi(getStr())\n\treturn n\n}\n\nfunc getStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tR := []int{getInt(), getInt(), getInt()}\n\tsort.Sort(sort.Reverse(sort.IntSlice(R)))\n\tans := 0\n\tfor i := 0; i < 3; i++ {\n\t\tif i == 0 {\n\t\t\tans += R[i] * 10\n\t\t} else {\n\t\t\tans += R[i]\n\t\t}\n\t}\n\tfmt.Println(ans)\n\n}\n\ntype IntHeap []int\n\nfunc (h IntHeap) Len() int { return len(h) }\nfunc (h IntHeap) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h IntHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\n\nfunc (h *IntHeap) Push(x interface{}) {\n\t// Push and Pop use pointer receivers because they modify the slice's length,\n\t// not just its contents.\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IntHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n", "language": "Go", "metadata": {"date": 1591739673, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03250.html", "problem_id": "p03250", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03250/input.txt", "sample_output_relpath": "derived/input_output/data/p03250/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03250/Go/s223246076.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s223246076", "user_id": "u534481484"}, "prompt_components": {"gold_output": "53\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar (\n\tfinv, inv, fac [MAX]int\n)\n\nfunc COM(n, k int) int {\n\tif n < k {\n\t\treturn 0\n\t}\n\tif n < 0 || k < 0 {\n\t\treturn 0\n\t}\n\treturn fac[n] * (finv[k] * finv[n-k] % MOD) % MOD\n}\n\nfunc init() {\n\tfac[0] = 1\n\tfac[1] = 1\n\tfinv[0] = 1\n\tfinv[1] = 1\n\tinv[1] = 1\n\tfor i := 2; i < MAX; i++ {\n\t\tfac[i] = fac[i-1] * i % MOD\n\t\tinv[i] = MOD - inv[MOD%i]*(MOD/i)%MOD\n\t\tfinv[i] = finv[i-1] * inv[i] % MOD\n\t}\n\t//sc.Split(bufio.ScanLines)\n\tsc.Split(bufio.ScanWords)\n\t//sc.Buffer([]byte{}, 100100)\n}\n\nconst (\n\tMOD = 1000000007\n\tMAX = 510000\n)\n\nfunc ModAdd(a, b int64) int64 {\n\treturn (a + b) % MOD\n}\n\nfunc ModMul(a, b int64) int64 {\n\treturn a * b % MOD\n}\n\nfunc ModSub(a, b int64) int64 {\n\tr := (a%MOD - b%MOD) % MOD\n\tif r < 0 {\n\t\tr += MOD\n\t}\n\treturn r\n}\n\nfunc ModDiv(a, b int64) int64 {\n\treturn a % MOD * ModInv(b) % MOD\n}\n\nfunc ModPow(a, n int64) int64 {\n\tvar r int64 = 1\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tr = r * a % MOD\n\t\t}\n\t\ta = a * a % MOD\n\t\tn >>= 1\n\t}\n\treturn r\n}\n\nfunc ModInv(a int64) int64 {\n\tvar b, u, v int64 = MOD, 1, 0\n\tfor b > 0 {\n\t\tt := a / b\n\t\ta -= t * b\n\t\ta, b = b, a\n\t\tu -= t * v\n\t\tu, v = v, u\n\t}\n\tu %= MOD\n\tif u < 0 {\n\t\tu += MOD\n\t}\n\treturn u\n}\n\ntype Q struct {\n\tvalue int\n\tindex int\n\tA, B int\n}\n\ntype QS []*Q\n\nfunc (p QS) Len() int { return len(p) }\nfunc (p QS) Less(i, j int) bool { return p[i].value > p[j].value }\nfunc (pq QS) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n\tpq[i].index = i\n\tpq[j].index = j\n}\n\nfunc (pq *QS) Push(x interface{}) {\n\tn := len(*pq)\n\titem := x.(*Q)\n\titem.index = n\n\t*pq = append(*pq, item)\n}\n\nfunc (pq *QS) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\told[n-1] = nil // avoid memory leak\n\titem.index = -1 // for safety\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\nfunc FactoredPrimeNumber(num int) map[int]int {\n\tm := map[int]int{}\n\treturn factor(m, num, 2)\n}\n\nfunc factor(result map[int]int, num, pnum int) map[int]int {\n\tif pnum*pnum > num {\n\t\tif num != 1 {\n\t\t\tresult[num] += 1\n\t\t}\n\t\treturn result\n\t}\n\n\tif num%pnum == 0 {\n\t\tnum /= pnum\n\t\tresult[pnum]++\n\t} else {\n\t\tpnum++\n\t}\n\treturn factor(result, num, pnum)\n}\n\nfunc GCD(a, b int64) int64 {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn GCD(b, a%b)\n}\n\nfunc LCM(a, b int64) int64 {\n\treturn a * b / GCD(a, b)\n}\n\ntype UnionFind struct {\n\tpar []int\n\tsize []int\n}\n\nfunc NewUnionFind(size int) *UnionFind {\n\treturn new(UnionFind).init(size)\n}\n\nfunc (uf *UnionFind) init(size int) *UnionFind {\n\tuf.par = make([]int, size)\n\tuf.size = make([]int, size)\n\n\tfor i := 0; i < size; i++ {\n\t\tuf.par[i] = i\n\t\tuf.size[i] = 1\n\t}\n\treturn uf\n}\n\nfunc (uf *UnionFind) Unite(p int, q int) {\n\trp := uf.Root(p)\n\trq := uf.Root(q)\n\tif rp == rq {\n\t\treturn\n\t}\n\tif uf.size[rp] < uf.size[rq] {\n\t\tuf.par[rp] = uf.par[rq]\n\t\tuf.size[rq] += uf.size[rp]\n\t} else {\n\t\tuf.par[rq] = uf.par[rp]\n\t\tuf.size[rp] += uf.size[rq]\n\t}\n}\n\nfunc (uf *UnionFind) Root(p int) int {\n\tfor uf.par[p] == p {\n\t\treturn p\n\t}\n\tuf.par[p] = uf.Root(uf.par[p])\n\treturn uf.par[p]\n}\n\nfunc (uf *UnionFind) Size(p int) int {\n\treturn uf.size[uf.Root(p)]\n}\n\nfunc (uf *UnionFind) Same(p int, q int) bool {\n\treturn uf.Root(p) == uf.Root(q)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tn, _ := strconv.Atoi(getStr())\n\treturn n\n}\n\nfunc getStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tR := []int{getInt(), getInt(), getInt()}\n\tsort.Sort(sort.Reverse(sort.IntSlice(R)))\n\tans := 0\n\tfor i := 0; i < 3; i++ {\n\t\tif i == 0 {\n\t\t\tans += R[i] * 10\n\t\t} else {\n\t\t\tans += R[i]\n\t\t}\n\t}\n\tfmt.Println(ans)\n\n}\n\ntype IntHeap []int\n\nfunc (h IntHeap) Len() int { return len(h) }\nfunc (h IntHeap) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h IntHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\n\nfunc (h *IntHeap) Push(x interface{}) {\n\t// Push and Pop use pointer receivers because they modify the slice's length,\n\t// not just its contents.\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IntHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou have decided to give an allowance to your child depending on the outcome of the game that he will play now.\n\nThe game is played as follows:\n\nThere are three \"integer panels\", each with a digit between 1 and 9 (inclusive) printed on it, and one \"operator panel\" with a + printed on it.\n\nThe player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)\n\nThen, the amount of the allowance will be equal to the resulting value of the formula.\n\nGiven the values A, B and C printed on the integer panels used in the game, find the maximum possible amount of the allowance.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the maximum possible amount of the allowance.\n\nSample Input 1\n\n1 5 2\n\nSample Output 1\n\n53\n\nThe amount of the allowance will be 53 when the panels are arranged as 52+1, and this is the maximum possible amount.\n\nSample Input 2\n\n9 9 9\n\nSample Output 2\n\n108\n\nSample Input 3\n\n6 6 7\n\nSample Output 3\n\n82", "sample_input": "1 5 2\n"}, "reference_outputs": ["53\n"], "source_document_id": "p03250", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou have decided to give an allowance to your child depending on the outcome of the game that he will play now.\n\nThe game is played as follows:\n\nThere are three \"integer panels\", each with a digit between 1 and 9 (inclusive) printed on it, and one \"operator panel\" with a + printed on it.\n\nThe player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)\n\nThen, the amount of the allowance will be equal to the resulting value of the formula.\n\nGiven the values A, B and C printed on the integer panels used in the game, find the maximum possible amount of the allowance.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the maximum possible amount of the allowance.\n\nSample Input 1\n\n1 5 2\n\nSample Output 1\n\n53\n\nThe amount of the allowance will be 53 when the panels are arranged as 52+1, and this is the maximum possible amount.\n\nSample Input 2\n\n9 9 9\n\nSample Output 2\n\n108\n\nSample Input 3\n\n6 6 7\n\nSample Output 3\n\n82", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3993, "cpu_time_ms": 22, "memory_kb": 12544}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s679085385", "group_id": "codeNet:p03250", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tn := make([]int, 3)\n\tfmt.Scan(&n[0], &n[1], &n[2])\n\tsort.Sort(sort.Reverse(sort.IntSlice(n)))\n\tfmt.Println(n[0]*10 + n[1] + n[2])\n}\n", "language": "Go", "metadata": {"date": 1566531574, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03250.html", "problem_id": "p03250", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03250/input.txt", "sample_output_relpath": "derived/input_output/data/p03250/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03250/Go/s679085385.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s679085385", "user_id": "u937220467"}, "prompt_components": {"gold_output": "53\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tn := make([]int, 3)\n\tfmt.Scan(&n[0], &n[1], &n[2])\n\tsort.Sort(sort.Reverse(sort.IntSlice(n)))\n\tfmt.Println(n[0]*10 + n[1] + n[2])\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou have decided to give an allowance to your child depending on the outcome of the game that he will play now.\n\nThe game is played as follows:\n\nThere are three \"integer panels\", each with a digit between 1 and 9 (inclusive) printed on it, and one \"operator panel\" with a + printed on it.\n\nThe player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)\n\nThen, the amount of the allowance will be equal to the resulting value of the formula.\n\nGiven the values A, B and C printed on the integer panels used in the game, find the maximum possible amount of the allowance.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the maximum possible amount of the allowance.\n\nSample Input 1\n\n1 5 2\n\nSample Output 1\n\n53\n\nThe amount of the allowance will be 53 when the panels are arranged as 52+1, and this is the maximum possible amount.\n\nSample Input 2\n\n9 9 9\n\nSample Output 2\n\n108\n\nSample Input 3\n\n6 6 7\n\nSample Output 3\n\n82", "sample_input": "1 5 2\n"}, "reference_outputs": ["53\n"], "source_document_id": "p03250", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou have decided to give an allowance to your child depending on the outcome of the game that he will play now.\n\nThe game is played as follows:\n\nThere are three \"integer panels\", each with a digit between 1 and 9 (inclusive) printed on it, and one \"operator panel\" with a + printed on it.\n\nThe player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)\n\nThen, the amount of the allowance will be equal to the resulting value of the formula.\n\nGiven the values A, B and C printed on the integer panels used in the game, find the maximum possible amount of the allowance.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the maximum possible amount of the allowance.\n\nSample Input 1\n\n1 5 2\n\nSample Output 1\n\n53\n\nThe amount of the allowance will be 53 when the panels are arranged as 52+1, and this is the maximum possible amount.\n\nSample Input 2\n\n9 9 9\n\nSample Output 2\n\n108\n\nSample Input 3\n\n6 6 7\n\nSample Output 3\n\n82", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s683888798", "group_id": "codeNet:p03250", "input_text": "// https://atcoder.jp/contests/abc110/tasks/abc110_a\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// d: debug IO. it can print debug in test.\nfunc solve(io *Io, d *Io) {\n\tA := io.NextInt()\n\tB := io.NextInt()\n\tC := io.NextInt()\n\n\tints := []int{A, B, C}\n\tsort.Ints(ints)\n\n\tres := ints[2]*10 + ints[1] + ints[0]\n\tio.Println(res)\n}\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\tsolve(io, nil)\n}\n\n/* IO Helpers */\n\n// Io combines reader, writer, & tokens as the state when processing the input\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\n// NewIo creates Io with Stdin & Stdout\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\n// Flush calls the writer's Flush\nfunc (io *Io) Flush() {\n\tio.writer.Flush()\n}\n\n// NextLine returns the string from reader.ReadLine()\nfunc (io *Io) NextLine() string {\n\tif io.nextToken < len(io.tokens) {\n\t\tpanic(\"io.nextToken < len(io.tokens)\")\n\t}\n\n\tvar buffer bytes.Buffer\n\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer.Write(line)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn buffer.String()\n}\n\n// NextLines returns []string from next n lines\nfunc (io *Io) NextLines(n int) []string {\n\tres := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextLine()\n\t}\n\treturn res\n}\n\n// Next returns the string token (partial string of the line divided by spaces)\nfunc (io *Io) Next() string {\n\tif io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\n\tres := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn res\n}\n\n// NextStrings returns the []string from the next n tokens\nfunc (io *Io) NextStrings(n int) []string {\n\tres := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.Next()\n\t}\n\treturn res\n}\n\n// NextInt returns the int from the next token\nfunc (io *Io) NextInt() int {\n\tres, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n\n// NextInts returns the []int from the next n tokens\nfunc (io *Io) NextInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextInt()\n\t}\n\treturn res\n}\n\n// NextFloat returns the float64 from the next token\nfunc (io *Io) NextFloat() float64 {\n\tres, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n\n// NextFloats returns the []float64 from the next n tokens\nfunc (io *Io) NextFloats(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextFloat()\n\t}\n\treturn res\n}\n\n// Println prints the input to the writer in an easy-to-see form\nfunc (io *Io) Println(a ...interface{}) {\n\tvar values []string\n\tfor i := 0; i < len(a); i++ {\n\t\tvalues = append(values, \"%v\")\n\t}\n\tio.Printfln(strings.Join(values, \" \"), a...)\n}\n\n// Print calls Fprint to the writer\nfunc (io *Io) Print(a interface{}) {\n\tfmt.Fprint(io.writer, a)\n}\n\n// Printf calls Fprintf to the writer\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\n// Printfln calls Fprint to the writer\nfunc (io *Io) Printfln(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format+\"\\n\", a...)\n}\n\n// PrintInts prints ints with space and new line at the end\nfunc (io *Io) PrintInts(ints []int) {\n\tfor i, e := range ints {\n\t\tio.Print(e)\n\n\t\tif i == len(ints)-1 {\n\t\t\tio.Println()\n\t\t} else {\n\t\t\tio.Print(\" \")\n\t\t}\n\t}\n}\n\n// Debug calls Println and Flush immediately\nfunc (io *Io) Debug(a ...interface{}) {\n\tif io == nil {\n\t\treturn\n\t}\n\n\tio.Println(a...)\n\tio.Flush()\n}\n\n/* Math Helpers */\n\n// MOD is 10^9 + 7\nconst MOD = 1000000007\n\n// Max of the ints\nfunc Max(numbers ...int) int {\n\tmax := numbers[0]\n\tfor i, number := range numbers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif number > max {\n\t\t\tmax = number\n\t\t}\n\t}\n\treturn max\n}\n\n// Min of the ints\nfunc Min(numbers ...int) int {\n\tmax := numbers[0]\n\tfor i, number := range numbers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif max > number {\n\t\t\tmax = number\n\t\t}\n\t}\n\treturn max\n}\n\n// DigitSum returns sum of the int's digits\nfunc DigitSum(n int) int {\n\tif n < 0 {\n\t\treturn -1\n\t}\n\n\tres := 0\n\n\tfor n > 0 {\n\t\tres += n % 10\n\t\tn /= 10\n\t}\n\n\treturn res\n}\n\n// Sum of the ints\nfunc Sum(numbers ...int) int {\n\tsum := 0\n\n\tfor _, number := range numbers {\n\t\tsum += number\n\t}\n\n\treturn sum\n}\n\n// Pow calculates the pow for int with O(log e)\nfunc Pow(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(fmt.Sprintf(\"Pow was called for a < 0 or e < 0, a: %d, e: %d\", a, e))\n\t}\n\n\tif e == 0 {\n\t\treturn 1\n\t}\n\n\tif e%2 == 0 {\n\t\thalf := Pow(a, e/2)\n\t\treturn half * half\n\t}\n\n\treturn a * Pow(a, e-1)\n}\n\n// Abs returns the absolute value of the input\nfunc Abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\n\treturn a\n}\n\n/* Structure Helpers */\n\n// Set is orderless List\ntype Set map[interface{}]struct{}\n\n// NewSet returns empty Set\nfunc NewSet() *Set {\n\treturn &Set{}\n}\n\n// Add the value to the set\nfunc (set *Set) Add(value interface{}) {\n\t(*set)[value] = struct{}{}\n}\n\n// Includes check the set has the value\nfunc (set *Set) Includes(value interface{}) bool {\n\t_, included := (*set)[value]\n\treturn included\n}\n\n// Remove deletes the value from the set if exists\nfunc (set *Set) Remove(value interface{}) {\n\tif !set.Includes(value) {\n\t\treturn\n\t}\n\n\tdelete(*set, value)\n}\n\n// ImmutableSort returns sorted slice without mutating original one\nfunc ImmutableSort(slice []int) []int {\n\tres := make([]int, len(slice))\n\tcopy(res, slice)\n\tsort.Ints(res)\n\treturn res\n}\n\n/* Util helpers */\n\n// Ternary is like `cond ? a : b`. should assert the returned value like `Ternary(cond, a, b).(int)`\nfunc Ternary(cond bool, a, b interface{}) interface{} {\n\tif cond {\n\t\treturn a\n\t}\n\n\treturn b\n}\n\n// TernaryInt uses Ternary and assert the value as int\nfunc TernaryInt(cond bool, a, b int) int {\n\treturn Ternary(cond, a, b).(int)\n}\n\n// TernaryString uses Ternary and assert the value as string\nfunc TernaryString(cond bool, a, b string) string {\n\treturn Ternary(cond, a, b).(string)\n}\n", "language": "Go", "metadata": {"date": 1565842694, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03250.html", "problem_id": "p03250", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03250/input.txt", "sample_output_relpath": "derived/input_output/data/p03250/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03250/Go/s683888798.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s683888798", "user_id": "u751468134"}, "prompt_components": {"gold_output": "53\n", "input_to_evaluate": "// https://atcoder.jp/contests/abc110/tasks/abc110_a\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// d: debug IO. it can print debug in test.\nfunc solve(io *Io, d *Io) {\n\tA := io.NextInt()\n\tB := io.NextInt()\n\tC := io.NextInt()\n\n\tints := []int{A, B, C}\n\tsort.Ints(ints)\n\n\tres := ints[2]*10 + ints[1] + ints[0]\n\tio.Println(res)\n}\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\tsolve(io, nil)\n}\n\n/* IO Helpers */\n\n// Io combines reader, writer, & tokens as the state when processing the input\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\n// NewIo creates Io with Stdin & Stdout\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\n// Flush calls the writer's Flush\nfunc (io *Io) Flush() {\n\tio.writer.Flush()\n}\n\n// NextLine returns the string from reader.ReadLine()\nfunc (io *Io) NextLine() string {\n\tif io.nextToken < len(io.tokens) {\n\t\tpanic(\"io.nextToken < len(io.tokens)\")\n\t}\n\n\tvar buffer bytes.Buffer\n\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer.Write(line)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn buffer.String()\n}\n\n// NextLines returns []string from next n lines\nfunc (io *Io) NextLines(n int) []string {\n\tres := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextLine()\n\t}\n\treturn res\n}\n\n// Next returns the string token (partial string of the line divided by spaces)\nfunc (io *Io) Next() string {\n\tif io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\n\tres := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn res\n}\n\n// NextStrings returns the []string from the next n tokens\nfunc (io *Io) NextStrings(n int) []string {\n\tres := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.Next()\n\t}\n\treturn res\n}\n\n// NextInt returns the int from the next token\nfunc (io *Io) NextInt() int {\n\tres, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n\n// NextInts returns the []int from the next n tokens\nfunc (io *Io) NextInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextInt()\n\t}\n\treturn res\n}\n\n// NextFloat returns the float64 from the next token\nfunc (io *Io) NextFloat() float64 {\n\tres, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n\n// NextFloats returns the []float64 from the next n tokens\nfunc (io *Io) NextFloats(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextFloat()\n\t}\n\treturn res\n}\n\n// Println prints the input to the writer in an easy-to-see form\nfunc (io *Io) Println(a ...interface{}) {\n\tvar values []string\n\tfor i := 0; i < len(a); i++ {\n\t\tvalues = append(values, \"%v\")\n\t}\n\tio.Printfln(strings.Join(values, \" \"), a...)\n}\n\n// Print calls Fprint to the writer\nfunc (io *Io) Print(a interface{}) {\n\tfmt.Fprint(io.writer, a)\n}\n\n// Printf calls Fprintf to the writer\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\n// Printfln calls Fprint to the writer\nfunc (io *Io) Printfln(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format+\"\\n\", a...)\n}\n\n// PrintInts prints ints with space and new line at the end\nfunc (io *Io) PrintInts(ints []int) {\n\tfor i, e := range ints {\n\t\tio.Print(e)\n\n\t\tif i == len(ints)-1 {\n\t\t\tio.Println()\n\t\t} else {\n\t\t\tio.Print(\" \")\n\t\t}\n\t}\n}\n\n// Debug calls Println and Flush immediately\nfunc (io *Io) Debug(a ...interface{}) {\n\tif io == nil {\n\t\treturn\n\t}\n\n\tio.Println(a...)\n\tio.Flush()\n}\n\n/* Math Helpers */\n\n// MOD is 10^9 + 7\nconst MOD = 1000000007\n\n// Max of the ints\nfunc Max(numbers ...int) int {\n\tmax := numbers[0]\n\tfor i, number := range numbers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif number > max {\n\t\t\tmax = number\n\t\t}\n\t}\n\treturn max\n}\n\n// Min of the ints\nfunc Min(numbers ...int) int {\n\tmax := numbers[0]\n\tfor i, number := range numbers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif max > number {\n\t\t\tmax = number\n\t\t}\n\t}\n\treturn max\n}\n\n// DigitSum returns sum of the int's digits\nfunc DigitSum(n int) int {\n\tif n < 0 {\n\t\treturn -1\n\t}\n\n\tres := 0\n\n\tfor n > 0 {\n\t\tres += n % 10\n\t\tn /= 10\n\t}\n\n\treturn res\n}\n\n// Sum of the ints\nfunc Sum(numbers ...int) int {\n\tsum := 0\n\n\tfor _, number := range numbers {\n\t\tsum += number\n\t}\n\n\treturn sum\n}\n\n// Pow calculates the pow for int with O(log e)\nfunc Pow(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(fmt.Sprintf(\"Pow was called for a < 0 or e < 0, a: %d, e: %d\", a, e))\n\t}\n\n\tif e == 0 {\n\t\treturn 1\n\t}\n\n\tif e%2 == 0 {\n\t\thalf := Pow(a, e/2)\n\t\treturn half * half\n\t}\n\n\treturn a * Pow(a, e-1)\n}\n\n// Abs returns the absolute value of the input\nfunc Abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\n\treturn a\n}\n\n/* Structure Helpers */\n\n// Set is orderless List\ntype Set map[interface{}]struct{}\n\n// NewSet returns empty Set\nfunc NewSet() *Set {\n\treturn &Set{}\n}\n\n// Add the value to the set\nfunc (set *Set) Add(value interface{}) {\n\t(*set)[value] = struct{}{}\n}\n\n// Includes check the set has the value\nfunc (set *Set) Includes(value interface{}) bool {\n\t_, included := (*set)[value]\n\treturn included\n}\n\n// Remove deletes the value from the set if exists\nfunc (set *Set) Remove(value interface{}) {\n\tif !set.Includes(value) {\n\t\treturn\n\t}\n\n\tdelete(*set, value)\n}\n\n// ImmutableSort returns sorted slice without mutating original one\nfunc ImmutableSort(slice []int) []int {\n\tres := make([]int, len(slice))\n\tcopy(res, slice)\n\tsort.Ints(res)\n\treturn res\n}\n\n/* Util helpers */\n\n// Ternary is like `cond ? a : b`. should assert the returned value like `Ternary(cond, a, b).(int)`\nfunc Ternary(cond bool, a, b interface{}) interface{} {\n\tif cond {\n\t\treturn a\n\t}\n\n\treturn b\n}\n\n// TernaryInt uses Ternary and assert the value as int\nfunc TernaryInt(cond bool, a, b int) int {\n\treturn Ternary(cond, a, b).(int)\n}\n\n// TernaryString uses Ternary and assert the value as string\nfunc TernaryString(cond bool, a, b string) string {\n\treturn Ternary(cond, a, b).(string)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou have decided to give an allowance to your child depending on the outcome of the game that he will play now.\n\nThe game is played as follows:\n\nThere are three \"integer panels\", each with a digit between 1 and 9 (inclusive) printed on it, and one \"operator panel\" with a + printed on it.\n\nThe player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)\n\nThen, the amount of the allowance will be equal to the resulting value of the formula.\n\nGiven the values A, B and C printed on the integer panels used in the game, find the maximum possible amount of the allowance.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the maximum possible amount of the allowance.\n\nSample Input 1\n\n1 5 2\n\nSample Output 1\n\n53\n\nThe amount of the allowance will be 53 when the panels are arranged as 52+1, and this is the maximum possible amount.\n\nSample Input 2\n\n9 9 9\n\nSample Output 2\n\n108\n\nSample Input 3\n\n6 6 7\n\nSample Output 3\n\n82", "sample_input": "1 5 2\n"}, "reference_outputs": ["53\n"], "source_document_id": "p03250", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou have decided to give an allowance to your child depending on the outcome of the game that he will play now.\n\nThe game is played as follows:\n\nThere are three \"integer panels\", each with a digit between 1 and 9 (inclusive) printed on it, and one \"operator panel\" with a + printed on it.\n\nThe player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)\n\nThen, the amount of the allowance will be equal to the resulting value of the formula.\n\nGiven the values A, B and C printed on the integer panels used in the game, find the maximum possible amount of the allowance.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the maximum possible amount of the allowance.\n\nSample Input 1\n\n1 5 2\n\nSample Output 1\n\n53\n\nThe amount of the allowance will be 53 when the panels are arranged as 52+1, and this is the maximum possible amount.\n\nSample Input 2\n\n9 9 9\n\nSample Output 2\n\n108\n\nSample Input 3\n\n6 6 7\n\nSample Output 3\n\n82", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6015, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s455140436", "group_id": "codeNet:p03250", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\tif len(os.Args) > 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(os.Stdout)\n\n\ta := getNextInt(scanner)\n\tb := getNextInt(scanner)\n\tc := getNextInt(scanner)\n\n\tans := a + b + c\n\tmax := a\n\tif max < b {\n\t\tmax = b\n\t}\n\tif max < c {\n\t\tmax = c\n\t}\n\tfmt.Fprintln(writer, ans+9*max)\n\n\twriter.Flush()\n}\n", "language": "Go", "metadata": {"date": 1561838166, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03250.html", "problem_id": "p03250", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03250/input.txt", "sample_output_relpath": "derived/input_output/data/p03250/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03250/Go/s455140436.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s455140436", "user_id": "u150542210"}, "prompt_components": {"gold_output": "53\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\tif len(os.Args) > 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(os.Stdout)\n\n\ta := getNextInt(scanner)\n\tb := getNextInt(scanner)\n\tc := getNextInt(scanner)\n\n\tans := a + b + c\n\tmax := a\n\tif max < b {\n\t\tmax = b\n\t}\n\tif max < c {\n\t\tmax = c\n\t}\n\tfmt.Fprintln(writer, ans+9*max)\n\n\twriter.Flush()\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou have decided to give an allowance to your child depending on the outcome of the game that he will play now.\n\nThe game is played as follows:\n\nThere are three \"integer panels\", each with a digit between 1 and 9 (inclusive) printed on it, and one \"operator panel\" with a + printed on it.\n\nThe player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)\n\nThen, the amount of the allowance will be equal to the resulting value of the formula.\n\nGiven the values A, B and C printed on the integer panels used in the game, find the maximum possible amount of the allowance.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the maximum possible amount of the allowance.\n\nSample Input 1\n\n1 5 2\n\nSample Output 1\n\n53\n\nThe amount of the allowance will be 53 when the panels are arranged as 52+1, and this is the maximum possible amount.\n\nSample Input 2\n\n9 9 9\n\nSample Output 2\n\n108\n\nSample Input 3\n\n6 6 7\n\nSample Output 3\n\n82", "sample_input": "1 5 2\n"}, "reference_outputs": ["53\n"], "source_document_id": "p03250", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou have decided to give an allowance to your child depending on the outcome of the game that he will play now.\n\nThe game is played as follows:\n\nThere are three \"integer panels\", each with a digit between 1 and 9 (inclusive) printed on it, and one \"operator panel\" with a + printed on it.\n\nThe player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)\n\nThen, the amount of the allowance will be equal to the resulting value of the formula.\n\nGiven the values A, B and C printed on the integer panels used in the game, find the maximum possible amount of the allowance.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the maximum possible amount of the allowance.\n\nSample Input 1\n\n1 5 2\n\nSample Output 1\n\n53\n\nThe amount of the allowance will be 53 when the panels are arranged as 52+1, and this is the maximum possible amount.\n\nSample Input 2\n\n9 9 9\n\nSample Output 2\n\n108\n\nSample Input 3\n\n6 6 7\n\nSample Output 3\n\n82", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 800, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s232686938", "group_id": "codeNet:p03250", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\tReadString = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\t// Split sets the split function for the Scanner. The default split function is ScanLines.\n\t// Split panics if it is called after scanning has started.\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n/*********** Arithmetic ***********/\n\n// Max returns the max integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Max(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m < integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// Min returns the min integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Min(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m > integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// PowInt is integer version of math.Pow\nfunc PowInt(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(errors.New(\"[argument error]: PowInt does not accept negative integers\"))\n\t}\n\tfa := float64(a)\n\tfe := float64(e)\n\tfanswer := math.Pow(fa, fe)\n\treturn int(fanswer)\n}\n\n// AbsInt is integer version of math.Abs\nfunc AbsInt(a int) int {\n\tfa := float64(a)\n\tfanswer := math.Abs(fa)\n\treturn int(fanswer)\n}\n\n// Gcd returns the Greatest Common Divisor of two natural numbers.\n// Gcd only accepts two natural numbers (a, b >= 1).\n// 0 or negative number causes panic.\n// Gcd uses the Euclidean Algorithm.\nfunc Gcd(a, b int) int {\n\tif a <= 0 || b <= 0 {\n\t\tpanic(errors.New(\"[argument error]: Gcd only accepts two NATURAL numbers\"))\n\t}\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\n\t// Euclidean Algorithm\n\tfor b > 0 {\n\t\tdiv := a % b\n\t\ta, b = b, div\n\t}\n\n\treturn a\n}\n\n// Lcm returns the Least Common Multiple of two natural numbers.\n// Lcd only accepts two natural numbers (a, b >= 1).\n// 0 or negative number causes panic.\n// Lcd uses the Euclidean Algorithm indirectly.\nfunc Lcm(a, b int) int {\n\tif a <= 0 || b <= 0 {\n\t\tpanic(errors.New(\"[argument error]: Gcd only accepts two NATURAL numbers\"))\n\t}\n\n\t// a = a'*gcd, b = b'*gcd, a*b = a'*b'*gcd^2\n\t// a' and b' are relatively prime numbers\n\t// gcd consists of prime numbers, that are included in a and b\n\tgcd := Gcd(a, b)\n\n\t// not (a * b / gcd), because of reducing a probability of overflow\n\treturn (a / gcd) * b\n}\n\n/*********** Utilities ***********/\n\n// DeleteElement returns a *NEW* slice, that have the same and minimum length and capacity.\n// DeleteElement makes a new slice by using easy slice literal.\nfunc DeleteElement(s []int, i int) []int {\n\tif i < 0 || len(s) <= i {\n\t\tpanic(errors.New(\"[index error]\"))\n\t}\n\t// appendのみの実装\n\tn := make([]int, 0, len(s)-1)\n\tn = append(n, s[:i]...)\n\tn = append(n, s[i+1:]...)\n\treturn n\n}\n\n// Concat returns a *NEW* slice, that have the same and minimum length and capacity.\nfunc Concat(s, t []rune) []rune {\n\tn := make([]rune, 0, len(s)+len(t))\n\tn = append(n, s...)\n\tn = append(n, t...)\n\treturn n\n}\n\n// UpperRune is rune version of `strings.ToUpper()`.\nfunc UpperRune(r rune) rune {\n\tstr := strings.ToUpper(string(r))\n\treturn []rune(str)[0]\n}\n\n// LowerRune is rune version of `strings.ToLower()`.\nfunc LowerRune(r rune) rune {\n\tstr := strings.ToLower(string(r))\n\treturn []rune(str)[0]\n}\n\n// ToggleRune returns a upper case if an input is a lower case, v.v.\nfunc ToggleRune(r rune) rune {\n\tvar str string\n\tif 'a' <= r && r <= 'z' {\n\t\tstr = strings.ToUpper(string(r))\n\t} else if 'A' <= r && r <= 'Z' {\n\t\tstr = strings.ToLower(string(r))\n\t} else {\n\t\tstr = string(r)\n\t}\n\treturn []rune(str)[0]\n}\n\n// ToggleString iteratively calls ToggleRune, and returns the toggled string.\nfunc ToggleString(s string) string {\n\tinputRunes := []rune(s)\n\toutputRunes := make([]rune, 0, len(inputRunes))\n\tfor _, r := range inputRunes {\n\t\toutputRunes = append(outputRunes, ToggleRune(r))\n\t}\n\treturn string(outputRunes)\n}\n\n// Strtoi is a wrapper of `strconv.Atoi()`.\n// If `strconv.Atoi()` returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n/*********** Binary Search ***********/\n\n// LowerBound returns an index of a slice whose value is EQUAL TO AND LARGER THAN A KEY VALUE.\nfunc LowerBound(s []int, key int) int {\n\tisLarger := func(index, key int) bool {\n\t\tif s[index] >= key {\n\t\t\treturn true\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tleft, right := -1, len(s)\n\n\tfor right-left > 1 {\n\t\tmid := left + (right-left)/2\n\t\tif isLarger(mid, key) {\n\t\t\tright = mid\n\t\t} else {\n\t\t\tleft = mid\n\t\t}\n\t}\n\n\treturn right\n}\n\n// UpperBound returns an index of a slice whose value is EQUAL TO AND SMALLER THAN A KEY VALUE.\nfunc UpperBound(s []int, key int) int {\n\tisSmaller := func(index, key int) bool {\n\t\tif s[index] <= key {\n\t\t\treturn true\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tleft, right := -1, len(s)\n\n\tfor right-left > 1 {\n\t\tmid := left + (right-left)/2\n\t\tif isSmaller(mid, key) {\n\t\t\tleft = mid\n\t\t} else {\n\t\t\tright = mid\n\t\t}\n\t}\n\n\treturn left\n}\n\n/*********** Factorization, Prime Number ***********/\n\n// TrialDivision returns the result of prime factorization of integer N.\nfunc TrialDivision(n int) map[int]int {\n\tif n <= 0 {\n\t\tpanic(errors.New(\"[argument error]: TrialDivision only accepts a NATURAL number\"))\n\t}\n\tif n == 1 {\n\t\treturn map[int]int{1: 1}\n\t}\n\n\tp := map[int]int{}\n\tsqrt := math.Pow(float64(n), 0.5)\n\tfor i := 2; i <= int(sqrt); i++ {\n\t\texp := 0\n\t\tfor n%i == 0 {\n\t\t\texp++\n\t\t\tn /= i\n\t\t}\n\n\t\tif exp == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tp[i] = exp\n\t}\n\tif n > 1 {\n\t\tp[n] = 1\n\t}\n\n\treturn p\n}\n\n// IsPrime judges whether an argument integer is a prime number or not.\nfunc IsPrime(n int) bool {\n\tif n == 1 {\n\t\treturn false\n\t}\n\n\tsqrt := math.Pow(float64(n), 0.5)\n\tfor i := 2; i <= int(sqrt); i++ {\n\t\tif n%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\n/********** sort package (snippets) **********/\n//sort.Sort(sort.IntSlice(s))\n//sort.Sort(sort.Reverse(sort.IntSlice(s)))\n//sort.Sort(sort.Float64Slice(s))\n//sort.Sort(sort.StringSlice(s))\n\n/********** copy function (snippets) **********/\n//a = []int{0, 1, 2}\n//b = make([]int, len(a))\n//copy(b, a)\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n\n/*******************************************************************/\n\nconst mod = 1e9 + 7\n\nvar a, b, c int\n\nfunc main() {\n\ta, b, c = ReadInt(), ReadInt(), ReadInt()\n\tfmt.Println(Max(10*a+b+c, a+10*b+c, a+b+10*c))\n}\n", "language": "Go", "metadata": {"date": 1547697800, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03250.html", "problem_id": "p03250", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03250/input.txt", "sample_output_relpath": "derived/input_output/data/p03250/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03250/Go/s232686938.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s232686938", "user_id": "u103600314"}, "prompt_components": {"gold_output": "53\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc init() {\n\tReadString = newReadString(os.Stdin)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nfunc newReadString(ior io.Reader) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\t// Split sets the split function for the Scanner. The default split function is ScanLines.\n\t// Split panics if it is called after scanning has started.\n\tr.Split(bufio.ScanWords)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n/*********** Arithmetic ***********/\n\n// Max returns the max integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Max(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m < integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// Min returns the min integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Min(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m > integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// PowInt is integer version of math.Pow\nfunc PowInt(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(errors.New(\"[argument error]: PowInt does not accept negative integers\"))\n\t}\n\tfa := float64(a)\n\tfe := float64(e)\n\tfanswer := math.Pow(fa, fe)\n\treturn int(fanswer)\n}\n\n// AbsInt is integer version of math.Abs\nfunc AbsInt(a int) int {\n\tfa := float64(a)\n\tfanswer := math.Abs(fa)\n\treturn int(fanswer)\n}\n\n// Gcd returns the Greatest Common Divisor of two natural numbers.\n// Gcd only accepts two natural numbers (a, b >= 1).\n// 0 or negative number causes panic.\n// Gcd uses the Euclidean Algorithm.\nfunc Gcd(a, b int) int {\n\tif a <= 0 || b <= 0 {\n\t\tpanic(errors.New(\"[argument error]: Gcd only accepts two NATURAL numbers\"))\n\t}\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\n\t// Euclidean Algorithm\n\tfor b > 0 {\n\t\tdiv := a % b\n\t\ta, b = b, div\n\t}\n\n\treturn a\n}\n\n// Lcm returns the Least Common Multiple of two natural numbers.\n// Lcd only accepts two natural numbers (a, b >= 1).\n// 0 or negative number causes panic.\n// Lcd uses the Euclidean Algorithm indirectly.\nfunc Lcm(a, b int) int {\n\tif a <= 0 || b <= 0 {\n\t\tpanic(errors.New(\"[argument error]: Gcd only accepts two NATURAL numbers\"))\n\t}\n\n\t// a = a'*gcd, b = b'*gcd, a*b = a'*b'*gcd^2\n\t// a' and b' are relatively prime numbers\n\t// gcd consists of prime numbers, that are included in a and b\n\tgcd := Gcd(a, b)\n\n\t// not (a * b / gcd), because of reducing a probability of overflow\n\treturn (a / gcd) * b\n}\n\n/*********** Utilities ***********/\n\n// DeleteElement returns a *NEW* slice, that have the same and minimum length and capacity.\n// DeleteElement makes a new slice by using easy slice literal.\nfunc DeleteElement(s []int, i int) []int {\n\tif i < 0 || len(s) <= i {\n\t\tpanic(errors.New(\"[index error]\"))\n\t}\n\t// appendのみの実装\n\tn := make([]int, 0, len(s)-1)\n\tn = append(n, s[:i]...)\n\tn = append(n, s[i+1:]...)\n\treturn n\n}\n\n// Concat returns a *NEW* slice, that have the same and minimum length and capacity.\nfunc Concat(s, t []rune) []rune {\n\tn := make([]rune, 0, len(s)+len(t))\n\tn = append(n, s...)\n\tn = append(n, t...)\n\treturn n\n}\n\n// UpperRune is rune version of `strings.ToUpper()`.\nfunc UpperRune(r rune) rune {\n\tstr := strings.ToUpper(string(r))\n\treturn []rune(str)[0]\n}\n\n// LowerRune is rune version of `strings.ToLower()`.\nfunc LowerRune(r rune) rune {\n\tstr := strings.ToLower(string(r))\n\treturn []rune(str)[0]\n}\n\n// ToggleRune returns a upper case if an input is a lower case, v.v.\nfunc ToggleRune(r rune) rune {\n\tvar str string\n\tif 'a' <= r && r <= 'z' {\n\t\tstr = strings.ToUpper(string(r))\n\t} else if 'A' <= r && r <= 'Z' {\n\t\tstr = strings.ToLower(string(r))\n\t} else {\n\t\tstr = string(r)\n\t}\n\treturn []rune(str)[0]\n}\n\n// ToggleString iteratively calls ToggleRune, and returns the toggled string.\nfunc ToggleString(s string) string {\n\tinputRunes := []rune(s)\n\toutputRunes := make([]rune, 0, len(inputRunes))\n\tfor _, r := range inputRunes {\n\t\toutputRunes = append(outputRunes, ToggleRune(r))\n\t}\n\treturn string(outputRunes)\n}\n\n// Strtoi is a wrapper of `strconv.Atoi()`.\n// If `strconv.Atoi()` returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n/*********** Binary Search ***********/\n\n// LowerBound returns an index of a slice whose value is EQUAL TO AND LARGER THAN A KEY VALUE.\nfunc LowerBound(s []int, key int) int {\n\tisLarger := func(index, key int) bool {\n\t\tif s[index] >= key {\n\t\t\treturn true\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tleft, right := -1, len(s)\n\n\tfor right-left > 1 {\n\t\tmid := left + (right-left)/2\n\t\tif isLarger(mid, key) {\n\t\t\tright = mid\n\t\t} else {\n\t\t\tleft = mid\n\t\t}\n\t}\n\n\treturn right\n}\n\n// UpperBound returns an index of a slice whose value is EQUAL TO AND SMALLER THAN A KEY VALUE.\nfunc UpperBound(s []int, key int) int {\n\tisSmaller := func(index, key int) bool {\n\t\tif s[index] <= key {\n\t\t\treturn true\n\t\t} else {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tleft, right := -1, len(s)\n\n\tfor right-left > 1 {\n\t\tmid := left + (right-left)/2\n\t\tif isSmaller(mid, key) {\n\t\t\tleft = mid\n\t\t} else {\n\t\t\tright = mid\n\t\t}\n\t}\n\n\treturn left\n}\n\n/*********** Factorization, Prime Number ***********/\n\n// TrialDivision returns the result of prime factorization of integer N.\nfunc TrialDivision(n int) map[int]int {\n\tif n <= 0 {\n\t\tpanic(errors.New(\"[argument error]: TrialDivision only accepts a NATURAL number\"))\n\t}\n\tif n == 1 {\n\t\treturn map[int]int{1: 1}\n\t}\n\n\tp := map[int]int{}\n\tsqrt := math.Pow(float64(n), 0.5)\n\tfor i := 2; i <= int(sqrt); i++ {\n\t\texp := 0\n\t\tfor n%i == 0 {\n\t\t\texp++\n\t\t\tn /= i\n\t\t}\n\n\t\tif exp == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tp[i] = exp\n\t}\n\tif n > 1 {\n\t\tp[n] = 1\n\t}\n\n\treturn p\n}\n\n// IsPrime judges whether an argument integer is a prime number or not.\nfunc IsPrime(n int) bool {\n\tif n == 1 {\n\t\treturn false\n\t}\n\n\tsqrt := math.Pow(float64(n), 0.5)\n\tfor i := 2; i <= int(sqrt); i++ {\n\t\tif n%i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\n/********** sort package (snippets) **********/\n//sort.Sort(sort.IntSlice(s))\n//sort.Sort(sort.Reverse(sort.IntSlice(s)))\n//sort.Sort(sort.Float64Slice(s))\n//sort.Sort(sort.StringSlice(s))\n\n/********** copy function (snippets) **********/\n//a = []int{0, 1, 2}\n//b = make([]int, len(a))\n//copy(b, a)\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n\n/*******************************************************************/\n\nconst mod = 1e9 + 7\n\nvar a, b, c int\n\nfunc main() {\n\ta, b, c = ReadInt(), ReadInt(), ReadInt()\n\tfmt.Println(Max(10*a+b+c, a+10*b+c, a+b+10*c))\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou have decided to give an allowance to your child depending on the outcome of the game that he will play now.\n\nThe game is played as follows:\n\nThere are three \"integer panels\", each with a digit between 1 and 9 (inclusive) printed on it, and one \"operator panel\" with a + printed on it.\n\nThe player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)\n\nThen, the amount of the allowance will be equal to the resulting value of the formula.\n\nGiven the values A, B and C printed on the integer panels used in the game, find the maximum possible amount of the allowance.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the maximum possible amount of the allowance.\n\nSample Input 1\n\n1 5 2\n\nSample Output 1\n\n53\n\nThe amount of the allowance will be 53 when the panels are arranged as 52+1, and this is the maximum possible amount.\n\nSample Input 2\n\n9 9 9\n\nSample Output 2\n\n108\n\nSample Input 3\n\n6 6 7\n\nSample Output 3\n\n82", "sample_input": "1 5 2\n"}, "reference_outputs": ["53\n"], "source_document_id": "p03250", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou have decided to give an allowance to your child depending on the outcome of the game that he will play now.\n\nThe game is played as follows:\n\nThere are three \"integer panels\", each with a digit between 1 and 9 (inclusive) printed on it, and one \"operator panel\" with a + printed on it.\n\nThe player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)\n\nThen, the amount of the allowance will be equal to the resulting value of the formula.\n\nGiven the values A, B and C printed on the integer panels used in the game, find the maximum possible amount of the allowance.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the maximum possible amount of the allowance.\n\nSample Input 1\n\n1 5 2\n\nSample Output 1\n\n53\n\nThe amount of the allowance will be 53 when the panels are arranged as 52+1, and this is the maximum possible amount.\n\nSample Input 2\n\n9 9 9\n\nSample Output 2\n\n108\n\nSample Input 3\n\n6 6 7\n\nSample Output 3\n\n82", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 7383, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s187860073", "group_id": "codeNet:p03250", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tnums := make([]int, 3)\n\tfor i := 0; i < 3; i++ {\n\t\tfmt.Scan(&nums[i])\n\t}\n\n\tsort.Sort(sort.Reverse(sort.IntSlice(nums)))\n ans := nums[0]*10 + nums[1] + nums[2]\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1546457999, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03250.html", "problem_id": "p03250", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03250/input.txt", "sample_output_relpath": "derived/input_output/data/p03250/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03250/Go/s187860073.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s187860073", "user_id": "u864667985"}, "prompt_components": {"gold_output": "53\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tnums := make([]int, 3)\n\tfor i := 0; i < 3; i++ {\n\t\tfmt.Scan(&nums[i])\n\t}\n\n\tsort.Sort(sort.Reverse(sort.IntSlice(nums)))\n ans := nums[0]*10 + nums[1] + nums[2]\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou have decided to give an allowance to your child depending on the outcome of the game that he will play now.\n\nThe game is played as follows:\n\nThere are three \"integer panels\", each with a digit between 1 and 9 (inclusive) printed on it, and one \"operator panel\" with a + printed on it.\n\nThe player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)\n\nThen, the amount of the allowance will be equal to the resulting value of the formula.\n\nGiven the values A, B and C printed on the integer panels used in the game, find the maximum possible amount of the allowance.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the maximum possible amount of the allowance.\n\nSample Input 1\n\n1 5 2\n\nSample Output 1\n\n53\n\nThe amount of the allowance will be 53 when the panels are arranged as 52+1, and this is the maximum possible amount.\n\nSample Input 2\n\n9 9 9\n\nSample Output 2\n\n108\n\nSample Input 3\n\n6 6 7\n\nSample Output 3\n\n82", "sample_input": "1 5 2\n"}, "reference_outputs": ["53\n"], "source_document_id": "p03250", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou have decided to give an allowance to your child depending on the outcome of the game that he will play now.\n\nThe game is played as follows:\n\nThere are three \"integer panels\", each with a digit between 1 and 9 (inclusive) printed on it, and one \"operator panel\" with a + printed on it.\n\nThe player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)\n\nThen, the amount of the allowance will be equal to the resulting value of the formula.\n\nGiven the values A, B and C printed on the integer panels used in the game, find the maximum possible amount of the allowance.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the maximum possible amount of the allowance.\n\nSample Input 1\n\n1 5 2\n\nSample Output 1\n\n53\n\nThe amount of the allowance will be 53 when the panels are arranged as 52+1, and this is the maximum possible amount.\n\nSample Input 2\n\n9 9 9\n\nSample Output 2\n\n108\n\nSample Input 3\n\n6 6 7\n\nSample Output 3\n\n82", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 238, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s436593712", "group_id": "codeNet:p03250", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\ts := IOInitialize()\n\tA := Int(s)\n\tB := Int(s)\n\tC := Int(s)\n\tnums := []int{A, B, C}\n\tindex := max(nums)\n\tres := 0\n\tfor i, num := range nums {\n\t\tif i == index {\n\t\t\tres += num * 10\n\t\t} else {\n\t\t\tres += num\n\t\t}\n\t}\n\tfmt.Println(res)\n}\n\nfunc max(nums []int) int {\n\tres := 0\n\tn := nums[0]\n\tfor i, num := range nums {\n\t\tif n < num {\n\t\t\tn = num\n\t\t\tres = i\n\t\t}\n\t}\n\treturn res\n}\n\nfunc IOInitialize() *bufio.Scanner {\n\ts := bufio.NewScanner(os.Stdin)\n\ts.Split(bufio.ScanWords)\n\treturn s\n}\n\nfunc Int(s *bufio.Scanner) int {\n\tif !s.Scan() {\n\t\tpanic(\"scan error\")\n\t}\n\n\tvalue, err := strconv.Atoi(s.Text())\n\tif err != nil {\n\t\tpanic(\"text to int error\")\n\t}\n\treturn value\n}\n\nfunc String(s *bufio.Scanner) string {\n\tif !s.Scan() {\n\t\tpanic(\"scan error\")\n\t}\n\n\treturn s.Text()\n}\n\nfunc scanNums(s *bufio.Scanner, len int) (nums []int) {\n\tfor i := 0; i < len; i++ {\n\t\tnum := Int(s)\n\t\tnums = append(nums, num)\n\t}\n\treturn\n}\n\nfunc scanstrings(s *bufio.Scanner, len int) (strs []string) {\n\tfor i := 0; i < len; i++ {\n\t\tstr := String(s)\n\t\tstrs = append(strs, str)\n\t}\n\treturn\n}\n", "language": "Go", "metadata": {"date": 1538251657, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03250.html", "problem_id": "p03250", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03250/input.txt", "sample_output_relpath": "derived/input_output/data/p03250/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03250/Go/s436593712.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s436593712", "user_id": "u029329478"}, "prompt_components": {"gold_output": "53\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\ts := IOInitialize()\n\tA := Int(s)\n\tB := Int(s)\n\tC := Int(s)\n\tnums := []int{A, B, C}\n\tindex := max(nums)\n\tres := 0\n\tfor i, num := range nums {\n\t\tif i == index {\n\t\t\tres += num * 10\n\t\t} else {\n\t\t\tres += num\n\t\t}\n\t}\n\tfmt.Println(res)\n}\n\nfunc max(nums []int) int {\n\tres := 0\n\tn := nums[0]\n\tfor i, num := range nums {\n\t\tif n < num {\n\t\t\tn = num\n\t\t\tres = i\n\t\t}\n\t}\n\treturn res\n}\n\nfunc IOInitialize() *bufio.Scanner {\n\ts := bufio.NewScanner(os.Stdin)\n\ts.Split(bufio.ScanWords)\n\treturn s\n}\n\nfunc Int(s *bufio.Scanner) int {\n\tif !s.Scan() {\n\t\tpanic(\"scan error\")\n\t}\n\n\tvalue, err := strconv.Atoi(s.Text())\n\tif err != nil {\n\t\tpanic(\"text to int error\")\n\t}\n\treturn value\n}\n\nfunc String(s *bufio.Scanner) string {\n\tif !s.Scan() {\n\t\tpanic(\"scan error\")\n\t}\n\n\treturn s.Text()\n}\n\nfunc scanNums(s *bufio.Scanner, len int) (nums []int) {\n\tfor i := 0; i < len; i++ {\n\t\tnum := Int(s)\n\t\tnums = append(nums, num)\n\t}\n\treturn\n}\n\nfunc scanstrings(s *bufio.Scanner, len int) (strs []string) {\n\tfor i := 0; i < len; i++ {\n\t\tstr := String(s)\n\t\tstrs = append(strs, str)\n\t}\n\treturn\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou have decided to give an allowance to your child depending on the outcome of the game that he will play now.\n\nThe game is played as follows:\n\nThere are three \"integer panels\", each with a digit between 1 and 9 (inclusive) printed on it, and one \"operator panel\" with a + printed on it.\n\nThe player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)\n\nThen, the amount of the allowance will be equal to the resulting value of the formula.\n\nGiven the values A, B and C printed on the integer panels used in the game, find the maximum possible amount of the allowance.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the maximum possible amount of the allowance.\n\nSample Input 1\n\n1 5 2\n\nSample Output 1\n\n53\n\nThe amount of the allowance will be 53 when the panels are arranged as 52+1, and this is the maximum possible amount.\n\nSample Input 2\n\n9 9 9\n\nSample Output 2\n\n108\n\nSample Input 3\n\n6 6 7\n\nSample Output 3\n\n82", "sample_input": "1 5 2\n"}, "reference_outputs": ["53\n"], "source_document_id": "p03250", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou have decided to give an allowance to your child depending on the outcome of the game that he will play now.\n\nThe game is played as follows:\n\nThere are three \"integer panels\", each with a digit between 1 and 9 (inclusive) printed on it, and one \"operator panel\" with a + printed on it.\n\nThe player should construct a formula of the form X + Y, by arranging the four panels from left to right. (The operator panel should not be placed at either end of the formula.)\n\nThen, the amount of the allowance will be equal to the resulting value of the formula.\n\nGiven the values A, B and C printed on the integer panels used in the game, find the maximum possible amount of the allowance.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, C \\leq 9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the maximum possible amount of the allowance.\n\nSample Input 1\n\n1 5 2\n\nSample Output 1\n\n53\n\nThe amount of the allowance will be 53 when the panels are arranged as 52+1, and this is the maximum possible amount.\n\nSample Input 2\n\n9 9 9\n\nSample Output 2\n\n108\n\nSample Input 3\n\n6 6 7\n\nSample Output 3\n\n82", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1122, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s363298359", "group_id": "codeNet:p03251", "input_text": "package main\n\nimport (\n \"fmt\"\n \"sort\"\n)\n\nfunc main() {\n var n, m, X, Y int \n fmt.Scan(&n, &m, &X, &Y)\n x := make([]int, n)\n y := make([]int, m)\n for i := 0; i < n; i++ {\n fmt.Scan(&x[i])\n }\n for i := 0; i < m; i++ {\n fmt.Scan(&y[i])\n }\n x = append(x, X)\n y = append(y, Y)\n sort.Ints(x)\n sort.Ints(y)\n\n ans := \"No War\"\n if x[n] >= y[0] {\n ans = \"War\"\n }\n fmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1588047263, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03251.html", "problem_id": "p03251", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03251/input.txt", "sample_output_relpath": "derived/input_output/data/p03251/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03251/Go/s363298359.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s363298359", "user_id": "u254871849"}, "prompt_components": {"gold_output": "No War\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"sort\"\n)\n\nfunc main() {\n var n, m, X, Y int \n fmt.Scan(&n, &m, &X, &Y)\n x := make([]int, n)\n y := make([]int, m)\n for i := 0; i < n; i++ {\n fmt.Scan(&x[i])\n }\n for i := 0; i < m; i++ {\n fmt.Scan(&y[i])\n }\n x = append(x, X)\n y = append(y, Y)\n sort.Ints(x)\n sort.Ints(y)\n\n ans := \"No War\"\n if x[n] >= y[0] {\n ans = \"War\"\n }\n fmt.Println(ans)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nOur world is one-dimensional, and ruled by two empires called Empire A and Empire B.\n\nThe capital of Empire A is located at coordinate X, and that of Empire B is located at coordinate Y.\n\nOne day, Empire A becomes inclined to put the cities at coordinates x_1, x_2, ..., x_N under its control, and Empire B becomes inclined to put the cities at coordinates y_1, y_2, ..., y_M under its control.\n\nIf there exists an integer Z that satisfies all of the following three conditions, they will come to an agreement, but otherwise war will break out.\n\nX < Z \\leq Y\n\nx_1, x_2, ..., x_N < Z\n\ny_1, y_2, ..., y_M \\geq Z\n\nDetermine if war will break out.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 100\n\n-100 \\leq X < Y \\leq 100\n\n-100 \\leq x_i, y_i \\leq 100\n\nx_1, x_2, ..., x_N \\neq X\n\nx_i are all different.\n\ny_1, y_2, ..., y_M \\neq Y\n\ny_i are all different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M X Y\nx_1 x_2 ... x_N\ny_1 y_2 ... y_M\n\nOutput\n\nIf war will break out, print War; otherwise, print No War.\n\nSample Input 1\n\n3 2 10 20\n8 15 13\n16 22\n\nSample Output 1\n\nNo War\n\nThe choice Z = 16 satisfies all of the three conditions as follows, thus they will come to an agreement.\n\nX = 10 < 16 \\leq 20 = Y\n\n8, 15, 13 < 16\n\n16, 22 \\geq 16\n\nSample Input 2\n\n4 2 -48 -1\n-20 -35 -91 -23\n-22 66\n\nSample Output 2\n\nWar\n\nSample Input 3\n\n5 3 6 8\n-10 3 1 5 -100\n100 6 14\n\nSample Output 3\n\nWar", "sample_input": "3 2 10 20\n8 15 13\n16 22\n"}, "reference_outputs": ["No War\n"], "source_document_id": "p03251", "source_text": "Score : 200 points\n\nProblem Statement\n\nOur world is one-dimensional, and ruled by two empires called Empire A and Empire B.\n\nThe capital of Empire A is located at coordinate X, and that of Empire B is located at coordinate Y.\n\nOne day, Empire A becomes inclined to put the cities at coordinates x_1, x_2, ..., x_N under its control, and Empire B becomes inclined to put the cities at coordinates y_1, y_2, ..., y_M under its control.\n\nIf there exists an integer Z that satisfies all of the following three conditions, they will come to an agreement, but otherwise war will break out.\n\nX < Z \\leq Y\n\nx_1, x_2, ..., x_N < Z\n\ny_1, y_2, ..., y_M \\geq Z\n\nDetermine if war will break out.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 100\n\n-100 \\leq X < Y \\leq 100\n\n-100 \\leq x_i, y_i \\leq 100\n\nx_1, x_2, ..., x_N \\neq X\n\nx_i are all different.\n\ny_1, y_2, ..., y_M \\neq Y\n\ny_i are all different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M X Y\nx_1 x_2 ... x_N\ny_1 y_2 ... y_M\n\nOutput\n\nIf war will break out, print War; otherwise, print No War.\n\nSample Input 1\n\n3 2 10 20\n8 15 13\n16 22\n\nSample Output 1\n\nNo War\n\nThe choice Z = 16 satisfies all of the three conditions as follows, thus they will come to an agreement.\n\nX = 10 < 16 \\leq 20 = Y\n\n8, 15, 13 < 16\n\n16, 22 \\geq 16\n\nSample Input 2\n\n4 2 -48 -1\n-20 -35 -91 -23\n-22 66\n\nSample Output 2\n\nWar\n\nSample Input 3\n\n5 3 6 8\n-10 3 1 5 -100\n100 6 14\n\nSample Output 3\n\nWar", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 399, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s897599197", "group_id": "codeNet:p03251", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar N,M,X,Y int\n\tfmt.Scan(&N,&M,&X,&Y)\n\tx := make([]int,N)\n\ty := make([]int,M)\n\tfor i:=0;i x[i]{\n\t\t\tymin = x[i]\n\t\t}\n\t}\n\n\tif xmax < ymin && X < Y {\n\t\tfmt.Println(\"No War\")\n\t}else {\n\t\tfmt.Println(\"War\")\n\t}\n\n}", "language": "Go", "metadata": {"date": 1566614996, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03251.html", "problem_id": "p03251", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03251/input.txt", "sample_output_relpath": "derived/input_output/data/p03251/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03251/Go/s897599197.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s897599197", "user_id": "u546051065"}, "prompt_components": {"gold_output": "No War\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar N,M,X,Y int\n\tfmt.Scan(&N,&M,&X,&Y)\n\tx := make([]int,N)\n\ty := make([]int,M)\n\tfor i:=0;i x[i]{\n\t\t\tymin = x[i]\n\t\t}\n\t}\n\n\tif xmax < ymin && X < Y {\n\t\tfmt.Println(\"No War\")\n\t}else {\n\t\tfmt.Println(\"War\")\n\t}\n\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nOur world is one-dimensional, and ruled by two empires called Empire A and Empire B.\n\nThe capital of Empire A is located at coordinate X, and that of Empire B is located at coordinate Y.\n\nOne day, Empire A becomes inclined to put the cities at coordinates x_1, x_2, ..., x_N under its control, and Empire B becomes inclined to put the cities at coordinates y_1, y_2, ..., y_M under its control.\n\nIf there exists an integer Z that satisfies all of the following three conditions, they will come to an agreement, but otherwise war will break out.\n\nX < Z \\leq Y\n\nx_1, x_2, ..., x_N < Z\n\ny_1, y_2, ..., y_M \\geq Z\n\nDetermine if war will break out.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 100\n\n-100 \\leq X < Y \\leq 100\n\n-100 \\leq x_i, y_i \\leq 100\n\nx_1, x_2, ..., x_N \\neq X\n\nx_i are all different.\n\ny_1, y_2, ..., y_M \\neq Y\n\ny_i are all different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M X Y\nx_1 x_2 ... x_N\ny_1 y_2 ... y_M\n\nOutput\n\nIf war will break out, print War; otherwise, print No War.\n\nSample Input 1\n\n3 2 10 20\n8 15 13\n16 22\n\nSample Output 1\n\nNo War\n\nThe choice Z = 16 satisfies all of the three conditions as follows, thus they will come to an agreement.\n\nX = 10 < 16 \\leq 20 = Y\n\n8, 15, 13 < 16\n\n16, 22 \\geq 16\n\nSample Input 2\n\n4 2 -48 -1\n-20 -35 -91 -23\n-22 66\n\nSample Output 2\n\nWar\n\nSample Input 3\n\n5 3 6 8\n-10 3 1 5 -100\n100 6 14\n\nSample Output 3\n\nWar", "sample_input": "3 2 10 20\n8 15 13\n16 22\n"}, "reference_outputs": ["No War\n"], "source_document_id": "p03251", "source_text": "Score : 200 points\n\nProblem Statement\n\nOur world is one-dimensional, and ruled by two empires called Empire A and Empire B.\n\nThe capital of Empire A is located at coordinate X, and that of Empire B is located at coordinate Y.\n\nOne day, Empire A becomes inclined to put the cities at coordinates x_1, x_2, ..., x_N under its control, and Empire B becomes inclined to put the cities at coordinates y_1, y_2, ..., y_M under its control.\n\nIf there exists an integer Z that satisfies all of the following three conditions, they will come to an agreement, but otherwise war will break out.\n\nX < Z \\leq Y\n\nx_1, x_2, ..., x_N < Z\n\ny_1, y_2, ..., y_M \\geq Z\n\nDetermine if war will break out.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 100\n\n-100 \\leq X < Y \\leq 100\n\n-100 \\leq x_i, y_i \\leq 100\n\nx_1, x_2, ..., x_N \\neq X\n\nx_i are all different.\n\ny_1, y_2, ..., y_M \\neq Y\n\ny_i are all different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M X Y\nx_1 x_2 ... x_N\ny_1 y_2 ... y_M\n\nOutput\n\nIf war will break out, print War; otherwise, print No War.\n\nSample Input 1\n\n3 2 10 20\n8 15 13\n16 22\n\nSample Output 1\n\nNo War\n\nThe choice Z = 16 satisfies all of the three conditions as follows, thus they will come to an agreement.\n\nX = 10 < 16 \\leq 20 = Y\n\n8, 15, 13 < 16\n\n16, 22 \\geq 16\n\nSample Input 2\n\n4 2 -48 -1\n-20 -35 -91 -23\n-22 66\n\nSample Output 2\n\nWar\n\nSample Input 3\n\n5 3 6 8\n-10 3 1 5 -100\n100 6 14\n\nSample Output 3\n\nWar", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 445, "cpu_time_ms": 4, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s717744731", "group_id": "codeNet:p03251", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N, M, X, Y, in int\n\tfmt.Scan(&N, &M, &X, &Y)\n\txarr := make([]int, N)\n\tyarr := make([]int, M)\n\txmax := -100\n\tymin := 100\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&in)\n\t\tif in > xmax {\n\t\t\txmax = in\n\t\t}\n\t\txarr[i] = in\n\t}\n\tfor i := 0; i < M; i++ {\n\t\tfmt.Scan(&in)\n\t\tif in < ymin {\n\t\t\tymin = in\n\t\t}\n\t\tyarr[i] = in\n\t}\n\tr := \"War\"\n\tfor i := X + 1; i <= Y; i++ {\n\t\tif i > xmax && i <= ymin {\n\t\t\tr = \"No War\"\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(r)\n}", "language": "Go", "metadata": {"date": 1556968294, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03251.html", "problem_id": "p03251", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03251/input.txt", "sample_output_relpath": "derived/input_output/data/p03251/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03251/Go/s717744731.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s717744731", "user_id": "u298152049"}, "prompt_components": {"gold_output": "No War\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N, M, X, Y, in int\n\tfmt.Scan(&N, &M, &X, &Y)\n\txarr := make([]int, N)\n\tyarr := make([]int, M)\n\txmax := -100\n\tymin := 100\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&in)\n\t\tif in > xmax {\n\t\t\txmax = in\n\t\t}\n\t\txarr[i] = in\n\t}\n\tfor i := 0; i < M; i++ {\n\t\tfmt.Scan(&in)\n\t\tif in < ymin {\n\t\t\tymin = in\n\t\t}\n\t\tyarr[i] = in\n\t}\n\tr := \"War\"\n\tfor i := X + 1; i <= Y; i++ {\n\t\tif i > xmax && i <= ymin {\n\t\t\tr = \"No War\"\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(r)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nOur world is one-dimensional, and ruled by two empires called Empire A and Empire B.\n\nThe capital of Empire A is located at coordinate X, and that of Empire B is located at coordinate Y.\n\nOne day, Empire A becomes inclined to put the cities at coordinates x_1, x_2, ..., x_N under its control, and Empire B becomes inclined to put the cities at coordinates y_1, y_2, ..., y_M under its control.\n\nIf there exists an integer Z that satisfies all of the following three conditions, they will come to an agreement, but otherwise war will break out.\n\nX < Z \\leq Y\n\nx_1, x_2, ..., x_N < Z\n\ny_1, y_2, ..., y_M \\geq Z\n\nDetermine if war will break out.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 100\n\n-100 \\leq X < Y \\leq 100\n\n-100 \\leq x_i, y_i \\leq 100\n\nx_1, x_2, ..., x_N \\neq X\n\nx_i are all different.\n\ny_1, y_2, ..., y_M \\neq Y\n\ny_i are all different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M X Y\nx_1 x_2 ... x_N\ny_1 y_2 ... y_M\n\nOutput\n\nIf war will break out, print War; otherwise, print No War.\n\nSample Input 1\n\n3 2 10 20\n8 15 13\n16 22\n\nSample Output 1\n\nNo War\n\nThe choice Z = 16 satisfies all of the three conditions as follows, thus they will come to an agreement.\n\nX = 10 < 16 \\leq 20 = Y\n\n8, 15, 13 < 16\n\n16, 22 \\geq 16\n\nSample Input 2\n\n4 2 -48 -1\n-20 -35 -91 -23\n-22 66\n\nSample Output 2\n\nWar\n\nSample Input 3\n\n5 3 6 8\n-10 3 1 5 -100\n100 6 14\n\nSample Output 3\n\nWar", "sample_input": "3 2 10 20\n8 15 13\n16 22\n"}, "reference_outputs": ["No War\n"], "source_document_id": "p03251", "source_text": "Score : 200 points\n\nProblem Statement\n\nOur world is one-dimensional, and ruled by two empires called Empire A and Empire B.\n\nThe capital of Empire A is located at coordinate X, and that of Empire B is located at coordinate Y.\n\nOne day, Empire A becomes inclined to put the cities at coordinates x_1, x_2, ..., x_N under its control, and Empire B becomes inclined to put the cities at coordinates y_1, y_2, ..., y_M under its control.\n\nIf there exists an integer Z that satisfies all of the following three conditions, they will come to an agreement, but otherwise war will break out.\n\nX < Z \\leq Y\n\nx_1, x_2, ..., x_N < Z\n\ny_1, y_2, ..., y_M \\geq Z\n\nDetermine if war will break out.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 100\n\n-100 \\leq X < Y \\leq 100\n\n-100 \\leq x_i, y_i \\leq 100\n\nx_1, x_2, ..., x_N \\neq X\n\nx_i are all different.\n\ny_1, y_2, ..., y_M \\neq Y\n\ny_i are all different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M X Y\nx_1 x_2 ... x_N\ny_1 y_2 ... y_M\n\nOutput\n\nIf war will break out, print War; otherwise, print No War.\n\nSample Input 1\n\n3 2 10 20\n8 15 13\n16 22\n\nSample Output 1\n\nNo War\n\nThe choice Z = 16 satisfies all of the three conditions as follows, thus they will come to an agreement.\n\nX = 10 < 16 \\leq 20 = Y\n\n8, 15, 13 < 16\n\n16, 22 \\geq 16\n\nSample Input 2\n\n4 2 -48 -1\n-20 -35 -91 -23\n-22 66\n\nSample Output 2\n\nWar\n\nSample Input 3\n\n5 3 6 8\n-10 3 1 5 -100\n100 6 14\n\nSample Output 3\n\nWar", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 481, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s912915250", "group_id": "codeNet:p03251", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc max(a []int) int {\n\tmax := a[0]\n\tfor _, v := range a {\n\t\tif max < v {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}\n\nfunc min(a []int) int {\n\tmin := a[0]\n\tfor _, v := range a {\n\t\tif v < min {\n\t\t\tmin = v\n\t\t}\n\t}\n\treturn min\n}\n\nfunc main() {\n\tvar N, M, X, Y int\n\tfmt.Scan(&N, &M, &X, &Y)\n\n\tx := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&x[i])\n\t}\n\ty := make([]int, M)\n\tfor i := 0; i < M; i++ {\n\t\tfmt.Scan(&y[i])\n\t}\n\n\txmax := max(x)\n\tymin := min(y)\n\n\tfor z := X + 1; z <= Y; z++ {\n\t\tif xmax < z && z <= ymin {\n\t\t\tfmt.Println(\"No War\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"War\")\n}\n", "language": "Go", "metadata": {"date": 1555526335, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03251.html", "problem_id": "p03251", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03251/input.txt", "sample_output_relpath": "derived/input_output/data/p03251/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03251/Go/s912915250.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s912915250", "user_id": "u102310764"}, "prompt_components": {"gold_output": "No War\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc max(a []int) int {\n\tmax := a[0]\n\tfor _, v := range a {\n\t\tif max < v {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}\n\nfunc min(a []int) int {\n\tmin := a[0]\n\tfor _, v := range a {\n\t\tif v < min {\n\t\t\tmin = v\n\t\t}\n\t}\n\treturn min\n}\n\nfunc main() {\n\tvar N, M, X, Y int\n\tfmt.Scan(&N, &M, &X, &Y)\n\n\tx := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scan(&x[i])\n\t}\n\ty := make([]int, M)\n\tfor i := 0; i < M; i++ {\n\t\tfmt.Scan(&y[i])\n\t}\n\n\txmax := max(x)\n\tymin := min(y)\n\n\tfor z := X + 1; z <= Y; z++ {\n\t\tif xmax < z && z <= ymin {\n\t\t\tfmt.Println(\"No War\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"War\")\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nOur world is one-dimensional, and ruled by two empires called Empire A and Empire B.\n\nThe capital of Empire A is located at coordinate X, and that of Empire B is located at coordinate Y.\n\nOne day, Empire A becomes inclined to put the cities at coordinates x_1, x_2, ..., x_N under its control, and Empire B becomes inclined to put the cities at coordinates y_1, y_2, ..., y_M under its control.\n\nIf there exists an integer Z that satisfies all of the following three conditions, they will come to an agreement, but otherwise war will break out.\n\nX < Z \\leq Y\n\nx_1, x_2, ..., x_N < Z\n\ny_1, y_2, ..., y_M \\geq Z\n\nDetermine if war will break out.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 100\n\n-100 \\leq X < Y \\leq 100\n\n-100 \\leq x_i, y_i \\leq 100\n\nx_1, x_2, ..., x_N \\neq X\n\nx_i are all different.\n\ny_1, y_2, ..., y_M \\neq Y\n\ny_i are all different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M X Y\nx_1 x_2 ... x_N\ny_1 y_2 ... y_M\n\nOutput\n\nIf war will break out, print War; otherwise, print No War.\n\nSample Input 1\n\n3 2 10 20\n8 15 13\n16 22\n\nSample Output 1\n\nNo War\n\nThe choice Z = 16 satisfies all of the three conditions as follows, thus they will come to an agreement.\n\nX = 10 < 16 \\leq 20 = Y\n\n8, 15, 13 < 16\n\n16, 22 \\geq 16\n\nSample Input 2\n\n4 2 -48 -1\n-20 -35 -91 -23\n-22 66\n\nSample Output 2\n\nWar\n\nSample Input 3\n\n5 3 6 8\n-10 3 1 5 -100\n100 6 14\n\nSample Output 3\n\nWar", "sample_input": "3 2 10 20\n8 15 13\n16 22\n"}, "reference_outputs": ["No War\n"], "source_document_id": "p03251", "source_text": "Score : 200 points\n\nProblem Statement\n\nOur world is one-dimensional, and ruled by two empires called Empire A and Empire B.\n\nThe capital of Empire A is located at coordinate X, and that of Empire B is located at coordinate Y.\n\nOne day, Empire A becomes inclined to put the cities at coordinates x_1, x_2, ..., x_N under its control, and Empire B becomes inclined to put the cities at coordinates y_1, y_2, ..., y_M under its control.\n\nIf there exists an integer Z that satisfies all of the following three conditions, they will come to an agreement, but otherwise war will break out.\n\nX < Z \\leq Y\n\nx_1, x_2, ..., x_N < Z\n\ny_1, y_2, ..., y_M \\geq Z\n\nDetermine if war will break out.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 100\n\n-100 \\leq X < Y \\leq 100\n\n-100 \\leq x_i, y_i \\leq 100\n\nx_1, x_2, ..., x_N \\neq X\n\nx_i are all different.\n\ny_1, y_2, ..., y_M \\neq Y\n\ny_i are all different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M X Y\nx_1 x_2 ... x_N\ny_1 y_2 ... y_M\n\nOutput\n\nIf war will break out, print War; otherwise, print No War.\n\nSample Input 1\n\n3 2 10 20\n8 15 13\n16 22\n\nSample Output 1\n\nNo War\n\nThe choice Z = 16 satisfies all of the three conditions as follows, thus they will come to an agreement.\n\nX = 10 < 16 \\leq 20 = Y\n\n8, 15, 13 < 16\n\n16, 22 \\geq 16\n\nSample Input 2\n\n4 2 -48 -1\n-20 -35 -91 -23\n-22 66\n\nSample Output 2\n\nWar\n\nSample Input 3\n\n5 3 6 8\n-10 3 1 5 -100\n100 6 14\n\nSample Output 3\n\nWar", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s451150549", "group_id": "codeNet:p03251", "input_text": "// Package main provides\n//\n// File: b.go\n// Author: ymiyamoto\n//\n// Created on Sun Dec 2 04:51:26 2018\n//\npackage main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nvar n, m, x, y int\n\nfunc main() {\n\tfmt.Scan(&n, &m, &x, &y)\n\n\txs := make([]int, n)\n\tys := make([]int, m)\n\n\tfor i := range xs {\n\t\tfmt.Scan(&xs[i])\n\t}\n\tsort.Ints(xs)\n\tmax := xs[len(xs)-1]\n\n\tfor i := range ys {\n\t\tfmt.Scan(&ys[i])\n\t}\n\tsort.Ints(ys)\n\tmin := ys[0]\n\n\tsort.Ints(ys)\n\tfor i := x + 1; i <= y; i++ {\n\t\tif max < i && i <= min {\n\t\t\tfmt.Println(\"No War\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"War\")\n}\n", "language": "Go", "metadata": {"date": 1543744979, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03251.html", "problem_id": "p03251", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03251/input.txt", "sample_output_relpath": "derived/input_output/data/p03251/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03251/Go/s451150549.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s451150549", "user_id": "u842030412"}, "prompt_components": {"gold_output": "No War\n", "input_to_evaluate": "// Package main provides\n//\n// File: b.go\n// Author: ymiyamoto\n//\n// Created on Sun Dec 2 04:51:26 2018\n//\npackage main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nvar n, m, x, y int\n\nfunc main() {\n\tfmt.Scan(&n, &m, &x, &y)\n\n\txs := make([]int, n)\n\tys := make([]int, m)\n\n\tfor i := range xs {\n\t\tfmt.Scan(&xs[i])\n\t}\n\tsort.Ints(xs)\n\tmax := xs[len(xs)-1]\n\n\tfor i := range ys {\n\t\tfmt.Scan(&ys[i])\n\t}\n\tsort.Ints(ys)\n\tmin := ys[0]\n\n\tsort.Ints(ys)\n\tfor i := x + 1; i <= y; i++ {\n\t\tif max < i && i <= min {\n\t\t\tfmt.Println(\"No War\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"War\")\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nOur world is one-dimensional, and ruled by two empires called Empire A and Empire B.\n\nThe capital of Empire A is located at coordinate X, and that of Empire B is located at coordinate Y.\n\nOne day, Empire A becomes inclined to put the cities at coordinates x_1, x_2, ..., x_N under its control, and Empire B becomes inclined to put the cities at coordinates y_1, y_2, ..., y_M under its control.\n\nIf there exists an integer Z that satisfies all of the following three conditions, they will come to an agreement, but otherwise war will break out.\n\nX < Z \\leq Y\n\nx_1, x_2, ..., x_N < Z\n\ny_1, y_2, ..., y_M \\geq Z\n\nDetermine if war will break out.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 100\n\n-100 \\leq X < Y \\leq 100\n\n-100 \\leq x_i, y_i \\leq 100\n\nx_1, x_2, ..., x_N \\neq X\n\nx_i are all different.\n\ny_1, y_2, ..., y_M \\neq Y\n\ny_i are all different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M X Y\nx_1 x_2 ... x_N\ny_1 y_2 ... y_M\n\nOutput\n\nIf war will break out, print War; otherwise, print No War.\n\nSample Input 1\n\n3 2 10 20\n8 15 13\n16 22\n\nSample Output 1\n\nNo War\n\nThe choice Z = 16 satisfies all of the three conditions as follows, thus they will come to an agreement.\n\nX = 10 < 16 \\leq 20 = Y\n\n8, 15, 13 < 16\n\n16, 22 \\geq 16\n\nSample Input 2\n\n4 2 -48 -1\n-20 -35 -91 -23\n-22 66\n\nSample Output 2\n\nWar\n\nSample Input 3\n\n5 3 6 8\n-10 3 1 5 -100\n100 6 14\n\nSample Output 3\n\nWar", "sample_input": "3 2 10 20\n8 15 13\n16 22\n"}, "reference_outputs": ["No War\n"], "source_document_id": "p03251", "source_text": "Score : 200 points\n\nProblem Statement\n\nOur world is one-dimensional, and ruled by two empires called Empire A and Empire B.\n\nThe capital of Empire A is located at coordinate X, and that of Empire B is located at coordinate Y.\n\nOne day, Empire A becomes inclined to put the cities at coordinates x_1, x_2, ..., x_N under its control, and Empire B becomes inclined to put the cities at coordinates y_1, y_2, ..., y_M under its control.\n\nIf there exists an integer Z that satisfies all of the following three conditions, they will come to an agreement, but otherwise war will break out.\n\nX < Z \\leq Y\n\nx_1, x_2, ..., x_N < Z\n\ny_1, y_2, ..., y_M \\geq Z\n\nDetermine if war will break out.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 100\n\n-100 \\leq X < Y \\leq 100\n\n-100 \\leq x_i, y_i \\leq 100\n\nx_1, x_2, ..., x_N \\neq X\n\nx_i are all different.\n\ny_1, y_2, ..., y_M \\neq Y\n\ny_i are all different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M X Y\nx_1 x_2 ... x_N\ny_1 y_2 ... y_M\n\nOutput\n\nIf war will break out, print War; otherwise, print No War.\n\nSample Input 1\n\n3 2 10 20\n8 15 13\n16 22\n\nSample Output 1\n\nNo War\n\nThe choice Z = 16 satisfies all of the three conditions as follows, thus they will come to an agreement.\n\nX = 10 < 16 \\leq 20 = Y\n\n8, 15, 13 < 16\n\n16, 22 \\geq 16\n\nSample Input 2\n\n4 2 -48 -1\n-20 -35 -91 -23\n-22 66\n\nSample Output 2\n\nWar\n\nSample Input 3\n\n5 3 6 8\n-10 3 1 5 -100\n100 6 14\n\nSample Output 3\n\nWar", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s140523754", "group_id": "codeNet:p03251", "input_text": "// Package main provides\n//\n// File: b.go\n// Author: ymiyamoto\n//\n// Created on Sun Dec 2 04:51:26 2018\n//\npackage main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nvar n, m, x, y int\n\nfunc main() {\n\tfmt.Scan(&n, &m, &x, &y)\n\n\txs := make([]int, n)\n\tys := make([]int, m)\n\n\tfor i := range xs {\n\t\tfmt.Scan(&xs[i])\n\t}\n\tsort.Ints(xs)\n\tmax := xs[len(xs)-1]\n\n\tfor i := range ys {\n\t\tfmt.Scan(&ys[i])\n\t}\n\tmin := ys[0]\n\n\tsort.Ints(ys)\n\tfor i := x; i <= y; i++ {\n\t\tif max < i && i <= min {\n\t\t\tfmt.Println(\"No War\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"War\")\n}\n", "language": "Go", "metadata": {"date": 1543744811, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03251.html", "problem_id": "p03251", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03251/input.txt", "sample_output_relpath": "derived/input_output/data/p03251/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03251/Go/s140523754.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s140523754", "user_id": "u842030412"}, "prompt_components": {"gold_output": "No War\n", "input_to_evaluate": "// Package main provides\n//\n// File: b.go\n// Author: ymiyamoto\n//\n// Created on Sun Dec 2 04:51:26 2018\n//\npackage main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nvar n, m, x, y int\n\nfunc main() {\n\tfmt.Scan(&n, &m, &x, &y)\n\n\txs := make([]int, n)\n\tys := make([]int, m)\n\n\tfor i := range xs {\n\t\tfmt.Scan(&xs[i])\n\t}\n\tsort.Ints(xs)\n\tmax := xs[len(xs)-1]\n\n\tfor i := range ys {\n\t\tfmt.Scan(&ys[i])\n\t}\n\tmin := ys[0]\n\n\tsort.Ints(ys)\n\tfor i := x; i <= y; i++ {\n\t\tif max < i && i <= min {\n\t\t\tfmt.Println(\"No War\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"War\")\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nOur world is one-dimensional, and ruled by two empires called Empire A and Empire B.\n\nThe capital of Empire A is located at coordinate X, and that of Empire B is located at coordinate Y.\n\nOne day, Empire A becomes inclined to put the cities at coordinates x_1, x_2, ..., x_N under its control, and Empire B becomes inclined to put the cities at coordinates y_1, y_2, ..., y_M under its control.\n\nIf there exists an integer Z that satisfies all of the following three conditions, they will come to an agreement, but otherwise war will break out.\n\nX < Z \\leq Y\n\nx_1, x_2, ..., x_N < Z\n\ny_1, y_2, ..., y_M \\geq Z\n\nDetermine if war will break out.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 100\n\n-100 \\leq X < Y \\leq 100\n\n-100 \\leq x_i, y_i \\leq 100\n\nx_1, x_2, ..., x_N \\neq X\n\nx_i are all different.\n\ny_1, y_2, ..., y_M \\neq Y\n\ny_i are all different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M X Y\nx_1 x_2 ... x_N\ny_1 y_2 ... y_M\n\nOutput\n\nIf war will break out, print War; otherwise, print No War.\n\nSample Input 1\n\n3 2 10 20\n8 15 13\n16 22\n\nSample Output 1\n\nNo War\n\nThe choice Z = 16 satisfies all of the three conditions as follows, thus they will come to an agreement.\n\nX = 10 < 16 \\leq 20 = Y\n\n8, 15, 13 < 16\n\n16, 22 \\geq 16\n\nSample Input 2\n\n4 2 -48 -1\n-20 -35 -91 -23\n-22 66\n\nSample Output 2\n\nWar\n\nSample Input 3\n\n5 3 6 8\n-10 3 1 5 -100\n100 6 14\n\nSample Output 3\n\nWar", "sample_input": "3 2 10 20\n8 15 13\n16 22\n"}, "reference_outputs": ["No War\n"], "source_document_id": "p03251", "source_text": "Score : 200 points\n\nProblem Statement\n\nOur world is one-dimensional, and ruled by two empires called Empire A and Empire B.\n\nThe capital of Empire A is located at coordinate X, and that of Empire B is located at coordinate Y.\n\nOne day, Empire A becomes inclined to put the cities at coordinates x_1, x_2, ..., x_N under its control, and Empire B becomes inclined to put the cities at coordinates y_1, y_2, ..., y_M under its control.\n\nIf there exists an integer Z that satisfies all of the following three conditions, they will come to an agreement, but otherwise war will break out.\n\nX < Z \\leq Y\n\nx_1, x_2, ..., x_N < Z\n\ny_1, y_2, ..., y_M \\geq Z\n\nDetermine if war will break out.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 100\n\n-100 \\leq X < Y \\leq 100\n\n-100 \\leq x_i, y_i \\leq 100\n\nx_1, x_2, ..., x_N \\neq X\n\nx_i are all different.\n\ny_1, y_2, ..., y_M \\neq Y\n\ny_i are all different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M X Y\nx_1 x_2 ... x_N\ny_1 y_2 ... y_M\n\nOutput\n\nIf war will break out, print War; otherwise, print No War.\n\nSample Input 1\n\n3 2 10 20\n8 15 13\n16 22\n\nSample Output 1\n\nNo War\n\nThe choice Z = 16 satisfies all of the three conditions as follows, thus they will come to an agreement.\n\nX = 10 < 16 \\leq 20 = Y\n\n8, 15, 13 < 16\n\n16, 22 \\geq 16\n\nSample Input 2\n\n4 2 -48 -1\n-20 -35 -91 -23\n-22 66\n\nSample Output 2\n\nWar\n\nSample Input 3\n\n5 3 6 8\n-10 3 1 5 -100\n100 6 14\n\nSample Output 3\n\nWar", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s205565711", "group_id": "codeNet:p03251", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"bufio\"\n\t\"strings\"\n)\n\nfunc main(){\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Scan()\n\tarr := strings.Split(sc.Text(), \" \")\n\tN, _ := strconv.Atoi(arr[0])\n\tM, _ := strconv.Atoi(arr[1])\n\tX, _ := strconv.Atoi(arr[2])\n\tY, _ := strconv.Atoi(arr[3])\n\tsc.Scan()\n\tx_list := strings.Split(sc.Text(), \" \")\n\tvar x, y, x_max int\n\tvar is_war bool\n\tx_max = X\n\tfor i:=0; i Y{\n\t\t\tis_war = true\n\t\t\tbreak\n\t\t}\n\t\tif x > x_max{\n\t\t\tx_max = x\n\t\t}\n\t}\n\tsc.Scan()\n\ty_list := strings.Split(sc.Text(), \" \")\n\tfor i:=0; i Y{\n\t\t\tis_war = true\n\t\t\tbreak\n\t\t}\n\t\tif x > x_max{\n\t\t\tx_max = x\n\t\t}\n\t}\n\tsc.Scan()\n\ty_list := strings.Split(sc.Text(), \" \")\n\tfor i:=0; i= len(ls.store) {\n\t\treturn nil, ErrLineNotFound\n\t}\n\treturn &Line{store: ls.store[n]}, nil\n}\n\nfunc (l *Line) Ints() []int {\n\tints, err := l.ints()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ints\n}\n\nfunc (l *Line) ints() ([]int, error) {\n\tvar ints []int\n\tfields := strings.Fields(l.store)\n\tfor _, s := range fields {\n\t\ti, err := strconv.Atoi(s)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tints = append(ints, i)\n\t}\n\treturn ints, nil\n}\n\n// Field specify current field scope.\nfunc (l *Line) Field(n int) *Line {\n\tclone := l.clone()\n\tclone.field = n\n\treturn clone\n}\n\nfunc (l *Line) Int() int {\n\tints, err := l.ints()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ints[l.field]\n}\n\nfunc newLines(r io.Reader, w io.Writer, onError onError) (*Lines, error) {\n\tlines := &Lines{\n\t\tr: r,\n\t\tw: w,\n\t\tonError: onErrorError,\n\t}\n\treturn lines, lines.init()\n}\n\nfunc (ls *Lines) init() error {\n\ts := bufio.NewScanner(ls.r)\n\tfor s.Scan() {\n\t\tls.store = append(ls.store, s.Text())\n\t}\n\treturn s.Err()\n}\n\nfunc (l *Line) clone() *Line {\n\tclone := *l\n\treturn &clone\n}\n\nfunc main() {\n\tlines := New(os.Stdin)\n\n\tline0 := lines.Line(0).Ints()\n\n\tx, y := line0[2], line0[3]\n\txs := lines.Line(1).Ints()\n\tys := lines.Line(2).Ints()\n\n\tcands := candidates(x, y)\n\n\tvar oks []int\nloop:\n\tfor _, cand := range cands {\n\t\tfor _, x := range xs {\n\t\t\tif x >= cand {\n\t\t\t\tcontinue loop\n\t\t\t}\n\t\t}\n\n\t\tfor _, y := range ys {\n\t\t\tif y < cand {\n\t\t\t\tcontinue loop\n\t\t\t}\n\t\t}\n\t\toks = append(oks, cand)\n\t}\n\n\tif len(oks) > 0 {\n\t\tfmt.Println(\"No War\")\n\t} else {\n\t\tfmt.Println(\"War\")\n\t}\n}\n\nfunc candidates(x, y int) []int {\n\tif x >= y {\n\t\treturn nil\n\t}\n\tvar ints []int\n\tfor i := x + 1; i <= y; i++ {\n\t\tints = append(ints, i)\n\t}\n\treturn ints\n}\n", "language": "Go", "metadata": {"date": 1537753068, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03251.html", "problem_id": "p03251", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03251/input.txt", "sample_output_relpath": "derived/input_output/data/p03251/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03251/Go/s837183709.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s837183709", "user_id": "u581588955"}, "prompt_components": {"gold_output": "No War\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"io/ioutil\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar (\n\t// ErrLineNotFound -\n\tErrLineNotFound = errors.New(\"lines: line not found\")\n)\n\ntype onError int\n\nconst (\n\tonErrorPanic onError = iota\n\tonErrorError\n)\n\n// Lines represents multi line.\ntype Lines struct {\n\tr io.Reader\n\tw io.Writer\n\tonError onError\n\n\tstore []string\n}\n\n// NewLines create lines from provided input reader.\nfunc New(r io.Reader) *Lines {\n\tlines, err := newLines(r, ioutil.Discard, onErrorPanic)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn lines\n}\n\n// Line represents single line.\ntype Line struct {\n\tstore string\n\tfield int\n}\n\n// Line return given n line.\nfunc (ls *Lines) Line(n int) *Line {\n\tline, err := ls.line(n)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn line\n}\n\nfunc (ls *Lines) line(n int) (*Line, error) {\n\tif n >= len(ls.store) {\n\t\treturn nil, ErrLineNotFound\n\t}\n\treturn &Line{store: ls.store[n]}, nil\n}\n\nfunc (l *Line) Ints() []int {\n\tints, err := l.ints()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ints\n}\n\nfunc (l *Line) ints() ([]int, error) {\n\tvar ints []int\n\tfields := strings.Fields(l.store)\n\tfor _, s := range fields {\n\t\ti, err := strconv.Atoi(s)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tints = append(ints, i)\n\t}\n\treturn ints, nil\n}\n\n// Field specify current field scope.\nfunc (l *Line) Field(n int) *Line {\n\tclone := l.clone()\n\tclone.field = n\n\treturn clone\n}\n\nfunc (l *Line) Int() int {\n\tints, err := l.ints()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn ints[l.field]\n}\n\nfunc newLines(r io.Reader, w io.Writer, onError onError) (*Lines, error) {\n\tlines := &Lines{\n\t\tr: r,\n\t\tw: w,\n\t\tonError: onErrorError,\n\t}\n\treturn lines, lines.init()\n}\n\nfunc (ls *Lines) init() error {\n\ts := bufio.NewScanner(ls.r)\n\tfor s.Scan() {\n\t\tls.store = append(ls.store, s.Text())\n\t}\n\treturn s.Err()\n}\n\nfunc (l *Line) clone() *Line {\n\tclone := *l\n\treturn &clone\n}\n\nfunc main() {\n\tlines := New(os.Stdin)\n\n\tline0 := lines.Line(0).Ints()\n\n\tx, y := line0[2], line0[3]\n\txs := lines.Line(1).Ints()\n\tys := lines.Line(2).Ints()\n\n\tcands := candidates(x, y)\n\n\tvar oks []int\nloop:\n\tfor _, cand := range cands {\n\t\tfor _, x := range xs {\n\t\t\tif x >= cand {\n\t\t\t\tcontinue loop\n\t\t\t}\n\t\t}\n\n\t\tfor _, y := range ys {\n\t\t\tif y < cand {\n\t\t\t\tcontinue loop\n\t\t\t}\n\t\t}\n\t\toks = append(oks, cand)\n\t}\n\n\tif len(oks) > 0 {\n\t\tfmt.Println(\"No War\")\n\t} else {\n\t\tfmt.Println(\"War\")\n\t}\n}\n\nfunc candidates(x, y int) []int {\n\tif x >= y {\n\t\treturn nil\n\t}\n\tvar ints []int\n\tfor i := x + 1; i <= y; i++ {\n\t\tints = append(ints, i)\n\t}\n\treturn ints\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nOur world is one-dimensional, and ruled by two empires called Empire A and Empire B.\n\nThe capital of Empire A is located at coordinate X, and that of Empire B is located at coordinate Y.\n\nOne day, Empire A becomes inclined to put the cities at coordinates x_1, x_2, ..., x_N under its control, and Empire B becomes inclined to put the cities at coordinates y_1, y_2, ..., y_M under its control.\n\nIf there exists an integer Z that satisfies all of the following three conditions, they will come to an agreement, but otherwise war will break out.\n\nX < Z \\leq Y\n\nx_1, x_2, ..., x_N < Z\n\ny_1, y_2, ..., y_M \\geq Z\n\nDetermine if war will break out.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 100\n\n-100 \\leq X < Y \\leq 100\n\n-100 \\leq x_i, y_i \\leq 100\n\nx_1, x_2, ..., x_N \\neq X\n\nx_i are all different.\n\ny_1, y_2, ..., y_M \\neq Y\n\ny_i are all different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M X Y\nx_1 x_2 ... x_N\ny_1 y_2 ... y_M\n\nOutput\n\nIf war will break out, print War; otherwise, print No War.\n\nSample Input 1\n\n3 2 10 20\n8 15 13\n16 22\n\nSample Output 1\n\nNo War\n\nThe choice Z = 16 satisfies all of the three conditions as follows, thus they will come to an agreement.\n\nX = 10 < 16 \\leq 20 = Y\n\n8, 15, 13 < 16\n\n16, 22 \\geq 16\n\nSample Input 2\n\n4 2 -48 -1\n-20 -35 -91 -23\n-22 66\n\nSample Output 2\n\nWar\n\nSample Input 3\n\n5 3 6 8\n-10 3 1 5 -100\n100 6 14\n\nSample Output 3\n\nWar", "sample_input": "3 2 10 20\n8 15 13\n16 22\n"}, "reference_outputs": ["No War\n"], "source_document_id": "p03251", "source_text": "Score : 200 points\n\nProblem Statement\n\nOur world is one-dimensional, and ruled by two empires called Empire A and Empire B.\n\nThe capital of Empire A is located at coordinate X, and that of Empire B is located at coordinate Y.\n\nOne day, Empire A becomes inclined to put the cities at coordinates x_1, x_2, ..., x_N under its control, and Empire B becomes inclined to put the cities at coordinates y_1, y_2, ..., y_M under its control.\n\nIf there exists an integer Z that satisfies all of the following three conditions, they will come to an agreement, but otherwise war will break out.\n\nX < Z \\leq Y\n\nx_1, x_2, ..., x_N < Z\n\ny_1, y_2, ..., y_M \\geq Z\n\nDetermine if war will break out.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 100\n\n-100 \\leq X < Y \\leq 100\n\n-100 \\leq x_i, y_i \\leq 100\n\nx_1, x_2, ..., x_N \\neq X\n\nx_i are all different.\n\ny_1, y_2, ..., y_M \\neq Y\n\ny_i are all different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M X Y\nx_1 x_2 ... x_N\ny_1 y_2 ... y_M\n\nOutput\n\nIf war will break out, print War; otherwise, print No War.\n\nSample Input 1\n\n3 2 10 20\n8 15 13\n16 22\n\nSample Output 1\n\nNo War\n\nThe choice Z = 16 satisfies all of the three conditions as follows, thus they will come to an agreement.\n\nX = 10 < 16 \\leq 20 = Y\n\n8, 15, 13 < 16\n\n16, 22 \\geq 16\n\nSample Input 2\n\n4 2 -48 -1\n-20 -35 -91 -23\n-22 66\n\nSample Output 2\n\nWar\n\nSample Input 3\n\n5 3 6 8\n-10 3 1 5 -100\n100 6 14\n\nSample Output 3\n\nWar", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2533, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s590299868", "group_id": "codeNet:p03260", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\ts, _ := r.ReadString('\\n')\n\ts = strings.TrimRight(s, \" \\t\\n\")\n\tslice := strings.Split(s, \" \")\n\ta := string(slice[0])\n\tb := string(slice[1])\n\tA, _ := strconv.Atoi(a)\n\tB, _ := strconv.Atoi(b)\n\n\tfor i := 1; i <= 3; i++ {\n\t\tif A*B*i%2 == 1 {\n\t\t\tfmt.Println(\"Yes\")\n\t\t\tos.Exit(0)\n\t\t}\n\t}\n\tfmt.Println(\"No\")\n\tos.Exit(0)\n\n}\n", "language": "Go", "metadata": {"date": 1593018511, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03260.html", "problem_id": "p03260", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03260/input.txt", "sample_output_relpath": "derived/input_output/data/p03260/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03260/Go/s590299868.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s590299868", "user_id": "u832399163"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\ts, _ := r.ReadString('\\n')\n\ts = strings.TrimRight(s, \" \\t\\n\")\n\tslice := strings.Split(s, \" \")\n\ta := string(slice[0])\n\tb := string(slice[1])\n\tA, _ := strconv.Atoi(a)\n\tB, _ := strconv.Atoi(b)\n\n\tfor i := 1; i <= 3; i++ {\n\t\tif A*B*i%2 == 1 {\n\t\t\tfmt.Println(\"Yes\")\n\t\t\tos.Exit(0)\n\t\t}\n\t}\n\tfmt.Println(\"No\")\n\tos.Exit(0)\n\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given integers A and B, each between 1 and 3 (inclusive).\n\nDetermine if there is an integer C between 1 and 3 (inclusive) such that A \\times B \\times C is an odd number.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf there is an integer C between 1 and 3 that satisfies the condition, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 1\n\nSample Output 1\n\nYes\n\nLet C = 3. Then, A \\times B \\times C = 3 \\times 1 \\times 3 = 9, which is an odd number.\n\nSample Input 2\n\n1 2\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n2 2\n\nSample Output 3\n\nNo", "sample_input": "3 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03260", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given integers A and B, each between 1 and 3 (inclusive).\n\nDetermine if there is an integer C between 1 and 3 (inclusive) such that A \\times B \\times C is an odd number.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf there is an integer C between 1 and 3 that satisfies the condition, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 1\n\nSample Output 1\n\nYes\n\nLet C = 3. Then, A \\times B \\times C = 3 \\times 1 \\times 3 = 9, which is an odd number.\n\nSample Input 2\n\n1 2\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n2 2\n\nSample Output 3\n\nNo", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 432, "cpu_time_ms": 6, "memory_kb": 1772}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s627759956", "group_id": "codeNet:p03260", "input_text": "// https://atcoder.jp/contests/abc109/tasks/abc109_a\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// d: debug IO. it can print debug in test.\nfunc solve(io *Io, d *Io) {\n\tA := io.NextInt()\n\tB := io.NextInt()\n\n\tcan := A%2 == 1 && B%2 == 1\n\tres := TernaryString(can, \"Yes\", \"No\")\n\tio.Println(res)\n}\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\tsolve(io, nil)\n}\n\n/* IO Helpers */\n\n// Io combines reader, writer, & tokens as the state when processing the input\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\n// NewIo creates Io with Stdin & Stdout\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\n// Flush calls the writer's Flush\nfunc (io *Io) Flush() {\n\tio.writer.Flush()\n}\n\n// NextLine returns the string from reader.ReadLine()\nfunc (io *Io) NextLine() string {\n\tif io.nextToken < len(io.tokens) {\n\t\tpanic(\"io.nextToken < len(io.tokens)\")\n\t}\n\n\tvar buffer bytes.Buffer\n\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer.Write(line)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn buffer.String()\n}\n\n// NextLines returns []string from next n lines\nfunc (io *Io) NextLines(n int) []string {\n\tres := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextLine()\n\t}\n\treturn res\n}\n\n// Next returns the string token (partial string of the line divided by spaces)\nfunc (io *Io) Next() string {\n\tif io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\n\tres := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn res\n}\n\n// NextStrings returns the []string from the next n tokens\nfunc (io *Io) NextStrings(n int) []string {\n\tres := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.Next()\n\t}\n\treturn res\n}\n\n// NextInt returns the int from the next token\nfunc (io *Io) NextInt() int {\n\tres, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n\n// NextInts returns the []int from the next n tokens\nfunc (io *Io) NextInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextInt()\n\t}\n\treturn res\n}\n\n// NextFloat returns the float64 from the next token\nfunc (io *Io) NextFloat() float64 {\n\tres, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n\n// NextFloats returns the []float64 from the next n tokens\nfunc (io *Io) NextFloats(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextFloat()\n\t}\n\treturn res\n}\n\n// Println prints the input to the writer in an easy-to-see form\nfunc (io *Io) Println(a ...interface{}) {\n\tvar values []string\n\tfor i := 0; i < len(a); i++ {\n\t\tvalues = append(values, \"%v\")\n\t}\n\tio.Printfln(strings.Join(values, \" \"), a...)\n}\n\n// Print calls Fprint to the writer\nfunc (io *Io) Print(a interface{}) {\n\tfmt.Fprint(io.writer, a)\n}\n\n// Printf calls Fprintf to the writer\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\n// Printfln calls Fprint to the writer\nfunc (io *Io) Printfln(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format+\"\\n\", a...)\n}\n\n// PrintInts prints ints with space and new line at the end\nfunc (io *Io) PrintInts(ints []int) {\n\tfor i, e := range ints {\n\t\tio.Print(e)\n\n\t\tif i == len(ints)-1 {\n\t\t\tio.Println()\n\t\t} else {\n\t\t\tio.Print(\" \")\n\t\t}\n\t}\n}\n\n// Debug calls Println and Flush immediately\nfunc (io *Io) Debug(a ...interface{}) {\n\tif io == nil {\n\t\treturn\n\t}\n\n\tio.Println(a...)\n\tio.Flush()\n}\n\n/* Math Helpers */\n\n// MOD is 10^9 + 7\nconst MOD = 1000000007\n\n// Max of the ints\nfunc Max(numbers ...int) int {\n\tmax := numbers[0]\n\tfor i, number := range numbers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif number > max {\n\t\t\tmax = number\n\t\t}\n\t}\n\treturn max\n}\n\n// Min of the ints\nfunc Min(numbers ...int) int {\n\tmax := numbers[0]\n\tfor i, number := range numbers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif max > number {\n\t\t\tmax = number\n\t\t}\n\t}\n\treturn max\n}\n\n// DigitSum returns sum of the int's digits\nfunc DigitSum(n int) int {\n\tif n < 0 {\n\t\treturn -1\n\t}\n\n\tres := 0\n\n\tfor n > 0 {\n\t\tres += n % 10\n\t\tn /= 10\n\t}\n\n\treturn res\n}\n\n// Sum of the ints\nfunc Sum(numbers ...int) int {\n\tsum := 0\n\n\tfor _, number := range numbers {\n\t\tsum += number\n\t}\n\n\treturn sum\n}\n\n// Pow calculates the pow for int with O(log e)\nfunc Pow(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(fmt.Sprintf(\"Pow was called for a < 0 or e < 0, a: %d, e: %d\", a, e))\n\t}\n\n\tif e == 0 {\n\t\treturn 1\n\t}\n\n\tif e%2 == 0 {\n\t\thalf := Pow(a, e/2)\n\t\treturn half * half\n\t}\n\n\treturn a * Pow(a, e-1)\n}\n\n// Abs returns the absolute value of the input\nfunc Abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\n\treturn a\n}\n\n/* Structure Helpers */\n\n// Set is orderless List\ntype Set map[interface{}]struct{}\n\n// NewSet returns empty Set\nfunc NewSet() *Set {\n\treturn &Set{}\n}\n\n// Add the value to the set\nfunc (set *Set) Add(value interface{}) {\n\t(*set)[value] = struct{}{}\n}\n\n// Includes check the set has the value\nfunc (set *Set) Includes(value interface{}) bool {\n\t_, included := (*set)[value]\n\treturn included\n}\n\n// Remove deletes the value from the set if exists\nfunc (set *Set) Remove(value interface{}) {\n\tif !set.Includes(value) {\n\t\treturn\n\t}\n\n\tdelete(*set, value)\n}\n\n// ImmutableSort returns sorted slice without mutating original one\nfunc ImmutableSort(slice []int) []int {\n\tres := make([]int, len(slice))\n\tcopy(res, slice)\n\tsort.Ints(res)\n\treturn res\n}\n\n/* Util helpers */\n\n// Ternary is like `cond ? a : b`. should assert the returned value like `Ternary(cond, a, b).(int)`\nfunc Ternary(cond bool, a, b interface{}) interface{} {\n\tif cond {\n\t\treturn a\n\t}\n\n\treturn b\n}\n\n// TernaryInt uses Ternary and assert the value as int\nfunc TernaryInt(cond bool, a, b int) int {\n\treturn Ternary(cond, a, b).(int)\n}\n\n// TernaryString uses Ternary and assert the value as string\nfunc TernaryString(cond bool, a, b string) string {\n\treturn Ternary(cond, a, b).(string)\n}\n", "language": "Go", "metadata": {"date": 1565896702, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03260.html", "problem_id": "p03260", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03260/input.txt", "sample_output_relpath": "derived/input_output/data/p03260/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03260/Go/s627759956.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s627759956", "user_id": "u751468134"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "// https://atcoder.jp/contests/abc109/tasks/abc109_a\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n// d: debug IO. it can print debug in test.\nfunc solve(io *Io, d *Io) {\n\tA := io.NextInt()\n\tB := io.NextInt()\n\n\tcan := A%2 == 1 && B%2 == 1\n\tres := TernaryString(can, \"Yes\", \"No\")\n\tio.Println(res)\n}\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\tsolve(io, nil)\n}\n\n/* IO Helpers */\n\n// Io combines reader, writer, & tokens as the state when processing the input\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\n// NewIo creates Io with Stdin & Stdout\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\n// Flush calls the writer's Flush\nfunc (io *Io) Flush() {\n\tio.writer.Flush()\n}\n\n// NextLine returns the string from reader.ReadLine()\nfunc (io *Io) NextLine() string {\n\tif io.nextToken < len(io.tokens) {\n\t\tpanic(\"io.nextToken < len(io.tokens)\")\n\t}\n\n\tvar buffer bytes.Buffer\n\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer.Write(line)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn buffer.String()\n}\n\n// NextLines returns []string from next n lines\nfunc (io *Io) NextLines(n int) []string {\n\tres := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextLine()\n\t}\n\treturn res\n}\n\n// Next returns the string token (partial string of the line divided by spaces)\nfunc (io *Io) Next() string {\n\tif io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\n\tres := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn res\n}\n\n// NextStrings returns the []string from the next n tokens\nfunc (io *Io) NextStrings(n int) []string {\n\tres := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.Next()\n\t}\n\treturn res\n}\n\n// NextInt returns the int from the next token\nfunc (io *Io) NextInt() int {\n\tres, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n\n// NextInts returns the []int from the next n tokens\nfunc (io *Io) NextInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextInt()\n\t}\n\treturn res\n}\n\n// NextFloat returns the float64 from the next token\nfunc (io *Io) NextFloat() float64 {\n\tres, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn res\n}\n\n// NextFloats returns the []float64 from the next n tokens\nfunc (io *Io) NextFloats(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = io.NextFloat()\n\t}\n\treturn res\n}\n\n// Println prints the input to the writer in an easy-to-see form\nfunc (io *Io) Println(a ...interface{}) {\n\tvar values []string\n\tfor i := 0; i < len(a); i++ {\n\t\tvalues = append(values, \"%v\")\n\t}\n\tio.Printfln(strings.Join(values, \" \"), a...)\n}\n\n// Print calls Fprint to the writer\nfunc (io *Io) Print(a interface{}) {\n\tfmt.Fprint(io.writer, a)\n}\n\n// Printf calls Fprintf to the writer\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\n// Printfln calls Fprint to the writer\nfunc (io *Io) Printfln(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format+\"\\n\", a...)\n}\n\n// PrintInts prints ints with space and new line at the end\nfunc (io *Io) PrintInts(ints []int) {\n\tfor i, e := range ints {\n\t\tio.Print(e)\n\n\t\tif i == len(ints)-1 {\n\t\t\tio.Println()\n\t\t} else {\n\t\t\tio.Print(\" \")\n\t\t}\n\t}\n}\n\n// Debug calls Println and Flush immediately\nfunc (io *Io) Debug(a ...interface{}) {\n\tif io == nil {\n\t\treturn\n\t}\n\n\tio.Println(a...)\n\tio.Flush()\n}\n\n/* Math Helpers */\n\n// MOD is 10^9 + 7\nconst MOD = 1000000007\n\n// Max of the ints\nfunc Max(numbers ...int) int {\n\tmax := numbers[0]\n\tfor i, number := range numbers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif number > max {\n\t\t\tmax = number\n\t\t}\n\t}\n\treturn max\n}\n\n// Min of the ints\nfunc Min(numbers ...int) int {\n\tmax := numbers[0]\n\tfor i, number := range numbers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif max > number {\n\t\t\tmax = number\n\t\t}\n\t}\n\treturn max\n}\n\n// DigitSum returns sum of the int's digits\nfunc DigitSum(n int) int {\n\tif n < 0 {\n\t\treturn -1\n\t}\n\n\tres := 0\n\n\tfor n > 0 {\n\t\tres += n % 10\n\t\tn /= 10\n\t}\n\n\treturn res\n}\n\n// Sum of the ints\nfunc Sum(numbers ...int) int {\n\tsum := 0\n\n\tfor _, number := range numbers {\n\t\tsum += number\n\t}\n\n\treturn sum\n}\n\n// Pow calculates the pow for int with O(log e)\nfunc Pow(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(fmt.Sprintf(\"Pow was called for a < 0 or e < 0, a: %d, e: %d\", a, e))\n\t}\n\n\tif e == 0 {\n\t\treturn 1\n\t}\n\n\tif e%2 == 0 {\n\t\thalf := Pow(a, e/2)\n\t\treturn half * half\n\t}\n\n\treturn a * Pow(a, e-1)\n}\n\n// Abs returns the absolute value of the input\nfunc Abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\n\treturn a\n}\n\n/* Structure Helpers */\n\n// Set is orderless List\ntype Set map[interface{}]struct{}\n\n// NewSet returns empty Set\nfunc NewSet() *Set {\n\treturn &Set{}\n}\n\n// Add the value to the set\nfunc (set *Set) Add(value interface{}) {\n\t(*set)[value] = struct{}{}\n}\n\n// Includes check the set has the value\nfunc (set *Set) Includes(value interface{}) bool {\n\t_, included := (*set)[value]\n\treturn included\n}\n\n// Remove deletes the value from the set if exists\nfunc (set *Set) Remove(value interface{}) {\n\tif !set.Includes(value) {\n\t\treturn\n\t}\n\n\tdelete(*set, value)\n}\n\n// ImmutableSort returns sorted slice without mutating original one\nfunc ImmutableSort(slice []int) []int {\n\tres := make([]int, len(slice))\n\tcopy(res, slice)\n\tsort.Ints(res)\n\treturn res\n}\n\n/* Util helpers */\n\n// Ternary is like `cond ? a : b`. should assert the returned value like `Ternary(cond, a, b).(int)`\nfunc Ternary(cond bool, a, b interface{}) interface{} {\n\tif cond {\n\t\treturn a\n\t}\n\n\treturn b\n}\n\n// TernaryInt uses Ternary and assert the value as int\nfunc TernaryInt(cond bool, a, b int) int {\n\treturn Ternary(cond, a, b).(int)\n}\n\n// TernaryString uses Ternary and assert the value as string\nfunc TernaryString(cond bool, a, b string) string {\n\treturn Ternary(cond, a, b).(string)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given integers A and B, each between 1 and 3 (inclusive).\n\nDetermine if there is an integer C between 1 and 3 (inclusive) such that A \\times B \\times C is an odd number.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf there is an integer C between 1 and 3 that satisfies the condition, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 1\n\nSample Output 1\n\nYes\n\nLet C = 3. Then, A \\times B \\times C = 3 \\times 1 \\times 3 = 9, which is an odd number.\n\nSample Input 2\n\n1 2\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n2 2\n\nSample Output 3\n\nNo", "sample_input": "3 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03260", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given integers A and B, each between 1 and 3 (inclusive).\n\nDetermine if there is an integer C between 1 and 3 (inclusive) such that A \\times B \\times C is an odd number.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf there is an integer C between 1 and 3 that satisfies the condition, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 1\n\nSample Output 1\n\nYes\n\nLet C = 3. Then, A \\times B \\times C = 3 \\times 1 \\times 3 = 9, which is an odd number.\n\nSample Input 2\n\n1 2\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n2 2\n\nSample Output 3\n\nNo", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5984, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s863149296", "group_id": "codeNet:p03260", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\tif len(os.Args) > 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(os.Stdout)\n\n\ta := getNextInt(scanner)\n\tb := getNextInt(scanner)\n\n\tans := \"Yes\"\n\n\tif (a*b)&1 == 0 {\n\t\tans = \"No\"\n\t}\n\n\tfmt.Fprintln(writer, ans)\n\twriter.Flush()\n}\n", "language": "Go", "metadata": {"date": 1561838768, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03260.html", "problem_id": "p03260", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03260/input.txt", "sample_output_relpath": "derived/input_output/data/p03260/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03260/Go/s863149296.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s863149296", "user_id": "u150542210"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\tif len(os.Args) > 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(os.Stdout)\n\n\ta := getNextInt(scanner)\n\tb := getNextInt(scanner)\n\n\tans := \"Yes\"\n\n\tif (a*b)&1 == 0 {\n\t\tans = \"No\"\n\t}\n\n\tfmt.Fprintln(writer, ans)\n\twriter.Flush()\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given integers A and B, each between 1 and 3 (inclusive).\n\nDetermine if there is an integer C between 1 and 3 (inclusive) such that A \\times B \\times C is an odd number.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf there is an integer C between 1 and 3 that satisfies the condition, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 1\n\nSample Output 1\n\nYes\n\nLet C = 3. Then, A \\times B \\times C = 3 \\times 1 \\times 3 = 9, which is an odd number.\n\nSample Input 2\n\n1 2\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n2 2\n\nSample Output 3\n\nNo", "sample_input": "3 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03260", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given integers A and B, each between 1 and 3 (inclusive).\n\nDetermine if there is an integer C between 1 and 3 (inclusive) such that A \\times B \\times C is an odd number.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf there is an integer C between 1 and 3 that satisfies the condition, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 1\n\nSample Output 1\n\nYes\n\nLet C = 3. Then, A \\times B \\times C = 3 \\times 1 \\times 3 = 9, which is an odd number.\n\nSample Input 2\n\n1 2\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n2 2\n\nSample Output 3\n\nNo", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s511804997", "group_id": "codeNet:p03260", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\tif len(os.Args) > 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(os.Stdout)\n\n\ta := getNextInt(scanner)\n\tb := getNextInt(scanner)\n\n\tans := \"Yes\"\n\n\tif a*b^1 == 0 {\n\t\tans = \"No\"\n\t}\n\n\tfmt.Fprintln(writer, ans)\n\twriter.Flush()\n}\n", "language": "Go", "metadata": {"date": 1561838708, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03260.html", "problem_id": "p03260", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03260/input.txt", "sample_output_relpath": "derived/input_output/data/p03260/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03260/Go/s511804997.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s511804997", "user_id": "u150542210"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\tif len(os.Args) > 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(os.Stdout)\n\n\ta := getNextInt(scanner)\n\tb := getNextInt(scanner)\n\n\tans := \"Yes\"\n\n\tif a*b^1 == 0 {\n\t\tans = \"No\"\n\t}\n\n\tfmt.Fprintln(writer, ans)\n\twriter.Flush()\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given integers A and B, each between 1 and 3 (inclusive).\n\nDetermine if there is an integer C between 1 and 3 (inclusive) such that A \\times B \\times C is an odd number.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf there is an integer C between 1 and 3 that satisfies the condition, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 1\n\nSample Output 1\n\nYes\n\nLet C = 3. Then, A \\times B \\times C = 3 \\times 1 \\times 3 = 9, which is an odd number.\n\nSample Input 2\n\n1 2\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n2 2\n\nSample Output 3\n\nNo", "sample_input": "3 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03260", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given integers A and B, each between 1 and 3 (inclusive).\n\nDetermine if there is an integer C between 1 and 3 (inclusive) such that A \\times B \\times C is an odd number.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf there is an integer C between 1 and 3 that satisfies the condition, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 1\n\nSample Output 1\n\nYes\n\nLet C = 3. Then, A \\times B \\times C = 3 \\times 1 \\times 3 = 9, which is an odd number.\n\nSample Input 2\n\n1 2\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n2 2\n\nSample Output 3\n\nNo", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 734, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s276679164", "group_id": "codeNet:p03260", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tnums := ScanNums(2)\n\tfor _, n := range nums {\n\t\tif n%2 == 0 {\n\t\t\tfmt.Print(\"No\")\n\t\t\tos.Exit(0)\n\t\t}\n\t}\n\tfmt.Print(\"Yes\")\n}\n\nfunc ScanNums(len int) (nums []int) {\n\tvar num int\n\tfor i := 0; i < len; i++ {\n\t\tfmt.Scan(&num)\n\t\tnums = append(nums, num)\n\t}\n\treturn\n}", "language": "Go", "metadata": {"date": 1554594083, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03260.html", "problem_id": "p03260", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03260/input.txt", "sample_output_relpath": "derived/input_output/data/p03260/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03260/Go/s276679164.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s276679164", "user_id": "u134387396"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tnums := ScanNums(2)\n\tfor _, n := range nums {\n\t\tif n%2 == 0 {\n\t\t\tfmt.Print(\"No\")\n\t\t\tos.Exit(0)\n\t\t}\n\t}\n\tfmt.Print(\"Yes\")\n}\n\nfunc ScanNums(len int) (nums []int) {\n\tvar num int\n\tfor i := 0; i < len; i++ {\n\t\tfmt.Scan(&num)\n\t\tnums = append(nums, num)\n\t}\n\treturn\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given integers A and B, each between 1 and 3 (inclusive).\n\nDetermine if there is an integer C between 1 and 3 (inclusive) such that A \\times B \\times C is an odd number.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf there is an integer C between 1 and 3 that satisfies the condition, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 1\n\nSample Output 1\n\nYes\n\nLet C = 3. Then, A \\times B \\times C = 3 \\times 1 \\times 3 = 9, which is an odd number.\n\nSample Input 2\n\n1 2\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n2 2\n\nSample Output 3\n\nNo", "sample_input": "3 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03260", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given integers A and B, each between 1 and 3 (inclusive).\n\nDetermine if there is an integer C between 1 and 3 (inclusive) such that A \\times B \\times C is an odd number.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf there is an integer C between 1 and 3 that satisfies the condition, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 1\n\nSample Output 1\n\nYes\n\nLet C = 3. Then, A \\times B \\times C = 3 \\times 1 \\times 3 = 9, which is an odd number.\n\nSample Input 2\n\n1 2\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n2 2\n\nSample Output 3\n\nNo", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 312, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s352046151", "group_id": "codeNet:p03260", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tif a == 2 || b == 2 {\n\t\tfmt.Println(\"No\")\n\t} else {\n\t\tfmt.Println(\"Yes\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1546087567, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03260.html", "problem_id": "p03260", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03260/input.txt", "sample_output_relpath": "derived/input_output/data/p03260/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03260/Go/s352046151.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s352046151", "user_id": "u113872560"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tif a == 2 || b == 2 {\n\t\tfmt.Println(\"No\")\n\t} else {\n\t\tfmt.Println(\"Yes\")\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given integers A and B, each between 1 and 3 (inclusive).\n\nDetermine if there is an integer C between 1 and 3 (inclusive) such that A \\times B \\times C is an odd number.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf there is an integer C between 1 and 3 that satisfies the condition, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 1\n\nSample Output 1\n\nYes\n\nLet C = 3. Then, A \\times B \\times C = 3 \\times 1 \\times 3 = 9, which is an odd number.\n\nSample Input 2\n\n1 2\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n2 2\n\nSample Output 3\n\nNo", "sample_input": "3 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03260", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given integers A and B, each between 1 and 3 (inclusive).\n\nDetermine if there is an integer C between 1 and 3 (inclusive) such that A \\times B \\times C is an odd number.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf there is an integer C between 1 and 3 that satisfies the condition, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 1\n\nSample Output 1\n\nYes\n\nLet C = 3. Then, A \\times B \\times C = 3 \\times 1 \\times 3 = 9, which is an odd number.\n\nSample Input 2\n\n1 2\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n2 2\n\nSample Output 3\n\nNo", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s583715092", "group_id": "codeNet:p03260", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t//\t\"strings\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\n\ta := sc.NextInt()\n\tb := sc.NextInt()\n\tif a%2 == 0 || b%2 == 0 {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\tfmt.Println(\"Yes\")\n\treturn\n\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tresult = append(result, v)\n\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1544320803, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03260.html", "problem_id": "p03260", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03260/input.txt", "sample_output_relpath": "derived/input_output/data/p03260/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03260/Go/s583715092.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s583715092", "user_id": "u084693263"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t//\t\"strings\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\n\ta := sc.NextInt()\n\tb := sc.NextInt()\n\tif a%2 == 0 || b%2 == 0 {\n\t\tfmt.Println(\"No\")\n\t\treturn\n\t}\n\tfmt.Println(\"Yes\")\n\treturn\n\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tresult = append(result, v)\n\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given integers A and B, each between 1 and 3 (inclusive).\n\nDetermine if there is an integer C between 1 and 3 (inclusive) such that A \\times B \\times C is an odd number.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf there is an integer C between 1 and 3 that satisfies the condition, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 1\n\nSample Output 1\n\nYes\n\nLet C = 3. Then, A \\times B \\times C = 3 \\times 1 \\times 3 = 9, which is an odd number.\n\nSample Input 2\n\n1 2\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n2 2\n\nSample Output 3\n\nNo", "sample_input": "3 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03260", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given integers A and B, each between 1 and 3 (inclusive).\n\nDetermine if there is an integer C between 1 and 3 (inclusive) such that A \\times B \\times C is an odd number.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf there is an integer C between 1 and 3 that satisfies the condition, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 1\n\nSample Output 1\n\nYes\n\nLet C = 3. Then, A \\times B \\times C = 3 \\times 1 \\times 3 = 9, which is an odd number.\n\nSample Input 2\n\n1 2\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n2 2\n\nSample Output 3\n\nNo", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1701, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s065070755", "group_id": "codeNet:p03260", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tif a*b%2 == 1 {\n\t\tfmt.Print(\"Yes\")\n\t} else {\n\t\tfmt.Print(\"No\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1536549063, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03260.html", "problem_id": "p03260", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03260/input.txt", "sample_output_relpath": "derived/input_output/data/p03260/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03260/Go/s065070755.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s065070755", "user_id": "u808427016"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tif a*b%2 == 1 {\n\t\tfmt.Print(\"Yes\")\n\t} else {\n\t\tfmt.Print(\"No\")\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given integers A and B, each between 1 and 3 (inclusive).\n\nDetermine if there is an integer C between 1 and 3 (inclusive) such that A \\times B \\times C is an odd number.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf there is an integer C between 1 and 3 that satisfies the condition, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 1\n\nSample Output 1\n\nYes\n\nLet C = 3. Then, A \\times B \\times C = 3 \\times 1 \\times 3 = 9, which is an odd number.\n\nSample Input 2\n\n1 2\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n2 2\n\nSample Output 3\n\nNo", "sample_input": "3 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03260", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given integers A and B, each between 1 and 3 (inclusive).\n\nDetermine if there is an integer C between 1 and 3 (inclusive) such that A \\times B \\times C is an odd number.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf there is an integer C between 1 and 3 that satisfies the condition, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 1\n\nSample Output 1\n\nYes\n\nLet C = 3. Then, A \\times B \\times C = 3 \\times 1 \\times 3 = 9, which is an odd number.\n\nSample Input 2\n\n1 2\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n2 2\n\nSample Output 3\n\nNo", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s100887433", "group_id": "codeNet:p03260", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tstdin := bufio.NewScanner(os.Stdin)\n\tstdin.Scan()\n\ttext := stdin.Text()\n\tstrs := strings.Fields(text)\n\ta, err := strconv.Atoi(strs[0])\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tb, err := strconv.Atoi(strs[1])\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tresult := a * b\n\tif result % 2 == 1 || (result * 3) % 2 == 1 {\n\t\tprint(\"Yes\")\n\t} else {\n\t\tprint(\"No\")\n\t}\n}", "language": "Go", "metadata": {"date": 1536459486, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03260.html", "problem_id": "p03260", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03260/input.txt", "sample_output_relpath": "derived/input_output/data/p03260/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03260/Go/s100887433.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s100887433", "user_id": "u557284649"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tstdin := bufio.NewScanner(os.Stdin)\n\tstdin.Scan()\n\ttext := stdin.Text()\n\tstrs := strings.Fields(text)\n\ta, err := strconv.Atoi(strs[0])\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tb, err := strconv.Atoi(strs[1])\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tresult := a * b\n\tif result % 2 == 1 || (result * 3) % 2 == 1 {\n\t\tprint(\"Yes\")\n\t} else {\n\t\tprint(\"No\")\n\t}\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given integers A and B, each between 1 and 3 (inclusive).\n\nDetermine if there is an integer C between 1 and 3 (inclusive) such that A \\times B \\times C is an odd number.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf there is an integer C between 1 and 3 that satisfies the condition, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 1\n\nSample Output 1\n\nYes\n\nLet C = 3. Then, A \\times B \\times C = 3 \\times 1 \\times 3 = 9, which is an odd number.\n\nSample Input 2\n\n1 2\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n2 2\n\nSample Output 3\n\nNo", "sample_input": "3 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03260", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given integers A and B, each between 1 and 3 (inclusive).\n\nDetermine if there is an integer C between 1 and 3 (inclusive) such that A \\times B \\times C is an odd number.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nIf there is an integer C between 1 and 3 that satisfies the condition, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 1\n\nSample Output 1\n\nYes\n\nLet C = 3. Then, A \\times B \\times C = 3 \\times 1 \\times 3 = 9, which is an odd number.\n\nSample Input 2\n\n1 2\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n2 2\n\nSample Output 3\n\nNo", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 419, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s691599338", "group_id": "codeNet:p03261", "input_text": "package main\n\nimport \"fmt\"\n\ntype word struct {\n\tname string\n\tsum rune\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\t\n\twords := make([]word,n)\n \tcnt := make(map[rune]bool,n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&words[i].name)\n\t\tfor j := 0; j < len(words[i].name); j++ {\n words[i].sum += rune(words[i].name[j])\n\t\t}\n \tif cnt[words[i].sum] {\n \tfmt.Println(\"No\")\n \treturn\n \t}\n \tcnt[words[i].sum] = true\n }\n \tfmt.Println(\"Yes\")\n}", "language": "Go", "metadata": {"date": 1586021489, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03261.html", "problem_id": "p03261", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03261/input.txt", "sample_output_relpath": "derived/input_output/data/p03261/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03261/Go/s691599338.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s691599338", "user_id": "u689167014"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\ntype word struct {\n\tname string\n\tsum rune\n}\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\t\n\twords := make([]word,n)\n \tcnt := make(map[rune]bool,n)\n\tfor i := 0; i < n; i++ {\n\t\tfmt.Scan(&words[i].name)\n\t\tfor j := 0; j < len(words[i].name); j++ {\n words[i].sum += rune(words[i].name[j])\n\t\t}\n \tif cnt[words[i].sum] {\n \tfmt.Println(\"No\")\n \treturn\n \t}\n \tcnt[words[i].sum] = true\n }\n \tfmt.Println(\"Yes\")\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi is practicing shiritori alone again today.\n\nShiritori is a game as follows:\n\nIn the first turn, a player announces any one word.\n\nIn the subsequent turns, a player announces a word that satisfies the following conditions:\n\nThat word is not announced before.\n\nThe first character of that word is the same as the last character of the last word announced.\n\nIn this game, he is practicing to announce as many words as possible in ten seconds.\n\nYou are given the number of words Takahashi announced, N, and the i-th word he announced, W_i, for each i. Determine if the rules of shiritori was observed, that is, every word announced by him satisfied the conditions.\n\nConstraints\n\nN is an integer satisfying 2 \\leq N \\leq 100.\n\nW_i is a string of length 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\nW_1\nW_2\n:\nW_N\n\nOutput\n\nIf every word announced by Takahashi satisfied the conditions, print Yes; otherwise, print No.\n\nSample Input 1\n\n4\nhoge\nenglish\nhoge\nenigma\n\nSample Output 1\n\nNo\n\nAs hoge is announced multiple times, the rules of shiritori was not observed.\n\nSample Input 2\n\n9\nbasic\nc\ncpp\nphp\npython\nnadesico\nocaml\nlua\nassembly\n\nSample Output 2\n\nYes\n\nSample Input 3\n\n8\na\naa\naaa\naaaa\naaaaa\naaaaaa\naaa\naaaaaaa\n\nSample Output 3\n\nNo\n\nSample Input 4\n\n3\nabc\narc\nagc\n\nSample Output 4\n\nNo", "sample_input": "4\nhoge\nenglish\nhoge\nenigma\n"}, "reference_outputs": ["No\n"], "source_document_id": "p03261", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi is practicing shiritori alone again today.\n\nShiritori is a game as follows:\n\nIn the first turn, a player announces any one word.\n\nIn the subsequent turns, a player announces a word that satisfies the following conditions:\n\nThat word is not announced before.\n\nThe first character of that word is the same as the last character of the last word announced.\n\nIn this game, he is practicing to announce as many words as possible in ten seconds.\n\nYou are given the number of words Takahashi announced, N, and the i-th word he announced, W_i, for each i. Determine if the rules of shiritori was observed, that is, every word announced by him satisfied the conditions.\n\nConstraints\n\nN is an integer satisfying 2 \\leq N \\leq 100.\n\nW_i is a string of length 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\nW_1\nW_2\n:\nW_N\n\nOutput\n\nIf every word announced by Takahashi satisfied the conditions, print Yes; otherwise, print No.\n\nSample Input 1\n\n4\nhoge\nenglish\nhoge\nenigma\n\nSample Output 1\n\nNo\n\nAs hoge is announced multiple times, the rules of shiritori was not observed.\n\nSample Input 2\n\n9\nbasic\nc\ncpp\nphp\npython\nnadesico\nocaml\nlua\nassembly\n\nSample Output 2\n\nYes\n\nSample Input 3\n\n8\na\naa\naaa\naaaa\naaaaa\naaaaaa\naaa\naaaaaaa\n\nSample Output 3\n\nNo\n\nSample Input 4\n\n3\nabc\narc\nagc\n\nSample Output 4\n\nNo", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 467, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s901756325", "group_id": "codeNet:p03261", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8 + 7\n)\n\nvar buf []byte = make([]byte, maxBufSize)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBufSize)\n}\n\nfunc main() {\n\tN := nextInt()\n\tWn := make([]string, N)\n\tWnsort := make([]string, N)\n\tfor i := range Wn {\n\t\tWn[i] = nextLine()\n\t}\n\tcopy(Wnsort, Wn)\n\n\tsort.Strings(Wnsort)\n\tfor i := 0; i < N-1; i++ {\n\t\tif Wn[i][len(Wn[i])-1] != Wn[i+1][0] || Wnsort[i+1] == Wnsort[i] {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n", "language": "Go", "metadata": {"date": 1585728064, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03261.html", "problem_id": "p03261", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03261/input.txt", "sample_output_relpath": "derived/input_output/data/p03261/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03261/Go/s901756325.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s901756325", "user_id": "u605443479"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8 + 7\n)\n\nvar buf []byte = make([]byte, maxBufSize)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBufSize)\n}\n\nfunc main() {\n\tN := nextInt()\n\tWn := make([]string, N)\n\tWnsort := make([]string, N)\n\tfor i := range Wn {\n\t\tWn[i] = nextLine()\n\t}\n\tcopy(Wnsort, Wn)\n\n\tsort.Strings(Wnsort)\n\tfor i := 0; i < N-1; i++ {\n\t\tif Wn[i][len(Wn[i])-1] != Wn[i+1][0] || Wnsort[i+1] == Wnsort[i] {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"Yes\")\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi is practicing shiritori alone again today.\n\nShiritori is a game as follows:\n\nIn the first turn, a player announces any one word.\n\nIn the subsequent turns, a player announces a word that satisfies the following conditions:\n\nThat word is not announced before.\n\nThe first character of that word is the same as the last character of the last word announced.\n\nIn this game, he is practicing to announce as many words as possible in ten seconds.\n\nYou are given the number of words Takahashi announced, N, and the i-th word he announced, W_i, for each i. Determine if the rules of shiritori was observed, that is, every word announced by him satisfied the conditions.\n\nConstraints\n\nN is an integer satisfying 2 \\leq N \\leq 100.\n\nW_i is a string of length 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\nW_1\nW_2\n:\nW_N\n\nOutput\n\nIf every word announced by Takahashi satisfied the conditions, print Yes; otherwise, print No.\n\nSample Input 1\n\n4\nhoge\nenglish\nhoge\nenigma\n\nSample Output 1\n\nNo\n\nAs hoge is announced multiple times, the rules of shiritori was not observed.\n\nSample Input 2\n\n9\nbasic\nc\ncpp\nphp\npython\nnadesico\nocaml\nlua\nassembly\n\nSample Output 2\n\nYes\n\nSample Input 3\n\n8\na\naa\naaa\naaaa\naaaaa\naaaaaa\naaa\naaaaaaa\n\nSample Output 3\n\nNo\n\nSample Input 4\n\n3\nabc\narc\nagc\n\nSample Output 4\n\nNo", "sample_input": "4\nhoge\nenglish\nhoge\nenigma\n"}, "reference_outputs": ["No\n"], "source_document_id": "p03261", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi is practicing shiritori alone again today.\n\nShiritori is a game as follows:\n\nIn the first turn, a player announces any one word.\n\nIn the subsequent turns, a player announces a word that satisfies the following conditions:\n\nThat word is not announced before.\n\nThe first character of that word is the same as the last character of the last word announced.\n\nIn this game, he is practicing to announce as many words as possible in ten seconds.\n\nYou are given the number of words Takahashi announced, N, and the i-th word he announced, W_i, for each i. Determine if the rules of shiritori was observed, that is, every word announced by him satisfied the conditions.\n\nConstraints\n\nN is an integer satisfying 2 \\leq N \\leq 100.\n\nW_i is a string of length 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\nW_1\nW_2\n:\nW_N\n\nOutput\n\nIf every word announced by Takahashi satisfied the conditions, print Yes; otherwise, print No.\n\nSample Input 1\n\n4\nhoge\nenglish\nhoge\nenigma\n\nSample Output 1\n\nNo\n\nAs hoge is announced multiple times, the rules of shiritori was not observed.\n\nSample Input 2\n\n9\nbasic\nc\ncpp\nphp\npython\nnadesico\nocaml\nlua\nassembly\n\nSample Output 2\n\nYes\n\nSample Input 3\n\n8\na\naa\naaa\naaaa\naaaaa\naaaaaa\naaa\naaaaaaa\n\nSample Output 3\n\nNo\n\nSample Input 4\n\n3\nabc\narc\nagc\n\nSample Output 4\n\nNo", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 768, "cpu_time_ms": 16, "memory_kb": 7808}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s238753212", "group_id": "codeNet:p03261", "input_text": "package main\nimport(\n \"fmt\"\n)\nfunc main(){\n var n, i, j int\n var temp byte\n fmt.Scan(&n)\n a:=make([]string, n)\n for i=0;i= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\nfunc (io *Io) NextInt() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) NextInt64() int64 {\n\ti, err := strconv.ParseInt(io.Next(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\n\nfunc (io *Io) NextFloat() float64 {\n\ti, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) PrintLn(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\nfunc intMin(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc (io *Io) PrintBool(b bool, trueS, falseS string) {\n\tif b {\n\t\tio.PrintLn(trueS)\n\t} else {\n\t\tio.PrintLn(falseS)\n\t}\n}\n\nfunc intMax(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc absi(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc b2i(b bool) int {\n\tif b {\n\t\treturn 1\n\t}\n\treturn 0\n}\n\ntype Int64s []int64\nfunc (f Int64s) Len() int {\n\treturn len(f)\n}\nfunc (f Int64s) Less(i, j int) bool {\n\treturn f[i] < f[j]\n}\n\nfunc (f Int64s) Swap(i, j int) {\n\tf[i], f[j] = f[j], f[i]\n}\n\n\nfunc solve(io *Io) {\n\tn := io.NextInt()\n\n\tused := map[string]bool{}\n\ts := io.Next()\n\tused[s] = true\n\n\tok := true\n\tfor i := 1; i < n; i++ {\n\t\ts2 := io.Next()\n\t\texists := used[s2]\n\t\tif exists {\n\t\t\tok = false\n\t\t}\n\t\tused[s2] = true\n\n\t\tif s[len(s)-1] != s2[0] {\n\t\t\tok = false\n\t\t}\n\t\ts = s2\n\t}\n\n\tio.PrintBool(ok, \"Yes\", \"No\")\n}\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\n\tsolve(io)\n}\n", "language": "Go", "metadata": {"date": 1536455423, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03261.html", "problem_id": "p03261", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03261/input.txt", "sample_output_relpath": "derived/input_output/data/p03261/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03261/Go/s881098483.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s881098483", "user_id": "u279196402"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t)\n\ntype Io struct {\n\treader *bufio.Reader\n\twriter *bufio.Writer\n\ttokens []string\n\tnextToken int\n}\n\nfunc NewIo() *Io {\n\treturn &Io{\n\t\treader: bufio.NewReader(os.Stdin),\n\t\twriter: bufio.NewWriter(os.Stdout),\n\t}\n}\n\nfunc (io *Io) Flush() {\n\terr := io.writer.Flush()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}\n\nfunc (io *Io) NextLine() string {\n\tvar buffer []byte\n\tfor {\n\t\tline, isPrefix, err := io.reader.ReadLine()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbuffer = append(buffer, line...)\n\t\tif !isPrefix {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buffer)\n}\n\nfunc (io *Io) Next() string {\n\tfor io.nextToken >= len(io.tokens) {\n\t\tline := io.NextLine()\n\t\tio.tokens = strings.Fields(line)\n\t\tio.nextToken = 0\n\t}\n\tr := io.tokens[io.nextToken]\n\tio.nextToken++\n\treturn r\n}\n\nfunc (io *Io) NextInt() int {\n\ti, err := strconv.Atoi(io.Next())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) NextInt64() int64 {\n\ti, err := strconv.ParseInt(io.Next(), 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\n\nfunc (io *Io) NextFloat() float64 {\n\ti, err := strconv.ParseFloat(io.Next(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc (io *Io) PrintLn(a ...interface{}) {\n\tfmt.Fprintln(io.writer, a...)\n}\n\nfunc (io *Io) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(io.writer, format, a...)\n}\n\nfunc intMin(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc (io *Io) PrintBool(b bool, trueS, falseS string) {\n\tif b {\n\t\tio.PrintLn(trueS)\n\t} else {\n\t\tio.PrintLn(falseS)\n\t}\n}\n\nfunc intMax(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc absi(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc b2i(b bool) int {\n\tif b {\n\t\treturn 1\n\t}\n\treturn 0\n}\n\ntype Int64s []int64\nfunc (f Int64s) Len() int {\n\treturn len(f)\n}\nfunc (f Int64s) Less(i, j int) bool {\n\treturn f[i] < f[j]\n}\n\nfunc (f Int64s) Swap(i, j int) {\n\tf[i], f[j] = f[j], f[i]\n}\n\n\nfunc solve(io *Io) {\n\tn := io.NextInt()\n\n\tused := map[string]bool{}\n\ts := io.Next()\n\tused[s] = true\n\n\tok := true\n\tfor i := 1; i < n; i++ {\n\t\ts2 := io.Next()\n\t\texists := used[s2]\n\t\tif exists {\n\t\t\tok = false\n\t\t}\n\t\tused[s2] = true\n\n\t\tif s[len(s)-1] != s2[0] {\n\t\t\tok = false\n\t\t}\n\t\ts = s2\n\t}\n\n\tio.PrintBool(ok, \"Yes\", \"No\")\n}\n\nfunc main() {\n\tio := NewIo()\n\tdefer io.Flush()\n\n\tsolve(io)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi is practicing shiritori alone again today.\n\nShiritori is a game as follows:\n\nIn the first turn, a player announces any one word.\n\nIn the subsequent turns, a player announces a word that satisfies the following conditions:\n\nThat word is not announced before.\n\nThe first character of that word is the same as the last character of the last word announced.\n\nIn this game, he is practicing to announce as many words as possible in ten seconds.\n\nYou are given the number of words Takahashi announced, N, and the i-th word he announced, W_i, for each i. Determine if the rules of shiritori was observed, that is, every word announced by him satisfied the conditions.\n\nConstraints\n\nN is an integer satisfying 2 \\leq N \\leq 100.\n\nW_i is a string of length 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\nW_1\nW_2\n:\nW_N\n\nOutput\n\nIf every word announced by Takahashi satisfied the conditions, print Yes; otherwise, print No.\n\nSample Input 1\n\n4\nhoge\nenglish\nhoge\nenigma\n\nSample Output 1\n\nNo\n\nAs hoge is announced multiple times, the rules of shiritori was not observed.\n\nSample Input 2\n\n9\nbasic\nc\ncpp\nphp\npython\nnadesico\nocaml\nlua\nassembly\n\nSample Output 2\n\nYes\n\nSample Input 3\n\n8\na\naa\naaa\naaaa\naaaaa\naaaaaa\naaa\naaaaaaa\n\nSample Output 3\n\nNo\n\nSample Input 4\n\n3\nabc\narc\nagc\n\nSample Output 4\n\nNo", "sample_input": "4\nhoge\nenglish\nhoge\nenigma\n"}, "reference_outputs": ["No\n"], "source_document_id": "p03261", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi is practicing shiritori alone again today.\n\nShiritori is a game as follows:\n\nIn the first turn, a player announces any one word.\n\nIn the subsequent turns, a player announces a word that satisfies the following conditions:\n\nThat word is not announced before.\n\nThe first character of that word is the same as the last character of the last word announced.\n\nIn this game, he is practicing to announce as many words as possible in ten seconds.\n\nYou are given the number of words Takahashi announced, N, and the i-th word he announced, W_i, for each i. Determine if the rules of shiritori was observed, that is, every word announced by him satisfied the conditions.\n\nConstraints\n\nN is an integer satisfying 2 \\leq N \\leq 100.\n\nW_i is a string of length 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\nW_1\nW_2\n:\nW_N\n\nOutput\n\nIf every word announced by Takahashi satisfied the conditions, print Yes; otherwise, print No.\n\nSample Input 1\n\n4\nhoge\nenglish\nhoge\nenigma\n\nSample Output 1\n\nNo\n\nAs hoge is announced multiple times, the rules of shiritori was not observed.\n\nSample Input 2\n\n9\nbasic\nc\ncpp\nphp\npython\nnadesico\nocaml\nlua\nassembly\n\nSample Output 2\n\nYes\n\nSample Input 3\n\n8\na\naa\naaa\naaaa\naaaaa\naaaaaa\naaa\naaaaaaa\n\nSample Output 3\n\nNo\n\nSample Input 4\n\n3\nabc\narc\nagc\n\nSample Output 4\n\nNo", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2316, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s598845766", "group_id": "codeNet:p03262", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 100000\n\tmaxBufSize = 1000000\n)\n\nvar sc *bufio.Scanner\n\nfunc initScanner(r io.Reader) *bufio.Scanner {\n\tbuf := make([]byte, initialBufSize)\n\n\tsc := bufio.NewScanner(r)\n\tsc.Buffer(buf, maxBufSize)\n\tsc.Split(bufio.ScanWords) // bufio.ScanLines\n\treturn sc\n}\n\nfunc main() {\n\tsc = initScanner(os.Stdin)\n\tfmt.Println(resolve(parseProblem()))\n}\n\nfunc parseProblem() int {\n\tn, x := scanInt(sc), scanInt(sc)\n\txs := make([]int, n+1)\n\tfor i := 0; i < n; i++ {\n\t\txs[i] = scanInt(sc)\n\t}\n\txs[n] = x\n\tsort.Sort(sort.IntSlice(xs))\n\tdf := xs[1] - xs[0]\n\tfor i := 1; i < n; i++ {\n\t\tv := xs[i+1] - xs[i]\n\t\tdf = gcd(df, v)\n\t}\n\treturn df\n}\n\nfunc gcd(a, b int) int {\n\tfor b > 0 {\n\t\tt := a / b\n\t\ta, b = b, a-t*b\n\t}\n\treturn a\n}\n\nfunc nextInt(sc *bufio.Scanner) int {\n\tsc.Scan()\n\ta, _ := strconv.Atoi(sc.Text())\n\treturn int(a)\n}\n\nfunc nextString(sc *bufio.Scanner) string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextIntSlice(sc *bufio.Scanner, n int) (a []int) {\n\n\ta = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = nextInt(sc)\n\t}\n\treturn a\n}\n\nfunc resolve(n int) int {\n\treturn n\n}\n\n// snip-scan-funcs\nfunc scanInt(sc *bufio.Scanner) int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn int(i)\n}\nfunc scanString(sc *bufio.Scanner) string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "language": "Go", "metadata": {"date": 1594647140, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03262.html", "problem_id": "p03262", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03262/input.txt", "sample_output_relpath": "derived/input_output/data/p03262/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03262/Go/s598845766.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s598845766", "user_id": "u623007471"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 100000\n\tmaxBufSize = 1000000\n)\n\nvar sc *bufio.Scanner\n\nfunc initScanner(r io.Reader) *bufio.Scanner {\n\tbuf := make([]byte, initialBufSize)\n\n\tsc := bufio.NewScanner(r)\n\tsc.Buffer(buf, maxBufSize)\n\tsc.Split(bufio.ScanWords) // bufio.ScanLines\n\treturn sc\n}\n\nfunc main() {\n\tsc = initScanner(os.Stdin)\n\tfmt.Println(resolve(parseProblem()))\n}\n\nfunc parseProblem() int {\n\tn, x := scanInt(sc), scanInt(sc)\n\txs := make([]int, n+1)\n\tfor i := 0; i < n; i++ {\n\t\txs[i] = scanInt(sc)\n\t}\n\txs[n] = x\n\tsort.Sort(sort.IntSlice(xs))\n\tdf := xs[1] - xs[0]\n\tfor i := 1; i < n; i++ {\n\t\tv := xs[i+1] - xs[i]\n\t\tdf = gcd(df, v)\n\t}\n\treturn df\n}\n\nfunc gcd(a, b int) int {\n\tfor b > 0 {\n\t\tt := a / b\n\t\ta, b = b, a-t*b\n\t}\n\treturn a\n}\n\nfunc nextInt(sc *bufio.Scanner) int {\n\tsc.Scan()\n\ta, _ := strconv.Atoi(sc.Text())\n\treturn int(a)\n}\n\nfunc nextString(sc *bufio.Scanner) string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextIntSlice(sc *bufio.Scanner, n int) (a []int) {\n\n\ta = make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = nextInt(sc)\n\t}\n\treturn a\n}\n\nfunc resolve(n int) int {\n\treturn n\n}\n\n// snip-scan-funcs\nfunc scanInt(sc *bufio.Scanner) int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn int(i)\n}\nfunc scanString(sc *bufio.Scanner) string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N cities on a number line. The i-th city is located at coordinate x_i.\n\nYour objective is to visit all these cities at least once.\n\nIn order to do so, you will first set a positive integer D.\n\nThen, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:\n\nMove 1: travel from coordinate y to coordinate y + D.\n\nMove 2: travel from coordinate y to coordinate y - D.\n\nFind the maximum value of D that enables you to visit all the cities.\n\nHere, to visit a city is to travel to the coordinate where that city is located.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq X \\leq 10^9\n\n1 \\leq x_i \\leq 10^9\n\nx_i are all different.\n\nx_1, x_2, ..., x_N \\neq X\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\nx_1 x_2 ... x_N\n\nOutput\n\nPrint the maximum value of D that enables you to visit all the cities.\n\nSample Input 1\n\n3 3\n1 7 11\n\nSample Output 1\n\n2\n\nSetting D = 2 enables you to visit all the cities as follows, and this is the maximum value of such D.\n\nPerform Move 2 to travel to coordinate 1.\n\nPerform Move 1 to travel to coordinate 3.\n\nPerform Move 1 to travel to coordinate 5.\n\nPerform Move 1 to travel to coordinate 7.\n\nPerform Move 1 to travel to coordinate 9.\n\nPerform Move 1 to travel to coordinate 11.\n\nSample Input 2\n\n3 81\n33 105 57\n\nSample Output 2\n\n24\n\nSample Input 3\n\n1 1\n1000000000\n\nSample Output 3\n\n999999999", "sample_input": "3 3\n1 7 11\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03262", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N cities on a number line. The i-th city is located at coordinate x_i.\n\nYour objective is to visit all these cities at least once.\n\nIn order to do so, you will first set a positive integer D.\n\nThen, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:\n\nMove 1: travel from coordinate y to coordinate y + D.\n\nMove 2: travel from coordinate y to coordinate y - D.\n\nFind the maximum value of D that enables you to visit all the cities.\n\nHere, to visit a city is to travel to the coordinate where that city is located.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq X \\leq 10^9\n\n1 \\leq x_i \\leq 10^9\n\nx_i are all different.\n\nx_1, x_2, ..., x_N \\neq X\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\nx_1 x_2 ... x_N\n\nOutput\n\nPrint the maximum value of D that enables you to visit all the cities.\n\nSample Input 1\n\n3 3\n1 7 11\n\nSample Output 1\n\n2\n\nSetting D = 2 enables you to visit all the cities as follows, and this is the maximum value of such D.\n\nPerform Move 2 to travel to coordinate 1.\n\nPerform Move 1 to travel to coordinate 3.\n\nPerform Move 1 to travel to coordinate 5.\n\nPerform Move 1 to travel to coordinate 7.\n\nPerform Move 1 to travel to coordinate 9.\n\nPerform Move 1 to travel to coordinate 11.\n\nSample Input 2\n\n3 81\n33 105 57\n\nSample Output 2\n\n24\n\nSample Input 3\n\n1 1\n1000000000\n\nSample Output 3\n\n999999999", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1355, "cpu_time_ms": 50, "memory_kb": 4316}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s013928073", "group_id": "codeNet:p03262", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8 + 7\n)\n\nvar buf []byte = make([]byte, maxBufSize)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBufSize)\n}\n\nfunc main() {\n\tN := nextInt()\n\tX := nextInt()\n\tans := 0\n\tfor i := 0; i < N; i++ {\n\t\tans = gcdof2numbers(abs(nextInt(), X), ans)\n\t\tfmt.Println(ans)\n\n\t}\n\tfmt.Println(ans)\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc gcdof2numbers(a int, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcdof2numbers(b, a%b)\n}\n\nfunc abs(a int, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t} else {\n\t\treturn b - a\n\t}\n}\n", "language": "Go", "metadata": {"date": 1585726068, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03262.html", "problem_id": "p03262", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03262/input.txt", "sample_output_relpath": "derived/input_output/data/p03262/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03262/Go/s013928073.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s013928073", "user_id": "u605443479"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8 + 7\n)\n\nvar buf []byte = make([]byte, maxBufSize)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBufSize)\n}\n\nfunc main() {\n\tN := nextInt()\n\tX := nextInt()\n\tans := 0\n\tfor i := 0; i < N; i++ {\n\t\tans = gcdof2numbers(abs(nextInt(), X), ans)\n\t\tfmt.Println(ans)\n\n\t}\n\tfmt.Println(ans)\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc gcdof2numbers(a int, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcdof2numbers(b, a%b)\n}\n\nfunc abs(a int, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t} else {\n\t\treturn b - a\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N cities on a number line. The i-th city is located at coordinate x_i.\n\nYour objective is to visit all these cities at least once.\n\nIn order to do so, you will first set a positive integer D.\n\nThen, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:\n\nMove 1: travel from coordinate y to coordinate y + D.\n\nMove 2: travel from coordinate y to coordinate y - D.\n\nFind the maximum value of D that enables you to visit all the cities.\n\nHere, to visit a city is to travel to the coordinate where that city is located.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq X \\leq 10^9\n\n1 \\leq x_i \\leq 10^9\n\nx_i are all different.\n\nx_1, x_2, ..., x_N \\neq X\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\nx_1 x_2 ... x_N\n\nOutput\n\nPrint the maximum value of D that enables you to visit all the cities.\n\nSample Input 1\n\n3 3\n1 7 11\n\nSample Output 1\n\n2\n\nSetting D = 2 enables you to visit all the cities as follows, and this is the maximum value of such D.\n\nPerform Move 2 to travel to coordinate 1.\n\nPerform Move 1 to travel to coordinate 3.\n\nPerform Move 1 to travel to coordinate 5.\n\nPerform Move 1 to travel to coordinate 7.\n\nPerform Move 1 to travel to coordinate 9.\n\nPerform Move 1 to travel to coordinate 11.\n\nSample Input 2\n\n3 81\n33 105 57\n\nSample Output 2\n\n24\n\nSample Input 3\n\n1 1\n1000000000\n\nSample Output 3\n\n999999999", "sample_input": "3 3\n1 7 11\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03262", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N cities on a number line. The i-th city is located at coordinate x_i.\n\nYour objective is to visit all these cities at least once.\n\nIn order to do so, you will first set a positive integer D.\n\nThen, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:\n\nMove 1: travel from coordinate y to coordinate y + D.\n\nMove 2: travel from coordinate y to coordinate y - D.\n\nFind the maximum value of D that enables you to visit all the cities.\n\nHere, to visit a city is to travel to the coordinate where that city is located.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq X \\leq 10^9\n\n1 \\leq x_i \\leq 10^9\n\nx_i are all different.\n\nx_1, x_2, ..., x_N \\neq X\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\nx_1 x_2 ... x_N\n\nOutput\n\nPrint the maximum value of D that enables you to visit all the cities.\n\nSample Input 1\n\n3 3\n1 7 11\n\nSample Output 1\n\n2\n\nSetting D = 2 enables you to visit all the cities as follows, and this is the maximum value of such D.\n\nPerform Move 2 to travel to coordinate 1.\n\nPerform Move 1 to travel to coordinate 3.\n\nPerform Move 1 to travel to coordinate 5.\n\nPerform Move 1 to travel to coordinate 7.\n\nPerform Move 1 to travel to coordinate 9.\n\nPerform Move 1 to travel to coordinate 11.\n\nSample Input 2\n\n3 81\n33 105 57\n\nSample Output 2\n\n24\n\nSample Input 3\n\n1 1\n1000000000\n\nSample Output 3\n\n999999999", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 733, "cpu_time_ms": 262, "memory_kb": 8704}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s303430105", "group_id": "codeNet:p03262", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar n, x int\n\ts := wordScanner(100)\n\tscanInts(s, &n, &x)\n\tl := scanIntSlice(s, n)\n\n\tsort.Ints(l)\n\td := make([]int, n)\n\tfor i, xi := range l {\n\t\td[i] = abs(x - xi)\n\t}\n\n\tans := d[0]\n\tfor _, di := range d {\n\t\tans = gcd(ans, di)\n\t}\n\n\tfmt.Println(ans)\n}\n\nfunc gcd(x, y int) int {\n\tfor x%y != 0 {\n\t\tx, y = y, x%y\n\t}\n\treturn y\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc wordScanner(n int) *bufio.Scanner {\n\ts := bufio.NewScanner(os.Stdin)\n\ts.Split(bufio.ScanWords)\n\tb := make([]byte, n)\n\ts.Buffer(b, n)\n\treturn s\n}\n\nfunc scanInts(s *bufio.Scanner, vals ...*int) {\n\tfor i := range vals {\n\t\ts.Scan()\n\t\tn, _ := strconv.Atoi(s.Text())\n\t\t*vals[i] = n\n\t}\n}\n\nfunc scanIntSlice(s *bufio.Scanner, n int) []int {\n\tvals := make([]int, n)\n\tfor i := range vals {\n\t\ts.Scan()\n\t\tm, _ := strconv.Atoi(s.Text())\n\t\tvals[i] = m\n\t}\n\treturn vals\n}\n", "language": "Go", "metadata": {"date": 1566267165, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03262.html", "problem_id": "p03262", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03262/input.txt", "sample_output_relpath": "derived/input_output/data/p03262/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03262/Go/s303430105.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s303430105", "user_id": "u889640107"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar n, x int\n\ts := wordScanner(100)\n\tscanInts(s, &n, &x)\n\tl := scanIntSlice(s, n)\n\n\tsort.Ints(l)\n\td := make([]int, n)\n\tfor i, xi := range l {\n\t\td[i] = abs(x - xi)\n\t}\n\n\tans := d[0]\n\tfor _, di := range d {\n\t\tans = gcd(ans, di)\n\t}\n\n\tfmt.Println(ans)\n}\n\nfunc gcd(x, y int) int {\n\tfor x%y != 0 {\n\t\tx, y = y, x%y\n\t}\n\treturn y\n}\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\n\nfunc wordScanner(n int) *bufio.Scanner {\n\ts := bufio.NewScanner(os.Stdin)\n\ts.Split(bufio.ScanWords)\n\tb := make([]byte, n)\n\ts.Buffer(b, n)\n\treturn s\n}\n\nfunc scanInts(s *bufio.Scanner, vals ...*int) {\n\tfor i := range vals {\n\t\ts.Scan()\n\t\tn, _ := strconv.Atoi(s.Text())\n\t\t*vals[i] = n\n\t}\n}\n\nfunc scanIntSlice(s *bufio.Scanner, n int) []int {\n\tvals := make([]int, n)\n\tfor i := range vals {\n\t\ts.Scan()\n\t\tm, _ := strconv.Atoi(s.Text())\n\t\tvals[i] = m\n\t}\n\treturn vals\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N cities on a number line. The i-th city is located at coordinate x_i.\n\nYour objective is to visit all these cities at least once.\n\nIn order to do so, you will first set a positive integer D.\n\nThen, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:\n\nMove 1: travel from coordinate y to coordinate y + D.\n\nMove 2: travel from coordinate y to coordinate y - D.\n\nFind the maximum value of D that enables you to visit all the cities.\n\nHere, to visit a city is to travel to the coordinate where that city is located.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq X \\leq 10^9\n\n1 \\leq x_i \\leq 10^9\n\nx_i are all different.\n\nx_1, x_2, ..., x_N \\neq X\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\nx_1 x_2 ... x_N\n\nOutput\n\nPrint the maximum value of D that enables you to visit all the cities.\n\nSample Input 1\n\n3 3\n1 7 11\n\nSample Output 1\n\n2\n\nSetting D = 2 enables you to visit all the cities as follows, and this is the maximum value of such D.\n\nPerform Move 2 to travel to coordinate 1.\n\nPerform Move 1 to travel to coordinate 3.\n\nPerform Move 1 to travel to coordinate 5.\n\nPerform Move 1 to travel to coordinate 7.\n\nPerform Move 1 to travel to coordinate 9.\n\nPerform Move 1 to travel to coordinate 11.\n\nSample Input 2\n\n3 81\n33 105 57\n\nSample Output 2\n\n24\n\nSample Input 3\n\n1 1\n1000000000\n\nSample Output 3\n\n999999999", "sample_input": "3 3\n1 7 11\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03262", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N cities on a number line. The i-th city is located at coordinate x_i.\n\nYour objective is to visit all these cities at least once.\n\nIn order to do so, you will first set a positive integer D.\n\nThen, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:\n\nMove 1: travel from coordinate y to coordinate y + D.\n\nMove 2: travel from coordinate y to coordinate y - D.\n\nFind the maximum value of D that enables you to visit all the cities.\n\nHere, to visit a city is to travel to the coordinate where that city is located.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq X \\leq 10^9\n\n1 \\leq x_i \\leq 10^9\n\nx_i are all different.\n\nx_1, x_2, ..., x_N \\neq X\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\nx_1 x_2 ... x_N\n\nOutput\n\nPrint the maximum value of D that enables you to visit all the cities.\n\nSample Input 1\n\n3 3\n1 7 11\n\nSample Output 1\n\n2\n\nSetting D = 2 enables you to visit all the cities as follows, and this is the maximum value of such D.\n\nPerform Move 2 to travel to coordinate 1.\n\nPerform Move 1 to travel to coordinate 3.\n\nPerform Move 1 to travel to coordinate 5.\n\nPerform Move 1 to travel to coordinate 7.\n\nPerform Move 1 to travel to coordinate 9.\n\nPerform Move 1 to travel to coordinate 11.\n\nSample Input 2\n\n3 81\n33 105 57\n\nSample Output 2\n\n24\n\nSample Input 3\n\n1 1\n1000000000\n\nSample Output 3\n\n999999999", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 928, "cpu_time_ms": 56, "memory_kb": 3840}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s541390247", "group_id": "codeNet:p03262", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t//\t\"strings\"\n\t\"sort\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\n\tn := sc.NextInt()\n\n\tx := make([]int, n+1)\n\n\tx[0] = sc.NextInt()\n\n\tfor i := 1; i <= n; i++ {\n\t\tx[i] = sc.NextInt()\n\t}\n\n\tsort.Ints(x)\n\t//\tfmt.Printf(\"%+v\\n\", x) // output for debug\n\n\tans := 100000000001\n\tfor i := 1; i < n+1; i++ {\n\t\tif x[i]-x[i-1] < ans {\n\t\t\tans = x[i] - x[i-1]\n\t\t}\n\t}\n\tfmt.Printf(\"%v\\n\", ans)\n\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tresult = append(result, v)\n\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1550706943, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03262.html", "problem_id": "p03262", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03262/input.txt", "sample_output_relpath": "derived/input_output/data/p03262/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03262/Go/s541390247.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s541390247", "user_id": "u084693263"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t//\t\"strings\"\n\t\"sort\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\n\tn := sc.NextInt()\n\n\tx := make([]int, n+1)\n\n\tx[0] = sc.NextInt()\n\n\tfor i := 1; i <= n; i++ {\n\t\tx[i] = sc.NextInt()\n\t}\n\n\tsort.Ints(x)\n\t//\tfmt.Printf(\"%+v\\n\", x) // output for debug\n\n\tans := 100000000001\n\tfor i := 1; i < n+1; i++ {\n\t\tif x[i]-x[i-1] < ans {\n\t\t\tans = x[i] - x[i-1]\n\t\t}\n\t}\n\tfmt.Printf(\"%v\\n\", ans)\n\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tresult = append(result, v)\n\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N cities on a number line. The i-th city is located at coordinate x_i.\n\nYour objective is to visit all these cities at least once.\n\nIn order to do so, you will first set a positive integer D.\n\nThen, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:\n\nMove 1: travel from coordinate y to coordinate y + D.\n\nMove 2: travel from coordinate y to coordinate y - D.\n\nFind the maximum value of D that enables you to visit all the cities.\n\nHere, to visit a city is to travel to the coordinate where that city is located.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq X \\leq 10^9\n\n1 \\leq x_i \\leq 10^9\n\nx_i are all different.\n\nx_1, x_2, ..., x_N \\neq X\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\nx_1 x_2 ... x_N\n\nOutput\n\nPrint the maximum value of D that enables you to visit all the cities.\n\nSample Input 1\n\n3 3\n1 7 11\n\nSample Output 1\n\n2\n\nSetting D = 2 enables you to visit all the cities as follows, and this is the maximum value of such D.\n\nPerform Move 2 to travel to coordinate 1.\n\nPerform Move 1 to travel to coordinate 3.\n\nPerform Move 1 to travel to coordinate 5.\n\nPerform Move 1 to travel to coordinate 7.\n\nPerform Move 1 to travel to coordinate 9.\n\nPerform Move 1 to travel to coordinate 11.\n\nSample Input 2\n\n3 81\n33 105 57\n\nSample Output 2\n\n24\n\nSample Input 3\n\n1 1\n1000000000\n\nSample Output 3\n\n999999999", "sample_input": "3 3\n1 7 11\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03262", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N cities on a number line. The i-th city is located at coordinate x_i.\n\nYour objective is to visit all these cities at least once.\n\nIn order to do so, you will first set a positive integer D.\n\nThen, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:\n\nMove 1: travel from coordinate y to coordinate y + D.\n\nMove 2: travel from coordinate y to coordinate y - D.\n\nFind the maximum value of D that enables you to visit all the cities.\n\nHere, to visit a city is to travel to the coordinate where that city is located.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq X \\leq 10^9\n\n1 \\leq x_i \\leq 10^9\n\nx_i are all different.\n\nx_1, x_2, ..., x_N \\neq X\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\nx_1 x_2 ... x_N\n\nOutput\n\nPrint the maximum value of D that enables you to visit all the cities.\n\nSample Input 1\n\n3 3\n1 7 11\n\nSample Output 1\n\n2\n\nSetting D = 2 enables you to visit all the cities as follows, and this is the maximum value of such D.\n\nPerform Move 2 to travel to coordinate 1.\n\nPerform Move 1 to travel to coordinate 3.\n\nPerform Move 1 to travel to coordinate 5.\n\nPerform Move 1 to travel to coordinate 7.\n\nPerform Move 1 to travel to coordinate 9.\n\nPerform Move 1 to travel to coordinate 11.\n\nSample Input 2\n\n3 81\n33 105 57\n\nSample Output 2\n\n24\n\nSample Input 3\n\n1 1\n1000000000\n\nSample Output 3\n\n999999999", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1894, "cpu_time_ms": 46, "memory_kb": 5632}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s801873858", "group_id": "codeNet:p03262", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, x int\n\tfmt.Scan(&n, &x)\n\n\tvar xx = make([]int, n)\n\tfor i := range xx {\n\t\tfmt.Scan(&xx[i])\n\t}\n\txx = append(xx, x)\n\tsort.Ints(xx)\n\tif x == 1 {\n\t\tfmt.Println(xx[1] - x)\n\t\treturn\n\t}\n\n\tvar deff_temp []int\n\tvar deff []int\n\tvar maxD int\n\tfor i := 0; i < n; i++ {\n\t\ttemp := xx[i] - xx[i+1]\n\t\tif temp < 0 {\n\t\t\tdeff_temp = append(deff_temp, -temp)\n\t\t} else {\n\t\t\tdeff_temp = append(deff_temp, temp)\n\t\t}\n\t}\n\tsort.Ints(deff_temp)\n\tfor i := 0; i < len(deff_temp); i++ {\n\t\tif deff_temp[i] != 0 {\n\t\t\tdeff = append(deff, deff_temp[i])\n\t\t}\n\t}\n\tmaxD = deff[0]\n\tfor i := 0; i < len(deff); i++ {\n\t\t////////////////\n\t\tif deff[i]%deff[0] != 0 {\n\t\t\tif deff[0]%2 == 0 && deff[i]%2 == 0 {\n\t\t\t\tmaxD = 2\n\t\t\t} else if deff[0]%3 == 0 && deff[i]%3 == 0 {\n\t\t\t\tmaxD = 3\n\t\t\t} else if deff[0]%5 == 0 && deff[i]%5 == 0 {\n\t\t\t\tmaxD = 5\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(maxD)\n\n}", "language": "Go", "metadata": {"date": 1549661634, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03262.html", "problem_id": "p03262", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03262/input.txt", "sample_output_relpath": "derived/input_output/data/p03262/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03262/Go/s801873858.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s801873858", "user_id": "u370270364"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, x int\n\tfmt.Scan(&n, &x)\n\n\tvar xx = make([]int, n)\n\tfor i := range xx {\n\t\tfmt.Scan(&xx[i])\n\t}\n\txx = append(xx, x)\n\tsort.Ints(xx)\n\tif x == 1 {\n\t\tfmt.Println(xx[1] - x)\n\t\treturn\n\t}\n\n\tvar deff_temp []int\n\tvar deff []int\n\tvar maxD int\n\tfor i := 0; i < n; i++ {\n\t\ttemp := xx[i] - xx[i+1]\n\t\tif temp < 0 {\n\t\t\tdeff_temp = append(deff_temp, -temp)\n\t\t} else {\n\t\t\tdeff_temp = append(deff_temp, temp)\n\t\t}\n\t}\n\tsort.Ints(deff_temp)\n\tfor i := 0; i < len(deff_temp); i++ {\n\t\tif deff_temp[i] != 0 {\n\t\t\tdeff = append(deff, deff_temp[i])\n\t\t}\n\t}\n\tmaxD = deff[0]\n\tfor i := 0; i < len(deff); i++ {\n\t\t////////////////\n\t\tif deff[i]%deff[0] != 0 {\n\t\t\tif deff[0]%2 == 0 && deff[i]%2 == 0 {\n\t\t\t\tmaxD = 2\n\t\t\t} else if deff[0]%3 == 0 && deff[i]%3 == 0 {\n\t\t\t\tmaxD = 3\n\t\t\t} else if deff[0]%5 == 0 && deff[i]%5 == 0 {\n\t\t\t\tmaxD = 5\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(maxD)\n\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N cities on a number line. The i-th city is located at coordinate x_i.\n\nYour objective is to visit all these cities at least once.\n\nIn order to do so, you will first set a positive integer D.\n\nThen, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:\n\nMove 1: travel from coordinate y to coordinate y + D.\n\nMove 2: travel from coordinate y to coordinate y - D.\n\nFind the maximum value of D that enables you to visit all the cities.\n\nHere, to visit a city is to travel to the coordinate where that city is located.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq X \\leq 10^9\n\n1 \\leq x_i \\leq 10^9\n\nx_i are all different.\n\nx_1, x_2, ..., x_N \\neq X\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\nx_1 x_2 ... x_N\n\nOutput\n\nPrint the maximum value of D that enables you to visit all the cities.\n\nSample Input 1\n\n3 3\n1 7 11\n\nSample Output 1\n\n2\n\nSetting D = 2 enables you to visit all the cities as follows, and this is the maximum value of such D.\n\nPerform Move 2 to travel to coordinate 1.\n\nPerform Move 1 to travel to coordinate 3.\n\nPerform Move 1 to travel to coordinate 5.\n\nPerform Move 1 to travel to coordinate 7.\n\nPerform Move 1 to travel to coordinate 9.\n\nPerform Move 1 to travel to coordinate 11.\n\nSample Input 2\n\n3 81\n33 105 57\n\nSample Output 2\n\n24\n\nSample Input 3\n\n1 1\n1000000000\n\nSample Output 3\n\n999999999", "sample_input": "3 3\n1 7 11\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03262", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N cities on a number line. The i-th city is located at coordinate x_i.\n\nYour objective is to visit all these cities at least once.\n\nIn order to do so, you will first set a positive integer D.\n\nThen, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:\n\nMove 1: travel from coordinate y to coordinate y + D.\n\nMove 2: travel from coordinate y to coordinate y - D.\n\nFind the maximum value of D that enables you to visit all the cities.\n\nHere, to visit a city is to travel to the coordinate where that city is located.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq X \\leq 10^9\n\n1 \\leq x_i \\leq 10^9\n\nx_i are all different.\n\nx_1, x_2, ..., x_N \\neq X\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\nx_1 x_2 ... x_N\n\nOutput\n\nPrint the maximum value of D that enables you to visit all the cities.\n\nSample Input 1\n\n3 3\n1 7 11\n\nSample Output 1\n\n2\n\nSetting D = 2 enables you to visit all the cities as follows, and this is the maximum value of such D.\n\nPerform Move 2 to travel to coordinate 1.\n\nPerform Move 1 to travel to coordinate 3.\n\nPerform Move 1 to travel to coordinate 5.\n\nPerform Move 1 to travel to coordinate 7.\n\nPerform Move 1 to travel to coordinate 9.\n\nPerform Move 1 to travel to coordinate 11.\n\nSample Input 2\n\n3 81\n33 105 57\n\nSample Output 2\n\n24\n\nSample Input 3\n\n1 1\n1000000000\n\nSample Output 3\n\n999999999", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 894, "cpu_time_ms": 713, "memory_kb": 7552}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s368256185", "group_id": "codeNet:p03262", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, x int\n\tfmt.Scan(&n, &x)\n\n\tvar xx = make([]int, n)\n\tfor i := range xx {\n\t\tfmt.Scan(&xx[i])\n\t}\n\txx = append(xx, x)\n\tsort.Ints(xx)\n\tif x == 1 {\n\t\tfmt.Println(xx[0] - x)\n\t\treturn\n\t}\n\n\tvar deff []int\n\tfor i := 0; i < n; i++ {\n\t\ttemp := xx[i] - xx[i+1]\n\t\tif temp < 0 {\n\t\t\tdeff = append(deff, -temp)\n\t\t} else {\n\t\t\tdeff = append(deff, temp)\n\t\t}\n\t}\n\tsort.Ints(deff)\n\tfmt.Println(deff)\n\tfor i := 0; i < len(deff); i++ {\n\t\tif deff[i]%deff[0] != 0 {\n\t\t\tfmt.Println(1)\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(deff[0])\n\n}", "language": "Go", "metadata": {"date": 1549657879, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03262.html", "problem_id": "p03262", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03262/input.txt", "sample_output_relpath": "derived/input_output/data/p03262/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03262/Go/s368256185.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s368256185", "user_id": "u370270364"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, x int\n\tfmt.Scan(&n, &x)\n\n\tvar xx = make([]int, n)\n\tfor i := range xx {\n\t\tfmt.Scan(&xx[i])\n\t}\n\txx = append(xx, x)\n\tsort.Ints(xx)\n\tif x == 1 {\n\t\tfmt.Println(xx[0] - x)\n\t\treturn\n\t}\n\n\tvar deff []int\n\tfor i := 0; i < n; i++ {\n\t\ttemp := xx[i] - xx[i+1]\n\t\tif temp < 0 {\n\t\t\tdeff = append(deff, -temp)\n\t\t} else {\n\t\t\tdeff = append(deff, temp)\n\t\t}\n\t}\n\tsort.Ints(deff)\n\tfmt.Println(deff)\n\tfor i := 0; i < len(deff); i++ {\n\t\tif deff[i]%deff[0] != 0 {\n\t\t\tfmt.Println(1)\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(deff[0])\n\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N cities on a number line. The i-th city is located at coordinate x_i.\n\nYour objective is to visit all these cities at least once.\n\nIn order to do so, you will first set a positive integer D.\n\nThen, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:\n\nMove 1: travel from coordinate y to coordinate y + D.\n\nMove 2: travel from coordinate y to coordinate y - D.\n\nFind the maximum value of D that enables you to visit all the cities.\n\nHere, to visit a city is to travel to the coordinate where that city is located.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq X \\leq 10^9\n\n1 \\leq x_i \\leq 10^9\n\nx_i are all different.\n\nx_1, x_2, ..., x_N \\neq X\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\nx_1 x_2 ... x_N\n\nOutput\n\nPrint the maximum value of D that enables you to visit all the cities.\n\nSample Input 1\n\n3 3\n1 7 11\n\nSample Output 1\n\n2\n\nSetting D = 2 enables you to visit all the cities as follows, and this is the maximum value of such D.\n\nPerform Move 2 to travel to coordinate 1.\n\nPerform Move 1 to travel to coordinate 3.\n\nPerform Move 1 to travel to coordinate 5.\n\nPerform Move 1 to travel to coordinate 7.\n\nPerform Move 1 to travel to coordinate 9.\n\nPerform Move 1 to travel to coordinate 11.\n\nSample Input 2\n\n3 81\n33 105 57\n\nSample Output 2\n\n24\n\nSample Input 3\n\n1 1\n1000000000\n\nSample Output 3\n\n999999999", "sample_input": "3 3\n1 7 11\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03262", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N cities on a number line. The i-th city is located at coordinate x_i.\n\nYour objective is to visit all these cities at least once.\n\nIn order to do so, you will first set a positive integer D.\n\nThen, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:\n\nMove 1: travel from coordinate y to coordinate y + D.\n\nMove 2: travel from coordinate y to coordinate y - D.\n\nFind the maximum value of D that enables you to visit all the cities.\n\nHere, to visit a city is to travel to the coordinate where that city is located.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq X \\leq 10^9\n\n1 \\leq x_i \\leq 10^9\n\nx_i are all different.\n\nx_1, x_2, ..., x_N \\neq X\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\nx_1 x_2 ... x_N\n\nOutput\n\nPrint the maximum value of D that enables you to visit all the cities.\n\nSample Input 1\n\n3 3\n1 7 11\n\nSample Output 1\n\n2\n\nSetting D = 2 enables you to visit all the cities as follows, and this is the maximum value of such D.\n\nPerform Move 2 to travel to coordinate 1.\n\nPerform Move 1 to travel to coordinate 3.\n\nPerform Move 1 to travel to coordinate 5.\n\nPerform Move 1 to travel to coordinate 7.\n\nPerform Move 1 to travel to coordinate 9.\n\nPerform Move 1 to travel to coordinate 11.\n\nSample Input 2\n\n3 81\n33 105 57\n\nSample Output 2\n\n24\n\nSample Input 3\n\n1 1\n1000000000\n\nSample Output 3\n\n999999999", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 560, "cpu_time_ms": 720, "memory_kb": 7424}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s256969496", "group_id": "codeNet:p03262", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc NextSlice(n int) []int {\n\tin := bufio.NewScanner(os.Stdin)\n\tvar mat []int\n\tin.Scan()\n\ttemp := strings.Split(in.Text(), \" \")\n\n\tfor i := 0; i < n; i++ {\n\t\tli, _ := strconv.Atoi(temp[i])\n\t\tmat = append(mat, li)\n\t}\n\treturn mat\n}\nfunc main() {\n\tvar n, x int\n\tfmt.Scan(&n, &x)\n\txx := NextSlice(n)\n\n\tfor i := 0; i < n; i++ {\n\t\tif x-xx[i] < 0 {\n\t\t\txx[i] -= x\n\t\t} else {\n\t\t\txx[i] = x - xx[i]\n\t\t}\n\t}\n\tsort.Ints(xx)\n\tfor i := 0; i < len(xx); i++ {\n\t\tfor j := 0; j < len(xx); {\n\t\t\tif xx[j]%xx[i] == 0 {\n\t\t\t\tj++\n\t\t\t}\n\t\t\tif j == len(xx)-1 {\n\t\t\t\tfmt.Println(xx[i])\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}", "language": "Go", "metadata": {"date": 1549496880, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03262.html", "problem_id": "p03262", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03262/input.txt", "sample_output_relpath": "derived/input_output/data/p03262/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03262/Go/s256969496.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s256969496", "user_id": "u370270364"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc NextSlice(n int) []int {\n\tin := bufio.NewScanner(os.Stdin)\n\tvar mat []int\n\tin.Scan()\n\ttemp := strings.Split(in.Text(), \" \")\n\n\tfor i := 0; i < n; i++ {\n\t\tli, _ := strconv.Atoi(temp[i])\n\t\tmat = append(mat, li)\n\t}\n\treturn mat\n}\nfunc main() {\n\tvar n, x int\n\tfmt.Scan(&n, &x)\n\txx := NextSlice(n)\n\n\tfor i := 0; i < n; i++ {\n\t\tif x-xx[i] < 0 {\n\t\t\txx[i] -= x\n\t\t} else {\n\t\t\txx[i] = x - xx[i]\n\t\t}\n\t}\n\tsort.Ints(xx)\n\tfor i := 0; i < len(xx); i++ {\n\t\tfor j := 0; j < len(xx); {\n\t\t\tif xx[j]%xx[i] == 0 {\n\t\t\t\tj++\n\t\t\t}\n\t\t\tif j == len(xx)-1 {\n\t\t\t\tfmt.Println(xx[i])\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N cities on a number line. The i-th city is located at coordinate x_i.\n\nYour objective is to visit all these cities at least once.\n\nIn order to do so, you will first set a positive integer D.\n\nThen, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:\n\nMove 1: travel from coordinate y to coordinate y + D.\n\nMove 2: travel from coordinate y to coordinate y - D.\n\nFind the maximum value of D that enables you to visit all the cities.\n\nHere, to visit a city is to travel to the coordinate where that city is located.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq X \\leq 10^9\n\n1 \\leq x_i \\leq 10^9\n\nx_i are all different.\n\nx_1, x_2, ..., x_N \\neq X\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\nx_1 x_2 ... x_N\n\nOutput\n\nPrint the maximum value of D that enables you to visit all the cities.\n\nSample Input 1\n\n3 3\n1 7 11\n\nSample Output 1\n\n2\n\nSetting D = 2 enables you to visit all the cities as follows, and this is the maximum value of such D.\n\nPerform Move 2 to travel to coordinate 1.\n\nPerform Move 1 to travel to coordinate 3.\n\nPerform Move 1 to travel to coordinate 5.\n\nPerform Move 1 to travel to coordinate 7.\n\nPerform Move 1 to travel to coordinate 9.\n\nPerform Move 1 to travel to coordinate 11.\n\nSample Input 2\n\n3 81\n33 105 57\n\nSample Output 2\n\n24\n\nSample Input 3\n\n1 1\n1000000000\n\nSample Output 3\n\n999999999", "sample_input": "3 3\n1 7 11\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03262", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N cities on a number line. The i-th city is located at coordinate x_i.\n\nYour objective is to visit all these cities at least once.\n\nIn order to do so, you will first set a positive integer D.\n\nThen, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:\n\nMove 1: travel from coordinate y to coordinate y + D.\n\nMove 2: travel from coordinate y to coordinate y - D.\n\nFind the maximum value of D that enables you to visit all the cities.\n\nHere, to visit a city is to travel to the coordinate where that city is located.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq X \\leq 10^9\n\n1 \\leq x_i \\leq 10^9\n\nx_i are all different.\n\nx_1, x_2, ..., x_N \\neq X\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\nx_1 x_2 ... x_N\n\nOutput\n\nPrint the maximum value of D that enables you to visit all the cities.\n\nSample Input 1\n\n3 3\n1 7 11\n\nSample Output 1\n\n2\n\nSetting D = 2 enables you to visit all the cities as follows, and this is the maximum value of such D.\n\nPerform Move 2 to travel to coordinate 1.\n\nPerform Move 1 to travel to coordinate 3.\n\nPerform Move 1 to travel to coordinate 5.\n\nPerform Move 1 to travel to coordinate 7.\n\nPerform Move 1 to travel to coordinate 9.\n\nPerform Move 1 to travel to coordinate 11.\n\nSample Input 2\n\n3 81\n33 105 57\n\nSample Output 2\n\n24\n\nSample Input 3\n\n1 1\n1000000000\n\nSample Output 3\n\n999999999", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 657, "cpu_time_ms": 2107, "memory_kb": 768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s568208022", "group_id": "codeNet:p03262", "input_text": "// by syu\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar in = NewScanner(os.Stdin, 0)\n\nfunc main() {\n\tN, X := in.Int(), in.Int()\n\tx := in.ArrayInt(N)\n\tx = append(x, X)\n\tsort.Ints(x)\n\tans := x[1] - x[0]\n\tfor i := 0; i < len(x)-1; i++ {\n\t\tgcd := Gcd(ans, x[i+1]-x[i])\n\t\tif gcd < ans {\n\t\t\tans = gcd\n\t\t}\n\t}\n\tPln(ans)\n}\n\ntype Scanner struct {\n\t*bufio.Scanner\n}\n\nfunc NewScanner(r io.Reader, max int) *Scanner {\n\ts := bufio.NewScanner(r)\n\ts.Split(bufio.ScanWords)\n\tif max <= 0 {\n\t\tmax = 1048576\n\t}\n\ts.Buffer([]byte{}, max)\n\treturn &Scanner{s}\n}\nfunc (s *Scanner) Int() int {\n\ts.Scan()\n\ti, e := strconv.ParseInt(s.Text(), 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn int(i)\n}\nfunc (s *Scanner) ArrayInt(n int) (r []int) {\n\tfor i := 0; i < n; i++ {\n\t\tr = append(r, s.Int())\n\t}\n\treturn\n}\nfunc Pln(s ...interface{}) {\n\tfmt.Println(s...)\n}\nfunc Gcd(a, b int) int {\n\tt := 0\n\tfor b != 0 {\n\t\tt = a % b\n\t\ta = b\n\t\tb = t\n\t}\n\treturn a\n}\n", "language": "Go", "metadata": {"date": 1546845373, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03262.html", "problem_id": "p03262", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03262/input.txt", "sample_output_relpath": "derived/input_output/data/p03262/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03262/Go/s568208022.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s568208022", "user_id": "u502859637"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "// by syu\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar in = NewScanner(os.Stdin, 0)\n\nfunc main() {\n\tN, X := in.Int(), in.Int()\n\tx := in.ArrayInt(N)\n\tx = append(x, X)\n\tsort.Ints(x)\n\tans := x[1] - x[0]\n\tfor i := 0; i < len(x)-1; i++ {\n\t\tgcd := Gcd(ans, x[i+1]-x[i])\n\t\tif gcd < ans {\n\t\t\tans = gcd\n\t\t}\n\t}\n\tPln(ans)\n}\n\ntype Scanner struct {\n\t*bufio.Scanner\n}\n\nfunc NewScanner(r io.Reader, max int) *Scanner {\n\ts := bufio.NewScanner(r)\n\ts.Split(bufio.ScanWords)\n\tif max <= 0 {\n\t\tmax = 1048576\n\t}\n\ts.Buffer([]byte{}, max)\n\treturn &Scanner{s}\n}\nfunc (s *Scanner) Int() int {\n\ts.Scan()\n\ti, e := strconv.ParseInt(s.Text(), 10, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn int(i)\n}\nfunc (s *Scanner) ArrayInt(n int) (r []int) {\n\tfor i := 0; i < n; i++ {\n\t\tr = append(r, s.Int())\n\t}\n\treturn\n}\nfunc Pln(s ...interface{}) {\n\tfmt.Println(s...)\n}\nfunc Gcd(a, b int) int {\n\tt := 0\n\tfor b != 0 {\n\t\tt = a % b\n\t\ta = b\n\t\tb = t\n\t}\n\treturn a\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N cities on a number line. The i-th city is located at coordinate x_i.\n\nYour objective is to visit all these cities at least once.\n\nIn order to do so, you will first set a positive integer D.\n\nThen, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:\n\nMove 1: travel from coordinate y to coordinate y + D.\n\nMove 2: travel from coordinate y to coordinate y - D.\n\nFind the maximum value of D that enables you to visit all the cities.\n\nHere, to visit a city is to travel to the coordinate where that city is located.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq X \\leq 10^9\n\n1 \\leq x_i \\leq 10^9\n\nx_i are all different.\n\nx_1, x_2, ..., x_N \\neq X\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\nx_1 x_2 ... x_N\n\nOutput\n\nPrint the maximum value of D that enables you to visit all the cities.\n\nSample Input 1\n\n3 3\n1 7 11\n\nSample Output 1\n\n2\n\nSetting D = 2 enables you to visit all the cities as follows, and this is the maximum value of such D.\n\nPerform Move 2 to travel to coordinate 1.\n\nPerform Move 1 to travel to coordinate 3.\n\nPerform Move 1 to travel to coordinate 5.\n\nPerform Move 1 to travel to coordinate 7.\n\nPerform Move 1 to travel to coordinate 9.\n\nPerform Move 1 to travel to coordinate 11.\n\nSample Input 2\n\n3 81\n33 105 57\n\nSample Output 2\n\n24\n\nSample Input 3\n\n1 1\n1000000000\n\nSample Output 3\n\n999999999", "sample_input": "3 3\n1 7 11\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03262", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N cities on a number line. The i-th city is located at coordinate x_i.\n\nYour objective is to visit all these cities at least once.\n\nIn order to do so, you will first set a positive integer D.\n\nThen, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:\n\nMove 1: travel from coordinate y to coordinate y + D.\n\nMove 2: travel from coordinate y to coordinate y - D.\n\nFind the maximum value of D that enables you to visit all the cities.\n\nHere, to visit a city is to travel to the coordinate where that city is located.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq X \\leq 10^9\n\n1 \\leq x_i \\leq 10^9\n\nx_i are all different.\n\nx_1, x_2, ..., x_N \\neq X\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\nx_1 x_2 ... x_N\n\nOutput\n\nPrint the maximum value of D that enables you to visit all the cities.\n\nSample Input 1\n\n3 3\n1 7 11\n\nSample Output 1\n\n2\n\nSetting D = 2 enables you to visit all the cities as follows, and this is the maximum value of such D.\n\nPerform Move 2 to travel to coordinate 1.\n\nPerform Move 1 to travel to coordinate 3.\n\nPerform Move 1 to travel to coordinate 5.\n\nPerform Move 1 to travel to coordinate 7.\n\nPerform Move 1 to travel to coordinate 9.\n\nPerform Move 1 to travel to coordinate 11.\n\nSample Input 2\n\n3 81\n33 105 57\n\nSample Output 2\n\n24\n\nSample Input 3\n\n1 1\n1000000000\n\nSample Output 3\n\n999999999", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 949, "cpu_time_ms": 58, "memory_kb": 5760}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s322759600", "group_id": "codeNet:p03262", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\n// const abcd = \"abcdefghijklmnopqrstuvwxyz\"\n// const ABCD = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\nvar dr = [...]int{0, 1, 1, 1, 0, -1, -1, -1, 0}\nvar dc = [...]int{1, 1, 0, -1, -1, -1, 0, 1, 0}\n\nfunc main() {\n\tlog.SetFlags(log.Lshortfile)\n\tnextReader = NewScanner()\n\tN := nextInt()\n\tX := nextInt()\n\tx := nextInts(N)\n\tx = append(x, X)\n\tsort.Ints(x)\n\tvar m int\n\tvar g int\n\tfor i := 1; i < N+1; i++ {\n\t\tm = x[i] - x[i-1]\n\t\tif g == 0 {\n\t\t\tg = m\n\t\t} else {\n\t\t\tg = gcd(g, m)\n\t\t}\n\t}\n\tfmt.Println(g)\n}\n\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\n\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc minmax(a, b int) (int, int) {\n\tif a > b {\n\t\treturn b, a\n\t}\n\treturn a, b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nvar nextReader func() string\n\nfunc NewScanner() func() string {\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\treturn func() string {\n\t\tr.Scan()\n\t\treturn r.Text()\n\t}\n}\nfunc nextString() string {\n\treturn nextReader()\n}\nfunc nextInt64() int64 {\n\tv, _ := strconv.ParseInt(nextReader(), 10, 64)\n\treturn v\n}\nfunc nextInt() int {\n\tv, _ := strconv.Atoi(nextReader())\n\treturn v\n}\nfunc nextInts(n int) []int {\n\tr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt()\n\t}\n\treturn r\n}\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(nextReader(), 64)\n\treturn f\n}\n", "language": "Go", "metadata": {"date": 1536455934, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03262.html", "problem_id": "p03262", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03262/input.txt", "sample_output_relpath": "derived/input_output/data/p03262/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03262/Go/s322759600.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s322759600", "user_id": "u696272993"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\n// const abcd = \"abcdefghijklmnopqrstuvwxyz\"\n// const ABCD = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\nvar dr = [...]int{0, 1, 1, 1, 0, -1, -1, -1, 0}\nvar dc = [...]int{1, 1, 0, -1, -1, -1, 0, 1, 0}\n\nfunc main() {\n\tlog.SetFlags(log.Lshortfile)\n\tnextReader = NewScanner()\n\tN := nextInt()\n\tX := nextInt()\n\tx := nextInts(N)\n\tx = append(x, X)\n\tsort.Ints(x)\n\tvar m int\n\tvar g int\n\tfor i := 1; i < N+1; i++ {\n\t\tm = x[i] - x[i-1]\n\t\tif g == 0 {\n\t\t\tg = m\n\t\t} else {\n\t\t\tg = gcd(g, m)\n\t\t}\n\t}\n\tfmt.Println(g)\n}\n\nfunc gcd(a, b int) int {\n\tif a < b {\n\t\ta, b = b, a\n\t}\n\tfor b != 0 {\n\t\ta, b = b, a%b\n\t}\n\treturn a\n}\nfunc lcm(a, b int) int {\n\treturn a * b / gcd(a, b)\n}\n\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\nfunc sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\nfunc minmax(a, b int) (int, int) {\n\tif a > b {\n\t\treturn b, a\n\t}\n\treturn a, b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\nvar nextReader func() string\n\nfunc NewScanner() func() string {\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\treturn func() string {\n\t\tr.Scan()\n\t\treturn r.Text()\n\t}\n}\nfunc nextString() string {\n\treturn nextReader()\n}\nfunc nextInt64() int64 {\n\tv, _ := strconv.ParseInt(nextReader(), 10, 64)\n\treturn v\n}\nfunc nextInt() int {\n\tv, _ := strconv.Atoi(nextReader())\n\treturn v\n}\nfunc nextInts(n int) []int {\n\tr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt()\n\t}\n\treturn r\n}\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(nextReader(), 64)\n\treturn f\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N cities on a number line. The i-th city is located at coordinate x_i.\n\nYour objective is to visit all these cities at least once.\n\nIn order to do so, you will first set a positive integer D.\n\nThen, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:\n\nMove 1: travel from coordinate y to coordinate y + D.\n\nMove 2: travel from coordinate y to coordinate y - D.\n\nFind the maximum value of D that enables you to visit all the cities.\n\nHere, to visit a city is to travel to the coordinate where that city is located.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq X \\leq 10^9\n\n1 \\leq x_i \\leq 10^9\n\nx_i are all different.\n\nx_1, x_2, ..., x_N \\neq X\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\nx_1 x_2 ... x_N\n\nOutput\n\nPrint the maximum value of D that enables you to visit all the cities.\n\nSample Input 1\n\n3 3\n1 7 11\n\nSample Output 1\n\n2\n\nSetting D = 2 enables you to visit all the cities as follows, and this is the maximum value of such D.\n\nPerform Move 2 to travel to coordinate 1.\n\nPerform Move 1 to travel to coordinate 3.\n\nPerform Move 1 to travel to coordinate 5.\n\nPerform Move 1 to travel to coordinate 7.\n\nPerform Move 1 to travel to coordinate 9.\n\nPerform Move 1 to travel to coordinate 11.\n\nSample Input 2\n\n3 81\n33 105 57\n\nSample Output 2\n\n24\n\nSample Input 3\n\n1 1\n1000000000\n\nSample Output 3\n\n999999999", "sample_input": "3 3\n1 7 11\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03262", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N cities on a number line. The i-th city is located at coordinate x_i.\n\nYour objective is to visit all these cities at least once.\n\nIn order to do so, you will first set a positive integer D.\n\nThen, you will depart from coordinate X and perform Move 1 and Move 2 below, as many times as you like:\n\nMove 1: travel from coordinate y to coordinate y + D.\n\nMove 2: travel from coordinate y to coordinate y - D.\n\nFind the maximum value of D that enables you to visit all the cities.\n\nHere, to visit a city is to travel to the coordinate where that city is located.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq X \\leq 10^9\n\n1 \\leq x_i \\leq 10^9\n\nx_i are all different.\n\nx_1, x_2, ..., x_N \\neq X\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\nx_1 x_2 ... x_N\n\nOutput\n\nPrint the maximum value of D that enables you to visit all the cities.\n\nSample Input 1\n\n3 3\n1 7 11\n\nSample Output 1\n\n2\n\nSetting D = 2 enables you to visit all the cities as follows, and this is the maximum value of such D.\n\nPerform Move 2 to travel to coordinate 1.\n\nPerform Move 1 to travel to coordinate 3.\n\nPerform Move 1 to travel to coordinate 5.\n\nPerform Move 1 to travel to coordinate 7.\n\nPerform Move 1 to travel to coordinate 9.\n\nPerform Move 1 to travel to coordinate 11.\n\nSample Input 2\n\n3 81\n33 105 57\n\nSample Output 2\n\n24\n\nSample Input 3\n\n1 1\n1000000000\n\nSample Output 3\n\n999999999", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1783, "cpu_time_ms": 51, "memory_kb": 3968}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s994886074", "group_id": "codeNet:p03324", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\t// Code for B - Ringo's Favorite Numbers\n\tvar D, N int\n\tfmt.Scanf(\"%d %d\", &D, &N)\n\n\tif D == 0 {\n\t\tif N == 100 {\n\t\t\tfmt.Println(N + 1)\n\t\t} else {\n\t\t\tfmt.Println(N)\n\t\t}\n\t} else if D == 1 {\n\t\tfmt.Println(N * 100)\n\t} else {\n\t\tfmt.Println(N * 10000)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1596948315, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03324.html", "problem_id": "p03324", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03324/input.txt", "sample_output_relpath": "derived/input_output/data/p03324/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03324/Go/s994886074.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s994886074", "user_id": "u128015095"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\t// Code for B - Ringo's Favorite Numbers\n\tvar D, N int\n\tfmt.Scanf(\"%d %d\", &D, &N)\n\n\tif D == 0 {\n\t\tif N == 100 {\n\t\t\tfmt.Println(N + 1)\n\t\t} else {\n\t\t\tfmt.Println(N)\n\t\t}\n\t} else if D == 1 {\n\t\tfmt.Println(N * 100)\n\t} else {\n\t\tfmt.Println(N * 10000)\n\t}\n}\n", "problem_context": "Score: 200 points\n\nProblem Statement\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.\n\nFind the N-th smallest integer that would make Ringo happy.\n\nConstraints\n\nD is 0, 1 or 2.\n\nN is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD N\n\nOutput\n\nPrint the N-th smallest integer that can be divided by 100 exactly D times.\n\nSample Input 1\n\n0 5\n\nSample Output 1\n\n5\n\nThe integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...\n\nThus, the 5-th smallest integer that would make Ringo happy is 5.\n\nSample Input 2\n\n1 11\n\nSample Output 2\n\n1100\n\nThe integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \\ 000, 1 \\ 100, ...\n\nThus, the integer we are seeking is 1 \\ 100.\n\nSample Input 3\n\n2 85\n\nSample Output 3\n\n850000\n\nThe integers that can be divided by 100 exactly twice are as follows: 10 \\ 000, 20 \\ 000, 30 \\ 000, ...\n\nThus, the integer we are seeking is 850 \\ 000.", "sample_input": "0 5\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03324", "source_text": "Score: 200 points\n\nProblem Statement\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.\n\nFind the N-th smallest integer that would make Ringo happy.\n\nConstraints\n\nD is 0, 1 or 2.\n\nN is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD N\n\nOutput\n\nPrint the N-th smallest integer that can be divided by 100 exactly D times.\n\nSample Input 1\n\n0 5\n\nSample Output 1\n\n5\n\nThe integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...\n\nThus, the 5-th smallest integer that would make Ringo happy is 5.\n\nSample Input 2\n\n1 11\n\nSample Output 2\n\n1100\n\nThe integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \\ 000, 1 \\ 100, ...\n\nThus, the integer we are seeking is 1 \\ 100.\n\nSample Input 3\n\n2 85\n\nSample Output 3\n\n850000\n\nThe integers that can be divided by 100 exactly twice are as follows: 10 \\ 000, 20 \\ 000, 30 \\ 000, ...\n\nThus, the integer we are seeking is 850 \\ 000.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 9, "memory_kb": 1836}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s460502719", "group_id": "codeNet:p03324", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\t// Code for B - Ringo's Favorite Numbers\n\tvar D, N int\n\tfmt.Scanf(\"%d %d\", &D, &N)\n\n\tif D == 0 {\n\t\tfmt.Println(N)\n\t} else if D == 1 {\n\t\tfmt.Println(N * 100)\n\t} else {\n\t\tfmt.Println(N * 10000)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1596948038, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03324.html", "problem_id": "p03324", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03324/input.txt", "sample_output_relpath": "derived/input_output/data/p03324/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03324/Go/s460502719.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s460502719", "user_id": "u128015095"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\t// Code for B - Ringo's Favorite Numbers\n\tvar D, N int\n\tfmt.Scanf(\"%d %d\", &D, &N)\n\n\tif D == 0 {\n\t\tfmt.Println(N)\n\t} else if D == 1 {\n\t\tfmt.Println(N * 100)\n\t} else {\n\t\tfmt.Println(N * 10000)\n\t}\n}\n", "problem_context": "Score: 200 points\n\nProblem Statement\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.\n\nFind the N-th smallest integer that would make Ringo happy.\n\nConstraints\n\nD is 0, 1 or 2.\n\nN is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD N\n\nOutput\n\nPrint the N-th smallest integer that can be divided by 100 exactly D times.\n\nSample Input 1\n\n0 5\n\nSample Output 1\n\n5\n\nThe integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...\n\nThus, the 5-th smallest integer that would make Ringo happy is 5.\n\nSample Input 2\n\n1 11\n\nSample Output 2\n\n1100\n\nThe integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \\ 000, 1 \\ 100, ...\n\nThus, the integer we are seeking is 1 \\ 100.\n\nSample Input 3\n\n2 85\n\nSample Output 3\n\n850000\n\nThe integers that can be divided by 100 exactly twice are as follows: 10 \\ 000, 20 \\ 000, 30 \\ 000, ...\n\nThus, the integer we are seeking is 850 \\ 000.", "sample_input": "0 5\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03324", "source_text": "Score: 200 points\n\nProblem Statement\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.\n\nFind the N-th smallest integer that would make Ringo happy.\n\nConstraints\n\nD is 0, 1 or 2.\n\nN is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD N\n\nOutput\n\nPrint the N-th smallest integer that can be divided by 100 exactly D times.\n\nSample Input 1\n\n0 5\n\nSample Output 1\n\n5\n\nThe integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...\n\nThus, the 5-th smallest integer that would make Ringo happy is 5.\n\nSample Input 2\n\n1 11\n\nSample Output 2\n\n1100\n\nThe integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \\ 000, 1 \\ 100, ...\n\nThus, the integer we are seeking is 1 \\ 100.\n\nSample Input 3\n\n2 85\n\nSample Output 3\n\n850000\n\nThe integers that can be divided by 100 exactly twice are as follows: 10 \\ 000, 20 \\ 000, 30 \\ 000, ...\n\nThus, the integer we are seeking is 850 \\ 000.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 240, "cpu_time_ms": 3, "memory_kb": 1836}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s478478323", "group_id": "codeNet:p03324", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar d, n int\n\tfmt.Scan(&d, &n)\n\n\tvar ans int\n\tswitch d {\n\tcase 0:\n\t\tans = 1 * n\n\tcase 1:\n\t\tans = 100 * n\n\tcase 2:\n\t\tans = 10000 * n\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1590873130, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03324.html", "problem_id": "p03324", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03324/input.txt", "sample_output_relpath": "derived/input_output/data/p03324/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03324/Go/s478478323.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s478478323", "user_id": "u367908963"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar d, n int\n\tfmt.Scan(&d, &n)\n\n\tvar ans int\n\tswitch d {\n\tcase 0:\n\t\tans = 1 * n\n\tcase 1:\n\t\tans = 100 * n\n\tcase 2:\n\t\tans = 10000 * n\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score: 200 points\n\nProblem Statement\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.\n\nFind the N-th smallest integer that would make Ringo happy.\n\nConstraints\n\nD is 0, 1 or 2.\n\nN is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD N\n\nOutput\n\nPrint the N-th smallest integer that can be divided by 100 exactly D times.\n\nSample Input 1\n\n0 5\n\nSample Output 1\n\n5\n\nThe integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...\n\nThus, the 5-th smallest integer that would make Ringo happy is 5.\n\nSample Input 2\n\n1 11\n\nSample Output 2\n\n1100\n\nThe integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \\ 000, 1 \\ 100, ...\n\nThus, the integer we are seeking is 1 \\ 100.\n\nSample Input 3\n\n2 85\n\nSample Output 3\n\n850000\n\nThe integers that can be divided by 100 exactly twice are as follows: 10 \\ 000, 20 \\ 000, 30 \\ 000, ...\n\nThus, the integer we are seeking is 850 \\ 000.", "sample_input": "0 5\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03324", "source_text": "Score: 200 points\n\nProblem Statement\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.\n\nFind the N-th smallest integer that would make Ringo happy.\n\nConstraints\n\nD is 0, 1 or 2.\n\nN is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD N\n\nOutput\n\nPrint the N-th smallest integer that can be divided by 100 exactly D times.\n\nSample Input 1\n\n0 5\n\nSample Output 1\n\n5\n\nThe integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...\n\nThus, the 5-th smallest integer that would make Ringo happy is 5.\n\nSample Input 2\n\n1 11\n\nSample Output 2\n\n1100\n\nThe integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \\ 000, 1 \\ 100, ...\n\nThus, the integer we are seeking is 1 \\ 100.\n\nSample Input 3\n\n2 85\n\nSample Output 3\n\n850000\n\nThe integers that can be divided by 100 exactly twice are as follows: 10 \\ 000, 20 \\ 000, 30 \\ 000, ...\n\nThus, the integer we are seeking is 850 \\ 000.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 203, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s677904676", "group_id": "codeNet:p03324", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tD, N := getInt(), getInt()\n\n\tx := 1\n\tfor i := 0; i < D; i++ {\n\t\tx *= 100\n\t}\n\n\ty := 0\n\tfor i := 0; i < N; i++ {\n\t\ty += x\n\t}\n\n\tif x*100 == y {\n\t\ty++\n\t}\n\tout(y)\n}\n", "language": "Go", "metadata": {"date": 1588358208, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03324.html", "problem_id": "p03324", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03324/input.txt", "sample_output_relpath": "derived/input_output/data/p03324/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03324/Go/s677904676.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s677904676", "user_id": "u814575783"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// min, max, asub, absなど基本関数\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc abs(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t}\n\treturn -a\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tD, N := getInt(), getInt()\n\n\tx := 1\n\tfor i := 0; i < D; i++ {\n\t\tx *= 100\n\t}\n\n\ty := 0\n\tfor i := 0; i < N; i++ {\n\t\ty += x\n\t}\n\n\tif x*100 == y {\n\t\ty++\n\t}\n\tout(y)\n}\n", "problem_context": "Score: 200 points\n\nProblem Statement\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.\n\nFind the N-th smallest integer that would make Ringo happy.\n\nConstraints\n\nD is 0, 1 or 2.\n\nN is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD N\n\nOutput\n\nPrint the N-th smallest integer that can be divided by 100 exactly D times.\n\nSample Input 1\n\n0 5\n\nSample Output 1\n\n5\n\nThe integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...\n\nThus, the 5-th smallest integer that would make Ringo happy is 5.\n\nSample Input 2\n\n1 11\n\nSample Output 2\n\n1100\n\nThe integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \\ 000, 1 \\ 100, ...\n\nThus, the integer we are seeking is 1 \\ 100.\n\nSample Input 3\n\n2 85\n\nSample Output 3\n\n850000\n\nThe integers that can be divided by 100 exactly twice are as follows: 10 \\ 000, 20 \\ 000, 30 \\ 000, ...\n\nThus, the integer we are seeking is 850 \\ 000.", "sample_input": "0 5\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03324", "source_text": "Score: 200 points\n\nProblem Statement\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.\n\nFind the N-th smallest integer that would make Ringo happy.\n\nConstraints\n\nD is 0, 1 or 2.\n\nN is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD N\n\nOutput\n\nPrint the N-th smallest integer that can be divided by 100 exactly D times.\n\nSample Input 1\n\n0 5\n\nSample Output 1\n\n5\n\nThe integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...\n\nThus, the 5-th smallest integer that would make Ringo happy is 5.\n\nSample Input 2\n\n1 11\n\nSample Output 2\n\n1100\n\nThe integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \\ 000, 1 \\ 100, ...\n\nThus, the integer we are seeking is 1 \\ 100.\n\nSample Input 3\n\n2 85\n\nSample Output 3\n\n850000\n\nThe integers that can be divided by 100 exactly twice are as follows: 10 \\ 000, 20 \\ 000, 30 \\ 000, ...\n\nThus, the integer we are seeking is 850 \\ 000.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 818, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s231392236", "group_id": "codeNet:p03324", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc pow(args ...int) int {\n x, y := args[0], args[1]\n res := 1\n if len(args) == 3 {\n mod := args[2]\n for y != 0 {\n if y & 1 == 1 {res = res * x % mod}\n y >>= 1\n x = x * x % mod\n }\n } else {\n for y != 0 {\n if y & 1 == 1 {res *= x}\n y >>= 1\n x *= x\n }\n }\n return res\n}\n\nfunc main() {\n var d, n int \n fmt.Scan(&d, &n)\n if n == 100 {\n fmt.Println(pow(10, d) * 101)\n } else {\n fmt.Println(pow(10, d) * n)\n }\n\n}", "language": "Go", "metadata": {"date": 1587956710, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03324.html", "problem_id": "p03324", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03324/input.txt", "sample_output_relpath": "derived/input_output/data/p03324/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03324/Go/s231392236.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s231392236", "user_id": "u254871849"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc pow(args ...int) int {\n x, y := args[0], args[1]\n res := 1\n if len(args) == 3 {\n mod := args[2]\n for y != 0 {\n if y & 1 == 1 {res = res * x % mod}\n y >>= 1\n x = x * x % mod\n }\n } else {\n for y != 0 {\n if y & 1 == 1 {res *= x}\n y >>= 1\n x *= x\n }\n }\n return res\n}\n\nfunc main() {\n var d, n int \n fmt.Scan(&d, &n)\n if n == 100 {\n fmt.Println(pow(10, d) * 101)\n } else {\n fmt.Println(pow(10, d) * n)\n }\n\n}", "problem_context": "Score: 200 points\n\nProblem Statement\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.\n\nFind the N-th smallest integer that would make Ringo happy.\n\nConstraints\n\nD is 0, 1 or 2.\n\nN is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD N\n\nOutput\n\nPrint the N-th smallest integer that can be divided by 100 exactly D times.\n\nSample Input 1\n\n0 5\n\nSample Output 1\n\n5\n\nThe integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...\n\nThus, the 5-th smallest integer that would make Ringo happy is 5.\n\nSample Input 2\n\n1 11\n\nSample Output 2\n\n1100\n\nThe integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \\ 000, 1 \\ 100, ...\n\nThus, the integer we are seeking is 1 \\ 100.\n\nSample Input 3\n\n2 85\n\nSample Output 3\n\n850000\n\nThe integers that can be divided by 100 exactly twice are as follows: 10 \\ 000, 20 \\ 000, 30 \\ 000, ...\n\nThus, the integer we are seeking is 850 \\ 000.", "sample_input": "0 5\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03324", "source_text": "Score: 200 points\n\nProblem Statement\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.\n\nFind the N-th smallest integer that would make Ringo happy.\n\nConstraints\n\nD is 0, 1 or 2.\n\nN is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD N\n\nOutput\n\nPrint the N-th smallest integer that can be divided by 100 exactly D times.\n\nSample Input 1\n\n0 5\n\nSample Output 1\n\n5\n\nThe integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...\n\nThus, the 5-th smallest integer that would make Ringo happy is 5.\n\nSample Input 2\n\n1 11\n\nSample Output 2\n\n1100\n\nThe integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \\ 000, 1 \\ 100, ...\n\nThus, the integer we are seeking is 1 \\ 100.\n\nSample Input 3\n\n2 85\n\nSample Output 3\n\n850000\n\nThe integers that can be divided by 100 exactly twice are as follows: 10 \\ 000, 20 \\ 000, 30 \\ 000, ...\n\nThus, the integer we are seeking is 850 \\ 000.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s259241002", "group_id": "codeNet:p03324", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tvar d, n int\n\tfmt.Fscan(r, &d)\n\tfmt.Fscan(r, &n)\n\n\tans := 1\n\tfor i := 1; i <= d; i++ {\n\t\tans *= 100\n\t}\n\tans *= n\n\n\tfmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1587861161, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03324.html", "problem_id": "p03324", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03324/input.txt", "sample_output_relpath": "derived/input_output/data/p03324/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03324/Go/s259241002.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s259241002", "user_id": "u433254839"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tr := bufio.NewReader(os.Stdin)\n\tvar d, n int\n\tfmt.Fscan(r, &d)\n\tfmt.Fscan(r, &n)\n\n\tans := 1\n\tfor i := 1; i <= d; i++ {\n\t\tans *= 100\n\t}\n\tans *= n\n\n\tfmt.Println(ans)\n}", "problem_context": "Score: 200 points\n\nProblem Statement\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.\n\nFind the N-th smallest integer that would make Ringo happy.\n\nConstraints\n\nD is 0, 1 or 2.\n\nN is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD N\n\nOutput\n\nPrint the N-th smallest integer that can be divided by 100 exactly D times.\n\nSample Input 1\n\n0 5\n\nSample Output 1\n\n5\n\nThe integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...\n\nThus, the 5-th smallest integer that would make Ringo happy is 5.\n\nSample Input 2\n\n1 11\n\nSample Output 2\n\n1100\n\nThe integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \\ 000, 1 \\ 100, ...\n\nThus, the integer we are seeking is 1 \\ 100.\n\nSample Input 3\n\n2 85\n\nSample Output 3\n\n850000\n\nThe integers that can be divided by 100 exactly twice are as follows: 10 \\ 000, 20 \\ 000, 30 \\ 000, ...\n\nThus, the integer we are seeking is 850 \\ 000.", "sample_input": "0 5\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03324", "source_text": "Score: 200 points\n\nProblem Statement\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.\n\nFind the N-th smallest integer that would make Ringo happy.\n\nConstraints\n\nD is 0, 1 or 2.\n\nN is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD N\n\nOutput\n\nPrint the N-th smallest integer that can be divided by 100 exactly D times.\n\nSample Input 1\n\n0 5\n\nSample Output 1\n\n5\n\nThe integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...\n\nThus, the 5-th smallest integer that would make Ringo happy is 5.\n\nSample Input 2\n\n1 11\n\nSample Output 2\n\n1100\n\nThe integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \\ 000, 1 \\ 100, ...\n\nThus, the integer we are seeking is 1 \\ 100.\n\nSample Input 3\n\n2 85\n\nSample Output 3\n\n850000\n\nThe integers that can be divided by 100 exactly twice are as follows: 10 \\ 000, 20 \\ 000, 30 \\ 000, ...\n\nThus, the integer we are seeking is 850 \\ 000.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 228, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s188996089", "group_id": "codeNet:p03324", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc pow(a, n int) int {\n\tret := 1\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tret *= a\n\t\t}\n\t\ta *= a\n\t\tn >>= 1\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\td, n := nextInt(), nextInt()\n\tvar ans int\n\tp := pow(100, d)\n\tans = p * n\n\tputs(ans)\n\twt.Flush()\n}\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twt = bufio.NewWriter(os.Stdout)\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(next())\n\treturn i\n}\n\nfunc puts(a ...interface{}) {\n\tfmt.Fprintln(wt, a...)\n}\n", "language": "Go", "metadata": {"date": 1579842520, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03324.html", "problem_id": "p03324", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03324/input.txt", "sample_output_relpath": "derived/input_output/data/p03324/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03324/Go/s188996089.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s188996089", "user_id": "u502813058"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc pow(a, n int) int {\n\tret := 1\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tret *= a\n\t\t}\n\t\ta *= a\n\t\tn >>= 1\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\td, n := nextInt(), nextInt()\n\tvar ans int\n\tp := pow(100, d)\n\tans = p * n\n\tputs(ans)\n\twt.Flush()\n}\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twt = bufio.NewWriter(os.Stdout)\n)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ti, _ := strconv.Atoi(next())\n\treturn i\n}\n\nfunc puts(a ...interface{}) {\n\tfmt.Fprintln(wt, a...)\n}\n", "problem_context": "Score: 200 points\n\nProblem Statement\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.\n\nFind the N-th smallest integer that would make Ringo happy.\n\nConstraints\n\nD is 0, 1 or 2.\n\nN is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD N\n\nOutput\n\nPrint the N-th smallest integer that can be divided by 100 exactly D times.\n\nSample Input 1\n\n0 5\n\nSample Output 1\n\n5\n\nThe integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...\n\nThus, the 5-th smallest integer that would make Ringo happy is 5.\n\nSample Input 2\n\n1 11\n\nSample Output 2\n\n1100\n\nThe integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \\ 000, 1 \\ 100, ...\n\nThus, the integer we are seeking is 1 \\ 100.\n\nSample Input 3\n\n2 85\n\nSample Output 3\n\n850000\n\nThe integers that can be divided by 100 exactly twice are as follows: 10 \\ 000, 20 \\ 000, 30 \\ 000, ...\n\nThus, the integer we are seeking is 850 \\ 000.", "sample_input": "0 5\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03324", "source_text": "Score: 200 points\n\nProblem Statement\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.\n\nFind the N-th smallest integer that would make Ringo happy.\n\nConstraints\n\nD is 0, 1 or 2.\n\nN is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD N\n\nOutput\n\nPrint the N-th smallest integer that can be divided by 100 exactly D times.\n\nSample Input 1\n\n0 5\n\nSample Output 1\n\n5\n\nThe integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...\n\nThus, the 5-th smallest integer that would make Ringo happy is 5.\n\nSample Input 2\n\n1 11\n\nSample Output 2\n\n1100\n\nThe integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \\ 000, 1 \\ 100, ...\n\nThus, the integer we are seeking is 1 \\ 100.\n\nSample Input 3\n\n2 85\n\nSample Output 3\n\n850000\n\nThe integers that can be divided by 100 exactly twice are as follows: 10 \\ 000, 20 \\ 000, 30 \\ 000, ...\n\nThus, the integer we are seeking is 850 \\ 000.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 565, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s787048908", "group_id": "codeNet:p03324", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar d, n int\n\tfmt.Scan(&d, &n)\n\tswitch d {\n\tcase 0:\n\t\tfmt.Printf(\"%d\", n)\n\tcase 1:\n\t\tfmt.Printf(\"%d\", n*100)\n\tcase 2:\n\t\tfmt.Printf(\"%d\", n*10000)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1576248549, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03324.html", "problem_id": "p03324", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03324/input.txt", "sample_output_relpath": "derived/input_output/data/p03324/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03324/Go/s787048908.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s787048908", "user_id": "u511254943"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar d, n int\n\tfmt.Scan(&d, &n)\n\tswitch d {\n\tcase 0:\n\t\tfmt.Printf(\"%d\", n)\n\tcase 1:\n\t\tfmt.Printf(\"%d\", n*100)\n\tcase 2:\n\t\tfmt.Printf(\"%d\", n*10000)\n\t}\n}\n", "problem_context": "Score: 200 points\n\nProblem Statement\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.\n\nFind the N-th smallest integer that would make Ringo happy.\n\nConstraints\n\nD is 0, 1 or 2.\n\nN is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD N\n\nOutput\n\nPrint the N-th smallest integer that can be divided by 100 exactly D times.\n\nSample Input 1\n\n0 5\n\nSample Output 1\n\n5\n\nThe integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...\n\nThus, the 5-th smallest integer that would make Ringo happy is 5.\n\nSample Input 2\n\n1 11\n\nSample Output 2\n\n1100\n\nThe integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \\ 000, 1 \\ 100, ...\n\nThus, the integer we are seeking is 1 \\ 100.\n\nSample Input 3\n\n2 85\n\nSample Output 3\n\n850000\n\nThe integers that can be divided by 100 exactly twice are as follows: 10 \\ 000, 20 \\ 000, 30 \\ 000, ...\n\nThus, the integer we are seeking is 850 \\ 000.", "sample_input": "0 5\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03324", "source_text": "Score: 200 points\n\nProblem Statement\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.\n\nFind the N-th smallest integer that would make Ringo happy.\n\nConstraints\n\nD is 0, 1 or 2.\n\nN is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD N\n\nOutput\n\nPrint the N-th smallest integer that can be divided by 100 exactly D times.\n\nSample Input 1\n\n0 5\n\nSample Output 1\n\n5\n\nThe integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...\n\nThus, the 5-th smallest integer that would make Ringo happy is 5.\n\nSample Input 2\n\n1 11\n\nSample Output 2\n\n1100\n\nThe integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \\ 000, 1 \\ 100, ...\n\nThus, the integer we are seeking is 1 \\ 100.\n\nSample Input 3\n\n2 85\n\nSample Output 3\n\n850000\n\nThe integers that can be divided by 100 exactly twice are as follows: 10 \\ 000, 20 \\ 000, 30 \\ 000, ...\n\nThus, the integer we are seeking is 850 \\ 000.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s068696877", "group_id": "codeNet:p03324", "input_text": "package main\n\nimport (\n \"fmt\"\n \"math\"\n) \n\nfunc main() {\n var d, n float64\n fmt.Scan(&d, &n)\n \n fmt.Println(math.Pow(100, d) * n)\n}", "language": "Go", "metadata": {"date": 1570104048, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03324.html", "problem_id": "p03324", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03324/input.txt", "sample_output_relpath": "derived/input_output/data/p03324/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03324/Go/s068696877.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s068696877", "user_id": "u195309147"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"math\"\n) \n\nfunc main() {\n var d, n float64\n fmt.Scan(&d, &n)\n \n fmt.Println(math.Pow(100, d) * n)\n}", "problem_context": "Score: 200 points\n\nProblem Statement\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.\n\nFind the N-th smallest integer that would make Ringo happy.\n\nConstraints\n\nD is 0, 1 or 2.\n\nN is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD N\n\nOutput\n\nPrint the N-th smallest integer that can be divided by 100 exactly D times.\n\nSample Input 1\n\n0 5\n\nSample Output 1\n\n5\n\nThe integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...\n\nThus, the 5-th smallest integer that would make Ringo happy is 5.\n\nSample Input 2\n\n1 11\n\nSample Output 2\n\n1100\n\nThe integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \\ 000, 1 \\ 100, ...\n\nThus, the integer we are seeking is 1 \\ 100.\n\nSample Input 3\n\n2 85\n\nSample Output 3\n\n850000\n\nThe integers that can be divided by 100 exactly twice are as follows: 10 \\ 000, 20 \\ 000, 30 \\ 000, ...\n\nThus, the integer we are seeking is 850 \\ 000.", "sample_input": "0 5\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03324", "source_text": "Score: 200 points\n\nProblem Statement\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.\n\nFind the N-th smallest integer that would make Ringo happy.\n\nConstraints\n\nD is 0, 1 or 2.\n\nN is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD N\n\nOutput\n\nPrint the N-th smallest integer that can be divided by 100 exactly D times.\n\nSample Input 1\n\n0 5\n\nSample Output 1\n\n5\n\nThe integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...\n\nThus, the 5-th smallest integer that would make Ringo happy is 5.\n\nSample Input 2\n\n1 11\n\nSample Output 2\n\n1100\n\nThe integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \\ 000, 1 \\ 100, ...\n\nThus, the integer we are seeking is 1 \\ 100.\n\nSample Input 3\n\n2 85\n\nSample Output 3\n\n850000\n\nThe integers that can be divided by 100 exactly twice are as follows: 10 \\ 000, 20 \\ 000, 30 \\ 000, ...\n\nThus, the integer we are seeking is 850 \\ 000.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s350747496", "group_id": "codeNet:p03324", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar d int\n\tvar n int\n\tvar ans int\n\n\tfmt.Scan(&d, &n)\n\n\tswitch d {\n\tcase 0:\n\t\tans = n\n\tcase 1:\n\t\tans = n * 100\n\tcase 2:\n\t\tans = n * 100 * 100\n\t}\n\n\tfmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1567216546, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03324.html", "problem_id": "p03324", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03324/input.txt", "sample_output_relpath": "derived/input_output/data/p03324/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03324/Go/s350747496.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s350747496", "user_id": "u209193252"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar d int\n\tvar n int\n\tvar ans int\n\n\tfmt.Scan(&d, &n)\n\n\tswitch d {\n\tcase 0:\n\t\tans = n\n\tcase 1:\n\t\tans = n * 100\n\tcase 2:\n\t\tans = n * 100 * 100\n\t}\n\n\tfmt.Println(ans)\n}", "problem_context": "Score: 200 points\n\nProblem Statement\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.\n\nFind the N-th smallest integer that would make Ringo happy.\n\nConstraints\n\nD is 0, 1 or 2.\n\nN is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD N\n\nOutput\n\nPrint the N-th smallest integer that can be divided by 100 exactly D times.\n\nSample Input 1\n\n0 5\n\nSample Output 1\n\n5\n\nThe integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...\n\nThus, the 5-th smallest integer that would make Ringo happy is 5.\n\nSample Input 2\n\n1 11\n\nSample Output 2\n\n1100\n\nThe integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \\ 000, 1 \\ 100, ...\n\nThus, the integer we are seeking is 1 \\ 100.\n\nSample Input 3\n\n2 85\n\nSample Output 3\n\n850000\n\nThe integers that can be divided by 100 exactly twice are as follows: 10 \\ 000, 20 \\ 000, 30 \\ 000, ...\n\nThus, the integer we are seeking is 850 \\ 000.", "sample_input": "0 5\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03324", "source_text": "Score: 200 points\n\nProblem Statement\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.\n\nFind the N-th smallest integer that would make Ringo happy.\n\nConstraints\n\nD is 0, 1 or 2.\n\nN is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD N\n\nOutput\n\nPrint the N-th smallest integer that can be divided by 100 exactly D times.\n\nSample Input 1\n\n0 5\n\nSample Output 1\n\n5\n\nThe integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...\n\nThus, the 5-th smallest integer that would make Ringo happy is 5.\n\nSample Input 2\n\n1 11\n\nSample Output 2\n\n1100\n\nThe integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \\ 000, 1 \\ 100, ...\n\nThus, the integer we are seeking is 1 \\ 100.\n\nSample Input 3\n\n2 85\n\nSample Output 3\n\n850000\n\nThe integers that can be divided by 100 exactly twice are as follows: 10 \\ 000, 20 \\ 000, 30 \\ 000, ...\n\nThus, the integer we are seeking is 850 \\ 000.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s518151839", "group_id": "codeNet:p03324", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar d, n int\n\tfmt.Scan(&d, &n)\n\n\tif d == 0 {\n\t\tif n == 100 {\n\t\t\tfmt.Println(n - 1)\n\t\t} else {\n\t\t\tfmt.Println(n)\n\t\t}\n\t} else if d == 1 {\n\t\tfmt.Println(n * 100)\n\t} else if d == 2 {\n\t\tfmt.Println(n * 10000)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1564278680, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03324.html", "problem_id": "p03324", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03324/input.txt", "sample_output_relpath": "derived/input_output/data/p03324/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03324/Go/s518151839.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s518151839", "user_id": "u550296200"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar d, n int\n\tfmt.Scan(&d, &n)\n\n\tif d == 0 {\n\t\tif n == 100 {\n\t\t\tfmt.Println(n - 1)\n\t\t} else {\n\t\t\tfmt.Println(n)\n\t\t}\n\t} else if d == 1 {\n\t\tfmt.Println(n * 100)\n\t} else if d == 2 {\n\t\tfmt.Println(n * 10000)\n\t}\n}\n", "problem_context": "Score: 200 points\n\nProblem Statement\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.\n\nFind the N-th smallest integer that would make Ringo happy.\n\nConstraints\n\nD is 0, 1 or 2.\n\nN is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD N\n\nOutput\n\nPrint the N-th smallest integer that can be divided by 100 exactly D times.\n\nSample Input 1\n\n0 5\n\nSample Output 1\n\n5\n\nThe integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...\n\nThus, the 5-th smallest integer that would make Ringo happy is 5.\n\nSample Input 2\n\n1 11\n\nSample Output 2\n\n1100\n\nThe integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \\ 000, 1 \\ 100, ...\n\nThus, the integer we are seeking is 1 \\ 100.\n\nSample Input 3\n\n2 85\n\nSample Output 3\n\n850000\n\nThe integers that can be divided by 100 exactly twice are as follows: 10 \\ 000, 20 \\ 000, 30 \\ 000, ...\n\nThus, the integer we are seeking is 850 \\ 000.", "sample_input": "0 5\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03324", "source_text": "Score: 200 points\n\nProblem Statement\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.\n\nFind the N-th smallest integer that would make Ringo happy.\n\nConstraints\n\nD is 0, 1 or 2.\n\nN is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD N\n\nOutput\n\nPrint the N-th smallest integer that can be divided by 100 exactly D times.\n\nSample Input 1\n\n0 5\n\nSample Output 1\n\n5\n\nThe integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...\n\nThus, the 5-th smallest integer that would make Ringo happy is 5.\n\nSample Input 2\n\n1 11\n\nSample Output 2\n\n1100\n\nThe integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \\ 000, 1 \\ 100, ...\n\nThus, the integer we are seeking is 1 \\ 100.\n\nSample Input 3\n\n2 85\n\nSample Output 3\n\n850000\n\nThe integers that can be divided by 100 exactly twice are as follows: 10 \\ 000, 20 \\ 000, 30 \\ 000, ...\n\nThus, the integer we are seeking is 850 \\ 000.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 252, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s117001825", "group_id": "codeNet:p03324", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar D, N int\n\tfmt.Scan(&D, &N)\n\tif N <= 99 {\n\t\tfmt.Println(math.Pow(100, float64(D)) * float64(N))\n\t} else {\n\t\tfmt.Println(math.Pow(100, float64(D)) * float64(101))\n\t}\n}", "language": "Go", "metadata": {"date": 1557659309, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03324.html", "problem_id": "p03324", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03324/input.txt", "sample_output_relpath": "derived/input_output/data/p03324/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03324/Go/s117001825.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s117001825", "user_id": "u298152049"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar D, N int\n\tfmt.Scan(&D, &N)\n\tif N <= 99 {\n\t\tfmt.Println(math.Pow(100, float64(D)) * float64(N))\n\t} else {\n\t\tfmt.Println(math.Pow(100, float64(D)) * float64(101))\n\t}\n}", "problem_context": "Score: 200 points\n\nProblem Statement\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.\n\nFind the N-th smallest integer that would make Ringo happy.\n\nConstraints\n\nD is 0, 1 or 2.\n\nN is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD N\n\nOutput\n\nPrint the N-th smallest integer that can be divided by 100 exactly D times.\n\nSample Input 1\n\n0 5\n\nSample Output 1\n\n5\n\nThe integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...\n\nThus, the 5-th smallest integer that would make Ringo happy is 5.\n\nSample Input 2\n\n1 11\n\nSample Output 2\n\n1100\n\nThe integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \\ 000, 1 \\ 100, ...\n\nThus, the integer we are seeking is 1 \\ 100.\n\nSample Input 3\n\n2 85\n\nSample Output 3\n\n850000\n\nThe integers that can be divided by 100 exactly twice are as follows: 10 \\ 000, 20 \\ 000, 30 \\ 000, ...\n\nThus, the integer we are seeking is 850 \\ 000.", "sample_input": "0 5\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03324", "source_text": "Score: 200 points\n\nProblem Statement\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.\n\nFind the N-th smallest integer that would make Ringo happy.\n\nConstraints\n\nD is 0, 1 or 2.\n\nN is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD N\n\nOutput\n\nPrint the N-th smallest integer that can be divided by 100 exactly D times.\n\nSample Input 1\n\n0 5\n\nSample Output 1\n\n5\n\nThe integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...\n\nThus, the 5-th smallest integer that would make Ringo happy is 5.\n\nSample Input 2\n\n1 11\n\nSample Output 2\n\n1100\n\nThe integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \\ 000, 1 \\ 100, ...\n\nThus, the integer we are seeking is 1 \\ 100.\n\nSample Input 3\n\n2 85\n\nSample Output 3\n\n850000\n\nThe integers that can be divided by 100 exactly twice are as follows: 10 \\ 000, 20 \\ 000, 30 \\ 000, ...\n\nThus, the integer we are seeking is 850 \\ 000.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 225, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s162756038", "group_id": "codeNet:p03324", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar D, N int\n\tfmt.Scan(&D, &N)\n\tif D == 0 {\n\t\tfmt.Println(N)\n\t} else {\n\t\tfmt.Println(math.Pow(100, float64(D)) * float64(N))\n\t}\n}", "language": "Go", "metadata": {"date": 1557658452, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03324.html", "problem_id": "p03324", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03324/input.txt", "sample_output_relpath": "derived/input_output/data/p03324/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03324/Go/s162756038.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s162756038", "user_id": "u298152049"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar D, N int\n\tfmt.Scan(&D, &N)\n\tif D == 0 {\n\t\tfmt.Println(N)\n\t} else {\n\t\tfmt.Println(math.Pow(100, float64(D)) * float64(N))\n\t}\n}", "problem_context": "Score: 200 points\n\nProblem Statement\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.\n\nFind the N-th smallest integer that would make Ringo happy.\n\nConstraints\n\nD is 0, 1 or 2.\n\nN is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD N\n\nOutput\n\nPrint the N-th smallest integer that can be divided by 100 exactly D times.\n\nSample Input 1\n\n0 5\n\nSample Output 1\n\n5\n\nThe integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...\n\nThus, the 5-th smallest integer that would make Ringo happy is 5.\n\nSample Input 2\n\n1 11\n\nSample Output 2\n\n1100\n\nThe integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \\ 000, 1 \\ 100, ...\n\nThus, the integer we are seeking is 1 \\ 100.\n\nSample Input 3\n\n2 85\n\nSample Output 3\n\n850000\n\nThe integers that can be divided by 100 exactly twice are as follows: 10 \\ 000, 20 \\ 000, 30 \\ 000, ...\n\nThus, the integer we are seeking is 850 \\ 000.", "sample_input": "0 5\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03324", "source_text": "Score: 200 points\n\nProblem Statement\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.\n\nFind the N-th smallest integer that would make Ringo happy.\n\nConstraints\n\nD is 0, 1 or 2.\n\nN is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD N\n\nOutput\n\nPrint the N-th smallest integer that can be divided by 100 exactly D times.\n\nSample Input 1\n\n0 5\n\nSample Output 1\n\n5\n\nThe integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...\n\nThus, the 5-th smallest integer that would make Ringo happy is 5.\n\nSample Input 2\n\n1 11\n\nSample Output 2\n\n1100\n\nThe integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \\ 000, 1 \\ 100, ...\n\nThus, the integer we are seeking is 1 \\ 100.\n\nSample Input 3\n\n2 85\n\nSample Output 3\n\n850000\n\nThe integers that can be divided by 100 exactly twice are as follows: 10 \\ 000, 20 \\ 000, 30 \\ 000, ...\n\nThus, the integer we are seeking is 850 \\ 000.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 185, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s276532572", "group_id": "codeNet:p03324", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var a, b int\n fmt.Scan(&a, &b)\n if a == 0 {\n if b == 100 {\n fmt.Println(b+1)\n } else {\n fmt.Println(b)\n }\n } else if a == 1 {\n res := 100 * b\n if b == 100 {\n fmt.Println(res+100)\n } else {\n fmt.Println(res)\n }\n } else {\n res := 100 * 100 * b\n if b == 100 {\n fmt.Println(res+10000)\n } else {\n fmt.Println(res)\n }\n }\n}", "language": "Go", "metadata": {"date": 1553822352, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03324.html", "problem_id": "p03324", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03324/input.txt", "sample_output_relpath": "derived/input_output/data/p03324/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03324/Go/s276532572.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s276532572", "user_id": "u860522477"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var a, b int\n fmt.Scan(&a, &b)\n if a == 0 {\n if b == 100 {\n fmt.Println(b+1)\n } else {\n fmt.Println(b)\n }\n } else if a == 1 {\n res := 100 * b\n if b == 100 {\n fmt.Println(res+100)\n } else {\n fmt.Println(res)\n }\n } else {\n res := 100 * 100 * b\n if b == 100 {\n fmt.Println(res+10000)\n } else {\n fmt.Println(res)\n }\n }\n}", "problem_context": "Score: 200 points\n\nProblem Statement\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.\n\nFind the N-th smallest integer that would make Ringo happy.\n\nConstraints\n\nD is 0, 1 or 2.\n\nN is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD N\n\nOutput\n\nPrint the N-th smallest integer that can be divided by 100 exactly D times.\n\nSample Input 1\n\n0 5\n\nSample Output 1\n\n5\n\nThe integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...\n\nThus, the 5-th smallest integer that would make Ringo happy is 5.\n\nSample Input 2\n\n1 11\n\nSample Output 2\n\n1100\n\nThe integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \\ 000, 1 \\ 100, ...\n\nThus, the integer we are seeking is 1 \\ 100.\n\nSample Input 3\n\n2 85\n\nSample Output 3\n\n850000\n\nThe integers that can be divided by 100 exactly twice are as follows: 10 \\ 000, 20 \\ 000, 30 \\ 000, ...\n\nThus, the integer we are seeking is 850 \\ 000.", "sample_input": "0 5\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03324", "source_text": "Score: 200 points\n\nProblem Statement\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.\n\nFind the N-th smallest integer that would make Ringo happy.\n\nConstraints\n\nD is 0, 1 or 2.\n\nN is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD N\n\nOutput\n\nPrint the N-th smallest integer that can be divided by 100 exactly D times.\n\nSample Input 1\n\n0 5\n\nSample Output 1\n\n5\n\nThe integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...\n\nThus, the 5-th smallest integer that would make Ringo happy is 5.\n\nSample Input 2\n\n1 11\n\nSample Output 2\n\n1100\n\nThe integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \\ 000, 1 \\ 100, ...\n\nThus, the integer we are seeking is 1 \\ 100.\n\nSample Input 3\n\n2 85\n\nSample Output 3\n\n850000\n\nThe integers that can be divided by 100 exactly twice are as follows: 10 \\ 000, 20 \\ 000, 30 \\ 000, ...\n\nThus, the integer we are seeking is 850 \\ 000.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 434, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s084052071", "group_id": "codeNet:p03324", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar d, n float64\n\tfmt.Scan(&d, &n)\n\tfmt.Println(int(math.Pow(100, d) * n))\n}\n", "language": "Go", "metadata": {"date": 1550298014, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03324.html", "problem_id": "p03324", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03324/input.txt", "sample_output_relpath": "derived/input_output/data/p03324/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03324/Go/s084052071.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s084052071", "user_id": "u554269352"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar d, n float64\n\tfmt.Scan(&d, &n)\n\tfmt.Println(int(math.Pow(100, d) * n))\n}\n", "problem_context": "Score: 200 points\n\nProblem Statement\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.\n\nFind the N-th smallest integer that would make Ringo happy.\n\nConstraints\n\nD is 0, 1 or 2.\n\nN is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD N\n\nOutput\n\nPrint the N-th smallest integer that can be divided by 100 exactly D times.\n\nSample Input 1\n\n0 5\n\nSample Output 1\n\n5\n\nThe integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...\n\nThus, the 5-th smallest integer that would make Ringo happy is 5.\n\nSample Input 2\n\n1 11\n\nSample Output 2\n\n1100\n\nThe integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \\ 000, 1 \\ 100, ...\n\nThus, the integer we are seeking is 1 \\ 100.\n\nSample Input 3\n\n2 85\n\nSample Output 3\n\n850000\n\nThe integers that can be divided by 100 exactly twice are as follows: 10 \\ 000, 20 \\ 000, 30 \\ 000, ...\n\nThus, the integer we are seeking is 850 \\ 000.", "sample_input": "0 5\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03324", "source_text": "Score: 200 points\n\nProblem Statement\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.\n\nFind the N-th smallest integer that would make Ringo happy.\n\nConstraints\n\nD is 0, 1 or 2.\n\nN is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD N\n\nOutput\n\nPrint the N-th smallest integer that can be divided by 100 exactly D times.\n\nSample Input 1\n\n0 5\n\nSample Output 1\n\n5\n\nThe integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...\n\nThus, the 5-th smallest integer that would make Ringo happy is 5.\n\nSample Input 2\n\n1 11\n\nSample Output 2\n\n1100\n\nThe integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \\ 000, 1 \\ 100, ...\n\nThus, the integer we are seeking is 1 \\ 100.\n\nSample Input 3\n\n2 85\n\nSample Output 3\n\n850000\n\nThe integers that can be divided by 100 exactly twice are as follows: 10 \\ 000, 20 \\ 000, 30 \\ 000, ...\n\nThus, the integer we are seeking is 850 \\ 000.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s014915156", "group_id": "codeNet:p03324", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar sc = bufio.NewScanner(os.Stdin)\n\tsc.Scan()\n\ts := strings.Split(sc.Text(), \" \")\n\tD, _ := strconv.Atoi(s[0])\n\tN, _ := strconv.Atoi(s[1])\n\ta := 0\n\tswitch D {\n\tcase 0:\n\t\tif N != 100 {\n\t\t\ta = N\n\t\t}else{\n\t\t\ta = N+1\n\t\t}\n\tcase 1:\n\t\tif N != 100 {\n\t\t\ta = N * 100\n\t\t}else{\n\t\t\ta = (N+1) * 100\n\t\t}\n\tcase 2:\n\t\tif N != 100 {\n\t\t\ta = N * (100 * 100)\n\t\t}else{\n\t\t\ta = (N+1) * (100 * 100)\n\t\t}\n\n\t}\n\tfmt.Print(a)\n}", "language": "Go", "metadata": {"date": 1529334372, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03324.html", "problem_id": "p03324", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03324/input.txt", "sample_output_relpath": "derived/input_output/data/p03324/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03324/Go/s014915156.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s014915156", "user_id": "u781152930"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar sc = bufio.NewScanner(os.Stdin)\n\tsc.Scan()\n\ts := strings.Split(sc.Text(), \" \")\n\tD, _ := strconv.Atoi(s[0])\n\tN, _ := strconv.Atoi(s[1])\n\ta := 0\n\tswitch D {\n\tcase 0:\n\t\tif N != 100 {\n\t\t\ta = N\n\t\t}else{\n\t\t\ta = N+1\n\t\t}\n\tcase 1:\n\t\tif N != 100 {\n\t\t\ta = N * 100\n\t\t}else{\n\t\t\ta = (N+1) * 100\n\t\t}\n\tcase 2:\n\t\tif N != 100 {\n\t\t\ta = N * (100 * 100)\n\t\t}else{\n\t\t\ta = (N+1) * (100 * 100)\n\t\t}\n\n\t}\n\tfmt.Print(a)\n}", "problem_context": "Score: 200 points\n\nProblem Statement\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.\n\nFind the N-th smallest integer that would make Ringo happy.\n\nConstraints\n\nD is 0, 1 or 2.\n\nN is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD N\n\nOutput\n\nPrint the N-th smallest integer that can be divided by 100 exactly D times.\n\nSample Input 1\n\n0 5\n\nSample Output 1\n\n5\n\nThe integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...\n\nThus, the 5-th smallest integer that would make Ringo happy is 5.\n\nSample Input 2\n\n1 11\n\nSample Output 2\n\n1100\n\nThe integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \\ 000, 1 \\ 100, ...\n\nThus, the integer we are seeking is 1 \\ 100.\n\nSample Input 3\n\n2 85\n\nSample Output 3\n\n850000\n\nThe integers that can be divided by 100 exactly twice are as follows: 10 \\ 000, 20 \\ 000, 30 \\ 000, ...\n\nThus, the integer we are seeking is 850 \\ 000.", "sample_input": "0 5\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03324", "source_text": "Score: 200 points\n\nProblem Statement\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.\n\nFind the N-th smallest integer that would make Ringo happy.\n\nConstraints\n\nD is 0, 1 or 2.\n\nN is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD N\n\nOutput\n\nPrint the N-th smallest integer that can be divided by 100 exactly D times.\n\nSample Input 1\n\n0 5\n\nSample Output 1\n\n5\n\nThe integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...\n\nThus, the 5-th smallest integer that would make Ringo happy is 5.\n\nSample Input 2\n\n1 11\n\nSample Output 2\n\n1100\n\nThe integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \\ 000, 1 \\ 100, ...\n\nThus, the integer we are seeking is 1 \\ 100.\n\nSample Input 3\n\n2 85\n\nSample Output 3\n\n850000\n\nThe integers that can be divided by 100 exactly twice are as follows: 10 \\ 000, 20 \\ 000, 30 \\ 000, ...\n\nThus, the integer we are seeking is 850 \\ 000.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 481, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s024852239", "group_id": "codeNet:p03324", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar a, b, e int\n\tvar c int = 100\n\tfmt.Scan(&a, &b)\n\tc = int(math.Pow(float64(c), float64(a)))\n\te = c\n\tfor i := a; i <= b; i++ {\n\t\tc += e\n\t}\n\tfmt.Println(c)\n}\n", "language": "Go", "metadata": {"date": 1529207294, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03324.html", "problem_id": "p03324", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03324/input.txt", "sample_output_relpath": "derived/input_output/data/p03324/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03324/Go/s024852239.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s024852239", "user_id": "u245858717"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nfunc main() {\n\tvar a, b, e int\n\tvar c int = 100\n\tfmt.Scan(&a, &b)\n\tc = int(math.Pow(float64(c), float64(a)))\n\te = c\n\tfor i := a; i <= b; i++ {\n\t\tc += e\n\t}\n\tfmt.Println(c)\n}\n", "problem_context": "Score: 200 points\n\nProblem Statement\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.\n\nFind the N-th smallest integer that would make Ringo happy.\n\nConstraints\n\nD is 0, 1 or 2.\n\nN is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD N\n\nOutput\n\nPrint the N-th smallest integer that can be divided by 100 exactly D times.\n\nSample Input 1\n\n0 5\n\nSample Output 1\n\n5\n\nThe integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...\n\nThus, the 5-th smallest integer that would make Ringo happy is 5.\n\nSample Input 2\n\n1 11\n\nSample Output 2\n\n1100\n\nThe integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \\ 000, 1 \\ 100, ...\n\nThus, the integer we are seeking is 1 \\ 100.\n\nSample Input 3\n\n2 85\n\nSample Output 3\n\n850000\n\nThe integers that can be divided by 100 exactly twice are as follows: 10 \\ 000, 20 \\ 000, 30 \\ 000, ...\n\nThus, the integer we are seeking is 850 \\ 000.", "sample_input": "0 5\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03324", "source_text": "Score: 200 points\n\nProblem Statement\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.\n\nFind the N-th smallest integer that would make Ringo happy.\n\nConstraints\n\nD is 0, 1 or 2.\n\nN is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD N\n\nOutput\n\nPrint the N-th smallest integer that can be divided by 100 exactly D times.\n\nSample Input 1\n\n0 5\n\nSample Output 1\n\n5\n\nThe integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...\n\nThus, the 5-th smallest integer that would make Ringo happy is 5.\n\nSample Input 2\n\n1 11\n\nSample Output 2\n\n1100\n\nThe integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \\ 000, 1 \\ 100, ...\n\nThus, the integer we are seeking is 1 \\ 100.\n\nSample Input 3\n\n2 85\n\nSample Output 3\n\n850000\n\nThe integers that can be divided by 100 exactly twice are as follows: 10 \\ 000, 20 \\ 000, 30 \\ 000, ...\n\nThus, the integer we are seeking is 850 \\ 000.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s367569022", "group_id": "codeNet:p03324", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var d, n int\n fmt.Scanln(&d, &n)\n if d == 0 {\n fmt.Printf(\"%d\\n\", n * 1)\n } else if d == 1 {\n fmt.Printf(\"%d\\n\", n * 100)\n } else if d == 2 {\n fmt.Printf(\"%d\\n\", n * 10000)\n } else {\n fmt.Printf(\":(\\n\")\n }\n}\n", "language": "Go", "metadata": {"date": 1529197986, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03324.html", "problem_id": "p03324", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03324/input.txt", "sample_output_relpath": "derived/input_output/data/p03324/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03324/Go/s367569022.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s367569022", "user_id": "u857135230"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var d, n int\n fmt.Scanln(&d, &n)\n if d == 0 {\n fmt.Printf(\"%d\\n\", n * 1)\n } else if d == 1 {\n fmt.Printf(\"%d\\n\", n * 100)\n } else if d == 2 {\n fmt.Printf(\"%d\\n\", n * 10000)\n } else {\n fmt.Printf(\":(\\n\")\n }\n}\n", "problem_context": "Score: 200 points\n\nProblem Statement\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.\n\nFind the N-th smallest integer that would make Ringo happy.\n\nConstraints\n\nD is 0, 1 or 2.\n\nN is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD N\n\nOutput\n\nPrint the N-th smallest integer that can be divided by 100 exactly D times.\n\nSample Input 1\n\n0 5\n\nSample Output 1\n\n5\n\nThe integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...\n\nThus, the 5-th smallest integer that would make Ringo happy is 5.\n\nSample Input 2\n\n1 11\n\nSample Output 2\n\n1100\n\nThe integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \\ 000, 1 \\ 100, ...\n\nThus, the integer we are seeking is 1 \\ 100.\n\nSample Input 3\n\n2 85\n\nSample Output 3\n\n850000\n\nThe integers that can be divided by 100 exactly twice are as follows: 10 \\ 000, 20 \\ 000, 30 \\ 000, ...\n\nThus, the integer we are seeking is 850 \\ 000.", "sample_input": "0 5\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03324", "source_text": "Score: 200 points\n\nProblem Statement\n\nToday, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.\n\nAs the name of the contest is AtCoder Beginner Contest 100, Ringo would be happy if he is given a positive integer that can be divided by 100 exactly D times.\n\nFind the N-th smallest integer that would make Ringo happy.\n\nConstraints\n\nD is 0, 1 or 2.\n\nN is an integer between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD N\n\nOutput\n\nPrint the N-th smallest integer that can be divided by 100 exactly D times.\n\nSample Input 1\n\n0 5\n\nSample Output 1\n\n5\n\nThe integers that can be divided by 100 exactly 0 times (that is, not divisible by 100) are as follows: 1, 2, 3, 4, 5, 6, 7, ...\n\nThus, the 5-th smallest integer that would make Ringo happy is 5.\n\nSample Input 2\n\n1 11\n\nSample Output 2\n\n1100\n\nThe integers that can be divided by 100 exactly once are as follows: 100, 200, 300, 400, 500, 600, 700, 800, 900, 1 \\ 000, 1 \\ 100, ...\n\nThus, the integer we are seeking is 1 \\ 100.\n\nSample Input 3\n\n2 85\n\nSample Output 3\n\n850000\n\nThe integers that can be divided by 100 exactly twice are as follows: 10 \\ 000, 20 \\ 000, 30 \\ 000, ...\n\nThus, the integer we are seeking is 850 \\ 000.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 300, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s203664005", "group_id": "codeNet:p03448", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tvar a, b, c, x int\n\tfmt.Scan(&a, &b, &c, &x)\n\n\tvar ans int\n\tfor i := 0; i <= a; i++ {\n\t\tfor j := 0; j <= b; j++ {\n\t\t\tfor k := 0; k <= c; k++ {\n\n\t\t\t\tif i*500+j*100+k*50 == x {\n\t\t\t\t\tans++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Print(ans)\n}", "language": "Go", "metadata": {"date": 1589993903, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03448.html", "problem_id": "p03448", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03448/input.txt", "sample_output_relpath": "derived/input_output/data/p03448/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03448/Go/s203664005.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s203664005", "user_id": "u196917985"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\n\tvar a, b, c, x int\n\tfmt.Scan(&a, &b, &c, &x)\n\n\tvar ans int\n\tfor i := 0; i <= a; i++ {\n\t\tfor j := 0; j <= b; j++ {\n\t\t\tfor k := 0; k <= c; k++ {\n\n\t\t\t\tif i*500+j*100+k*50 == x {\n\t\t\t\t\tans++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Print(ans)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan).\nIn how many ways can we select some of these coins so that they are X yen in total?\n\nCoins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for some kind of coin, the numbers of that coin are different.\n\nConstraints\n\n0 \\leq A, B, C \\leq 50\n\nA + B + C \\geq 1\n\n50 \\leq X \\leq 20 000\n\nA, B and C are integers.\n\nX is a multiple of 50.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nX\n\nOutput\n\nPrint the number of ways to select coins.\n\nSample Input 1\n\n2\n2\n2\n100\n\nSample Output 1\n\n2\n\nThere are two ways to satisfy the condition:\n\nSelect zero 500-yen coins, one 100-yen coin and zero 50-yen coins.\n\nSelect zero 500-yen coins, zero 100-yen coins and two 50-yen coins.\n\nSample Input 2\n\n5\n1\n0\n150\n\nSample Output 2\n\n0\n\nNote that the total must be exactly X yen.\n\nSample Input 3\n\n30\n40\n50\n6000\n\nSample Output 3\n\n213", "sample_input": "2\n2\n2\n100\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03448", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan).\nIn how many ways can we select some of these coins so that they are X yen in total?\n\nCoins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for some kind of coin, the numbers of that coin are different.\n\nConstraints\n\n0 \\leq A, B, C \\leq 50\n\nA + B + C \\geq 1\n\n50 \\leq X \\leq 20 000\n\nA, B and C are integers.\n\nX is a multiple of 50.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nX\n\nOutput\n\nPrint the number of ways to select coins.\n\nSample Input 1\n\n2\n2\n2\n100\n\nSample Output 1\n\n2\n\nThere are two ways to satisfy the condition:\n\nSelect zero 500-yen coins, one 100-yen coin and zero 50-yen coins.\n\nSelect zero 500-yen coins, zero 100-yen coins and two 50-yen coins.\n\nSample Input 2\n\n5\n1\n0\n150\n\nSample Output 2\n\n0\n\nNote that the total must be exactly X yen.\n\nSample Input 3\n\n30\n40\n50\n6000\n\nSample Output 3\n\n213", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 265, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s317918930", "group_id": "codeNet:p03448", "input_text": "package main\n\nimport \"fmt\"\nimport \"bufio\"\nimport \"os\"\nimport \"strconv\"\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n sc.Scan()\n i, e := strconv.Atoi(sc.Text())\n if e != nil {\n panic(e)\n }\n return i\n}\n\nfunc main() {\n var a,b,c,x int\n \n sc.Split(bufio.ScanWords)\n a = nextInt() // 500\n b = nextInt() // 100\n c = nextInt() // 50\n x = nextInt()\n \n cnt:=0\n \n var i_max, j_max, k_max int\n\n if a > x/500 {\n i_max = x/500\n } else {\n i_max = a\n }\n if b > x/100 {\n j_max = x/100\n } else {\n j_max = b\n }\n if c > x/50 {\n k_max = x/50\n } else {\n k_max = c\n }\n \n // fmt.Print(\"%d %d %d\", i_max, j_max, k_max)\n \n for i:=0; i<=i_max; i++ {\n for j:=0; j<=j_max; j++ {\n for k:=0; k<=k_max; k++ {\n if i*500+j*100+k*50 == x {\n cnt++\n }\n }\n }\n }\n\n fmt.Print(cnt)\n}", "language": "Go", "metadata": {"date": 1589763391, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03448.html", "problem_id": "p03448", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03448/input.txt", "sample_output_relpath": "derived/input_output/data/p03448/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03448/Go/s317918930.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s317918930", "user_id": "u739468352"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\nimport \"bufio\"\nimport \"os\"\nimport \"strconv\"\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n sc.Scan()\n i, e := strconv.Atoi(sc.Text())\n if e != nil {\n panic(e)\n }\n return i\n}\n\nfunc main() {\n var a,b,c,x int\n \n sc.Split(bufio.ScanWords)\n a = nextInt() // 500\n b = nextInt() // 100\n c = nextInt() // 50\n x = nextInt()\n \n cnt:=0\n \n var i_max, j_max, k_max int\n\n if a > x/500 {\n i_max = x/500\n } else {\n i_max = a\n }\n if b > x/100 {\n j_max = x/100\n } else {\n j_max = b\n }\n if c > x/50 {\n k_max = x/50\n } else {\n k_max = c\n }\n \n // fmt.Print(\"%d %d %d\", i_max, j_max, k_max)\n \n for i:=0; i<=i_max; i++ {\n for j:=0; j<=j_max; j++ {\n for k:=0; k<=k_max; k++ {\n if i*500+j*100+k*50 == x {\n cnt++\n }\n }\n }\n }\n\n fmt.Print(cnt)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan).\nIn how many ways can we select some of these coins so that they are X yen in total?\n\nCoins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for some kind of coin, the numbers of that coin are different.\n\nConstraints\n\n0 \\leq A, B, C \\leq 50\n\nA + B + C \\geq 1\n\n50 \\leq X \\leq 20 000\n\nA, B and C are integers.\n\nX is a multiple of 50.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nX\n\nOutput\n\nPrint the number of ways to select coins.\n\nSample Input 1\n\n2\n2\n2\n100\n\nSample Output 1\n\n2\n\nThere are two ways to satisfy the condition:\n\nSelect zero 500-yen coins, one 100-yen coin and zero 50-yen coins.\n\nSelect zero 500-yen coins, zero 100-yen coins and two 50-yen coins.\n\nSample Input 2\n\n5\n1\n0\n150\n\nSample Output 2\n\n0\n\nNote that the total must be exactly X yen.\n\nSample Input 3\n\n30\n40\n50\n6000\n\nSample Output 3\n\n213", "sample_input": "2\n2\n2\n100\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03448", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan).\nIn how many ways can we select some of these coins so that they are X yen in total?\n\nCoins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for some kind of coin, the numbers of that coin are different.\n\nConstraints\n\n0 \\leq A, B, C \\leq 50\n\nA + B + C \\geq 1\n\n50 \\leq X \\leq 20 000\n\nA, B and C are integers.\n\nX is a multiple of 50.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nX\n\nOutput\n\nPrint the number of ways to select coins.\n\nSample Input 1\n\n2\n2\n2\n100\n\nSample Output 1\n\n2\n\nThere are two ways to satisfy the condition:\n\nSelect zero 500-yen coins, one 100-yen coin and zero 50-yen coins.\n\nSelect zero 500-yen coins, zero 100-yen coins and two 50-yen coins.\n\nSample Input 2\n\n5\n1\n0\n150\n\nSample Output 2\n\n0\n\nNote that the total must be exactly X yen.\n\nSample Input 3\n\n30\n40\n50\n6000\n\nSample Output 3\n\n213", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 862, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s086642055", "group_id": "codeNet:p03448", "input_text": "package main\nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n \"strconv\"\n)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n sc.Split(bufio.ScanWords)\n a := nextInt()\n b := nextInt()\n c := nextInt()\n x := nextInt()\n\n count := 0\n for i := 0; i <= a; i++ {\n for j := 0; j <= b; j++ {\n for r := 0; r <= c; r++ {\n\t\t if (i * 500 + j * 100 + r * 50) == x {\n\t\t\t count++\n\t\t }\n }\n }\n }\n fmt.Println(count)\n\n}\n\nfunc nextString() (string) {\n\tsc.Scan()\n\tv := sc.Text()\n\treturn v\n}\n\nfunc nextInt() (int) {\n\tsc.Scan()\n\tv, e := strconv.Atoi(sc.Text())\n if e != nil { panic(e) }\n return v\n}\n\nfunc nextFloat() (float64) {\n\tsc.Scan()\n\tv, e := strconv.ParseFloat(sc.Text(), 64)\n if e != nil { panic(e) }\n return v\n}\n", "language": "Go", "metadata": {"date": 1584336210, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03448.html", "problem_id": "p03448", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03448/input.txt", "sample_output_relpath": "derived/input_output/data/p03448/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03448/Go/s086642055.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s086642055", "user_id": "u027449325"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n \"strconv\"\n)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n sc.Split(bufio.ScanWords)\n a := nextInt()\n b := nextInt()\n c := nextInt()\n x := nextInt()\n\n count := 0\n for i := 0; i <= a; i++ {\n for j := 0; j <= b; j++ {\n for r := 0; r <= c; r++ {\n\t\t if (i * 500 + j * 100 + r * 50) == x {\n\t\t\t count++\n\t\t }\n }\n }\n }\n fmt.Println(count)\n\n}\n\nfunc nextString() (string) {\n\tsc.Scan()\n\tv := sc.Text()\n\treturn v\n}\n\nfunc nextInt() (int) {\n\tsc.Scan()\n\tv, e := strconv.Atoi(sc.Text())\n if e != nil { panic(e) }\n return v\n}\n\nfunc nextFloat() (float64) {\n\tsc.Scan()\n\tv, e := strconv.ParseFloat(sc.Text(), 64)\n if e != nil { panic(e) }\n return v\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan).\nIn how many ways can we select some of these coins so that they are X yen in total?\n\nCoins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for some kind of coin, the numbers of that coin are different.\n\nConstraints\n\n0 \\leq A, B, C \\leq 50\n\nA + B + C \\geq 1\n\n50 \\leq X \\leq 20 000\n\nA, B and C are integers.\n\nX is a multiple of 50.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nX\n\nOutput\n\nPrint the number of ways to select coins.\n\nSample Input 1\n\n2\n2\n2\n100\n\nSample Output 1\n\n2\n\nThere are two ways to satisfy the condition:\n\nSelect zero 500-yen coins, one 100-yen coin and zero 50-yen coins.\n\nSelect zero 500-yen coins, zero 100-yen coins and two 50-yen coins.\n\nSample Input 2\n\n5\n1\n0\n150\n\nSample Output 2\n\n0\n\nNote that the total must be exactly X yen.\n\nSample Input 3\n\n30\n40\n50\n6000\n\nSample Output 3\n\n213", "sample_input": "2\n2\n2\n100\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03448", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan).\nIn how many ways can we select some of these coins so that they are X yen in total?\n\nCoins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for some kind of coin, the numbers of that coin are different.\n\nConstraints\n\n0 \\leq A, B, C \\leq 50\n\nA + B + C \\geq 1\n\n50 \\leq X \\leq 20 000\n\nA, B and C are integers.\n\nX is a multiple of 50.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nX\n\nOutput\n\nPrint the number of ways to select coins.\n\nSample Input 1\n\n2\n2\n2\n100\n\nSample Output 1\n\n2\n\nThere are two ways to satisfy the condition:\n\nSelect zero 500-yen coins, one 100-yen coin and zero 50-yen coins.\n\nSelect zero 500-yen coins, zero 100-yen coins and two 50-yen coins.\n\nSample Input 2\n\n5\n1\n0\n150\n\nSample Output 2\n\n0\n\nNote that the total must be exactly X yen.\n\nSample Input 3\n\n30\n40\n50\n6000\n\nSample Output 3\n\n213", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 729, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s263851035", "group_id": "codeNet:p03448", "input_text": "package main\n\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n \"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nfunc next() string{\n sc.Scan()\n return sc.Text()\n}\n\nfunc nextInt() int{\n a, _ := strconv.Atoi(next())\n return a\n}\n\nfunc main() {\n var (\n a int\n b int\n c int\n x int\n count int\n )\n\n a = nextInt()\n b = nextInt()\n c = nextInt()\n x = nextInt()\n\n for i := 0; i <= a; i++ {\n for j := 0; j <= b; j++ {\n for k := 0; k <= c; k++ {\n if x == 500*i + 100*j + 50*k {\n count++\n }\n }\n }\n }\n\n fmt.Println(count)\n}", "language": "Go", "metadata": {"date": 1581607830, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03448.html", "problem_id": "p03448", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03448/input.txt", "sample_output_relpath": "derived/input_output/data/p03448/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03448/Go/s263851035.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s263851035", "user_id": "u688762199"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n \"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nfunc next() string{\n sc.Scan()\n return sc.Text()\n}\n\nfunc nextInt() int{\n a, _ := strconv.Atoi(next())\n return a\n}\n\nfunc main() {\n var (\n a int\n b int\n c int\n x int\n count int\n )\n\n a = nextInt()\n b = nextInt()\n c = nextInt()\n x = nextInt()\n\n for i := 0; i <= a; i++ {\n for j := 0; j <= b; j++ {\n for k := 0; k <= c; k++ {\n if x == 500*i + 100*j + 50*k {\n count++\n }\n }\n }\n }\n\n fmt.Println(count)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan).\nIn how many ways can we select some of these coins so that they are X yen in total?\n\nCoins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for some kind of coin, the numbers of that coin are different.\n\nConstraints\n\n0 \\leq A, B, C \\leq 50\n\nA + B + C \\geq 1\n\n50 \\leq X \\leq 20 000\n\nA, B and C are integers.\n\nX is a multiple of 50.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nX\n\nOutput\n\nPrint the number of ways to select coins.\n\nSample Input 1\n\n2\n2\n2\n100\n\nSample Output 1\n\n2\n\nThere are two ways to satisfy the condition:\n\nSelect zero 500-yen coins, one 100-yen coin and zero 50-yen coins.\n\nSelect zero 500-yen coins, zero 100-yen coins and two 50-yen coins.\n\nSample Input 2\n\n5\n1\n0\n150\n\nSample Output 2\n\n0\n\nNote that the total must be exactly X yen.\n\nSample Input 3\n\n30\n40\n50\n6000\n\nSample Output 3\n\n213", "sample_input": "2\n2\n2\n100\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03448", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan).\nIn how many ways can we select some of these coins so that they are X yen in total?\n\nCoins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for some kind of coin, the numbers of that coin are different.\n\nConstraints\n\n0 \\leq A, B, C \\leq 50\n\nA + B + C \\geq 1\n\n50 \\leq X \\leq 20 000\n\nA, B and C are integers.\n\nX is a multiple of 50.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nX\n\nOutput\n\nPrint the number of ways to select coins.\n\nSample Input 1\n\n2\n2\n2\n100\n\nSample Output 1\n\n2\n\nThere are two ways to satisfy the condition:\n\nSelect zero 500-yen coins, one 100-yen coin and zero 50-yen coins.\n\nSelect zero 500-yen coins, zero 100-yen coins and two 50-yen coins.\n\nSample Input 2\n\n5\n1\n0\n150\n\nSample Output 2\n\n0\n\nNote that the total must be exactly X yen.\n\nSample Input 3\n\n30\n40\n50\n6000\n\nSample Output 3\n\n213", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 678, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s871867207", "group_id": "codeNet:p03448", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\n/**\nin\n2\n2\n2\n100\n */\nfunc main() {\n var a, b, c, target int\n fmt.Scan(&a, &b, &c, &target)\n cnt := 0\n for i:=0 ; i <= a ; i++ {\n for j:=0 ; j<=b ; j++ {\n for k:=0 ; k<=c ; k++ {\n if i*500 + j*100 + k*50 == target {\n cnt++\n }\n }\n }\n }\n fmt.Println(cnt)\n}\n\n", "language": "Go", "metadata": {"date": 1581485102, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03448.html", "problem_id": "p03448", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03448/input.txt", "sample_output_relpath": "derived/input_output/data/p03448/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03448/Go/s871867207.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s871867207", "user_id": "u588466905"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\n/**\nin\n2\n2\n2\n100\n */\nfunc main() {\n var a, b, c, target int\n fmt.Scan(&a, &b, &c, &target)\n cnt := 0\n for i:=0 ; i <= a ; i++ {\n for j:=0 ; j<=b ; j++ {\n for k:=0 ; k<=c ; k++ {\n if i*500 + j*100 + k*50 == target {\n cnt++\n }\n }\n }\n }\n fmt.Println(cnt)\n}\n\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan).\nIn how many ways can we select some of these coins so that they are X yen in total?\n\nCoins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for some kind of coin, the numbers of that coin are different.\n\nConstraints\n\n0 \\leq A, B, C \\leq 50\n\nA + B + C \\geq 1\n\n50 \\leq X \\leq 20 000\n\nA, B and C are integers.\n\nX is a multiple of 50.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nX\n\nOutput\n\nPrint the number of ways to select coins.\n\nSample Input 1\n\n2\n2\n2\n100\n\nSample Output 1\n\n2\n\nThere are two ways to satisfy the condition:\n\nSelect zero 500-yen coins, one 100-yen coin and zero 50-yen coins.\n\nSelect zero 500-yen coins, zero 100-yen coins and two 50-yen coins.\n\nSample Input 2\n\n5\n1\n0\n150\n\nSample Output 2\n\n0\n\nNote that the total must be exactly X yen.\n\nSample Input 3\n\n30\n40\n50\n6000\n\nSample Output 3\n\n213", "sample_input": "2\n2\n2\n100\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03448", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan).\nIn how many ways can we select some of these coins so that they are X yen in total?\n\nCoins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for some kind of coin, the numbers of that coin are different.\n\nConstraints\n\n0 \\leq A, B, C \\leq 50\n\nA + B + C \\geq 1\n\n50 \\leq X \\leq 20 000\n\nA, B and C are integers.\n\nX is a multiple of 50.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nX\n\nOutput\n\nPrint the number of ways to select coins.\n\nSample Input 1\n\n2\n2\n2\n100\n\nSample Output 1\n\n2\n\nThere are two ways to satisfy the condition:\n\nSelect zero 500-yen coins, one 100-yen coin and zero 50-yen coins.\n\nSelect zero 500-yen coins, zero 100-yen coins and two 50-yen coins.\n\nSample Input 2\n\n5\n1\n0\n150\n\nSample Output 2\n\n0\n\nNote that the total must be exactly X yen.\n\nSample Input 3\n\n30\n40\n50\n6000\n\nSample Output 3\n\n213", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 334, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s098765955", "group_id": "codeNet:p03448", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, c, x int\n\tfmt.Scan(&a)\n\tfmt.Scan(&b)\n\tfmt.Scan(&c)\n\tfmt.Scan(&x)\n\n\tvar result int\n\tfor i := 0; i <= a; i++ {\n\t\tfor j := 0; j <= b; j++ {\n\t\t\tfor m := 0; m <= c; m++ {\n\t\t\t\tif i*500+j*100+m*50 == x {\n\t\t\t\t\tresult++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(result)\n}\n", "language": "Go", "metadata": {"date": 1581054541, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03448.html", "problem_id": "p03448", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03448/input.txt", "sample_output_relpath": "derived/input_output/data/p03448/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03448/Go/s098765955.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s098765955", "user_id": "u753867091"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, c, x int\n\tfmt.Scan(&a)\n\tfmt.Scan(&b)\n\tfmt.Scan(&c)\n\tfmt.Scan(&x)\n\n\tvar result int\n\tfor i := 0; i <= a; i++ {\n\t\tfor j := 0; j <= b; j++ {\n\t\t\tfor m := 0; m <= c; m++ {\n\t\t\t\tif i*500+j*100+m*50 == x {\n\t\t\t\t\tresult++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(result)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan).\nIn how many ways can we select some of these coins so that they are X yen in total?\n\nCoins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for some kind of coin, the numbers of that coin are different.\n\nConstraints\n\n0 \\leq A, B, C \\leq 50\n\nA + B + C \\geq 1\n\n50 \\leq X \\leq 20 000\n\nA, B and C are integers.\n\nX is a multiple of 50.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nX\n\nOutput\n\nPrint the number of ways to select coins.\n\nSample Input 1\n\n2\n2\n2\n100\n\nSample Output 1\n\n2\n\nThere are two ways to satisfy the condition:\n\nSelect zero 500-yen coins, one 100-yen coin and zero 50-yen coins.\n\nSelect zero 500-yen coins, zero 100-yen coins and two 50-yen coins.\n\nSample Input 2\n\n5\n1\n0\n150\n\nSample Output 2\n\n0\n\nNote that the total must be exactly X yen.\n\nSample Input 3\n\n30\n40\n50\n6000\n\nSample Output 3\n\n213", "sample_input": "2\n2\n2\n100\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03448", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan).\nIn how many ways can we select some of these coins so that they are X yen in total?\n\nCoins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for some kind of coin, the numbers of that coin are different.\n\nConstraints\n\n0 \\leq A, B, C \\leq 50\n\nA + B + C \\geq 1\n\n50 \\leq X \\leq 20 000\n\nA, B and C are integers.\n\nX is a multiple of 50.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nX\n\nOutput\n\nPrint the number of ways to select coins.\n\nSample Input 1\n\n2\n2\n2\n100\n\nSample Output 1\n\n2\n\nThere are two ways to satisfy the condition:\n\nSelect zero 500-yen coins, one 100-yen coin and zero 50-yen coins.\n\nSelect zero 500-yen coins, zero 100-yen coins and two 50-yen coins.\n\nSample Input 2\n\n5\n1\n0\n150\n\nSample Output 2\n\n0\n\nNote that the total must be exactly X yen.\n\nSample Input 3\n\n30\n40\n50\n6000\n\nSample Output 3\n\n213", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 305, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s642346705", "group_id": "codeNet:p03448", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar A, B, C, X, count int\n\tfmt.Scan(&A, &B, &C, &X)\n\tfor i := 0; i <= A; i++ {\n\t\tfor j := 0; j <= B; j++ {\n\t\t\tfor k := 0; k <= C; k++ {\n\t\t\t\tif i*500+j*100+k*50 == X {\n\t\t\t\t\tcount++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(count)\n}\n", "language": "Go", "metadata": {"date": 1572821459, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03448.html", "problem_id": "p03448", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03448/input.txt", "sample_output_relpath": "derived/input_output/data/p03448/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03448/Go/s642346705.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s642346705", "user_id": "u924691798"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar A, B, C, X, count int\n\tfmt.Scan(&A, &B, &C, &X)\n\tfor i := 0; i <= A; i++ {\n\t\tfor j := 0; j <= B; j++ {\n\t\t\tfor k := 0; k <= C; k++ {\n\t\t\t\tif i*500+j*100+k*50 == X {\n\t\t\t\t\tcount++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(count)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan).\nIn how many ways can we select some of these coins so that they are X yen in total?\n\nCoins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for some kind of coin, the numbers of that coin are different.\n\nConstraints\n\n0 \\leq A, B, C \\leq 50\n\nA + B + C \\geq 1\n\n50 \\leq X \\leq 20 000\n\nA, B and C are integers.\n\nX is a multiple of 50.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nX\n\nOutput\n\nPrint the number of ways to select coins.\n\nSample Input 1\n\n2\n2\n2\n100\n\nSample Output 1\n\n2\n\nThere are two ways to satisfy the condition:\n\nSelect zero 500-yen coins, one 100-yen coin and zero 50-yen coins.\n\nSelect zero 500-yen coins, zero 100-yen coins and two 50-yen coins.\n\nSample Input 2\n\n5\n1\n0\n150\n\nSample Output 2\n\n0\n\nNote that the total must be exactly X yen.\n\nSample Input 3\n\n30\n40\n50\n6000\n\nSample Output 3\n\n213", "sample_input": "2\n2\n2\n100\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03448", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan).\nIn how many ways can we select some of these coins so that they are X yen in total?\n\nCoins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for some kind of coin, the numbers of that coin are different.\n\nConstraints\n\n0 \\leq A, B, C \\leq 50\n\nA + B + C \\geq 1\n\n50 \\leq X \\leq 20 000\n\nA, B and C are integers.\n\nX is a multiple of 50.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nX\n\nOutput\n\nPrint the number of ways to select coins.\n\nSample Input 1\n\n2\n2\n2\n100\n\nSample Output 1\n\n2\n\nThere are two ways to satisfy the condition:\n\nSelect zero 500-yen coins, one 100-yen coin and zero 50-yen coins.\n\nSelect zero 500-yen coins, zero 100-yen coins and two 50-yen coins.\n\nSample Input 2\n\n5\n1\n0\n150\n\nSample Output 2\n\n0\n\nNote that the total must be exactly X yen.\n\nSample Input 3\n\n30\n40\n50\n6000\n\nSample Output 3\n\n213", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 263, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s031703535", "group_id": "codeNet:p03448", "input_text": "package main\n\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a,b,c,d int\n\tfmt.Scan(&a)\n\tfmt.Scan(&b)\n\tfmt.Scan(&c)\n\tfmt.Scan(&d)\n\n\tcount := 0\n\tfor i := 0; i <= a; i++ {\n\t\tfor j := 0; j <= b; j++ {\n\t\t\tfor k := 0; k <= c; k++ {\n\t\t\t\ttotal := 500 * i + 100 * j + 50 * k\n\t\t\t\tif total == d {\n\t\t\t\t\tcount++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(count)\n}", "language": "Go", "metadata": {"date": 1568337513, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03448.html", "problem_id": "p03448", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03448/input.txt", "sample_output_relpath": "derived/input_output/data/p03448/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03448/Go/s031703535.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s031703535", "user_id": "u390374229"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a,b,c,d int\n\tfmt.Scan(&a)\n\tfmt.Scan(&b)\n\tfmt.Scan(&c)\n\tfmt.Scan(&d)\n\n\tcount := 0\n\tfor i := 0; i <= a; i++ {\n\t\tfor j := 0; j <= b; j++ {\n\t\t\tfor k := 0; k <= c; k++ {\n\t\t\t\ttotal := 500 * i + 100 * j + 50 * k\n\t\t\t\tif total == d {\n\t\t\t\t\tcount++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(count)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan).\nIn how many ways can we select some of these coins so that they are X yen in total?\n\nCoins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for some kind of coin, the numbers of that coin are different.\n\nConstraints\n\n0 \\leq A, B, C \\leq 50\n\nA + B + C \\geq 1\n\n50 \\leq X \\leq 20 000\n\nA, B and C are integers.\n\nX is a multiple of 50.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nX\n\nOutput\n\nPrint the number of ways to select coins.\n\nSample Input 1\n\n2\n2\n2\n100\n\nSample Output 1\n\n2\n\nThere are two ways to satisfy the condition:\n\nSelect zero 500-yen coins, one 100-yen coin and zero 50-yen coins.\n\nSelect zero 500-yen coins, zero 100-yen coins and two 50-yen coins.\n\nSample Input 2\n\n5\n1\n0\n150\n\nSample Output 2\n\n0\n\nNote that the total must be exactly X yen.\n\nSample Input 3\n\n30\n40\n50\n6000\n\nSample Output 3\n\n213", "sample_input": "2\n2\n2\n100\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03448", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan).\nIn how many ways can we select some of these coins so that they are X yen in total?\n\nCoins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for some kind of coin, the numbers of that coin are different.\n\nConstraints\n\n0 \\leq A, B, C \\leq 50\n\nA + B + C \\geq 1\n\n50 \\leq X \\leq 20 000\n\nA, B and C are integers.\n\nX is a multiple of 50.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nX\n\nOutput\n\nPrint the number of ways to select coins.\n\nSample Input 1\n\n2\n2\n2\n100\n\nSample Output 1\n\n2\n\nThere are two ways to satisfy the condition:\n\nSelect zero 500-yen coins, one 100-yen coin and zero 50-yen coins.\n\nSelect zero 500-yen coins, zero 100-yen coins and two 50-yen coins.\n\nSample Input 2\n\n5\n1\n0\n150\n\nSample Output 2\n\n0\n\nNote that the total must be exactly X yen.\n\nSample Input 3\n\n30\n40\n50\n6000\n\nSample Output 3\n\n213", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s181724125", "group_id": "codeNet:p03448", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, c, x, ans int\n\tfmt.Scan(&a, &b, &c, &x)\n\tfor i := 0; i <= a; i++ {\n\t\tfor j := 0; j <= b; j++ {\n\t\t\tfor k := 0; k <= c; k++ {\n\t\t\t\tif i*500+j*100+k*50 == x {\n\t\t\t\t\tans++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1568259420, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03448.html", "problem_id": "p03448", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03448/input.txt", "sample_output_relpath": "derived/input_output/data/p03448/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03448/Go/s181724125.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s181724125", "user_id": "u937220467"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b, c, x, ans int\n\tfmt.Scan(&a, &b, &c, &x)\n\tfor i := 0; i <= a; i++ {\n\t\tfor j := 0; j <= b; j++ {\n\t\t\tfor k := 0; k <= c; k++ {\n\t\t\t\tif i*500+j*100+k*50 == x {\n\t\t\t\t\tans++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan).\nIn how many ways can we select some of these coins so that they are X yen in total?\n\nCoins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for some kind of coin, the numbers of that coin are different.\n\nConstraints\n\n0 \\leq A, B, C \\leq 50\n\nA + B + C \\geq 1\n\n50 \\leq X \\leq 20 000\n\nA, B and C are integers.\n\nX is a multiple of 50.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nX\n\nOutput\n\nPrint the number of ways to select coins.\n\nSample Input 1\n\n2\n2\n2\n100\n\nSample Output 1\n\n2\n\nThere are two ways to satisfy the condition:\n\nSelect zero 500-yen coins, one 100-yen coin and zero 50-yen coins.\n\nSelect zero 500-yen coins, zero 100-yen coins and two 50-yen coins.\n\nSample Input 2\n\n5\n1\n0\n150\n\nSample Output 2\n\n0\n\nNote that the total must be exactly X yen.\n\nSample Input 3\n\n30\n40\n50\n6000\n\nSample Output 3\n\n213", "sample_input": "2\n2\n2\n100\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03448", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan).\nIn how many ways can we select some of these coins so that they are X yen in total?\n\nCoins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for some kind of coin, the numbers of that coin are different.\n\nConstraints\n\n0 \\leq A, B, C \\leq 50\n\nA + B + C \\geq 1\n\n50 \\leq X \\leq 20 000\n\nA, B and C are integers.\n\nX is a multiple of 50.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nX\n\nOutput\n\nPrint the number of ways to select coins.\n\nSample Input 1\n\n2\n2\n2\n100\n\nSample Output 1\n\n2\n\nThere are two ways to satisfy the condition:\n\nSelect zero 500-yen coins, one 100-yen coin and zero 50-yen coins.\n\nSelect zero 500-yen coins, zero 100-yen coins and two 50-yen coins.\n\nSample Input 2\n\n5\n1\n0\n150\n\nSample Output 2\n\n0\n\nNote that the total must be exactly X yen.\n\nSample Input 3\n\n30\n40\n50\n6000\n\nSample Output 3\n\n213", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 257, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s478974238", "group_id": "codeNet:p03448", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar ReadString func() string\nvar ReadLine func() string\nvar ReadInt64 func() int64\nvar ReadInt func() int\nvar ReadIntSlice func(int) []int\nvar ReadInt64Slice func(int) []int64\nvar GetIntAbs func(int) int\nvar Atoi func(string) int\nvar FindMin func([] int) int\nvar FindMax func([] int) int\n\nfunc init() {\n\tReadString = newReadString()\n\tReadLine = readLine\n\tReadInt64 = readInt64\n\tReadInt = readInt\n\tReadIntSlice = readIntSlice\n\tFindMin = findMin\n\tFindMax = findMax\n}\n\nfunc main() {\n\tA := ReadInt()\n\tB := ReadInt()\n\tC := ReadInt()\n\tX := ReadInt()\n\n\tvar r int\n\tfor a := 0; a < A; a++ {\n\t\tfor b := 0; b < B; b++ {\n\t\t\tfor c := 0; c < C; c++ {\n\t\t\t\ttotal := (500 * a) + (100 * b) + (50 * c)\n\t\t\t\tif total == X {\n\t\t\t\t\tr += 1\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(r)\n}\n\n/*------ scan ------*/\n\nfunc newReadString() func() string {\n\tsc.Buffer(make([]byte, 1024), 2048)\n\tsc.Split(bufio.ScanWords)\n\treturn func() string {\n\t\tif !sc.Scan() {\n\t\t\tpanic(\"scanできなかった\")\n\t\t}\n\t\treturn sc.Text()\n\t}\n}\n\nfunc readLine() string {\n\tif !sc.Scan() {\n\t\tpanic(\"line をscanできなかった\")\n\t}\n\treturn sc.Text()\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tfmt.Println(\"parseInt失敗\")\n\t\tpanic(err.Error())\n\t}\n\treturn int64(i)\n}\n\nfunc readInt() int {\n\ti := ReadInt64()\n\treturn int(i)\n}\n\nfunc readIntSlice(n int) []int {\n\tarr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarr[i] = ReadInt()\n\t}\n\treturn arr\n}\n\nfunc readInt64Slice(n int) []int64 {\n\tarr := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tarr[i] = ReadInt64()\n\t}\n\treturn arr\n}\n\n/*------ number util ------*/\n\nfunc getIntAbs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\treturn n\n}\n\nfunc atoi(a string) int {\n\ti, err := strconv.Atoi(a)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc findMin(arr []int) int {\n\tif len(arr) == 0 {\n\t\treturn 0\n\t}\n\tmin := arr[0]\n\tfor _, v := range arr {\n\t\tif v < min {\n\t\t\tmin = v\n\t\t}\n\t}\n\treturn min\n}\n\nfunc findMax(arr []int) int {\n\tif len(arr) == 0 {\n\t\treturn 0\n\t}\n\tmax := arr[0]\n\tfor _, v := range arr {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}", "language": "Go", "metadata": {"date": 1563162060, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03448.html", "problem_id": "p03448", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03448/input.txt", "sample_output_relpath": "derived/input_output/data/p03448/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03448/Go/s478974238.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s478974238", "user_id": "u657610454"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar ReadString func() string\nvar ReadLine func() string\nvar ReadInt64 func() int64\nvar ReadInt func() int\nvar ReadIntSlice func(int) []int\nvar ReadInt64Slice func(int) []int64\nvar GetIntAbs func(int) int\nvar Atoi func(string) int\nvar FindMin func([] int) int\nvar FindMax func([] int) int\n\nfunc init() {\n\tReadString = newReadString()\n\tReadLine = readLine\n\tReadInt64 = readInt64\n\tReadInt = readInt\n\tReadIntSlice = readIntSlice\n\tFindMin = findMin\n\tFindMax = findMax\n}\n\nfunc main() {\n\tA := ReadInt()\n\tB := ReadInt()\n\tC := ReadInt()\n\tX := ReadInt()\n\n\tvar r int\n\tfor a := 0; a < A; a++ {\n\t\tfor b := 0; b < B; b++ {\n\t\t\tfor c := 0; c < C; c++ {\n\t\t\t\ttotal := (500 * a) + (100 * b) + (50 * c)\n\t\t\t\tif total == X {\n\t\t\t\t\tr += 1\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(r)\n}\n\n/*------ scan ------*/\n\nfunc newReadString() func() string {\n\tsc.Buffer(make([]byte, 1024), 2048)\n\tsc.Split(bufio.ScanWords)\n\treturn func() string {\n\t\tif !sc.Scan() {\n\t\t\tpanic(\"scanできなかった\")\n\t\t}\n\t\treturn sc.Text()\n\t}\n}\n\nfunc readLine() string {\n\tif !sc.Scan() {\n\t\tpanic(\"line をscanできなかった\")\n\t}\n\treturn sc.Text()\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tfmt.Println(\"parseInt失敗\")\n\t\tpanic(err.Error())\n\t}\n\treturn int64(i)\n}\n\nfunc readInt() int {\n\ti := ReadInt64()\n\treturn int(i)\n}\n\nfunc readIntSlice(n int) []int {\n\tarr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarr[i] = ReadInt()\n\t}\n\treturn arr\n}\n\nfunc readInt64Slice(n int) []int64 {\n\tarr := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tarr[i] = ReadInt64()\n\t}\n\treturn arr\n}\n\n/*------ number util ------*/\n\nfunc getIntAbs(n int) int {\n\tif n < 0 {\n\t\treturn -n\n\t}\n\treturn n\n}\n\nfunc atoi(a string) int {\n\ti, err := strconv.Atoi(a)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\nfunc findMin(arr []int) int {\n\tif len(arr) == 0 {\n\t\treturn 0\n\t}\n\tmin := arr[0]\n\tfor _, v := range arr {\n\t\tif v < min {\n\t\t\tmin = v\n\t\t}\n\t}\n\treturn min\n}\n\nfunc findMax(arr []int) int {\n\tif len(arr) == 0 {\n\t\treturn 0\n\t}\n\tmax := arr[0]\n\tfor _, v := range arr {\n\t\tif v > max {\n\t\t\tmax = v\n\t\t}\n\t}\n\treturn max\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan).\nIn how many ways can we select some of these coins so that they are X yen in total?\n\nCoins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for some kind of coin, the numbers of that coin are different.\n\nConstraints\n\n0 \\leq A, B, C \\leq 50\n\nA + B + C \\geq 1\n\n50 \\leq X \\leq 20 000\n\nA, B and C are integers.\n\nX is a multiple of 50.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nX\n\nOutput\n\nPrint the number of ways to select coins.\n\nSample Input 1\n\n2\n2\n2\n100\n\nSample Output 1\n\n2\n\nThere are two ways to satisfy the condition:\n\nSelect zero 500-yen coins, one 100-yen coin and zero 50-yen coins.\n\nSelect zero 500-yen coins, zero 100-yen coins and two 50-yen coins.\n\nSample Input 2\n\n5\n1\n0\n150\n\nSample Output 2\n\n0\n\nNote that the total must be exactly X yen.\n\nSample Input 3\n\n30\n40\n50\n6000\n\nSample Output 3\n\n213", "sample_input": "2\n2\n2\n100\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03448", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan).\nIn how many ways can we select some of these coins so that they are X yen in total?\n\nCoins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for some kind of coin, the numbers of that coin are different.\n\nConstraints\n\n0 \\leq A, B, C \\leq 50\n\nA + B + C \\geq 1\n\n50 \\leq X \\leq 20 000\n\nA, B and C are integers.\n\nX is a multiple of 50.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nX\n\nOutput\n\nPrint the number of ways to select coins.\n\nSample Input 1\n\n2\n2\n2\n100\n\nSample Output 1\n\n2\n\nThere are two ways to satisfy the condition:\n\nSelect zero 500-yen coins, one 100-yen coin and zero 50-yen coins.\n\nSelect zero 500-yen coins, zero 100-yen coins and two 50-yen coins.\n\nSample Input 2\n\n5\n1\n0\n150\n\nSample Output 2\n\n0\n\nNote that the total must be exactly X yen.\n\nSample Input 3\n\n30\n40\n50\n6000\n\nSample Output 3\n\n213", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2168, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s052509739", "group_id": "codeNet:p03448", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tscanner := makeScanner(1024)\n\ta := eGetInt(scanner)\n\tb := eGetInt(scanner)\n\tc := eGetInt(scanner)\n\tx := eGetInt(scanner)\n\tcount := 0\n\tfor i := 0; i <= a; i++ {\n\t\tfor j := 0; j <= b; j++ {\n\t\t\tfor k := 0; k <= c; k++ {\n\t\t\t\tsum := i*500 + j*100 + k*50\n\t\t\t\tif sum == x {\n\t\t\t\t\tcount++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(count)\n}\n\n////////////////////////////////////////////////////////////////////////////////\n// ライブラリ\n////////////////////////////////////////////////////////////////////////////////\nfunc makeScanner(maxByte int) *bufio.Scanner {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Buffer(make([]uint8, 0, 8192), maxByte)\n\treturn scanner\n}\nfunc makeWordScanner() *bufio.Scanner {\n\tscanner := makeScanner(8192)\n\tscanner.Split(bufio.ScanWords)\n\treturn scanner\n}\nfunc eGetLine(r *bufio.Scanner) string {\n\tif r.Scan() {\n\t\treturn r.Text()\n\t}\n\terr := r.Err()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\t// EOF\n\treturn \"\"\n}\n\nfunc eGetInt(r *bufio.Scanner) int {\n\tline := eGetLine(r)\n\treturn eAtoi(line)\n}\nfunc eGetInt64(r *bufio.Scanner) int64 {\n\tline := eGetLine(r)\n\treturn eAtoInt64(line)\n}\nfunc eGetFields(r *bufio.Scanner) []string {\n\tline := eGetLine(r)\n\treturn strings.Fields(line)\n}\nfunc eGetInts(r *bufio.Scanner) []int {\n\tfields := eGetFields(r)\n\tints := make([]int, len(fields))\n\tfor i := 0; i < len(ints); i++ {\n\t\tints[i] = eAtoi(fields[i])\n\t}\n\treturn ints\n}\nfunc eGetInt64s(r *bufio.Scanner) []int64 {\n\tfields := eGetFields(r)\n\tints := make([]int64, len(fields))\n\tfor i := 0; i < len(ints); i++ {\n\t\tints[i] = eAtoInt64(fields[i])\n\t}\n\treturn ints\n}\nfunc eGetChars(r *bufio.Scanner) []string {\n\tline := eGetLine(r)\n\treturn strings.Split(line, \"\")\n}\nfunc eAtoi(s string) int {\n\tn, err := strconv.Atoi(s)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn n\n}\nfunc eAtoInt64(s string) int64 {\n\tn, err := strconv.ParseInt(s, 10, 64)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn n\n}\n", "language": "Go", "metadata": {"date": 1561823889, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03448.html", "problem_id": "p03448", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03448/input.txt", "sample_output_relpath": "derived/input_output/data/p03448/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03448/Go/s052509739.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s052509739", "user_id": "u663116078"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tscanner := makeScanner(1024)\n\ta := eGetInt(scanner)\n\tb := eGetInt(scanner)\n\tc := eGetInt(scanner)\n\tx := eGetInt(scanner)\n\tcount := 0\n\tfor i := 0; i <= a; i++ {\n\t\tfor j := 0; j <= b; j++ {\n\t\t\tfor k := 0; k <= c; k++ {\n\t\t\t\tsum := i*500 + j*100 + k*50\n\t\t\t\tif sum == x {\n\t\t\t\t\tcount++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(count)\n}\n\n////////////////////////////////////////////////////////////////////////////////\n// ライブラリ\n////////////////////////////////////////////////////////////////////////////////\nfunc makeScanner(maxByte int) *bufio.Scanner {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Buffer(make([]uint8, 0, 8192), maxByte)\n\treturn scanner\n}\nfunc makeWordScanner() *bufio.Scanner {\n\tscanner := makeScanner(8192)\n\tscanner.Split(bufio.ScanWords)\n\treturn scanner\n}\nfunc eGetLine(r *bufio.Scanner) string {\n\tif r.Scan() {\n\t\treturn r.Text()\n\t}\n\terr := r.Err()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\t// EOF\n\treturn \"\"\n}\n\nfunc eGetInt(r *bufio.Scanner) int {\n\tline := eGetLine(r)\n\treturn eAtoi(line)\n}\nfunc eGetInt64(r *bufio.Scanner) int64 {\n\tline := eGetLine(r)\n\treturn eAtoInt64(line)\n}\nfunc eGetFields(r *bufio.Scanner) []string {\n\tline := eGetLine(r)\n\treturn strings.Fields(line)\n}\nfunc eGetInts(r *bufio.Scanner) []int {\n\tfields := eGetFields(r)\n\tints := make([]int, len(fields))\n\tfor i := 0; i < len(ints); i++ {\n\t\tints[i] = eAtoi(fields[i])\n\t}\n\treturn ints\n}\nfunc eGetInt64s(r *bufio.Scanner) []int64 {\n\tfields := eGetFields(r)\n\tints := make([]int64, len(fields))\n\tfor i := 0; i < len(ints); i++ {\n\t\tints[i] = eAtoInt64(fields[i])\n\t}\n\treturn ints\n}\nfunc eGetChars(r *bufio.Scanner) []string {\n\tline := eGetLine(r)\n\treturn strings.Split(line, \"\")\n}\nfunc eAtoi(s string) int {\n\tn, err := strconv.Atoi(s)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn n\n}\nfunc eAtoInt64(s string) int64 {\n\tn, err := strconv.ParseInt(s, 10, 64)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treturn n\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan).\nIn how many ways can we select some of these coins so that they are X yen in total?\n\nCoins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for some kind of coin, the numbers of that coin are different.\n\nConstraints\n\n0 \\leq A, B, C \\leq 50\n\nA + B + C \\geq 1\n\n50 \\leq X \\leq 20 000\n\nA, B and C are integers.\n\nX is a multiple of 50.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nX\n\nOutput\n\nPrint the number of ways to select coins.\n\nSample Input 1\n\n2\n2\n2\n100\n\nSample Output 1\n\n2\n\nThere are two ways to satisfy the condition:\n\nSelect zero 500-yen coins, one 100-yen coin and zero 50-yen coins.\n\nSelect zero 500-yen coins, zero 100-yen coins and two 50-yen coins.\n\nSample Input 2\n\n5\n1\n0\n150\n\nSample Output 2\n\n0\n\nNote that the total must be exactly X yen.\n\nSample Input 3\n\n30\n40\n50\n6000\n\nSample Output 3\n\n213", "sample_input": "2\n2\n2\n100\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03448", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan).\nIn how many ways can we select some of these coins so that they are X yen in total?\n\nCoins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for some kind of coin, the numbers of that coin are different.\n\nConstraints\n\n0 \\leq A, B, C \\leq 50\n\nA + B + C \\geq 1\n\n50 \\leq X \\leq 20 000\n\nA, B and C are integers.\n\nX is a multiple of 50.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nX\n\nOutput\n\nPrint the number of ways to select coins.\n\nSample Input 1\n\n2\n2\n2\n100\n\nSample Output 1\n\n2\n\nThere are two ways to satisfy the condition:\n\nSelect zero 500-yen coins, one 100-yen coin and zero 50-yen coins.\n\nSelect zero 500-yen coins, zero 100-yen coins and two 50-yen coins.\n\nSample Input 2\n\n5\n1\n0\n150\n\nSample Output 2\n\n0\n\nNote that the total must be exactly X yen.\n\nSample Input 3\n\n30\n40\n50\n6000\n\nSample Output 3\n\n213", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1977, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s975724930", "group_id": "codeNet:p03448", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nvar X, A, B, C, ans int\n\nfunc main() {\n\tfmt.Scan(&A, &B, &C, &X)\n\n\tfor i := 0; i <= A; i++ {\n\t\tfor j := 0; j <= B; j++ {\n\t\t\tfor k := 0; k <= C; k++ {\n\t\t\t\tif 500*i+100*j+50*k == X {\n\t\t\t\t\tans++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n\n}\n\n/* ---------------------------------------- */\n\nfunc combination(x, y int) int {\n\treturn permutation(x, y) / permutation(y, y)\n}\n\nfunc permutation(x, y int) int {\n\tvar ans int = 1\n\tfor i := x - y; 0 < i; i-- {\n\t\tans *= i\n\t}\n\treturn ans\n}\n\nfunc max(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Max(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\n\nfunc min(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Min(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\nfunc pow(x, y int) int { return int(math.Pow(float64(x), float64(y))) }\nfunc abs(x int) int { return int(math.Abs(float64(x))) }\nfunc floor(x int) int { return int(math.Floor(float64(x))) }\n\ntype XY struct {\n\tx int\n\ty int\n}\ntype SortBy []XY\n\nfunc (a SortBy) Len() int { return len(a) }\nfunc (a SortBy) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a SortBy) Less(i, j int) bool {\n\tif a[i].x == a[j].x {\n\t\treturn a[i].y > a[j].y\n\t}\n\treturn a[i].x > a[j].x\n}\n", "language": "Go", "metadata": {"date": 1560718298, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03448.html", "problem_id": "p03448", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03448/input.txt", "sample_output_relpath": "derived/input_output/data/p03448/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03448/Go/s975724930.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s975724930", "user_id": "u266742706"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n)\n\nvar X, A, B, C, ans int\n\nfunc main() {\n\tfmt.Scan(&A, &B, &C, &X)\n\n\tfor i := 0; i <= A; i++ {\n\t\tfor j := 0; j <= B; j++ {\n\t\t\tfor k := 0; k <= C; k++ {\n\t\t\t\tif 500*i+100*j+50*k == X {\n\t\t\t\t\tans++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ans)\n\n}\n\n/* ---------------------------------------- */\n\nfunc combination(x, y int) int {\n\treturn permutation(x, y) / permutation(y, y)\n}\n\nfunc permutation(x, y int) int {\n\tvar ans int = 1\n\tfor i := x - y; 0 < i; i-- {\n\t\tans *= i\n\t}\n\treturn ans\n}\n\nfunc max(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Max(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\n\nfunc min(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Min(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\nfunc pow(x, y int) int { return int(math.Pow(float64(x), float64(y))) }\nfunc abs(x int) int { return int(math.Abs(float64(x))) }\nfunc floor(x int) int { return int(math.Floor(float64(x))) }\n\ntype XY struct {\n\tx int\n\ty int\n}\ntype SortBy []XY\n\nfunc (a SortBy) Len() int { return len(a) }\nfunc (a SortBy) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a SortBy) Less(i, j int) bool {\n\tif a[i].x == a[j].x {\n\t\treturn a[i].y > a[j].y\n\t}\n\treturn a[i].x > a[j].x\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan).\nIn how many ways can we select some of these coins so that they are X yen in total?\n\nCoins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for some kind of coin, the numbers of that coin are different.\n\nConstraints\n\n0 \\leq A, B, C \\leq 50\n\nA + B + C \\geq 1\n\n50 \\leq X \\leq 20 000\n\nA, B and C are integers.\n\nX is a multiple of 50.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nX\n\nOutput\n\nPrint the number of ways to select coins.\n\nSample Input 1\n\n2\n2\n2\n100\n\nSample Output 1\n\n2\n\nThere are two ways to satisfy the condition:\n\nSelect zero 500-yen coins, one 100-yen coin and zero 50-yen coins.\n\nSelect zero 500-yen coins, zero 100-yen coins and two 50-yen coins.\n\nSample Input 2\n\n5\n1\n0\n150\n\nSample Output 2\n\n0\n\nNote that the total must be exactly X yen.\n\nSample Input 3\n\n30\n40\n50\n6000\n\nSample Output 3\n\n213", "sample_input": "2\n2\n2\n100\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03448", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou have A 500-yen coins, B 100-yen coins and C 50-yen coins (yen is the currency of Japan).\nIn how many ways can we select some of these coins so that they are X yen in total?\n\nCoins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for some kind of coin, the numbers of that coin are different.\n\nConstraints\n\n0 \\leq A, B, C \\leq 50\n\nA + B + C \\geq 1\n\n50 \\leq X \\leq 20 000\n\nA, B and C are integers.\n\nX is a multiple of 50.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nX\n\nOutput\n\nPrint the number of ways to select coins.\n\nSample Input 1\n\n2\n2\n2\n100\n\nSample Output 1\n\n2\n\nThere are two ways to satisfy the condition:\n\nSelect zero 500-yen coins, one 100-yen coin and zero 50-yen coins.\n\nSelect zero 500-yen coins, zero 100-yen coins and two 50-yen coins.\n\nSample Input 2\n\n5\n1\n0\n150\n\nSample Output 2\n\n0\n\nNote that the total must be exactly X yen.\n\nSample Input 3\n\n30\n40\n50\n6000\n\nSample Output 3\n\n213", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1272, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s609812757", "group_id": "codeNet:p03448", "input_text": "package main\n\nimport(\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar (\n\t\tfhy, hy, fy, sum, count int\n\t)\n\tfmt.Scan(&fhy, &hy, &fy, &sum)\n\tfor i:= 0;i= 1) || (index == 1 && num < 10000) {\n\t\treturn\n\t}else {\n\t\terrMsg = \"条件満たしてないよ\"\n\t\treturn\n\t}\n\n}\n\n\n// 偶数か奇数を判定\nfunc detectEvenOdd(num []int) (msg string) {\n\tif ((num[0]*num[1]) % 2) == 0 {\n\t\tmsg = \"Even\"\n\t\treturn\n\t}else {\n\t\tmsg = \"Odd\"\n\t\treturn\n\t}\n}\nfunc numError() error {\n\treturn errors.New(\"条件満たしてないよ\")\n}\nfunc main() {\n\ti, err := SplitIntStdin(\" \")\n\tvar msg string\n\tif err == nil {\n\t\tmsg = detectEvenOdd(i)\n\t\tfmt.Println(msg)\n\t}\n}", "language": "Go", "metadata": {"date": 1573532359, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03455.html", "problem_id": "p03455", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03455/input.txt", "sample_output_relpath": "derived/input_output/data/p03455/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03455/Go/s808497116.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s808497116", "user_id": "u751269680"}, "prompt_components": {"gold_output": "Even\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"bufio\"\n\t\"strconv\"\n\t\"strings\"\n\t\"errors\"\n\t\"log\"\n)\n\n// 文字列を1行入力\nfunc StrStdin() (stringReturned string) {\n\tscanner := bufio.NewScanner(os.Stdin)\n\n\tscanner.Scan()\n\tstringInput := scanner.Text()\n\n\tstringReturned = strings.TrimSpace(stringInput)\n\n\treturn\n}\n\n// 整数値を1つ取得\n// func IntStdin() (int, error) {\n// \tstringInput := StrStdin()\n// \treturn strconv.Atoi(strings.TrimSpace(stringInput))\n// }\n\n// 空白や空文字だけの値を除去したSplit()\nfunc SplitWithoutEmpty(stringTargeted string, delim string) (stringReturned []string) {\n\tstringSplited := strings.Split(stringTargeted, delim)\n\n\tfor _, str := range stringSplited {\n\t\tif str != \"\" {\n\t\t\tstringReturned = append(stringReturned, str)\n\t\t}\n\t}\n\n\treturn\n}\n\n// デリミタで分割して文字列スライスを取得\nfunc SplitStrStdin(delim string) (stringReturned []string) {\n // 文字列で1行取得\n stringInput := StrStdin()\n\n // 空白で分割\n // stringSplited := strings.Split(stringInput, delim)\n stringReturned = SplitWithoutEmpty(stringInput, delim)\n\n return\n}\n\n// デリミタで分割して整数値スライスを取得\nfunc SplitIntStdin(delim string) (intSlices []int, err error) {\n\t// 文字列スライスを取得\n\tstringSplited := SplitStrStdin(\" \")\n\n\t// 整数スライスに保存\n\tfor i := range stringSplited {\n\t\tvar iparam int\n\t\tvar errMsg string\n\t\tiparam, err = strconv.Atoi(stringSplited[i])\n\t\t\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\terrMsg = catchNumError(iparam, i)\n\t\tif errMsg != \"\" {\n\t\t\tif errMsg := numError(); errMsg != nil {\n\t\t\t\tlog.Fatal(errMsg)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\tintSlices = append(intSlices, iparam)\n\n\t}\n\n\treturn\n}\n\n// 数値の条件を判定\nfunc catchNumError(num int, index int) (errMsg string) {\n\tif (index == 0 && num >= 1) || (index == 1 && num < 10000) {\n\t\treturn\n\t}else {\n\t\terrMsg = \"条件満たしてないよ\"\n\t\treturn\n\t}\n\n}\n\n\n// 偶数か奇数を判定\nfunc detectEvenOdd(num []int) (msg string) {\n\tif ((num[0]*num[1]) % 2) == 0 {\n\t\tmsg = \"Even\"\n\t\treturn\n\t}else {\n\t\tmsg = \"Odd\"\n\t\treturn\n\t}\n}\nfunc numError() error {\n\treturn errors.New(\"条件満たしてないよ\")\n}\nfunc main() {\n\ti, err := SplitIntStdin(\" \")\n\tvar msg string\n\tif err == nil {\n\t\tmsg = detectEvenOdd(i)\n\t\tfmt.Println(msg)\n\t}\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer the deer found two positive integers, a and b.\nDetermine whether the product of a and b is even or odd.\n\nConstraints\n\n1 ≤ a,b ≤ 10000\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 product is odd, print Odd; if it is even, print Even.\n\nSample Input 1\n\n3 4\n\nSample Output 1\n\nEven\n\nAs 3 × 4 = 12 is even, print Even.\n\nSample Input 2\n\n1 21\n\nSample Output 2\n\nOdd\n\nAs 1 × 21 = 21 is odd, print Odd.", "sample_input": "3 4\n"}, "reference_outputs": ["Even\n"], "source_document_id": "p03455", "source_text": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer the deer found two positive integers, a and b.\nDetermine whether the product of a and b is even or odd.\n\nConstraints\n\n1 ≤ a,b ≤ 10000\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 product is odd, print Odd; if it is even, print Even.\n\nSample Input 1\n\n3 4\n\nSample Output 1\n\nEven\n\nAs 3 × 4 = 12 is even, print Even.\n\nSample Input 2\n\n1 21\n\nSample Output 2\n\nOdd\n\nAs 1 × 21 = 21 is odd, print Odd.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2285, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s820360436", "group_id": "codeNet:p03455", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tif product := a * b; product % 2 == 0 {\n\t\tfmt.Println(\"Even\")\n\t} else {\n\t\tfmt.Println(\"Odd\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1568943461, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03455.html", "problem_id": "p03455", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03455/input.txt", "sample_output_relpath": "derived/input_output/data/p03455/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03455/Go/s820360436.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s820360436", "user_id": "u432551953"}, "prompt_components": {"gold_output": "Even\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tif product := a * b; product % 2 == 0 {\n\t\tfmt.Println(\"Even\")\n\t} else {\n\t\tfmt.Println(\"Odd\")\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer the deer found two positive integers, a and b.\nDetermine whether the product of a and b is even or odd.\n\nConstraints\n\n1 ≤ a,b ≤ 10000\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 product is odd, print Odd; if it is even, print Even.\n\nSample Input 1\n\n3 4\n\nSample Output 1\n\nEven\n\nAs 3 × 4 = 12 is even, print Even.\n\nSample Input 2\n\n1 21\n\nSample Output 2\n\nOdd\n\nAs 1 × 21 = 21 is odd, print Odd.", "sample_input": "3 4\n"}, "reference_outputs": ["Even\n"], "source_document_id": "p03455", "source_text": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer the deer found two positive integers, a and b.\nDetermine whether the product of a and b is even or odd.\n\nConstraints\n\n1 ≤ a,b ≤ 10000\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 product is odd, print Odd; if it is even, print Even.\n\nSample Input 1\n\n3 4\n\nSample Output 1\n\nEven\n\nAs 3 × 4 = 12 is even, print Even.\n\nSample Input 2\n\n1 21\n\nSample Output 2\n\nOdd\n\nAs 1 × 21 = 21 is odd, print Odd.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s298365056", "group_id": "codeNet:p03455", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInput() (int, int, error) {\n\tsc.Split(bufio.ScanWords)\n\ta := make([]int, 2)\n\tfor i := range a {\n\t\tsc.Scan()\n\t\tn, err := strconv.Atoi(sc.Text())\n\t\ta[i] = n\n\t\tif err != nil {\n\t\t\treturn 0, 0, err\n\t\t}\n\t}\n\treturn a[0], a[1], nil\n}\n\nfunc main() {\n\n\ta, b, err := getInput()\n\tif err != nil {\n\t\tfmt.Printf(\"error: %s\\n\", err)\n\t\treturn\n\t}\n\n\tif (a*b)&0x00000001 == 1 {\n\t\tfmt.Println(\"Odd\")\n\t\treturn\n\t}\n\n\tfmt.Println(\"Even\")\n\n}\n", "language": "Go", "metadata": {"date": 1563936600, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03455.html", "problem_id": "p03455", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03455/input.txt", "sample_output_relpath": "derived/input_output/data/p03455/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03455/Go/s298365056.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s298365056", "user_id": "u911419846"}, "prompt_components": {"gold_output": "Even\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInput() (int, int, error) {\n\tsc.Split(bufio.ScanWords)\n\ta := make([]int, 2)\n\tfor i := range a {\n\t\tsc.Scan()\n\t\tn, err := strconv.Atoi(sc.Text())\n\t\ta[i] = n\n\t\tif err != nil {\n\t\t\treturn 0, 0, err\n\t\t}\n\t}\n\treturn a[0], a[1], nil\n}\n\nfunc main() {\n\n\ta, b, err := getInput()\n\tif err != nil {\n\t\tfmt.Printf(\"error: %s\\n\", err)\n\t\treturn\n\t}\n\n\tif (a*b)&0x00000001 == 1 {\n\t\tfmt.Println(\"Odd\")\n\t\treturn\n\t}\n\n\tfmt.Println(\"Even\")\n\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer the deer found two positive integers, a and b.\nDetermine whether the product of a and b is even or odd.\n\nConstraints\n\n1 ≤ a,b ≤ 10000\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 product is odd, print Odd; if it is even, print Even.\n\nSample Input 1\n\n3 4\n\nSample Output 1\n\nEven\n\nAs 3 × 4 = 12 is even, print Even.\n\nSample Input 2\n\n1 21\n\nSample Output 2\n\nOdd\n\nAs 1 × 21 = 21 is odd, print Odd.", "sample_input": "3 4\n"}, "reference_outputs": ["Even\n"], "source_document_id": "p03455", "source_text": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer the deer found two positive integers, a and b.\nDetermine whether the product of a and b is even or odd.\n\nConstraints\n\n1 ≤ a,b ≤ 10000\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 product is odd, print Odd; if it is even, print Even.\n\nSample Input 1\n\n3 4\n\nSample Output 1\n\nEven\n\nAs 3 × 4 = 12 is even, print Even.\n\nSample Input 2\n\n1 21\n\nSample Output 2\n\nOdd\n\nAs 1 × 21 = 21 is odd, print Odd.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 520, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s816351957", "group_id": "codeNet:p03455", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var a, b int\n fmt.Scan(&a, &b)\n if product := a * b; product % 2 == 0 {\n fmt.Println(\"Even\")\n } else {\n fmt.Println(\"Odd\")\n }\n}", "language": "Go", "metadata": {"date": 1559714468, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03455.html", "problem_id": "p03455", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03455/input.txt", "sample_output_relpath": "derived/input_output/data/p03455/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03455/Go/s816351957.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s816351957", "user_id": "u202566188"}, "prompt_components": {"gold_output": "Even\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var a, b int\n fmt.Scan(&a, &b)\n if product := a * b; product % 2 == 0 {\n fmt.Println(\"Even\")\n } else {\n fmt.Println(\"Odd\")\n }\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer the deer found two positive integers, a and b.\nDetermine whether the product of a and b is even or odd.\n\nConstraints\n\n1 ≤ a,b ≤ 10000\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 product is odd, print Odd; if it is even, print Even.\n\nSample Input 1\n\n3 4\n\nSample Output 1\n\nEven\n\nAs 3 × 4 = 12 is even, print Even.\n\nSample Input 2\n\n1 21\n\nSample Output 2\n\nOdd\n\nAs 1 × 21 = 21 is odd, print Odd.", "sample_input": "3 4\n"}, "reference_outputs": ["Even\n"], "source_document_id": "p03455", "source_text": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer the deer found two positive integers, a and b.\nDetermine whether the product of a and b is even or odd.\n\nConstraints\n\n1 ≤ a,b ≤ 10000\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 product is odd, print Odd; if it is even, print Even.\n\nSample Input 1\n\n3 4\n\nSample Output 1\n\nEven\n\nAs 3 × 4 = 12 is even, print Even.\n\nSample Input 2\n\n1 21\n\nSample Output 2\n\nOdd\n\nAs 1 × 21 = 21 is odd, print Odd.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s793704529", "group_id": "codeNet:p03455", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\n\tfmt.Scanf(\"%d %d\", &a, &b)\n\n\tswitch a*b%2{\n\tcase 0:\n\t\tfmt.Println(\"Even\")\n\tcase 1:\n\t\tfmt.Println(\"Odd\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1557460926, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03455.html", "problem_id": "p03455", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03455/input.txt", "sample_output_relpath": "derived/input_output/data/p03455/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03455/Go/s793704529.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s793704529", "user_id": "u372177994"}, "prompt_components": {"gold_output": "Even\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a, b int\n\n\tfmt.Scanf(\"%d %d\", &a, &b)\n\n\tswitch a*b%2{\n\tcase 0:\n\t\tfmt.Println(\"Even\")\n\tcase 1:\n\t\tfmt.Println(\"Odd\")\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer the deer found two positive integers, a and b.\nDetermine whether the product of a and b is even or odd.\n\nConstraints\n\n1 ≤ a,b ≤ 10000\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 product is odd, print Odd; if it is even, print Even.\n\nSample Input 1\n\n3 4\n\nSample Output 1\n\nEven\n\nAs 3 × 4 = 12 is even, print Even.\n\nSample Input 2\n\n1 21\n\nSample Output 2\n\nOdd\n\nAs 1 × 21 = 21 is odd, print Odd.", "sample_input": "3 4\n"}, "reference_outputs": ["Even\n"], "source_document_id": "p03455", "source_text": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer the deer found two positive integers, a and b.\nDetermine whether the product of a and b is even or odd.\n\nConstraints\n\n1 ≤ a,b ≤ 10000\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 product is odd, print Odd; if it is even, print Even.\n\nSample Input 1\n\n3 4\n\nSample Output 1\n\nEven\n\nAs 3 × 4 = 12 is even, print Even.\n\nSample Input 2\n\n1 21\n\nSample Output 2\n\nOdd\n\nAs 1 × 21 = 21 is odd, print Odd.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 172, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s585374818", "group_id": "codeNet:p03455", "input_text": "package main\n \nimport (\n \"fmt\"\n)\n \nfunc main() {\n \n var a, b int\n ans := \"Odd\"\n \n fmt.Scan(&a, &b)\n \n if (a * b) % 2 == 0 {\n ans = \"Even\"\n }\n fmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1555883821, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03455.html", "problem_id": "p03455", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03455/input.txt", "sample_output_relpath": "derived/input_output/data/p03455/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03455/Go/s585374818.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s585374818", "user_id": "u140680196"}, "prompt_components": {"gold_output": "Even\n", "input_to_evaluate": "package main\n \nimport (\n \"fmt\"\n)\n \nfunc main() {\n \n var a, b int\n ans := \"Odd\"\n \n fmt.Scan(&a, &b)\n \n if (a * b) % 2 == 0 {\n ans = \"Even\"\n }\n fmt.Println(ans)\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer the deer found two positive integers, a and b.\nDetermine whether the product of a and b is even or odd.\n\nConstraints\n\n1 ≤ a,b ≤ 10000\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 product is odd, print Odd; if it is even, print Even.\n\nSample Input 1\n\n3 4\n\nSample Output 1\n\nEven\n\nAs 3 × 4 = 12 is even, print Even.\n\nSample Input 2\n\n1 21\n\nSample Output 2\n\nOdd\n\nAs 1 × 21 = 21 is odd, print Odd.", "sample_input": "3 4\n"}, "reference_outputs": ["Even\n"], "source_document_id": "p03455", "source_text": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer the deer found two positive integers, a and b.\nDetermine whether the product of a and b is even or odd.\n\nConstraints\n\n1 ≤ a,b ≤ 10000\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 product is odd, print Odd; if it is even, print Even.\n\nSample Input 1\n\n3 4\n\nSample Output 1\n\nEven\n\nAs 3 × 4 = 12 is even, print Even.\n\nSample Input 2\n\n1 21\n\nSample Output 2\n\nOdd\n\nAs 1 × 21 = 21 is odd, print Odd.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s034758221", "group_id": "codeNet:p03455", "input_text": "package main\nimport (\n \"fmt\"\n)\n\n\nfunc main() {\n\nvar a,b int\nfmt.Scan(&a, &b)\n an := a * b\n if an % 2 == 1{\n fmt.Println(\"Odd\")\n } else {\n fmt.Println(\"Even\")\n }\n}", "language": "Go", "metadata": {"date": 1555511812, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03455.html", "problem_id": "p03455", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03455/input.txt", "sample_output_relpath": "derived/input_output/data/p03455/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03455/Go/s034758221.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s034758221", "user_id": "u545203108"}, "prompt_components": {"gold_output": "Even\n", "input_to_evaluate": "package main\nimport (\n \"fmt\"\n)\n\n\nfunc main() {\n\nvar a,b int\nfmt.Scan(&a, &b)\n an := a * b\n if an % 2 == 1{\n fmt.Println(\"Odd\")\n } else {\n fmt.Println(\"Even\")\n }\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer the deer found two positive integers, a and b.\nDetermine whether the product of a and b is even or odd.\n\nConstraints\n\n1 ≤ a,b ≤ 10000\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 product is odd, print Odd; if it is even, print Even.\n\nSample Input 1\n\n3 4\n\nSample Output 1\n\nEven\n\nAs 3 × 4 = 12 is even, print Even.\n\nSample Input 2\n\n1 21\n\nSample Output 2\n\nOdd\n\nAs 1 × 21 = 21 is odd, print Odd.", "sample_input": "3 4\n"}, "reference_outputs": ["Even\n"], "source_document_id": "p03455", "source_text": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer the deer found two positive integers, a and b.\nDetermine whether the product of a and b is even or odd.\n\nConstraints\n\n1 ≤ a,b ≤ 10000\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 product is odd, print Odd; if it is even, print Even.\n\nSample Input 1\n\n3 4\n\nSample Output 1\n\nEven\n\nAs 3 × 4 = 12 is even, print Even.\n\nSample Input 2\n\n1 21\n\nSample Output 2\n\nOdd\n\nAs 1 × 21 = 21 is odd, print Odd.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s640060008", "group_id": "codeNet:p03455", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n a := 0\n b := 0\n fmt.Scan(&a)\n fmt.Scan(&b)\n if a * b % 2 == 0 {\n fmt.Println(\"Even\")\n } else {\n fmt.Println(\"Odd\")\n }\n}\n", "language": "Go", "metadata": {"date": 1555279318, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03455.html", "problem_id": "p03455", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03455/input.txt", "sample_output_relpath": "derived/input_output/data/p03455/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03455/Go/s640060008.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s640060008", "user_id": "u150861392"}, "prompt_components": {"gold_output": "Even\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n a := 0\n b := 0\n fmt.Scan(&a)\n fmt.Scan(&b)\n if a * b % 2 == 0 {\n fmt.Println(\"Even\")\n } else {\n fmt.Println(\"Odd\")\n }\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer the deer found two positive integers, a and b.\nDetermine whether the product of a and b is even or odd.\n\nConstraints\n\n1 ≤ a,b ≤ 10000\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 product is odd, print Odd; if it is even, print Even.\n\nSample Input 1\n\n3 4\n\nSample Output 1\n\nEven\n\nAs 3 × 4 = 12 is even, print Even.\n\nSample Input 2\n\n1 21\n\nSample Output 2\n\nOdd\n\nAs 1 × 21 = 21 is odd, print Odd.", "sample_input": "3 4\n"}, "reference_outputs": ["Even\n"], "source_document_id": "p03455", "source_text": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer the deer found two positive integers, a and b.\nDetermine whether the product of a and b is even or odd.\n\nConstraints\n\n1 ≤ a,b ≤ 10000\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 product is odd, print Odd; if it is even, print Even.\n\nSample Input 1\n\n3 4\n\nSample Output 1\n\nEven\n\nAs 3 × 4 = 12 is even, print Even.\n\nSample Input 2\n\n1 21\n\nSample Output 2\n\nOdd\n\nAs 1 × 21 = 21 is odd, print Odd.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s292631873", "group_id": "codeNet:p03455", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var a, b int\n fmt.Scan(&a, &b)\n if a*b%2 == 0 {\n fmt.Println(\"Even\")\n return\n }\n fmt.Println(\"Odd\")\n}\n", "language": "Go", "metadata": {"date": 1553975102, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03455.html", "problem_id": "p03455", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03455/input.txt", "sample_output_relpath": "derived/input_output/data/p03455/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03455/Go/s292631873.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s292631873", "user_id": "u471449221"}, "prompt_components": {"gold_output": "Even\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var a, b int\n fmt.Scan(&a, &b)\n if a*b%2 == 0 {\n fmt.Println(\"Even\")\n return\n }\n fmt.Println(\"Odd\")\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer the deer found two positive integers, a and b.\nDetermine whether the product of a and b is even or odd.\n\nConstraints\n\n1 ≤ a,b ≤ 10000\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 product is odd, print Odd; if it is even, print Even.\n\nSample Input 1\n\n3 4\n\nSample Output 1\n\nEven\n\nAs 3 × 4 = 12 is even, print Even.\n\nSample Input 2\n\n1 21\n\nSample Output 2\n\nOdd\n\nAs 1 × 21 = 21 is odd, print Odd.", "sample_input": "3 4\n"}, "reference_outputs": ["Even\n"], "source_document_id": "p03455", "source_text": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer the deer found two positive integers, a and b.\nDetermine whether the product of a and b is even or odd.\n\nConstraints\n\n1 ≤ a,b ≤ 10000\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 product is odd, print Odd; if it is even, print Even.\n\nSample Input 1\n\n3 4\n\nSample Output 1\n\nEven\n\nAs 3 × 4 = 12 is even, print Even.\n\nSample Input 2\n\n1 21\n\nSample Output 2\n\nOdd\n\nAs 1 × 21 = 21 is odd, print Odd.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 156, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s425181356", "group_id": "codeNet:p03455", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n/*\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n// readLine can read long line string (at least 10^5)\nfunc readLine() string {\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n// NextLine reads a line text from stdin, and then returns its string.\nfunc NextLine() string {\n\treturn readLine()\n}\n*/\n\nvar sc = bufio.NewScanner(os.Stdin)\n\n// NextLine reads a line text from stdin, and then returns its string.\nfunc NextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// NextIntsLine reads a line text, that consists of **ONLY INTEGERS DELIMITED BY SPACES**, from stdin.\n// And then returns intergers slice.\nfunc NextIntsLine() []int {\n\tints := []int{}\n\tintsStr := NextLine()\n\ttmp := strings.Split(intsStr, \" \")\n\tfor _, s := range tmp {\n\t\tinteger, _ := strconv.Atoi(s)\n\t\tints = append(ints, integer)\n\t}\n\treturn ints\n}\n\n// NextStringsLine reads a line text, that consists of **STRINGS DELIMITED BY SPACES**, from stdin.\n// And then returns strings slice.\nfunc NextStringsLine() []string {\n\tstr := NextLine()\n\treturn strings.Split(str, \" \")\n}\n\n// NextRunesLine reads a line text, that consists of **ONLY CHARACTERS ARRANGED CONTINUOUSLY**, from stdin.\n// Ant then returns runes slice.\nfunc NextRunesLine() []rune {\n\treturn []rune(NextLine())\n}\n\n// Max returns the max integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Max(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m < integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// Min returns the min integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Min(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m > integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// PowInt is integer version of math.Pow\nfunc PowInt(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(errors.New(\"[argument error]: PowInt does not accept negative integers\"))\n\t}\n\tfa := float64(a)\n\tfe := float64(e)\n\tfanswer := math.Pow(fa, fe)\n\treturn int(fanswer)\n}\n\n// AbsInt is integer version of math.Abs\nfunc AbsInt(a int) int {\n\tfa := float64(a)\n\tfanswer := math.Abs(fa)\n\treturn int(fanswer)\n}\n\n// DeleteElement returns a *NEW* slice, that have the same and minimum length and capacity.\n// DeleteElement makes a new slice by using easy slice literal.\nfunc DeleteElement(s []int, i int) []int {\n\tif i < 0 || len(s) <= i {\n\t\tpanic(errors.New(\"[index error]\"))\n\t}\n\t// appendのみの実装\n\tn := make([]int, 0, len(s)-1)\n\tn = append(n, s[:i]...)\n\tn = append(n, s[i+1:]...)\n\treturn n\n}\n\n// Concat returns a *NEW* slice, that have the same and minimum length and capacity.\nfunc Concat(s, t []rune) []rune {\n\tn := make([]rune, 0, len(s)+len(t))\n\tn = append(n, s...)\n\tn = append(n, t...)\n\treturn n\n}\n\n// UpperRune is rune version of `strings.ToUpper()`.\nfunc UpperRune(r rune) rune {\n\tstr := strings.ToUpper(string(r))\n\treturn []rune(str)[0]\n}\n\n// LowerRune is rune version of `strings.ToLower()`.\nfunc LowerRune(r rune) rune {\n\tstr := strings.ToLower(string(r))\n\treturn []rune(str)[0]\n}\n\n// ToggleRune returns a upper case if an input is a lower case, v.v.\nfunc ToggleRune(r rune) rune {\n\tvar str string\n\tif 'a' <= r && r <= 'z' {\n\t\tstr = strings.ToUpper(string(r))\n\t} else if 'A' <= r && r <= 'Z' {\n\t\tstr = strings.ToLower(string(r))\n\t} else {\n\t\tstr = string(r)\n\t}\n\treturn []rune(str)[0]\n}\n\n// ToggleString iteratively calls ToggleRune, and returns the toggled string.\nfunc ToggleString(s string) string {\n\tinputRunes := []rune(s)\n\toutputRunes := make([]rune, 0, len(inputRunes))\n\tfor _, r := range inputRunes {\n\t\toutputRunes = append(outputRunes, ToggleRune(r))\n\t}\n\treturn string(outputRunes)\n}\n\n// Strtoi is a wrapper of `strconv.Atoi()`.\n// If `strconv.Atoi()` returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// sort package (snippets)\n//sort.Sort(sort.IntSlice(s))\n//sort.Sort(sort.Reverse(sort.IntSlice(s)))\n//sort.Sort(sort.Float64Slice(s))\n//sort.Sort(sort.StringSlice(s))\n\n// copy function\n//a = []int{0, 1, 2}\n//b = make([]int, len(a))\n//copy(b, a)\n\n/*******************************************************************/\n\nvar a, b int\n\nfunc main() {\n\ttmp := NextIntsLine()\n\ta, b = tmp[0], tmp[1]\n\tif a*b%2 == 0 {\n\t\tfmt.Println(\"Even\")\n\t} else {\n\t\tfmt.Println(\"Odd\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1544668983, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03455.html", "problem_id": "p03455", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03455/input.txt", "sample_output_relpath": "derived/input_output/data/p03455/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03455/Go/s425181356.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s425181356", "user_id": "u103600314"}, "prompt_components": {"gold_output": "Even\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n/*\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n// readLine can read long line string (at least 10^5)\nfunc readLine() string {\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n// NextLine reads a line text from stdin, and then returns its string.\nfunc NextLine() string {\n\treturn readLine()\n}\n*/\n\nvar sc = bufio.NewScanner(os.Stdin)\n\n// NextLine reads a line text from stdin, and then returns its string.\nfunc NextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// NextIntsLine reads a line text, that consists of **ONLY INTEGERS DELIMITED BY SPACES**, from stdin.\n// And then returns intergers slice.\nfunc NextIntsLine() []int {\n\tints := []int{}\n\tintsStr := NextLine()\n\ttmp := strings.Split(intsStr, \" \")\n\tfor _, s := range tmp {\n\t\tinteger, _ := strconv.Atoi(s)\n\t\tints = append(ints, integer)\n\t}\n\treturn ints\n}\n\n// NextStringsLine reads a line text, that consists of **STRINGS DELIMITED BY SPACES**, from stdin.\n// And then returns strings slice.\nfunc NextStringsLine() []string {\n\tstr := NextLine()\n\treturn strings.Split(str, \" \")\n}\n\n// NextRunesLine reads a line text, that consists of **ONLY CHARACTERS ARRANGED CONTINUOUSLY**, from stdin.\n// Ant then returns runes slice.\nfunc NextRunesLine() []rune {\n\treturn []rune(NextLine())\n}\n\n// Max returns the max integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Max(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m < integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// Min returns the min integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Min(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m > integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// PowInt is integer version of math.Pow\nfunc PowInt(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(errors.New(\"[argument error]: PowInt does not accept negative integers\"))\n\t}\n\tfa := float64(a)\n\tfe := float64(e)\n\tfanswer := math.Pow(fa, fe)\n\treturn int(fanswer)\n}\n\n// AbsInt is integer version of math.Abs\nfunc AbsInt(a int) int {\n\tfa := float64(a)\n\tfanswer := math.Abs(fa)\n\treturn int(fanswer)\n}\n\n// DeleteElement returns a *NEW* slice, that have the same and minimum length and capacity.\n// DeleteElement makes a new slice by using easy slice literal.\nfunc DeleteElement(s []int, i int) []int {\n\tif i < 0 || len(s) <= i {\n\t\tpanic(errors.New(\"[index error]\"))\n\t}\n\t// appendのみの実装\n\tn := make([]int, 0, len(s)-1)\n\tn = append(n, s[:i]...)\n\tn = append(n, s[i+1:]...)\n\treturn n\n}\n\n// Concat returns a *NEW* slice, that have the same and minimum length and capacity.\nfunc Concat(s, t []rune) []rune {\n\tn := make([]rune, 0, len(s)+len(t))\n\tn = append(n, s...)\n\tn = append(n, t...)\n\treturn n\n}\n\n// UpperRune is rune version of `strings.ToUpper()`.\nfunc UpperRune(r rune) rune {\n\tstr := strings.ToUpper(string(r))\n\treturn []rune(str)[0]\n}\n\n// LowerRune is rune version of `strings.ToLower()`.\nfunc LowerRune(r rune) rune {\n\tstr := strings.ToLower(string(r))\n\treturn []rune(str)[0]\n}\n\n// ToggleRune returns a upper case if an input is a lower case, v.v.\nfunc ToggleRune(r rune) rune {\n\tvar str string\n\tif 'a' <= r && r <= 'z' {\n\t\tstr = strings.ToUpper(string(r))\n\t} else if 'A' <= r && r <= 'Z' {\n\t\tstr = strings.ToLower(string(r))\n\t} else {\n\t\tstr = string(r)\n\t}\n\treturn []rune(str)[0]\n}\n\n// ToggleString iteratively calls ToggleRune, and returns the toggled string.\nfunc ToggleString(s string) string {\n\tinputRunes := []rune(s)\n\toutputRunes := make([]rune, 0, len(inputRunes))\n\tfor _, r := range inputRunes {\n\t\toutputRunes = append(outputRunes, ToggleRune(r))\n\t}\n\treturn string(outputRunes)\n}\n\n// Strtoi is a wrapper of `strconv.Atoi()`.\n// If `strconv.Atoi()` returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// sort package (snippets)\n//sort.Sort(sort.IntSlice(s))\n//sort.Sort(sort.Reverse(sort.IntSlice(s)))\n//sort.Sort(sort.Float64Slice(s))\n//sort.Sort(sort.StringSlice(s))\n\n// copy function\n//a = []int{0, 1, 2}\n//b = make([]int, len(a))\n//copy(b, a)\n\n/*******************************************************************/\n\nvar a, b int\n\nfunc main() {\n\ttmp := NextIntsLine()\n\ta, b = tmp[0], tmp[1]\n\tif a*b%2 == 0 {\n\t\tfmt.Println(\"Even\")\n\t} else {\n\t\tfmt.Println(\"Odd\")\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer the deer found two positive integers, a and b.\nDetermine whether the product of a and b is even or odd.\n\nConstraints\n\n1 ≤ a,b ≤ 10000\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 product is odd, print Odd; if it is even, print Even.\n\nSample Input 1\n\n3 4\n\nSample Output 1\n\nEven\n\nAs 3 × 4 = 12 is even, print Even.\n\nSample Input 2\n\n1 21\n\nSample Output 2\n\nOdd\n\nAs 1 × 21 = 21 is odd, print Odd.", "sample_input": "3 4\n"}, "reference_outputs": ["Even\n"], "source_document_id": "p03455", "source_text": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer the deer found two positive integers, a and b.\nDetermine whether the product of a and b is even or odd.\n\nConstraints\n\n1 ≤ a,b ≤ 10000\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 product is odd, print Odd; if it is even, print Even.\n\nSample Input 1\n\n3 4\n\nSample Output 1\n\nEven\n\nAs 3 × 4 = 12 is even, print Even.\n\nSample Input 2\n\n1 21\n\nSample Output 2\n\nOdd\n\nAs 1 × 21 = 21 is odd, print Odd.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4673, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s375871115", "group_id": "codeNet:p03455", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tx := a * b\n\tif x%2 == 0 {\n\t\tfmt.Println(\"Even\")\n\t} else {\n\t\tfmt.Println(\"Odd\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1542089391, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03455.html", "problem_id": "p03455", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03455/input.txt", "sample_output_relpath": "derived/input_output/data/p03455/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03455/Go/s375871115.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s375871115", "user_id": "u767936647"}, "prompt_components": {"gold_output": "Even\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a, b int\n\tfmt.Scan(&a, &b)\n\tx := a * b\n\tif x%2 == 0 {\n\t\tfmt.Println(\"Even\")\n\t} else {\n\t\tfmt.Println(\"Odd\")\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer the deer found two positive integers, a and b.\nDetermine whether the product of a and b is even or odd.\n\nConstraints\n\n1 ≤ a,b ≤ 10000\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 product is odd, print Odd; if it is even, print Even.\n\nSample Input 1\n\n3 4\n\nSample Output 1\n\nEven\n\nAs 3 × 4 = 12 is even, print Even.\n\nSample Input 2\n\n1 21\n\nSample Output 2\n\nOdd\n\nAs 1 × 21 = 21 is odd, print Odd.", "sample_input": "3 4\n"}, "reference_outputs": ["Even\n"], "source_document_id": "p03455", "source_text": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer the deer found two positive integers, a and b.\nDetermine whether the product of a and b is even or odd.\n\nConstraints\n\n1 ≤ a,b ≤ 10000\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 product is odd, print Odd; if it is even, print Even.\n\nSample Input 1\n\n3 4\n\nSample Output 1\n\nEven\n\nAs 3 × 4 = 12 is even, print Even.\n\nSample Input 2\n\n1 21\n\nSample Output 2\n\nOdd\n\nAs 1 × 21 = 21 is odd, print Odd.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s688451507", "group_id": "codeNet:p03455", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\ta := nextInt()\n\tb := nextInt()\n\n\tif (a*b)%2 == 0 {\n\t\tfmt.Println(\"Even\")\n\t} else {\n\t\tfmt.Println(\"Odd\")\n\t}\n}\n\n// 以下がテンプレート\n\nvar nextReader func() string\n\nfunc init() {\n\tnextReader = NewScanner()\n}\n\nfunc NewScanner() func() string {\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\treturn func() string {\n\t\tr.Scan()\n\t\treturn r.Text()\n\t}\n}\nfunc nextString() string {\n\treturn nextReader()\n}\nfunc nextInt64() int64 {\n\tv, _ := strconv.ParseInt(nextReader(), 10, 64)\n\treturn v\n}\nfunc nextInt() int {\n\tv, _ := strconv.Atoi(nextReader())\n\treturn v\n}\nfunc nextInts(n int) []int {\n\tr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt()\n\t}\n\treturn r\n}\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(nextReader(), 64)\n\treturn f\n}", "language": "Go", "metadata": {"date": 1540934662, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03455.html", "problem_id": "p03455", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03455/input.txt", "sample_output_relpath": "derived/input_output/data/p03455/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03455/Go/s688451507.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s688451507", "user_id": "u331811000"}, "prompt_components": {"gold_output": "Even\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\ta := nextInt()\n\tb := nextInt()\n\n\tif (a*b)%2 == 0 {\n\t\tfmt.Println(\"Even\")\n\t} else {\n\t\tfmt.Println(\"Odd\")\n\t}\n}\n\n// 以下がテンプレート\n\nvar nextReader func() string\n\nfunc init() {\n\tnextReader = NewScanner()\n}\n\nfunc NewScanner() func() string {\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\treturn func() string {\n\t\tr.Scan()\n\t\treturn r.Text()\n\t}\n}\nfunc nextString() string {\n\treturn nextReader()\n}\nfunc nextInt64() int64 {\n\tv, _ := strconv.ParseInt(nextReader(), 10, 64)\n\treturn v\n}\nfunc nextInt() int {\n\tv, _ := strconv.Atoi(nextReader())\n\treturn v\n}\nfunc nextInts(n int) []int {\n\tr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt()\n\t}\n\treturn r\n}\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(nextReader(), 64)\n\treturn f\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer the deer found two positive integers, a and b.\nDetermine whether the product of a and b is even or odd.\n\nConstraints\n\n1 ≤ a,b ≤ 10000\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 product is odd, print Odd; if it is even, print Even.\n\nSample Input 1\n\n3 4\n\nSample Output 1\n\nEven\n\nAs 3 × 4 = 12 is even, print Even.\n\nSample Input 2\n\n1 21\n\nSample Output 2\n\nOdd\n\nAs 1 × 21 = 21 is odd, print Odd.", "sample_input": "3 4\n"}, "reference_outputs": ["Even\n"], "source_document_id": "p03455", "source_text": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer the deer found two positive integers, a and b.\nDetermine whether the product of a and b is even or odd.\n\nConstraints\n\n1 ≤ a,b ≤ 10000\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 product is odd, print Odd; if it is even, print Even.\n\nSample Input 1\n\n3 4\n\nSample Output 1\n\nEven\n\nAs 3 × 4 = 12 is even, print Even.\n\nSample Input 2\n\n1 21\n\nSample Output 2\n\nOdd\n\nAs 1 × 21 = 21 is odd, print Odd.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 883, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s572238829", "group_id": "codeNet:p03455", "input_text": "package main\n\nimport (\n\t\"os\"\n\t\"bufio\"\n)\n\nfunc main() {\n\n\tr := bufio.NewReader(os.Stdin)\n\ta, _ := r.ReadByte()\n\tb, _ := r.ReadByte()\n\n\tif a * b % 2 == 0 {\n\t\tprintln(\"Even\")\n\t} else{\n\t\tprintln(\"Odd\")\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1518130293, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03455.html", "problem_id": "p03455", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03455/input.txt", "sample_output_relpath": "derived/input_output/data/p03455/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03455/Go/s572238829.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s572238829", "user_id": "u899855470"}, "prompt_components": {"gold_output": "Even\n", "input_to_evaluate": "package main\n\nimport (\n\t\"os\"\n\t\"bufio\"\n)\n\nfunc main() {\n\n\tr := bufio.NewReader(os.Stdin)\n\ta, _ := r.ReadByte()\n\tb, _ := r.ReadByte()\n\n\tif a * b % 2 == 0 {\n\t\tprintln(\"Even\")\n\t} else{\n\t\tprintln(\"Odd\")\n\t}\n\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer the deer found two positive integers, a and b.\nDetermine whether the product of a and b is even or odd.\n\nConstraints\n\n1 ≤ a,b ≤ 10000\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 product is odd, print Odd; if it is even, print Even.\n\nSample Input 1\n\n3 4\n\nSample Output 1\n\nEven\n\nAs 3 × 4 = 12 is even, print Even.\n\nSample Input 2\n\n1 21\n\nSample Output 2\n\nOdd\n\nAs 1 × 21 = 21 is odd, print Odd.", "sample_input": "3 4\n"}, "reference_outputs": ["Even\n"], "source_document_id": "p03455", "source_text": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer the deer found two positive integers, a and b.\nDetermine whether the product of a and b is even or odd.\n\nConstraints\n\n1 ≤ a,b ≤ 10000\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 product is odd, print Odd; if it is even, print Even.\n\nSample Input 1\n\n3 4\n\nSample Output 1\n\nEven\n\nAs 3 × 4 = 12 is even, print Even.\n\nSample Input 2\n\n1 21\n\nSample Output 2\n\nOdd\n\nAs 1 × 21 = 21 is odd, print Odd.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s479702232", "group_id": "codeNet:p03455", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tstdin := bufio.NewReader(os.Stdin)\n\n\tnum1str, err := stdin.ReadString([]byte(\" \")[0])\n\tnum1, err := strconv.Atoi(num1str)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tnum2str, err := stdin.ReadString([]byte(\" \")[0])\n\tnum2, err := strconv.Atoi(num2str)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tif ((num1 % 2) * (num2 % 2)) == 1 {\n\t\tfmt.Println(\"Odd\")\n\t} else {\n\t\tfmt.Println(\"Even\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1517055910, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03455.html", "problem_id": "p03455", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03455/input.txt", "sample_output_relpath": "derived/input_output/data/p03455/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03455/Go/s479702232.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s479702232", "user_id": "u816631826"}, "prompt_components": {"gold_output": "Even\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tstdin := bufio.NewReader(os.Stdin)\n\n\tnum1str, err := stdin.ReadString([]byte(\" \")[0])\n\tnum1, err := strconv.Atoi(num1str)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tnum2str, err := stdin.ReadString([]byte(\" \")[0])\n\tnum2, err := strconv.Atoi(num2str)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tif ((num1 % 2) * (num2 % 2)) == 1 {\n\t\tfmt.Println(\"Odd\")\n\t} else {\n\t\tfmt.Println(\"Even\")\n\t}\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer the deer found two positive integers, a and b.\nDetermine whether the product of a and b is even or odd.\n\nConstraints\n\n1 ≤ a,b ≤ 10000\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 product is odd, print Odd; if it is even, print Even.\n\nSample Input 1\n\n3 4\n\nSample Output 1\n\nEven\n\nAs 3 × 4 = 12 is even, print Even.\n\nSample Input 2\n\n1 21\n\nSample Output 2\n\nOdd\n\nAs 1 × 21 = 21 is odd, print Odd.", "sample_input": "3 4\n"}, "reference_outputs": ["Even\n"], "source_document_id": "p03455", "source_text": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer the deer found two positive integers, a and b.\nDetermine whether the product of a and b is even or odd.\n\nConstraints\n\n1 ≤ a,b ≤ 10000\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 product is odd, print Odd; if it is even, print Even.\n\nSample Input 1\n\n3 4\n\nSample Output 1\n\nEven\n\nAs 3 × 4 = 12 is even, print Even.\n\nSample Input 2\n\n1 21\n\nSample Output 2\n\nOdd\n\nAs 1 × 21 = 21 is odd, print Odd.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 443, "cpu_time_ms": 3, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s208557032", "group_id": "codeNet:p03455", "input_text": "package main\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var a, b int\n fmt.Scanf(\"%d %d\", &a, &b)\n\n if (a*b) % 2 == 0 {\n fmt.Print(\"Even\")\n } else{\n fmt.Print(\"Odd\")\n }\n\n\n}", "language": "Go", "metadata": {"date": 1516688432, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03455.html", "problem_id": "p03455", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03455/input.txt", "sample_output_relpath": "derived/input_output/data/p03455/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03455/Go/s208557032.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s208557032", "user_id": "u232197316"}, "prompt_components": {"gold_output": "Even\n", "input_to_evaluate": "package main\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var a, b int\n fmt.Scanf(\"%d %d\", &a, &b)\n\n if (a*b) % 2 == 0 {\n fmt.Print(\"Even\")\n } else{\n fmt.Print(\"Odd\")\n }\n\n\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer the deer found two positive integers, a and b.\nDetermine whether the product of a and b is even or odd.\n\nConstraints\n\n1 ≤ a,b ≤ 10000\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 product is odd, print Odd; if it is even, print Even.\n\nSample Input 1\n\n3 4\n\nSample Output 1\n\nEven\n\nAs 3 × 4 = 12 is even, print Even.\n\nSample Input 2\n\n1 21\n\nSample Output 2\n\nOdd\n\nAs 1 × 21 = 21 is odd, print Odd.", "sample_input": "3 4\n"}, "reference_outputs": ["Even\n"], "source_document_id": "p03455", "source_text": "Score : 100 points\n\nProblem Statement\n\nAtCoDeer the deer found two positive integers, a and b.\nDetermine whether the product of a and b is even or odd.\n\nConstraints\n\n1 ≤ a,b ≤ 10000\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 product is odd, print Odd; if it is even, print Even.\n\nSample Input 1\n\n3 4\n\nSample Output 1\n\nEven\n\nAs 3 × 4 = 12 is even, print Even.\n\nSample Input 2\n\n1 21\n\nSample Output 2\n\nOdd\n\nAs 1 × 21 = 21 is odd, print Odd.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s436207122", "group_id": "codeNet:p03471", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ta, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\treturn a\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tN := scanInt()\n\tY := scanInt()\n\n\tfor a := 0; a <= N; a++ {\n\t\tfor b := 0; b+a <= N; b++ {\n\t\t\ttotal := 10000*a + 5000*b + 1000*(N-a-b)\n\t\t\tif total == Y {\n\t\t\t\tfmt.Println(a, b, N-a-b)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(-1, -1, -1)\n}\n", "language": "Go", "metadata": {"date": 1596080825, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03471.html", "problem_id": "p03471", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03471/input.txt", "sample_output_relpath": "derived/input_output/data/p03471/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03471/Go/s436207122.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s436207122", "user_id": "u610093958"}, "prompt_components": {"gold_output": "4 0 5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanInt() int {\n\tsc.Scan()\n\ta, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\treturn a\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tN := scanInt()\n\tY := scanInt()\n\n\tfor a := 0; a <= N; a++ {\n\t\tfor b := 0; b+a <= N; b++ {\n\t\t\ttotal := 10000*a + 5000*b + 1000*(N-a-b)\n\t\t\tif total == Y {\n\t\t\t\tfmt.Println(a, b, N-a-b)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(-1, -1, -1)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "sample_input": "9 45000\n"}, "reference_outputs": ["4 0 5\n"], "source_document_id": "p03471", "source_text": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 489, "cpu_time_ms": 10, "memory_kb": 1772}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s695028098", "group_id": "codeNet:p03471", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, y int\n\n\tfmt.Scan(&n, &y)\n\tfor i := 0; i <= n; i++ {\n\t\tfor j := 0; j <= (n - i); j++ {\n\t\t\tk := n - i - j\n\t\t\tif i*10000+j*5000+k*1000 == y {\n\t\t\t\tfmt.Println(i, j, k)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(-1, -1, -1)\n}\n", "language": "Go", "metadata": {"date": 1593540402, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03471.html", "problem_id": "p03471", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03471/input.txt", "sample_output_relpath": "derived/input_output/data/p03471/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03471/Go/s695028098.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s695028098", "user_id": "u770009793"}, "prompt_components": {"gold_output": "4 0 5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, y int\n\n\tfmt.Scan(&n, &y)\n\tfor i := 0; i <= n; i++ {\n\t\tfor j := 0; j <= (n - i); j++ {\n\t\t\tk := n - i - j\n\t\t\tif i*10000+j*5000+k*1000 == y {\n\t\t\t\tfmt.Println(i, j, k)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(-1, -1, -1)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "sample_input": "9 45000\n"}, "reference_outputs": ["4 0 5\n"], "source_document_id": "p03471", "source_text": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 9, "memory_kb": 1768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s196280796", "group_id": "codeNet:p03471", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, y int\n\tfmt.Scan(&n, &y)\n\tfmt.Println(calcMoney(n, y))\n}\n\nfunc calcMoney(n int, yen int) (str string) {\n\tfor x := 0; x <= n; x++ {\n\t\tfor y := 0; y <= n-x; y++ {\n\t\t\tz := n - x - y\n\t\t\tif 0 <= z {\n\t\t\t\tif yen == 10000*x+5000*y+1000*z {\n\t\t\t\t\treturn fmt.Sprintf(\"%d %d %d\", x, y, z)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn \"-1 -1 -1\"\n}", "language": "Go", "metadata": {"date": 1592040230, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03471.html", "problem_id": "p03471", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03471/input.txt", "sample_output_relpath": "derived/input_output/data/p03471/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03471/Go/s196280796.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s196280796", "user_id": "u631995956"}, "prompt_components": {"gold_output": "4 0 5\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, y int\n\tfmt.Scan(&n, &y)\n\tfmt.Println(calcMoney(n, y))\n}\n\nfunc calcMoney(n int, yen int) (str string) {\n\tfor x := 0; x <= n; x++ {\n\t\tfor y := 0; y <= n-x; y++ {\n\t\t\tz := n - x - y\n\t\t\tif 0 <= z {\n\t\t\t\tif yen == 10000*x+5000*y+1000*z {\n\t\t\t\t\treturn fmt.Sprintf(\"%d %d %d\", x, y, z)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn \"-1 -1 -1\"\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "sample_input": "9 45000\n"}, "reference_outputs": ["4 0 5\n"], "source_document_id": "p03471", "source_text": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 5, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s155793509", "group_id": "codeNet:p03471", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nvar (\n\treader io.Reader = os.Stdin\n\twriter io.Writer = os.Stdout\n)\n\nfunc main() {\n\trun()\n}\n\nfunc run() {\n\tvar N, Y int\n\tfmt.Fscan(reader, &N, &Y)\n\n\tfor i := N; i >= 0; i-- {\n\t\tfor j := N - i; j >= 0; j-- {\n\t\t\ttotal := 10000*i + 5000*j + 1000*(N-i-j)\n\n\t\t\tif total == Y {\n\t\t\t\tfmt.Fprintln(writer, i, j, (N - i - j))\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Fprintln(writer, -1, -1, -1)\n\n}\n", "language": "Go", "metadata": {"date": 1589930071, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03471.html", "problem_id": "p03471", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03471/input.txt", "sample_output_relpath": "derived/input_output/data/p03471/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03471/Go/s155793509.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s155793509", "user_id": "u177410652"}, "prompt_components": {"gold_output": "4 0 5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nvar (\n\treader io.Reader = os.Stdin\n\twriter io.Writer = os.Stdout\n)\n\nfunc main() {\n\trun()\n}\n\nfunc run() {\n\tvar N, Y int\n\tfmt.Fscan(reader, &N, &Y)\n\n\tfor i := N; i >= 0; i-- {\n\t\tfor j := N - i; j >= 0; j-- {\n\t\t\ttotal := 10000*i + 5000*j + 1000*(N-i-j)\n\n\t\t\tif total == Y {\n\t\t\t\tfmt.Fprintln(writer, i, j, (N - i - j))\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Fprintln(writer, -1, -1, -1)\n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "sample_input": "9 45000\n"}, "reference_outputs": ["4 0 5\n"], "source_document_id": "p03471", "source_text": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 420, "cpu_time_ms": 4, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s749915846", "group_id": "codeNet:p03471", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nvar (\n\treader io.Reader = os.Stdin\n\twriter io.Writer = os.Stdout\n)\n\nfunc main() {\n\trun()\n}\n\nfunc run() {\n\tvar N, Y int\n\tfmt.Fscan(reader, &N, &Y)\n\n\tfor i := N; i >= 0; i-- {\n\t\tfor j := N - i; j >= 0; j-- {\n\t\t\ttotal := 10000*i + 5000*j + 1000*(N-i-j)\n\n\t\t\t// if total <= Y {\n\t\t\tif total == Y {\n\t\t\t\tfmt.Fprintln(writer, i, j, (N - i - j))\n\t\t\t\t// } else {\n\t\t\t\t// \tfmt.Fprintln(writer, -1, -1, -1)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// }\n\t\t}\n\t}\n\n\tfmt.Fprintln(writer, -1, -1, -1)\n\n}\n", "language": "Go", "metadata": {"date": 1589889997, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03471.html", "problem_id": "p03471", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03471/input.txt", "sample_output_relpath": "derived/input_output/data/p03471/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03471/Go/s749915846.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s749915846", "user_id": "u177410652"}, "prompt_components": {"gold_output": "4 0 5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nvar (\n\treader io.Reader = os.Stdin\n\twriter io.Writer = os.Stdout\n)\n\nfunc main() {\n\trun()\n}\n\nfunc run() {\n\tvar N, Y int\n\tfmt.Fscan(reader, &N, &Y)\n\n\tfor i := N; i >= 0; i-- {\n\t\tfor j := N - i; j >= 0; j-- {\n\t\t\ttotal := 10000*i + 5000*j + 1000*(N-i-j)\n\n\t\t\t// if total <= Y {\n\t\t\tif total == Y {\n\t\t\t\tfmt.Fprintln(writer, i, j, (N - i - j))\n\t\t\t\t// } else {\n\t\t\t\t// \tfmt.Fprintln(writer, -1, -1, -1)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// }\n\t\t}\n\t}\n\n\tfmt.Fprintln(writer, -1, -1, -1)\n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "sample_input": "9 45000\n"}, "reference_outputs": ["4 0 5\n"], "source_document_id": "p03471", "source_text": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s889809198", "group_id": "codeNet:p03471", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N, sum int\n\tfmt.Scan(&N, &sum)\n\tresult := [3]int{-1, -1, -1}\n\nBREAK_LABEL:\n\tfor i := 0; i < N; i++ {\n\t\tfor j := 0; j < N-i; j++ {\n\t\t\tif sum == 10000*i+5000*j+1000*(N-i-j) {\n\t\t\t\tresult[0] = i\n\t\t\t\tresult[1] = j\n\t\t\t\tresult[2] = N - i - j\n\t\t\t\tbreak BREAK_LABEL\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Printf(\"%d %d %d\", result[0], result[1], result[2])\n}\n", "language": "Go", "metadata": {"date": 1588659523, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03471.html", "problem_id": "p03471", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03471/input.txt", "sample_output_relpath": "derived/input_output/data/p03471/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03471/Go/s889809198.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s889809198", "user_id": "u292220197"}, "prompt_components": {"gold_output": "4 0 5\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N, sum int\n\tfmt.Scan(&N, &sum)\n\tresult := [3]int{-1, -1, -1}\n\nBREAK_LABEL:\n\tfor i := 0; i < N; i++ {\n\t\tfor j := 0; j < N-i; j++ {\n\t\t\tif sum == 10000*i+5000*j+1000*(N-i-j) {\n\t\t\t\tresult[0] = i\n\t\t\t\tresult[1] = j\n\t\t\t\tresult[2] = N - i - j\n\t\t\t\tbreak BREAK_LABEL\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Printf(\"%d %d %d\", result[0], result[1], result[2])\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "sample_input": "9 45000\n"}, "reference_outputs": ["4 0 5\n"], "source_document_id": "p03471", "source_text": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s099219071", "group_id": "codeNet:p03471", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, y int\n\tfmt.Scan(&n, &y)\n\n\tvar ans = []int{-1, -1, -1}\n\tfor i := 0; i <= n; i++ {\n\t\tfor j := 0; j <= n-i; j++ {\n\t\t\tk := n - i - j\n\t\t\tif i*10000+j*5000+k*1000 == y {\n\t\t\t\tans[0] = i\n\t\t\t\tans[1] = j\n\t\t\t\tans[2] = k\n\t\t\t}\n\t\t}\n\t}\n\tfor _, v := range ans {\n\t\tfmt.Printf(\"%v \", v)\n\t}\n\tfmt.Println()\n}\n", "language": "Go", "metadata": {"date": 1588464086, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03471.html", "problem_id": "p03471", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03471/input.txt", "sample_output_relpath": "derived/input_output/data/p03471/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03471/Go/s099219071.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s099219071", "user_id": "u620351704"}, "prompt_components": {"gold_output": "4 0 5\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, y int\n\tfmt.Scan(&n, &y)\n\n\tvar ans = []int{-1, -1, -1}\n\tfor i := 0; i <= n; i++ {\n\t\tfor j := 0; j <= n-i; j++ {\n\t\t\tk := n - i - j\n\t\t\tif i*10000+j*5000+k*1000 == y {\n\t\t\t\tans[0] = i\n\t\t\t\tans[1] = j\n\t\t\t\tans[2] = k\n\t\t\t}\n\t\t}\n\t}\n\tfor _, v := range ans {\n\t\tfmt.Printf(\"%v \", v)\n\t}\n\tfmt.Println()\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "sample_input": "9 45000\n"}, "reference_outputs": ["4 0 5\n"], "source_document_id": "p03471", "source_text": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 5, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s423749141", "group_id": "codeNet:p03471", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, y int\n\tfmt.Scan(&n, &y)\n\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif n < i+j {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif y == (10000*i + 5000*j + 1000*(n-(i+j))) {\n\t\t\t\tfmt.Printf(\"%d %d %d\\n\", i, j, n-(i+j))\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"-1 -1 -1\")\n}\n", "language": "Go", "metadata": {"date": 1584936000, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03471.html", "problem_id": "p03471", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03471/input.txt", "sample_output_relpath": "derived/input_output/data/p03471/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03471/Go/s423749141.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s423749141", "user_id": "u753867091"}, "prompt_components": {"gold_output": "4 0 5\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, y int\n\tfmt.Scan(&n, &y)\n\n\tfor i := 0; i < n; i++ {\n\t\tfor j := 0; j < n; j++ {\n\t\t\tif n < i+j {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif y == (10000*i + 5000*j + 1000*(n-(i+j))) {\n\t\t\t\tfmt.Printf(\"%d %d %d\\n\", i, j, n-(i+j))\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(\"-1 -1 -1\")\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "sample_input": "9 45000\n"}, "reference_outputs": ["4 0 5\n"], "source_document_id": "p03471", "source_text": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 306, "cpu_time_ms": 6, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s717258727", "group_id": "codeNet:p03471", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\ntype Pair struct {\n\tp1, p2 interface{}\n}\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n)\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tscanner.Buffer(buf, maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\n\tN, Y := readInt(), readInt()\n\n\t// x , y , z\n\t// x + y + z = N\n\t// 10000x + 5000y + 1000z = Y\n\t// 3元連立一次方程式\n\n\thit := false\n\tfor x := 0; x <= N; x++ {\n\t\tfor y := 0; y <= N; y++ {\n\t\t\tfor z := 0; z <= N; z++ {\n\t\t\t\tif x+y+z > N {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tans := 10000*x + 5000*y + 1000*z\n\t\t\t\tif ans == Y {\n\t\t\t\t\tfmt.Println(x, y, z)\n\t\t\t\t\thit = true\n\t\t\t\t\tgoto end\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\nend:\n\tif !hit {\n\t\tfmt.Println(-1, -1, -1)\n\t}\n}\n\n/*==========================================\n * Library\n *==========================================*/\nfunc write(s string) {\n\twriter.WriteString(s)\n}\n\nfunc print() {\n\twriter.Flush()\n}\n\n// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可\nfunc readLine() (s string) {\n\tif scanner.Scan() {\n\t\ts = scanner.Text()\n\t}\n\treturn s\n}\n\nfunc readInt() (read int) {\n\tscanner.Scan()\n\tread, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readFloat() (read float64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readRunes() (read []rune) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, v)\n\t}\n\treturn\n}\n\nfunc readString() (read string) {\n\tscanner.Scan()\n\tread = scanner.Text()\n\treturn\n}\n\nfunc readStrings() (read []string) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, string(v))\n\t}\n\treturn\n}\n\nfunc s2i(s string) int {\n\tvar intVal, e = strconv.Atoi(s)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int) string {\n\tvar strVal = strconv.Itoa(i)\n\treturn strVal\n}\n\nfunc s2f(s string) float64 {\n\tvar floatVal, e = strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn floatVal\n}\n\nfunc sum(i []int) int {\n\tsum := 0\n\tfor _, val := range i {\n\t\tsum += val\n\t}\n\treturn sum\n}\n\nfunc split(s string) []string {\n\treturn strings.Fields(s)\n}\n\nfunc strAry2intAry(strs []string) []int {\n\tvar ret = make([]int, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal, e = strconv.Atoi(string(str))\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = strconv.Itoa(num)\n\t\tret = append(ret, strVal)\n\t}\n\treturn ret\n}\n\nfunc ary2str(strs []string) string {\n\treturn strings.Join(strs, \" \")\n}\n\nfunc reverse(res []int) []int {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\n\nfunc initalize(res []int, init int) {\n\tif len(res) == 0 {\n\t\treturn\n\t}\n\tres[0] = init\n\tfor i := 0; i < len(res); i++ {\n\t\tcopy(res[i:], res[:i])\n\t}\n}\n\n//\n// func regexpExample() {\n// // Your code here!\n// var str = \"13:20\"\n// r := regexp.MustCompile(`(\\d+):(\\d+)`)\n// fmt.Println(r.FindStringSubmatch(str))\n// }\n\n// type Country struct {\n// gold int\n// silver int\n// blonze int\n// }\n\n// // 複数ソートのサンプル\n// func stableSortExample() []Country{\n// var country = []Country {\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:3, blonze:2},\n// {gold:1, silver:3, blonze:3},\n// }\n// sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })\n// return country\n// }\n", "language": "Go", "metadata": {"date": 1581026040, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03471.html", "problem_id": "p03471", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03471/input.txt", "sample_output_relpath": "derived/input_output/data/p03471/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03471/Go/s717258727.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s717258727", "user_id": "u967669872"}, "prompt_components": {"gold_output": "4 0 5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\ntype Pair struct {\n\tp1, p2 interface{}\n}\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n)\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tscanner.Buffer(buf, maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\n\tN, Y := readInt(), readInt()\n\n\t// x , y , z\n\t// x + y + z = N\n\t// 10000x + 5000y + 1000z = Y\n\t// 3元連立一次方程式\n\n\thit := false\n\tfor x := 0; x <= N; x++ {\n\t\tfor y := 0; y <= N; y++ {\n\t\t\tfor z := 0; z <= N; z++ {\n\t\t\t\tif x+y+z > N {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tans := 10000*x + 5000*y + 1000*z\n\t\t\t\tif ans == Y {\n\t\t\t\t\tfmt.Println(x, y, z)\n\t\t\t\t\thit = true\n\t\t\t\t\tgoto end\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\nend:\n\tif !hit {\n\t\tfmt.Println(-1, -1, -1)\n\t}\n}\n\n/*==========================================\n * Library\n *==========================================*/\nfunc write(s string) {\n\twriter.WriteString(s)\n}\n\nfunc print() {\n\twriter.Flush()\n}\n\n// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可\nfunc readLine() (s string) {\n\tif scanner.Scan() {\n\t\ts = scanner.Text()\n\t}\n\treturn s\n}\n\nfunc readInt() (read int) {\n\tscanner.Scan()\n\tread, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readFloat() (read float64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readRunes() (read []rune) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, v)\n\t}\n\treturn\n}\n\nfunc readString() (read string) {\n\tscanner.Scan()\n\tread = scanner.Text()\n\treturn\n}\n\nfunc readStrings() (read []string) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, string(v))\n\t}\n\treturn\n}\n\nfunc s2i(s string) int {\n\tvar intVal, e = strconv.Atoi(s)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int) string {\n\tvar strVal = strconv.Itoa(i)\n\treturn strVal\n}\n\nfunc s2f(s string) float64 {\n\tvar floatVal, e = strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn floatVal\n}\n\nfunc sum(i []int) int {\n\tsum := 0\n\tfor _, val := range i {\n\t\tsum += val\n\t}\n\treturn sum\n}\n\nfunc split(s string) []string {\n\treturn strings.Fields(s)\n}\n\nfunc strAry2intAry(strs []string) []int {\n\tvar ret = make([]int, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal, e = strconv.Atoi(string(str))\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = strconv.Itoa(num)\n\t\tret = append(ret, strVal)\n\t}\n\treturn ret\n}\n\nfunc ary2str(strs []string) string {\n\treturn strings.Join(strs, \" \")\n}\n\nfunc reverse(res []int) []int {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\n\nfunc initalize(res []int, init int) {\n\tif len(res) == 0 {\n\t\treturn\n\t}\n\tres[0] = init\n\tfor i := 0; i < len(res); i++ {\n\t\tcopy(res[i:], res[:i])\n\t}\n}\n\n//\n// func regexpExample() {\n// // Your code here!\n// var str = \"13:20\"\n// r := regexp.MustCompile(`(\\d+):(\\d+)`)\n// fmt.Println(r.FindStringSubmatch(str))\n// }\n\n// type Country struct {\n// gold int\n// silver int\n// blonze int\n// }\n\n// // 複数ソートのサンプル\n// func stableSortExample() []Country{\n// var country = []Country {\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:3, blonze:2},\n// {gold:1, silver:3, blonze:3},\n// }\n// sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })\n// return country\n// }\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "sample_input": "9 45000\n"}, "reference_outputs": ["4 0 5\n"], "source_document_id": "p03471", "source_text": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3914, "cpu_time_ms": 2107, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s301588232", "group_id": "codeNet:p03471", "input_text": "package main\n\nimport (\n \"fmt\"\n \"os\"\n)\n\nfunc main() {\n\n var N, Y int\n fmt.Fscanf(os.Stdin, \"%d %d\", &N, &Y)\n\n for a := 0; a <= N; a++ {\n for b := 0; b <= N; b++ {\n if a+b > N {\n break\n }\n remain := Y - a*10000 - b*5000\n if remain < 0 {\n break\n }\n c := remain / 1000\n if a+b+c > N {\n break\n }\n fmt.Printf(\"%d %d %d\\n\", a, b, c)\n return\n }\n }\n fmt.Printf(\"-1 -1 -1\\n\")\n}", "language": "Go", "metadata": {"date": 1579647791, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03471.html", "problem_id": "p03471", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03471/input.txt", "sample_output_relpath": "derived/input_output/data/p03471/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03471/Go/s301588232.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s301588232", "user_id": "u004477916"}, "prompt_components": {"gold_output": "4 0 5\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"os\"\n)\n\nfunc main() {\n\n var N, Y int\n fmt.Fscanf(os.Stdin, \"%d %d\", &N, &Y)\n\n for a := 0; a <= N; a++ {\n for b := 0; b <= N; b++ {\n if a+b > N {\n break\n }\n remain := Y - a*10000 - b*5000\n if remain < 0 {\n break\n }\n c := remain / 1000\n if a+b+c > N {\n break\n }\n fmt.Printf(\"%d %d %d\\n\", a, b, c)\n return\n }\n }\n fmt.Printf(\"-1 -1 -1\\n\")\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "sample_input": "9 45000\n"}, "reference_outputs": ["4 0 5\n"], "source_document_id": "p03471", "source_text": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 557, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s765735055", "group_id": "codeNet:p03471", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar (\n\t\tn int\n\t\ty int\n\t\tresult string = \"-1 -1 -1\"\n\t)\n\n\tfmt.Scan(&n, &y)\n\n\tfor i := 0; i < n+1; i++ {\n\t\tfor j := 0; j < n+1-i; j++ {\n\t\t\tfor k := 0; k < n+1-i-j; k++ {\n\t\t\t\tif n != i+j+k {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tif y == 10000*i+5000*j+1000*k {\n\t\t\t\t\tresult = strconv.Itoa(i) + \" \" + strconv.Itoa(j) + \" \" + strconv.Itoa(k)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(result)\n}\n", "language": "Go", "metadata": {"date": 1572446078, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03471.html", "problem_id": "p03471", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03471/input.txt", "sample_output_relpath": "derived/input_output/data/p03471/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03471/Go/s765735055.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s765735055", "user_id": "u468065539"}, "prompt_components": {"gold_output": "4 0 5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar (\n\t\tn int\n\t\ty int\n\t\tresult string = \"-1 -1 -1\"\n\t)\n\n\tfmt.Scan(&n, &y)\n\n\tfor i := 0; i < n+1; i++ {\n\t\tfor j := 0; j < n+1-i; j++ {\n\t\t\tfor k := 0; k < n+1-i-j; k++ {\n\t\t\t\tif n != i+j+k {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tif y == 10000*i+5000*j+1000*k {\n\t\t\t\t\tresult = strconv.Itoa(i) + \" \" + strconv.Itoa(j) + \" \" + strconv.Itoa(k)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(result)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "sample_input": "9 45000\n"}, "reference_outputs": ["4 0 5\n"], "source_document_id": "p03471", "source_text": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 433, "cpu_time_ms": 1348, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s239715392", "group_id": "codeNet:p03471", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, y int\n\tfmt.Scan(&n, &y)\n\n\tfor i := 0; i <= n; i++ {\n\t\tfor j := 0; i+j <= n; j++ {\n\t\t\tif 10000*i+5000*j+1000*(n-i-j) == y {\n\t\t\t\tfmt.Println(i, j, (n - i - j))\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(-1, -1, -1)\n}\n", "language": "Go", "metadata": {"date": 1572026246, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03471.html", "problem_id": "p03471", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03471/input.txt", "sample_output_relpath": "derived/input_output/data/p03471/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03471/Go/s239715392.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s239715392", "user_id": "u616744985"}, "prompt_components": {"gold_output": "4 0 5\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, y int\n\tfmt.Scan(&n, &y)\n\n\tfor i := 0; i <= n; i++ {\n\t\tfor j := 0; i+j <= n; j++ {\n\t\t\tif 10000*i+5000*j+1000*(n-i-j) == y {\n\t\t\t\tfmt.Println(i, j, (n - i - j))\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(-1, -1, -1)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "sample_input": "9 45000\n"}, "reference_outputs": ["4 0 5\n"], "source_document_id": "p03471", "source_text": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 6, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s532474887", "group_id": "codeNet:p03471", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tn, y := getInt(), getInt()\n\n\tans := [3]int{-1, -1, -1}\n\tfor i := 0; i <= n; i++ {\n\t\tfor j := 0; j <= n-i; j++ {\n\t\t\tk := (n - i - j)\n\t\t\tyen10000, yen5000, yen1000 := i*10000, j*5000, k*1000\n\t\t\tcand := yen10000 + yen5000 + yen1000\n\n\t\t\tif y == cand {\n\t\t\t\tans = [3]int{i, j, k}\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(ans[0], ans[1], ans[2])\n}\n\n// -----------------------------------------\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\t// buf := 200001\n\t// sc.Buffer(make([]byte, buf), buf)\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc getInt() int {\n\ti, err := strconv.Atoi(getString())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\ts := sc.Text()\n\treturn s\n}\n", "language": "Go", "metadata": {"date": 1569976798, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03471.html", "problem_id": "p03471", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03471/input.txt", "sample_output_relpath": "derived/input_output/data/p03471/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03471/Go/s532474887.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s532474887", "user_id": "u543933043"}, "prompt_components": {"gold_output": "4 0 5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tn, y := getInt(), getInt()\n\n\tans := [3]int{-1, -1, -1}\n\tfor i := 0; i <= n; i++ {\n\t\tfor j := 0; j <= n-i; j++ {\n\t\t\tk := (n - i - j)\n\t\t\tyen10000, yen5000, yen1000 := i*10000, j*5000, k*1000\n\t\t\tcand := yen10000 + yen5000 + yen1000\n\n\t\t\tif y == cand {\n\t\t\t\tans = [3]int{i, j, k}\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(ans[0], ans[1], ans[2])\n}\n\n// -----------------------------------------\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\t// buf := 200001\n\t// sc.Buffer(make([]byte, buf), buf)\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc getInt() int {\n\ti, err := strconv.Atoi(getString())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\ts := sc.Text()\n\treturn s\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "sample_input": "9 45000\n"}, "reference_outputs": ["4 0 5\n"], "source_document_id": "p03471", "source_text": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 752, "cpu_time_ms": 4, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s780598253", "group_id": "codeNet:p03471", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar stdin = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tarr := scanArrayInt()\n\tn, y := arr[0], arr[1]\n\tret := []int{-1, -1, -1}\n\tfor y10000 := 0; y10000 <= n; y10000++ {\n\t\tfor y5000 := 0; y5000 <= n; y5000++ {\n\t\t\ty1000 := n - y10000 + y5000\n\t\t\tt := y10000*10000 + y5000*5000 + y1000*1000\n\t\t\tif t == y {\n\t\t\t\tret = []int{y10000, y5000, y1000}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ret[0], ret[1], ret[2])\n}\nfunc scanArrayInt() []int {\n\tvar ret = []int{}\n\tstdin.Scan()\n\tfor _, s := range strings.Split(stdin.Text(), \" \") {\n\t\ti, _ := strconv.Atoi(s)\n\t\tret = append(ret, i)\n\t}\n\treturn ret\n}\n", "language": "Go", "metadata": {"date": 1567780931, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03471.html", "problem_id": "p03471", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03471/input.txt", "sample_output_relpath": "derived/input_output/data/p03471/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03471/Go/s780598253.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s780598253", "user_id": "u564244597"}, "prompt_components": {"gold_output": "4 0 5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar stdin = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tarr := scanArrayInt()\n\tn, y := arr[0], arr[1]\n\tret := []int{-1, -1, -1}\n\tfor y10000 := 0; y10000 <= n; y10000++ {\n\t\tfor y5000 := 0; y5000 <= n; y5000++ {\n\t\t\ty1000 := n - y10000 + y5000\n\t\t\tt := y10000*10000 + y5000*5000 + y1000*1000\n\t\t\tif t == y {\n\t\t\t\tret = []int{y10000, y5000, y1000}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ret[0], ret[1], ret[2])\n}\nfunc scanArrayInt() []int {\n\tvar ret = []int{}\n\tstdin.Scan()\n\tfor _, s := range strings.Split(stdin.Text(), \" \") {\n\t\ti, _ := strconv.Atoi(s)\n\t\tret = append(ret, i)\n\t}\n\treturn ret\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "sample_input": "9 45000\n"}, "reference_outputs": ["4 0 5\n"], "source_document_id": "p03471", "source_text": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 642, "cpu_time_ms": 8, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s193347873", "group_id": "codeNet:p03471", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, y int\n\tfmt.Scan(&n, &y)\n\ty /= 1000\n\tfor i := 0; i <= n; i++ {\n\t\tif i*10 > y {\n\t\t\tbreak\n\t\t}\n\t\tfor j := 0; j <= n-i; j++ {\n\t\t\tk := n - i - j\n\t\t\tif i*10+j*5+k == y {\n\t\t\t\tfmt.Println(i, j, k)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(-1, -1, -1)\n}\n", "language": "Go", "metadata": {"date": 1566148492, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03471.html", "problem_id": "p03471", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03471/input.txt", "sample_output_relpath": "derived/input_output/data/p03471/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03471/Go/s193347873.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s193347873", "user_id": "u347640436"}, "prompt_components": {"gold_output": "4 0 5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, y int\n\tfmt.Scan(&n, &y)\n\ty /= 1000\n\tfor i := 0; i <= n; i++ {\n\t\tif i*10 > y {\n\t\t\tbreak\n\t\t}\n\t\tfor j := 0; j <= n-i; j++ {\n\t\t\tk := n - i - j\n\t\t\tif i*10+j*5+k == y {\n\t\t\t\tfmt.Println(i, j, k)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(-1, -1, -1)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "sample_input": "9 45000\n"}, "reference_outputs": ["4 0 5\n"], "source_document_id": "p03471", "source_text": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 293, "cpu_time_ms": 4, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s034027150", "group_id": "codeNet:p03471", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, y int\n\tfmt.Scan(&n, &y)\n\tfor i := 0; i <= n; i++ {\n\t\tfor j := 0; j <= n-i; j++ {\n\t\t\tk := (y - i*10000 + j*5000) / 1000\n\t\t\tif i+j+k == n {\n\t\t\t\tfmt.Println(i, j, k)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(-1, -1, -1)\n}\n", "language": "Go", "metadata": {"date": 1566148083, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03471.html", "problem_id": "p03471", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03471/input.txt", "sample_output_relpath": "derived/input_output/data/p03471/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03471/Go/s034027150.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s034027150", "user_id": "u347640436"}, "prompt_components": {"gold_output": "4 0 5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, y int\n\tfmt.Scan(&n, &y)\n\tfor i := 0; i <= n; i++ {\n\t\tfor j := 0; j <= n-i; j++ {\n\t\t\tk := (y - i*10000 + j*5000) / 1000\n\t\t\tif i+j+k == n {\n\t\t\t\tfmt.Println(i, j, k)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(-1, -1, -1)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "sample_input": "9 45000\n"}, "reference_outputs": ["4 0 5\n"], "source_document_id": "p03471", "source_text": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 8, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s417997715", "group_id": "codeNet:p03471", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\n)\n\nfunc main() {\n\tsolve(os.Stdin, os.Stdout)\n}\n\ntype ReaderEx struct {\n\tbaseScanner *bufio.Scanner\n\twords []string\n\tnextWordIdx func() int\n\tinitWordIdx func()\n}\n\nfunc NewScannerEx(stdin io.Reader) *ReaderEx {\n\tvar this ReaderEx\n\tvar idx int\n\tthis.baseScanner = bufio.NewScanner(stdin)\n\tthis.baseScanner.Buffer(make([]byte, 0), 1E+11)\n\tthis.nextWordIdx = func() int {\n\t\tcur := idx\n\t\tidx++\n\t\treturn cur\n\t}\n\tthis.initWordIdx = func() {\n\t\tidx = 0\n\t}\n\treturn &this\n}\n\nfunc (me *ReaderEx) ScanAndSplit() (isScanned bool) {\n\tisScanned = me.baseScanner.Scan()\n\n\tme.words = strings.Fields(me.baseScanner.Text())\n\tme.initWordIdx()\n\treturn\n}\n\nfunc (me *ReaderEx) Scan() (ok bool) {\n\tok = me.baseScanner.Scan()\n\treturn\n}\nfunc (me *ReaderEx) getString() string {\n\treturn me.baseScanner.Text()\n}\n\nfunc (me *ReaderEx) getInt() int {\n\tn, err := strconv.Atoi(me.baseScanner.Text())\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}()\n\n\treturn n\n}\n\nfunc (me *ReaderEx) nextBytes() []byte {\n\treturn []byte(me.words[me.nextWordIdx()])\n}\nfunc (me *ReaderEx) nextString() string {\n\treturn me.words[me.nextWordIdx()]\n}\n\ntype StringArray []string\n\nfunc (me *ReaderEx) nextStringArray() StringArray {\n\treturn me.words[me.nextWordIdx():]\n}\n\nfunc (me StringArray) toStrings() []string {\n\treturn me\n}\n\nfunc (me StringArray) toInts() []int {\n\tstrValues := me.toStrings()\n\tvalues := make([]int, len(strValues))\n\tfor i, v := range strValues {\n\t\tn, err := strconv.Atoi(v)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tvalues[i] = n\n\t}\n\treturn values\n}\nfunc (me *ReaderEx) nextInt() int {\n\tn, err := strconv.Atoi(me.words[me.nextWordIdx()])\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tpanic(fmt.Sprintf(\"getInt(%d)\", n))\n\t\t}\n\t}()\n\treturn n\n}\n\nfunc pow(x, y, mod int) (ans int) {\n\n\tans = 1\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(y)))); ; bit >>= 1 {\n\t\tif y&bit != 0 {\n\t\t\tans *= x\n\t\t\tif mod > 0 {\n\t\t\t\tans %= mod\n\t\t\t}\n\t\t}\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t\tans *= ans\n\t\tif mod > 0 {\n\t\t\tans %= mod\n\t\t}\n\t}\n}\n\ntype factType struct {\n\tprime int\n\tcount int\n}\n\nfunc fact(n int) (facts []factType) {\n\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tfa := factType{prime: i}\n\t\t\tfor n%fa.prime == 0 {\n\t\t\t\tn /= fa.prime\n\t\t\t\tfa.count++\n\t\t\t}\n\t\t\tfacts = append(facts, fa)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfacts = append(facts, factType{prime: n, count: 1})\n\t}\n\treturn facts\n}\nfunc dec2bin(n int) (ret []bool) {\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(n)))); ; bit >>= 1 {\n\t\tret = append(ret, n&bit != 0)\n\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t}\n\n}\n\nfunc abs(v int) int {\n\tif v < 0 {\n\t\tv = -v\n\t}\n\treturn v\n}\n\nfunc solve(stdin io.Reader, stdout io.Writer) {\n\tr := NewScannerEx(stdin)\n\tr.ScanAndSplit()\n\tn, y := r.nextInt(), r.nextInt()\n\n\tsatu := []int{10000, 5000, 1000}\n\tyBy10000 := y / 10000\n\n\tvar ans = []int{-1, -1, -1}\nloop:\n\tfor i := 0; i < yBy10000; i++ {\n\t\trest := y - i*satu[0]\n\n\t\tyBy5000 := rest / satu[1]\n\t\tfor j := 0; j < yBy5000; j++ {\n\t\t\trest -= j * satu[1]\n\n\t\t\tif rest%satu[2] == 0 {\n\t\t\t\tk := rest / satu[2]\n\n\t\t\t\tif i+j+k == n {\n\t\t\t\t\tans = []int{i, j, k}\n\t\t\t\t\tbreak loop\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Fprintln(stdout, func(x string) string { return x[1 : len(x)-1] }(fmt.Sprint(ans)))\n\n}\n\n", "language": "Go", "metadata": {"date": 1565884421, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03471.html", "problem_id": "p03471", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03471/input.txt", "sample_output_relpath": "derived/input_output/data/p03471/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03471/Go/s417997715.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s417997715", "user_id": "u463655976"}, "prompt_components": {"gold_output": "4 0 5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\n)\n\nfunc main() {\n\tsolve(os.Stdin, os.Stdout)\n}\n\ntype ReaderEx struct {\n\tbaseScanner *bufio.Scanner\n\twords []string\n\tnextWordIdx func() int\n\tinitWordIdx func()\n}\n\nfunc NewScannerEx(stdin io.Reader) *ReaderEx {\n\tvar this ReaderEx\n\tvar idx int\n\tthis.baseScanner = bufio.NewScanner(stdin)\n\tthis.baseScanner.Buffer(make([]byte, 0), 1E+11)\n\tthis.nextWordIdx = func() int {\n\t\tcur := idx\n\t\tidx++\n\t\treturn cur\n\t}\n\tthis.initWordIdx = func() {\n\t\tidx = 0\n\t}\n\treturn &this\n}\n\nfunc (me *ReaderEx) ScanAndSplit() (isScanned bool) {\n\tisScanned = me.baseScanner.Scan()\n\n\tme.words = strings.Fields(me.baseScanner.Text())\n\tme.initWordIdx()\n\treturn\n}\n\nfunc (me *ReaderEx) Scan() (ok bool) {\n\tok = me.baseScanner.Scan()\n\treturn\n}\nfunc (me *ReaderEx) getString() string {\n\treturn me.baseScanner.Text()\n}\n\nfunc (me *ReaderEx) getInt() int {\n\tn, err := strconv.Atoi(me.baseScanner.Text())\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}()\n\n\treturn n\n}\n\nfunc (me *ReaderEx) nextBytes() []byte {\n\treturn []byte(me.words[me.nextWordIdx()])\n}\nfunc (me *ReaderEx) nextString() string {\n\treturn me.words[me.nextWordIdx()]\n}\n\ntype StringArray []string\n\nfunc (me *ReaderEx) nextStringArray() StringArray {\n\treturn me.words[me.nextWordIdx():]\n}\n\nfunc (me StringArray) toStrings() []string {\n\treturn me\n}\n\nfunc (me StringArray) toInts() []int {\n\tstrValues := me.toStrings()\n\tvalues := make([]int, len(strValues))\n\tfor i, v := range strValues {\n\t\tn, err := strconv.Atoi(v)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tvalues[i] = n\n\t}\n\treturn values\n}\nfunc (me *ReaderEx) nextInt() int {\n\tn, err := strconv.Atoi(me.words[me.nextWordIdx()])\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tpanic(fmt.Sprintf(\"getInt(%d)\", n))\n\t\t}\n\t}()\n\treturn n\n}\n\nfunc pow(x, y, mod int) (ans int) {\n\n\tans = 1\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(y)))); ; bit >>= 1 {\n\t\tif y&bit != 0 {\n\t\t\tans *= x\n\t\t\tif mod > 0 {\n\t\t\t\tans %= mod\n\t\t\t}\n\t\t}\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t\tans *= ans\n\t\tif mod > 0 {\n\t\t\tans %= mod\n\t\t}\n\t}\n}\n\ntype factType struct {\n\tprime int\n\tcount int\n}\n\nfunc fact(n int) (facts []factType) {\n\n\tfor i := 2; i*i <= n; i++ {\n\t\tif n%i == 0 {\n\t\t\tfa := factType{prime: i}\n\t\t\tfor n%fa.prime == 0 {\n\t\t\t\tn /= fa.prime\n\t\t\t\tfa.count++\n\t\t\t}\n\t\t\tfacts = append(facts, fa)\n\t\t}\n\t}\n\tif n > 1 {\n\t\tfacts = append(facts, factType{prime: n, count: 1})\n\t}\n\treturn facts\n}\nfunc dec2bin(n int) (ret []bool) {\n\tfor bit := 1 << uint(math.Floor(math.Log2(float64(n)))); ; bit >>= 1 {\n\t\tret = append(ret, n&bit != 0)\n\n\t\tif bit <= 1 {\n\t\t\treturn\n\t\t}\n\t}\n\n}\n\nfunc abs(v int) int {\n\tif v < 0 {\n\t\tv = -v\n\t}\n\treturn v\n}\n\nfunc solve(stdin io.Reader, stdout io.Writer) {\n\tr := NewScannerEx(stdin)\n\tr.ScanAndSplit()\n\tn, y := r.nextInt(), r.nextInt()\n\n\tsatu := []int{10000, 5000, 1000}\n\tyBy10000 := y / 10000\n\n\tvar ans = []int{-1, -1, -1}\nloop:\n\tfor i := 0; i < yBy10000; i++ {\n\t\trest := y - i*satu[0]\n\n\t\tyBy5000 := rest / satu[1]\n\t\tfor j := 0; j < yBy5000; j++ {\n\t\t\trest -= j * satu[1]\n\n\t\t\tif rest%satu[2] == 0 {\n\t\t\t\tk := rest / satu[2]\n\n\t\t\t\tif i+j+k == n {\n\t\t\t\t\tans = []int{i, j, k}\n\t\t\t\t\tbreak loop\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Fprintln(stdout, func(x string) string { return x[1 : len(x)-1] }(fmt.Sprint(ans)))\n\n}\n\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "sample_input": "9 45000\n"}, "reference_outputs": ["4 0 5\n"], "source_document_id": "p03471", "source_text": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3226, "cpu_time_ms": 91, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s827226041", "group_id": "codeNet:p03471", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, yen int\n\tfmt.Scan(&n, ¥)\n\n\tvar slice [3]int\n\tvar judge bool\n\tfor i := 0; i <= n; i++ {\n\t\tfor j := 0; j <= n; j++ {\n\t\t\tfor k := 0; k <= n; k++ {\n\t\t\t\tif i+j+k > n {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif 10000*i+5000*j+1000*k == yen {\n\t\t\t\t\tslice[0] = i\n\t\t\t\t\tslice[1] = j\n\t\t\t\t\tslice[2] = k\n\t\t\t\t\tjudge = true\n\t\t\t\t}\n\t\t\t}\n\t\t\tif judge || i+j > n {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif judge {\n\t\t\tbreak\n\t\t}\n\t}\n\tif !judge {\n\t\tslice[0] = -1\n\t\tslice[1] = -1\n\t\tslice[2] = -1\n\t}\n\tfmt.Println(slice)\n\n}\n", "language": "Go", "metadata": {"date": 1565873984, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03471.html", "problem_id": "p03471", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03471/input.txt", "sample_output_relpath": "derived/input_output/data/p03471/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03471/Go/s827226041.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s827226041", "user_id": "u565596723"}, "prompt_components": {"gold_output": "4 0 5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, yen int\n\tfmt.Scan(&n, ¥)\n\n\tvar slice [3]int\n\tvar judge bool\n\tfor i := 0; i <= n; i++ {\n\t\tfor j := 0; j <= n; j++ {\n\t\t\tfor k := 0; k <= n; k++ {\n\t\t\t\tif i+j+k > n {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif 10000*i+5000*j+1000*k == yen {\n\t\t\t\t\tslice[0] = i\n\t\t\t\t\tslice[1] = j\n\t\t\t\t\tslice[2] = k\n\t\t\t\t\tjudge = true\n\t\t\t\t}\n\t\t\t}\n\t\t\tif judge || i+j > n {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif judge {\n\t\t\tbreak\n\t\t}\n\t}\n\tif !judge {\n\t\tslice[0] = -1\n\t\tslice[1] = -1\n\t\tslice[2] = -1\n\t}\n\tfmt.Println(slice)\n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "sample_input": "9 45000\n"}, "reference_outputs": ["4 0 5\n"], "source_document_id": "p03471", "source_text": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 519, "cpu_time_ms": 2107, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s703135292", "group_id": "codeNet:p03471", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\ntype xyz struct {\n\tx int\n\ty int\n\tz int\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tN := nextInt()\n\tY := nextInt()\n\t//N := 9\n\t//Y := 45000\n\tslice := []xyz{}\n\n\tL: \n\tfor i := 0; i < N+1; i++ {\n\t\tx := N - i\n\t\tfor j := 0; j < x+1; j++ {\n\t\t\tz := N - i - j\n\t\t\tif 10000*i+5000*j+1000*z == Y {\n\t\t\t\tslice = append(slice, xyz{\n\t\t\t\t\tx: i,\n\t\t\t\t\ty: j,\n\t\t\t\t\tz: z,\n\t\t\t\t})\n\t\t\t\tbreak L\n\t\t\t}\n\n\t\t}\n\t}\n\n\tif len(slice) == 0 {\n\t\tfmt.Printf(\"-1 -1 -1\")\n\t} else {\n\t\tx := slice[0].x\n\t\ty := slice[0].y\n\t\tz := slice[0].z\n\n\t\tfmt.Printf(\"%d %d %d\", x, y, z)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1559164046, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03471.html", "problem_id": "p03471", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03471/input.txt", "sample_output_relpath": "derived/input_output/data/p03471/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03471/Go/s703135292.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s703135292", "user_id": "u710190793"}, "prompt_components": {"gold_output": "4 0 5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\ntype xyz struct {\n\tx int\n\ty int\n\tz int\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tN := nextInt()\n\tY := nextInt()\n\t//N := 9\n\t//Y := 45000\n\tslice := []xyz{}\n\n\tL: \n\tfor i := 0; i < N+1; i++ {\n\t\tx := N - i\n\t\tfor j := 0; j < x+1; j++ {\n\t\t\tz := N - i - j\n\t\t\tif 10000*i+5000*j+1000*z == Y {\n\t\t\t\tslice = append(slice, xyz{\n\t\t\t\t\tx: i,\n\t\t\t\t\ty: j,\n\t\t\t\t\tz: z,\n\t\t\t\t})\n\t\t\t\tbreak L\n\t\t\t}\n\n\t\t}\n\t}\n\n\tif len(slice) == 0 {\n\t\tfmt.Printf(\"-1 -1 -1\")\n\t} else {\n\t\tx := slice[0].x\n\t\ty := slice[0].y\n\t\tz := slice[0].z\n\n\t\tfmt.Printf(\"%d %d %d\", x, y, z)\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "sample_input": "9 45000\n"}, "reference_outputs": ["4 0 5\n"], "source_document_id": "p03471", "source_text": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 738, "cpu_time_ms": 4, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s708525679", "group_id": "codeNet:p03471", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N, Y int\n\tfmt.Scan(&N, &Y)\n\tfor i := 0; i <= N; i++ {\n\t\tfor j := 0; j <= N; j++ {\n\t\t\tk := Y/1000 - 10*i - 5*j\n\t\t\tif 0 <= k && (i+j+k) == N {\n\t\t\t\tfmt.Println(i, j, k)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(-1, -1, -1)\n}\n", "language": "Go", "metadata": {"date": 1558141072, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03471.html", "problem_id": "p03471", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03471/input.txt", "sample_output_relpath": "derived/input_output/data/p03471/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03471/Go/s708525679.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s708525679", "user_id": "u196030116"}, "prompt_components": {"gold_output": "4 0 5\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N, Y int\n\tfmt.Scan(&N, &Y)\n\tfor i := 0; i <= N; i++ {\n\t\tfor j := 0; j <= N; j++ {\n\t\t\tk := Y/1000 - 10*i - 5*j\n\t\t\tif 0 <= k && (i+j+k) == N {\n\t\t\t\tfmt.Println(i, j, k)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(-1, -1, -1)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "sample_input": "9 45000\n"}, "reference_outputs": ["4 0 5\n"], "source_document_id": "p03471", "source_text": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 263, "cpu_time_ms": 9, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s850574327", "group_id": "codeNet:p03471", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc answer(reader io.Reader, writer io.Writer) {\n\tsc = bufio.NewScanner(reader)\n\tsc.Split(bufio.ScanWords)\n\ta := nextInt()\n\tb := nextInt()\n\tx := -1\n\ty := -1\n\tz := -1\n\tc := b - a*1000\n\tfor i := 0; i <= a && c-i*9000 >= 0; i++ {\n\t\tt := float64(c - i*9000)\n\t\tif (t/4000) == float64(int(t/4000)) && a-i-int(t/4000) >= 0 {\n\t\t\tx = i\n\t\t\ty = int(t / 4000)\n\t\t\tz = a - x - y\n\t\t\tbreak\n\t\t}\n\t}\n\t/*\n\t\t x+y+z = a\n\t\t\tx*10000 + y*5000 + z*1000 = b\n\t\t z = a - x - y\n\t\t x*10000 + y*5000 + (a-x-y)*1000 = b\n\t\t x*9000 + y*4000 = b - a*1000\n\t\t y = (b-a*1000-x*9000)/4000\n\t*/\n\n\tfmt.Fprintf(writer, \"%d %d %d\", x, y, z)\n}\n\nfunc main() {\n\tanswer(os.Stdin, os.Stdout)\n}\n", "language": "Go", "metadata": {"date": 1554090977, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03471.html", "problem_id": "p03471", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03471/input.txt", "sample_output_relpath": "derived/input_output/data/p03471/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03471/Go/s850574327.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s850574327", "user_id": "u880731071"}, "prompt_components": {"gold_output": "4 0 5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc *bufio.Scanner\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc answer(reader io.Reader, writer io.Writer) {\n\tsc = bufio.NewScanner(reader)\n\tsc.Split(bufio.ScanWords)\n\ta := nextInt()\n\tb := nextInt()\n\tx := -1\n\ty := -1\n\tz := -1\n\tc := b - a*1000\n\tfor i := 0; i <= a && c-i*9000 >= 0; i++ {\n\t\tt := float64(c - i*9000)\n\t\tif (t/4000) == float64(int(t/4000)) && a-i-int(t/4000) >= 0 {\n\t\t\tx = i\n\t\t\ty = int(t / 4000)\n\t\t\tz = a - x - y\n\t\t\tbreak\n\t\t}\n\t}\n\t/*\n\t\t x+y+z = a\n\t\t\tx*10000 + y*5000 + z*1000 = b\n\t\t z = a - x - y\n\t\t x*10000 + y*5000 + (a-x-y)*1000 = b\n\t\t x*9000 + y*4000 = b - a*1000\n\t\t y = (b-a*1000-x*9000)/4000\n\t*/\n\n\tfmt.Fprintf(writer, \"%d %d %d\", x, y, z)\n}\n\nfunc main() {\n\tanswer(os.Stdin, os.Stdout)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "sample_input": "9 45000\n"}, "reference_outputs": ["4 0 5\n"], "source_document_id": "p03471", "source_text": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 854, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s543830159", "group_id": "codeNet:p03471", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, y int\n\tfmt.Scan(&n, &y)\n\n\tfor i := 0; i <= n; i++ {\n\t\tvar osatu10000Yen = i\n\t\tfor j := 0; j <= n-i; j++ {\n\t\t\tvar osatu5000Yen = j\n\t\t\tfor k := 0; k <= n-i-j; k++ {\n\t\t\t\tvar osatu1000Yen = k\n\t\t\t\tif y == (osatu10000Yen*10000 + osatu5000Yen*5000 + osatu1000Yen*1000) {\n\t\t\t\t\tfmt.Println(osatu10000Yen, osatu5000Yen, osatu1000Yen)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(-1, -1, -1)\n}\n", "language": "Go", "metadata": {"date": 1551577468, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03471.html", "problem_id": "p03471", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03471/input.txt", "sample_output_relpath": "derived/input_output/data/p03471/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03471/Go/s543830159.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s543830159", "user_id": "u543933043"}, "prompt_components": {"gold_output": "4 0 5\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, y int\n\tfmt.Scan(&n, &y)\n\n\tfor i := 0; i <= n; i++ {\n\t\tvar osatu10000Yen = i\n\t\tfor j := 0; j <= n-i; j++ {\n\t\t\tvar osatu5000Yen = j\n\t\t\tfor k := 0; k <= n-i-j; k++ {\n\t\t\t\tvar osatu1000Yen = k\n\t\t\t\tif y == (osatu10000Yen*10000 + osatu5000Yen*5000 + osatu1000Yen*1000) {\n\t\t\t\t\tfmt.Println(osatu10000Yen, osatu5000Yen, osatu1000Yen)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(-1, -1, -1)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "sample_input": "9 45000\n"}, "reference_outputs": ["4 0 5\n"], "source_document_id": "p03471", "source_text": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 432, "cpu_time_ms": 1845, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s544062485", "group_id": "codeNet:p03471", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N, Y int\n\tfmt.Scan(&N, &Y)\n\ta := -1; b := -1; c := -1\n\n\tfor i := 0; i <= N; i++ {\n\t\tfor j := 0; j <= (N - i); j++ {\n\t\t\tk := N - i - j\n\t\t\tif i * 10000 + j * 5000 + 1000 * k == Y{\n\t\t\t\ta = i\n\t\t\t\tb = j\n\t\t\t\tc = k\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(a, b, c)\n\t}", "language": "Go", "metadata": {"date": 1550960455, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03471.html", "problem_id": "p03471", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03471/input.txt", "sample_output_relpath": "derived/input_output/data/p03471/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03471/Go/s544062485.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s544062485", "user_id": "u899421906"}, "prompt_components": {"gold_output": "4 0 5\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar N, Y int\n\tfmt.Scan(&N, &Y)\n\ta := -1; b := -1; c := -1\n\n\tfor i := 0; i <= N; i++ {\n\t\tfor j := 0; j <= (N - i); j++ {\n\t\t\tk := N - i - j\n\t\t\tif i * 10000 + j * 5000 + 1000 * k == Y{\n\t\t\t\ta = i\n\t\t\t\tb = j\n\t\t\t\tc = k\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(a, b, c)\n\t}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "sample_input": "9 45000\n"}, "reference_outputs": ["4 0 5\n"], "source_document_id": "p03471", "source_text": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 291, "cpu_time_ms": 5, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s004718042", "group_id": "codeNet:p03471", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var num, sum int\n fmt.Scan(&num, &sum)\n sum /= 1000\n\n //fmt.Println(num, sum)\n\n var done bool\n maxM := int(sum / 10)\n for m := 0; m <= maxM; m++ {\n sum2 := sum - m*10\n num2 := num - m\n maxG := int(sum2 / 5)\n if maxG > num2 {\n continue\n }\n for g := 0; g <= maxG; g++ {\n sum3 := sum2 - g*5\n num3 := num2 - g\n if sum3 == num3 {\n if !done {\n done = true\n fmt.Println(m, g, num3)\n }\n }\n }\n }\n if !done {\n fmt.Println(-1, -1, -1)\n }\n}\n", "language": "Go", "metadata": {"date": 1550020882, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03471.html", "problem_id": "p03471", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03471/input.txt", "sample_output_relpath": "derived/input_output/data/p03471/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03471/Go/s004718042.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s004718042", "user_id": "u282164747"}, "prompt_components": {"gold_output": "4 0 5\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var num, sum int\n fmt.Scan(&num, &sum)\n sum /= 1000\n\n //fmt.Println(num, sum)\n\n var done bool\n maxM := int(sum / 10)\n for m := 0; m <= maxM; m++ {\n sum2 := sum - m*10\n num2 := num - m\n maxG := int(sum2 / 5)\n if maxG > num2 {\n continue\n }\n for g := 0; g <= maxG; g++ {\n sum3 := sum2 - g*5\n num3 := num2 - g\n if sum3 == num3 {\n if !done {\n done = true\n fmt.Println(m, g, num3)\n }\n }\n }\n }\n if !done {\n fmt.Println(-1, -1, -1)\n }\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "sample_input": "9 45000\n"}, "reference_outputs": ["4 0 5\n"], "source_document_id": "p03471", "source_text": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 689, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s107704054", "group_id": "codeNet:p03471", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N, Y int\n\tax, ay, az := -1, -1, -1\n\tfmt.Scan(&N, &Y)\n\tfor ix := 0; ix <= N; ix++ {\n\t\tfor iy := 0; iy <= N; iy++ {\n\t\t\tiz := N - ix - iy\n\t\t\tsum := 10000*ix + 5000*iy + 1000*iz\n\t\t\tif Y == sum {\n\t\t\t\tax = ix\n\t\t\t\tay = iy\n\t\t\t\taz = iz\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ax, ay, az)\n}\n", "language": "Go", "metadata": {"date": 1542230667, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03471.html", "problem_id": "p03471", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03471/input.txt", "sample_output_relpath": "derived/input_output/data/p03471/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03471/Go/s107704054.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s107704054", "user_id": "u767936647"}, "prompt_components": {"gold_output": "4 0 5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar N, Y int\n\tax, ay, az := -1, -1, -1\n\tfmt.Scan(&N, &Y)\n\tfor ix := 0; ix <= N; ix++ {\n\t\tfor iy := 0; iy <= N; iy++ {\n\t\t\tiz := N - ix - iy\n\t\t\tsum := 10000*ix + 5000*iy + 1000*iz\n\t\t\tif Y == sum {\n\t\t\t\tax = ix\n\t\t\t\tay = iy\n\t\t\t\taz = iz\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(ax, ay, az)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "sample_input": "9 45000\n"}, "reference_outputs": ["4 0 5\n"], "source_document_id": "p03471", "source_text": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 318, "cpu_time_ms": 7, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s083527644", "group_id": "codeNet:p03471", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tvar y int\n\tfmt.Scan(&n)\n\tfmt.Scan(&y)\n\n\tmax5000 := min(n, y/5000)\n\tmax10000 := min(n, y/10000)\n\n\tvar i, j int\n\tfor i = 0; i <= max10000; i++ {\n\t\tfor j = 0; j <= max5000-i; j++ {\n\t\t\tif y-10000*i-5000*j == 1000*(n-i-j) {\n\t\t\t\tfmt.Println(i, j, n-i-j)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(-1, -1, -1)\n\treturn\n}\n\nfunc min(i, j int) int {\n\tif i <= j {\n\t\treturn i\n\t}\n\treturn j\n}\n", "language": "Go", "metadata": {"date": 1532829409, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03471.html", "problem_id": "p03471", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03471/input.txt", "sample_output_relpath": "derived/input_output/data/p03471/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03471/Go/s083527644.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s083527644", "user_id": "u949442192"}, "prompt_components": {"gold_output": "4 0 5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tvar y int\n\tfmt.Scan(&n)\n\tfmt.Scan(&y)\n\n\tmax5000 := min(n, y/5000)\n\tmax10000 := min(n, y/10000)\n\n\tvar i, j int\n\tfor i = 0; i <= max10000; i++ {\n\t\tfor j = 0; j <= max5000-i; j++ {\n\t\t\tif y-10000*i-5000*j == 1000*(n-i-j) {\n\t\t\t\tfmt.Println(i, j, n-i-j)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(-1, -1, -1)\n\treturn\n}\n\nfunc min(i, j int) int {\n\tif i <= j {\n\t\treturn i\n\t}\n\treturn j\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "sample_input": "9 45000\n"}, "reference_outputs": ["4 0 5\n"], "source_document_id": "p03471", "source_text": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 431, "cpu_time_ms": 4, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s540311868", "group_id": "codeNet:p03471", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, y int\n\tfmt.Scanf(\"%d %d\", &n, &y)\n\n\t// a, b, c := findPair(0, 0, 0, n, y)\n\ta, b, c := findPair2(n, y)\n\tfmt.Println(a, b, c)\n}\n\nfunc findPair2(n, y int) (int, int, int) {\n\tfor i := 0; i <= n; i++ {\n\t\tfor j := 0; j <= n-i; j++ {\n\t\t\tk := n - i - j\n\t\t\tif k >= 0 && i*10000+j*5000+k*1000 == y {\n\t\t\t\treturn i, j, k\n\t\t\t}\n\t\t}\n\t}\n\treturn -1, -1, -1\n}\n\nfunc findPair(a, b, c, n, y int) (int, int, int) {\n\t// fmt.Printf(\"a=%d, b=%d, c=%d, n=%d, y=%d\\n\", a, b, c, n, y)\n\tif y == 0 {\n\t\tif n == 0 {\n\t\t\treturn a, b, c\n\t\t} else {\n\t\t\treturn -1, -1, -1\n\t\t}\n\t} else if y < 0 {\n\t\treturn -1, -1, -1\n\t}\n\n\tif n > 0 {\n\t\tif 10000*n < y {\n\t\t\treturn -1, -1, -1\n\t\t}\n\t\tif r1, r2, r3 := findPair(a+1, b, c, n-1, y-10000); r1 != -1 {\n\t\t\treturn r1, r2, r3\n\t\t}\n\t\tif 5000*n < y {\n\t\t\treturn -1, -1, -1\n\t\t}\n\t\tif r1, r2, r3 := findPair(a, b+1, c, n-1, y-5000); r1 != -1 {\n\t\t\treturn r1, r2, r3\n\t\t}\n\t\tif 1000*n < y {\n\t\t\treturn -1, -1, -1\n\t\t}\n\t\tif r1, r2, r3 := findPair(a, b, c+1, n-1, y-1000); r1 != -1 {\n\t\t\treturn r1, r2, r3\n\t\t}\n\t}\n\treturn -1, -1, -1\n}\n", "language": "Go", "metadata": {"date": 1522179479, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03471.html", "problem_id": "p03471", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03471/input.txt", "sample_output_relpath": "derived/input_output/data/p03471/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03471/Go/s540311868.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s540311868", "user_id": "u985556061"}, "prompt_components": {"gold_output": "4 0 5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n, y int\n\tfmt.Scanf(\"%d %d\", &n, &y)\n\n\t// a, b, c := findPair(0, 0, 0, n, y)\n\ta, b, c := findPair2(n, y)\n\tfmt.Println(a, b, c)\n}\n\nfunc findPair2(n, y int) (int, int, int) {\n\tfor i := 0; i <= n; i++ {\n\t\tfor j := 0; j <= n-i; j++ {\n\t\t\tk := n - i - j\n\t\t\tif k >= 0 && i*10000+j*5000+k*1000 == y {\n\t\t\t\treturn i, j, k\n\t\t\t}\n\t\t}\n\t}\n\treturn -1, -1, -1\n}\n\nfunc findPair(a, b, c, n, y int) (int, int, int) {\n\t// fmt.Printf(\"a=%d, b=%d, c=%d, n=%d, y=%d\\n\", a, b, c, n, y)\n\tif y == 0 {\n\t\tif n == 0 {\n\t\t\treturn a, b, c\n\t\t} else {\n\t\t\treturn -1, -1, -1\n\t\t}\n\t} else if y < 0 {\n\t\treturn -1, -1, -1\n\t}\n\n\tif n > 0 {\n\t\tif 10000*n < y {\n\t\t\treturn -1, -1, -1\n\t\t}\n\t\tif r1, r2, r3 := findPair(a+1, b, c, n-1, y-10000); r1 != -1 {\n\t\t\treturn r1, r2, r3\n\t\t}\n\t\tif 5000*n < y {\n\t\t\treturn -1, -1, -1\n\t\t}\n\t\tif r1, r2, r3 := findPair(a, b+1, c, n-1, y-5000); r1 != -1 {\n\t\t\treturn r1, r2, r3\n\t\t}\n\t\tif 1000*n < y {\n\t\t\treturn -1, -1, -1\n\t\t}\n\t\tif r1, r2, r3 := findPair(a, b, c+1, n-1, y-1000); r1 != -1 {\n\t\t\treturn r1, r2, r3\n\t\t}\n\t}\n\treturn -1, -1, -1\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "sample_input": "9 45000\n"}, "reference_outputs": ["4 0 5\n"], "source_document_id": "p03471", "source_text": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1071, "cpu_time_ms": 4, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s796602277", "group_id": "codeNet:p03471", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tmaiInt := nextInt()\n\tyenInt := nextInt()\n\tyenIntRaw := yenInt\n\n\tif yenInt%1000 != 0 {\n\t\tfmt.Println(\"-1 -1 -1\")\n\t\treturn\n\t}\n\n\tyenInt /= 1000\n\n\tyen10 := 0\n\tyen5 := 0\n\tyen1 := 0\n\n\tif yenInt > 10 {\n\t\tyen10 = (yenInt - yenInt%10) / 10\n\t\tyenInt -= yen10 * 10\n\t}\n\n\tif yenInt > 5 {\n\t\tyen5 = (yenInt - yenInt%5) / 5\n\t\tyenInt -= yen5 * 5\n\t}\n\n\tif yenInt >= 1 {\n\t\tyen1 = yenInt\n\t}\n\n\tis10 := false\n\tis10N := false\n\tis5 := false\nreCheck:\n\tfmt.Printf(\"%d %d %d\\n\", yen10, yen5, yen1)\n\tif maiInt != yen1+yen5+yen10 {\n\t\tif is5 {\n\t\t\tif yen1 < 10 {\n\t\t\t\tfmt.Println(\"-1 -1 -1\")\n\t\t\t\treturn\n\t\t\t} else {\n\t\t\t\tyen1 -= 10\n\t\t\t\tyen10 += 1\n\t\t\t}\n\t\t} else if is10 || is10N || yen10 == 0 {\n\t\t\tyen5 -= 1\n\t\t\tyen1 += 5\n\t\t\tif !is10 {\n\t\t\t\tis10N = false\n\t\t\t}\n\t\t\tis10 = false\n\t\t\tif yen5 == 0 && (is10 && is10N || is5) {\n\t\t\t\tis5 = true\n\t\t\t}\n\t\t} else {\n\t\t\tyen10 -= 1\n\t\t\tyen5 += 2\n\t\t\tis10 = true\n\t\t\tis10N = true\n\t\t}\n\n\t\tif yen1 < 0 || yen5 < 0 || yen10 < 0 {\n\t\t\tfmt.Println(\"-1 -1 -1\")\n\t\t\treturn\n\t\t}\n\t\tgoto reCheck\n\t}\n\n\tif yen10*10000+yen5*5000+yen1*1000 != yenIntRaw {\n\t\tfmt.Println(\"-1 -1 -1\")\n\t} else {\n\t\tfmt.Printf(\"%d %d %d\", yen10, yen5, yen1)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1515627186, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03471.html", "problem_id": "p03471", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03471/input.txt", "sample_output_relpath": "derived/input_output/data/p03471/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03471/Go/s796602277.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s796602277", "user_id": "u046532996"}, "prompt_components": {"gold_output": "4 0 5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tmaiInt := nextInt()\n\tyenInt := nextInt()\n\tyenIntRaw := yenInt\n\n\tif yenInt%1000 != 0 {\n\t\tfmt.Println(\"-1 -1 -1\")\n\t\treturn\n\t}\n\n\tyenInt /= 1000\n\n\tyen10 := 0\n\tyen5 := 0\n\tyen1 := 0\n\n\tif yenInt > 10 {\n\t\tyen10 = (yenInt - yenInt%10) / 10\n\t\tyenInt -= yen10 * 10\n\t}\n\n\tif yenInt > 5 {\n\t\tyen5 = (yenInt - yenInt%5) / 5\n\t\tyenInt -= yen5 * 5\n\t}\n\n\tif yenInt >= 1 {\n\t\tyen1 = yenInt\n\t}\n\n\tis10 := false\n\tis10N := false\n\tis5 := false\nreCheck:\n\tfmt.Printf(\"%d %d %d\\n\", yen10, yen5, yen1)\n\tif maiInt != yen1+yen5+yen10 {\n\t\tif is5 {\n\t\t\tif yen1 < 10 {\n\t\t\t\tfmt.Println(\"-1 -1 -1\")\n\t\t\t\treturn\n\t\t\t} else {\n\t\t\t\tyen1 -= 10\n\t\t\t\tyen10 += 1\n\t\t\t}\n\t\t} else if is10 || is10N || yen10 == 0 {\n\t\t\tyen5 -= 1\n\t\t\tyen1 += 5\n\t\t\tif !is10 {\n\t\t\t\tis10N = false\n\t\t\t}\n\t\t\tis10 = false\n\t\t\tif yen5 == 0 && (is10 && is10N || is5) {\n\t\t\t\tis5 = true\n\t\t\t}\n\t\t} else {\n\t\t\tyen10 -= 1\n\t\t\tyen5 += 2\n\t\t\tis10 = true\n\t\t\tis10N = true\n\t\t}\n\n\t\tif yen1 < 0 || yen5 < 0 || yen10 < 0 {\n\t\t\tfmt.Println(\"-1 -1 -1\")\n\t\t\treturn\n\t\t}\n\t\tgoto reCheck\n\t}\n\n\tif yen10*10000+yen5*5000+yen1*1000 != yenIntRaw {\n\t\tfmt.Println(\"-1 -1 -1\")\n\t} else {\n\t\tfmt.Printf(\"%d %d %d\", yen10, yen5, yen1)\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "sample_input": "9 45000\n"}, "reference_outputs": ["4 0 5\n"], "source_document_id": "p03471", "source_text": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1359, "cpu_time_ms": 20, "memory_kb": 768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s029609805", "group_id": "codeNet:p03471", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tmaiInt := nextInt()\n\tyenInt := nextInt()\n\tyenIntRaw := yenInt\n\n\tif yenInt%1000 != 0 {\n\t\tfmt.Println(\"-1 -1 -1\")\n\t\treturn\n\t}\n\n\tyenInt /= 1000\n\n\tyen10 := 0\n\tyen5 := 0\n\tyen1 := 0\n\n\tif yenInt > 10 {\n\t\tyen10 = (yenInt - yenInt%10) / 10\n\t\tyenInt -= yen10 * 10\n\t}\n\n\tif yenInt > 5 {\n\t\tyen5 = (yenInt - yenInt%5) / 5\n\t\tyenInt -= yen5 * 5\n\t}\n\n\tif yenInt > 1 {\n\t\tyen1 = yenInt\n\t}\n\n\tis10 := false\n\tis5 := false\nreCheck:\n\tif maiInt > yen1+yen5+yen10 {\n\t\tif is5 {\n\t\t\tif yen1 < 10{\n\t\t\t\tfmt.Println(\"-1 -1 -1\")\n\t\t\t\treturn\n\t\t\t}else {\n\t\t\t\tyen1 -= 10\n\t\t\t\tyen10 += 1\n\t\t\t}\n\t\t} else if is10 || yen10 == 0 {\n\t\t\tyen5 -= 1\n\t\t\tyen1 += 5\n\t\t\tis10 = false\n\t\t\tif yen5 == 0 {\n\t\t\t\tis5 = true\n\t\t\t}\n\t\t} else {\n\t\t\tyen10 -= 1\n\t\t\tyen5 += 2\n\t\t\tis10 = true\n\t\t}\n\t\tgoto reCheck\n\t}\n\n\tif yen10*10000+yen5*5000+yen1*1000 != yenIntRaw {\n\t\tfmt.Println(\"-1 -1 -1\")\n\t} else {\n\t\tfmt.Printf(\"%d %d %d\", yen10, yen5, yen1)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1515625333, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03471.html", "problem_id": "p03471", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03471/input.txt", "sample_output_relpath": "derived/input_output/data/p03471/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03471/Go/s029609805.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s029609805", "user_id": "u046532996"}, "prompt_components": {"gold_output": "4 0 5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tmaiInt := nextInt()\n\tyenInt := nextInt()\n\tyenIntRaw := yenInt\n\n\tif yenInt%1000 != 0 {\n\t\tfmt.Println(\"-1 -1 -1\")\n\t\treturn\n\t}\n\n\tyenInt /= 1000\n\n\tyen10 := 0\n\tyen5 := 0\n\tyen1 := 0\n\n\tif yenInt > 10 {\n\t\tyen10 = (yenInt - yenInt%10) / 10\n\t\tyenInt -= yen10 * 10\n\t}\n\n\tif yenInt > 5 {\n\t\tyen5 = (yenInt - yenInt%5) / 5\n\t\tyenInt -= yen5 * 5\n\t}\n\n\tif yenInt > 1 {\n\t\tyen1 = yenInt\n\t}\n\n\tis10 := false\n\tis5 := false\nreCheck:\n\tif maiInt > yen1+yen5+yen10 {\n\t\tif is5 {\n\t\t\tif yen1 < 10{\n\t\t\t\tfmt.Println(\"-1 -1 -1\")\n\t\t\t\treturn\n\t\t\t}else {\n\t\t\t\tyen1 -= 10\n\t\t\t\tyen10 += 1\n\t\t\t}\n\t\t} else if is10 || yen10 == 0 {\n\t\t\tyen5 -= 1\n\t\t\tyen1 += 5\n\t\t\tis10 = false\n\t\t\tif yen5 == 0 {\n\t\t\t\tis5 = true\n\t\t\t}\n\t\t} else {\n\t\t\tyen10 -= 1\n\t\t\tyen5 += 2\n\t\t\tis10 = true\n\t\t}\n\t\tgoto reCheck\n\t}\n\n\tif yen10*10000+yen5*5000+yen1*1000 != yenIntRaw {\n\t\tfmt.Println(\"-1 -1 -1\")\n\t} else {\n\t\tfmt.Printf(\"%d %d %d\", yen10, yen5, yen1)\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "sample_input": "9 45000\n"}, "reference_outputs": ["4 0 5\n"], "source_document_id": "p03471", "source_text": "Score : 300 points\n\nProblem Statement\n\nThe commonly used bills in Japan are 10000-yen, 5000-yen and 1000-yen bills. Below, the word \"bill\" refers to only these.\n\nAccording to Aohashi, he received an otoshidama (New Year money gift) envelope from his grandfather that contained N bills for a total of Y yen, but he may be lying. Determine whether such a situation is possible, and if it is, find a possible set of bills contained in the envelope. Assume that his grandfather is rich enough, and the envelope was large enough.\n\nConstraints\n\n1 ≤ N ≤ 2000\n\n1000 ≤ Y ≤ 2 × 10^7\n\nN is an integer.\n\nY is a multiple of 1000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Y\n\nOutput\n\nIf the total value of N bills cannot be Y yen, print -1 -1 -1.\n\nIf the total value of N bills can be Y yen, let one such set of bills be \"x 10000-yen bills, y 5000-yen bills and z 1000-yen bills\", and print x, y, z with spaces in between. If there are multiple possibilities, any of them may be printed.\n\nSample Input 1\n\n9 45000\n\nSample Output 1\n\n4 0 5\n\nIf the envelope contained 4 10000-yen bills and 5 1000-yen bills, he had 9 bills and 45000 yen in total. It is also possible that the envelope contained 9 5000-yen bills, so the output 0 9 0 is also correct.\n\nSample Input 2\n\n20 196000\n\nSample Output 2\n\n-1 -1 -1\n\nWhen the envelope contained 20 bills in total, the total value would be 200000 yen if all the bills were 10000-yen bills, and would be at most 195000 yen otherwise, so it would never be 196000 yen.\n\nSample Input 3\n\n1000 1234000\n\nSample Output 3\n\n14 27 959\n\nThere are also many other possibilities.\n\nSample Input 4\n\n2000 20000000\n\nSample Output 4\n\n2000 0 0", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1123, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s110151342", "group_id": "codeNet:p03472", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, 1000000)\n\n\tN, H := getInt(), getInt()\n\ta := make([]int, N)\n\tb := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\ta[i], b[i] = getInt(), getInt()\n\t}\n\tsort.Ints(a)\n\tsort.Ints(b)\n\tmaxA := a[len(a)-1]\n\tans := 0\n\tpos := len(b) - 1\n\tfor b[pos] > maxA {\n\t\tH -= b[pos]\n\t\tans++\n\t\tpos--\n\t\tif pos < 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif H > 0 {\n\t\tn := (H + maxA/2 - 1) / maxA\n\t\tans += n\n\t}\n\n\tout(ans)\n}\n", "language": "Go", "metadata": {"date": 1584678616, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03472.html", "problem_id": "p03472", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03472/input.txt", "sample_output_relpath": "derived/input_output/data/p03472/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03472/Go/s110151342.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s110151342", "user_id": "u814575783"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, 1000000)\n\n\tN, H := getInt(), getInt()\n\ta := make([]int, N)\n\tb := make([]int, N)\n\tfor i := 0; i < N; i++ {\n\t\ta[i], b[i] = getInt(), getInt()\n\t}\n\tsort.Ints(a)\n\tsort.Ints(b)\n\tmaxA := a[len(a)-1]\n\tans := 0\n\tpos := len(b) - 1\n\tfor b[pos] > maxA {\n\t\tH -= b[pos]\n\t\tans++\n\t\tpos--\n\t\tif pos < 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif H > 0 {\n\t\tn := (H + maxA/2 - 1) / maxA\n\t\tans += n\n\t}\n\n\tout(ans)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are going out for a walk, when you suddenly encounter a monster. Fortunately, you have N katana (swords), Katana 1, Katana 2, …, Katana N, and can perform the following two kinds of attacks in any order:\n\nWield one of the katana you have. When you wield Katana i (1 ≤ i ≤ N), the monster receives a_i points of damage. The same katana can be wielded any number of times.\n\nThrow one of the katana you have. When you throw Katana i (1 ≤ i ≤ N) at the monster, it receives b_i points of damage, and you lose the katana. That is, you can no longer wield or throw that katana.\n\nThe monster will vanish when the total damage it has received is H points or more. At least how many attacks do you need in order to vanish it in total?\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n1 ≤ H ≤ 10^9\n\n1 ≤ a_i ≤ 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 H\na_1 b_1\n:\na_N b_N\n\nOutput\n\nPrint the minimum total number of attacks required to vanish the monster.\n\nSample Input 1\n\n1 10\n3 5\n\nSample Output 1\n\n3\n\nYou have one katana. Wielding it deals 3 points of damage, and throwing it deals 5 points of damage. By wielding it twice and then throwing it, you will deal 3 + 3 + 5 = 11 points of damage in a total of three attacks, vanishing the monster.\n\nSample Input 2\n\n2 10\n3 5\n2 6\n\nSample Output 2\n\n2\n\nIn addition to the katana above, you also have another katana. Wielding it deals 2 points of damage, and throwing it deals 6 points of damage. By throwing both katana, you will deal 5 + 6 = 11 points of damage in two attacks, vanishing the monster.\n\nSample Input 3\n\n4 1000000000\n1 1\n1 10000000\n1 30000000\n1 99999999\n\nSample Output 3\n\n860000004\n\nSample Input 4\n\n5 500\n35 44\n28 83\n46 62\n31 79\n40 43\n\nSample Output 4\n\n9", "sample_input": "1 10\n3 5\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03472", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are going out for a walk, when you suddenly encounter a monster. Fortunately, you have N katana (swords), Katana 1, Katana 2, …, Katana N, and can perform the following two kinds of attacks in any order:\n\nWield one of the katana you have. When you wield Katana i (1 ≤ i ≤ N), the monster receives a_i points of damage. The same katana can be wielded any number of times.\n\nThrow one of the katana you have. When you throw Katana i (1 ≤ i ≤ N) at the monster, it receives b_i points of damage, and you lose the katana. That is, you can no longer wield or throw that katana.\n\nThe monster will vanish when the total damage it has received is H points or more. At least how many attacks do you need in order to vanish it in total?\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n1 ≤ H ≤ 10^9\n\n1 ≤ a_i ≤ 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 H\na_1 b_1\n:\na_N b_N\n\nOutput\n\nPrint the minimum total number of attacks required to vanish the monster.\n\nSample Input 1\n\n1 10\n3 5\n\nSample Output 1\n\n3\n\nYou have one katana. Wielding it deals 3 points of damage, and throwing it deals 5 points of damage. By wielding it twice and then throwing it, you will deal 3 + 3 + 5 = 11 points of damage in a total of three attacks, vanishing the monster.\n\nSample Input 2\n\n2 10\n3 5\n2 6\n\nSample Output 2\n\n2\n\nIn addition to the katana above, you also have another katana. Wielding it deals 2 points of damage, and throwing it deals 6 points of damage. By throwing both katana, you will deal 5 + 6 = 11 points of damage in two attacks, vanishing the monster.\n\nSample Input 3\n\n4 1000000000\n1 1\n1 10000000\n1 30000000\n1 99999999\n\nSample Output 3\n\n860000004\n\nSample Input 4\n\n5 500\n35 44\n28 83\n46 62\n31 79\n40 43\n\nSample Output 4\n\n9", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 956, "cpu_time_ms": 71, "memory_kb": 4608}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s950686460", "group_id": "codeNet:p03472", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, 1000000)\n\n\tN, H := getInt(), getInt()\n\ta := make([]int, N)\n\tb := make([]int, N)\n\tmaxA := 0\n\tminBA := 0\n\tposB := 0\n\tfor i := 0; i < N; i++ {\n\t\ta[i], b[i] = getInt(), getInt()\n\t\tif a[i] > maxA {\n\t\t\tmaxA = a[i]\n\t\t\tminBA = b[i]\n\t\t\tposB = i\n\t\t} else if a[i] == maxA {\n\t\t\tif minBA > b[i] {\n\t\t\t\tminBA = b[i]\n\t\t\t\tposB = i\n\t\t\t}\n\t\t}\n\t}\n\tsort.Ints(a)\n\tb = append(b[:posB], b[posB+1:]...)\n\tsort.Ints(b)\n\n\tans := 0\n\tposB = len(b) - 1\n\tfor posB >= 0 && b[posB] > maxA {\n\t\tif H <= minBA {\n\t\t\tH -= minBA\n\t\t\tbreak\n\t\t}\n\t\tH -= b[posB]\n\t\tposB--\n\t\tans++\n\t\tif H <= 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\t//\tout(b, posB, maxA)\n\t//\tout(H)\n\tif H <= minBA {\n\t\tans++\n\t} else {\n\t\tif minBA > maxA {\n\t\t\tn := (H - minBA) / maxA\n\t\t\tif (H-minBA)%maxA != 0 {\n\t\t\t\tn++\n\t\t\t}\n\t\t\tans += n + 1\n\t\t} else {\n\t\t\tn := H / maxA\n\t\t\tif H%maxA != 0 {\n\t\t\t\tn++\n\t\t\t}\n\t\t\tans += n\n\t\t}\n\t}\n\tout(ans)\n}\n", "language": "Go", "metadata": {"date": 1584678069, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03472.html", "problem_id": "p03472", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03472/input.txt", "sample_output_relpath": "derived/input_output/data/p03472/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03472/Go/s950686460.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s950686460", "user_id": "u814575783"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc asub(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, 1000000)\n\n\tN, H := getInt(), getInt()\n\ta := make([]int, N)\n\tb := make([]int, N)\n\tmaxA := 0\n\tminBA := 0\n\tposB := 0\n\tfor i := 0; i < N; i++ {\n\t\ta[i], b[i] = getInt(), getInt()\n\t\tif a[i] > maxA {\n\t\t\tmaxA = a[i]\n\t\t\tminBA = b[i]\n\t\t\tposB = i\n\t\t} else if a[i] == maxA {\n\t\t\tif minBA > b[i] {\n\t\t\t\tminBA = b[i]\n\t\t\t\tposB = i\n\t\t\t}\n\t\t}\n\t}\n\tsort.Ints(a)\n\tb = append(b[:posB], b[posB+1:]...)\n\tsort.Ints(b)\n\n\tans := 0\n\tposB = len(b) - 1\n\tfor posB >= 0 && b[posB] > maxA {\n\t\tif H <= minBA {\n\t\t\tH -= minBA\n\t\t\tbreak\n\t\t}\n\t\tH -= b[posB]\n\t\tposB--\n\t\tans++\n\t\tif H <= 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\t//\tout(b, posB, maxA)\n\t//\tout(H)\n\tif H <= minBA {\n\t\tans++\n\t} else {\n\t\tif minBA > maxA {\n\t\t\tn := (H - minBA) / maxA\n\t\t\tif (H-minBA)%maxA != 0 {\n\t\t\t\tn++\n\t\t\t}\n\t\t\tans += n + 1\n\t\t} else {\n\t\t\tn := H / maxA\n\t\t\tif H%maxA != 0 {\n\t\t\t\tn++\n\t\t\t}\n\t\t\tans += n\n\t\t}\n\t}\n\tout(ans)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are going out for a walk, when you suddenly encounter a monster. Fortunately, you have N katana (swords), Katana 1, Katana 2, …, Katana N, and can perform the following two kinds of attacks in any order:\n\nWield one of the katana you have. When you wield Katana i (1 ≤ i ≤ N), the monster receives a_i points of damage. The same katana can be wielded any number of times.\n\nThrow one of the katana you have. When you throw Katana i (1 ≤ i ≤ N) at the monster, it receives b_i points of damage, and you lose the katana. That is, you can no longer wield or throw that katana.\n\nThe monster will vanish when the total damage it has received is H points or more. At least how many attacks do you need in order to vanish it in total?\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n1 ≤ H ≤ 10^9\n\n1 ≤ a_i ≤ 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 H\na_1 b_1\n:\na_N b_N\n\nOutput\n\nPrint the minimum total number of attacks required to vanish the monster.\n\nSample Input 1\n\n1 10\n3 5\n\nSample Output 1\n\n3\n\nYou have one katana. Wielding it deals 3 points of damage, and throwing it deals 5 points of damage. By wielding it twice and then throwing it, you will deal 3 + 3 + 5 = 11 points of damage in a total of three attacks, vanishing the monster.\n\nSample Input 2\n\n2 10\n3 5\n2 6\n\nSample Output 2\n\n2\n\nIn addition to the katana above, you also have another katana. Wielding it deals 2 points of damage, and throwing it deals 6 points of damage. By throwing both katana, you will deal 5 + 6 = 11 points of damage in two attacks, vanishing the monster.\n\nSample Input 3\n\n4 1000000000\n1 1\n1 10000000\n1 30000000\n1 99999999\n\nSample Output 3\n\n860000004\n\nSample Input 4\n\n5 500\n35 44\n28 83\n46 62\n31 79\n40 43\n\nSample Output 4\n\n9", "sample_input": "1 10\n3 5\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03472", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are going out for a walk, when you suddenly encounter a monster. Fortunately, you have N katana (swords), Katana 1, Katana 2, …, Katana N, and can perform the following two kinds of attacks in any order:\n\nWield one of the katana you have. When you wield Katana i (1 ≤ i ≤ N), the monster receives a_i points of damage. The same katana can be wielded any number of times.\n\nThrow one of the katana you have. When you throw Katana i (1 ≤ i ≤ N) at the monster, it receives b_i points of damage, and you lose the katana. That is, you can no longer wield or throw that katana.\n\nThe monster will vanish when the total damage it has received is H points or more. At least how many attacks do you need in order to vanish it in total?\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n1 ≤ H ≤ 10^9\n\n1 ≤ a_i ≤ 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 H\na_1 b_1\n:\na_N b_N\n\nOutput\n\nPrint the minimum total number of attacks required to vanish the monster.\n\nSample Input 1\n\n1 10\n3 5\n\nSample Output 1\n\n3\n\nYou have one katana. Wielding it deals 3 points of damage, and throwing it deals 5 points of damage. By wielding it twice and then throwing it, you will deal 3 + 3 + 5 = 11 points of damage in a total of three attacks, vanishing the monster.\n\nSample Input 2\n\n2 10\n3 5\n2 6\n\nSample Output 2\n\n2\n\nIn addition to the katana above, you also have another katana. Wielding it deals 2 points of damage, and throwing it deals 6 points of damage. By throwing both katana, you will deal 5 + 6 = 11 points of damage in two attacks, vanishing the monster.\n\nSample Input 3\n\n4 1000000000\n1 1\n1 10000000\n1 30000000\n1 99999999\n\nSample Output 3\n\n860000004\n\nSample Input 4\n\n5 500\n35 44\n28 83\n46 62\n31 79\n40 43\n\nSample Output 4\n\n9", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1410, "cpu_time_ms": 71, "memory_kb": 4608}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s220350199", "group_id": "codeNet:p03472", "input_text": "package main\n \nimport (\n\t\"sort\"\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n \nvar sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)\n \nfunc scanString() string { sc.Scan(); return sc.Text() }\nfunc scanRunes() []rune { return []rune(scanString()) }\nfunc scanInt() int { a,_ := strconv.Atoi(scanString()); return a }\nfunc scanInt64() int64 { a,_ := strconv.ParseInt(scanString(),10,64); return a }\nfunc scanFloat64() float64 { a,_ := strconv.ParseFloat(scanString(),64); return a }\n \nfunc scanInts(n int) []int {\n\tres := make([]int, n); for i := 0; i < n; i++ { res[i] = scanInt() }; return res\n}\n \nfunc debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }\n \nfunc abs(a int) int { if a<0 { return -a }; return a }\nfunc min(a,b int) int { if ab { return a }; return b }\n \n//•*¨*•.¸¸♪Main•*¨*•.¸¸♪( -ω-)ノ ( ・ω・)\n \nfunc main() {\n\tdefer wr.Flush()\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1001001)\n \n\tn := scanInt()\n\th := scanInt()\n \n\ta := make([]int, n)\n\tmaxa := 0\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = scanInt()\n\t\tmaxa = max(maxa, a[i])\n\t\tb[i] = scanInt()\n\t}\n\n\tsort.Ints(b)\n\n\tc := 0\n\tfor i := 0; i < n; i++ {\n\t\tif maxa > b[n-1-i] {\n\t\t\tbreak\n\t\t}\n\n\t\th -= b[n-1-i]\n\t\tc++\n\n\t\tif h <= 0 {\n\t\t\th = 0\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfmt.Fprintln(wr, c+(h+maxa-1)/maxa)\n \n}\n", "language": "Go", "metadata": {"date": 1583996449, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03472.html", "problem_id": "p03472", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03472/input.txt", "sample_output_relpath": "derived/input_output/data/p03472/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03472/Go/s220350199.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s220350199", "user_id": "u548992197"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n \nimport (\n\t\"sort\"\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n \nvar sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)\n \nfunc scanString() string { sc.Scan(); return sc.Text() }\nfunc scanRunes() []rune { return []rune(scanString()) }\nfunc scanInt() int { a,_ := strconv.Atoi(scanString()); return a }\nfunc scanInt64() int64 { a,_ := strconv.ParseInt(scanString(),10,64); return a }\nfunc scanFloat64() float64 { a,_ := strconv.ParseFloat(scanString(),64); return a }\n \nfunc scanInts(n int) []int {\n\tres := make([]int, n); for i := 0; i < n; i++ { res[i] = scanInt() }; return res\n}\n \nfunc debug(a ...interface{}) { fmt.Fprintln(os.Stderr, a...) }\n \nfunc abs(a int) int { if a<0 { return -a }; return a }\nfunc min(a,b int) int { if ab { return a }; return b }\n \n//•*¨*•.¸¸♪Main•*¨*•.¸¸♪( -ω-)ノ ( ・ω・)\n \nfunc main() {\n\tdefer wr.Flush()\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 10000), 1001001)\n \n\tn := scanInt()\n\th := scanInt()\n \n\ta := make([]int, n)\n\tmaxa := 0\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = scanInt()\n\t\tmaxa = max(maxa, a[i])\n\t\tb[i] = scanInt()\n\t}\n\n\tsort.Ints(b)\n\n\tc := 0\n\tfor i := 0; i < n; i++ {\n\t\tif maxa > b[n-1-i] {\n\t\t\tbreak\n\t\t}\n\n\t\th -= b[n-1-i]\n\t\tc++\n\n\t\tif h <= 0 {\n\t\t\th = 0\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfmt.Fprintln(wr, c+(h+maxa-1)/maxa)\n \n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are going out for a walk, when you suddenly encounter a monster. Fortunately, you have N katana (swords), Katana 1, Katana 2, …, Katana N, and can perform the following two kinds of attacks in any order:\n\nWield one of the katana you have. When you wield Katana i (1 ≤ i ≤ N), the monster receives a_i points of damage. The same katana can be wielded any number of times.\n\nThrow one of the katana you have. When you throw Katana i (1 ≤ i ≤ N) at the monster, it receives b_i points of damage, and you lose the katana. That is, you can no longer wield or throw that katana.\n\nThe monster will vanish when the total damage it has received is H points or more. At least how many attacks do you need in order to vanish it in total?\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n1 ≤ H ≤ 10^9\n\n1 ≤ a_i ≤ 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 H\na_1 b_1\n:\na_N b_N\n\nOutput\n\nPrint the minimum total number of attacks required to vanish the monster.\n\nSample Input 1\n\n1 10\n3 5\n\nSample Output 1\n\n3\n\nYou have one katana. Wielding it deals 3 points of damage, and throwing it deals 5 points of damage. By wielding it twice and then throwing it, you will deal 3 + 3 + 5 = 11 points of damage in a total of three attacks, vanishing the monster.\n\nSample Input 2\n\n2 10\n3 5\n2 6\n\nSample Output 2\n\n2\n\nIn addition to the katana above, you also have another katana. Wielding it deals 2 points of damage, and throwing it deals 6 points of damage. By throwing both katana, you will deal 5 + 6 = 11 points of damage in two attacks, vanishing the monster.\n\nSample Input 3\n\n4 1000000000\n1 1\n1 10000000\n1 30000000\n1 99999999\n\nSample Output 3\n\n860000004\n\nSample Input 4\n\n5 500\n35 44\n28 83\n46 62\n31 79\n40 43\n\nSample Output 4\n\n9", "sample_input": "1 10\n3 5\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03472", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are going out for a walk, when you suddenly encounter a monster. Fortunately, you have N katana (swords), Katana 1, Katana 2, …, Katana N, and can perform the following two kinds of attacks in any order:\n\nWield one of the katana you have. When you wield Katana i (1 ≤ i ≤ N), the monster receives a_i points of damage. The same katana can be wielded any number of times.\n\nThrow one of the katana you have. When you throw Katana i (1 ≤ i ≤ N) at the monster, it receives b_i points of damage, and you lose the katana. That is, you can no longer wield or throw that katana.\n\nThe monster will vanish when the total damage it has received is H points or more. At least how many attacks do you need in order to vanish it in total?\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n1 ≤ H ≤ 10^9\n\n1 ≤ a_i ≤ 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 H\na_1 b_1\n:\na_N b_N\n\nOutput\n\nPrint the minimum total number of attacks required to vanish the monster.\n\nSample Input 1\n\n1 10\n3 5\n\nSample Output 1\n\n3\n\nYou have one katana. Wielding it deals 3 points of damage, and throwing it deals 5 points of damage. By wielding it twice and then throwing it, you will deal 3 + 3 + 5 = 11 points of damage in a total of three attacks, vanishing the monster.\n\nSample Input 2\n\n2 10\n3 5\n2 6\n\nSample Output 2\n\n2\n\nIn addition to the katana above, you also have another katana. Wielding it deals 2 points of damage, and throwing it deals 6 points of damage. By throwing both katana, you will deal 5 + 6 = 11 points of damage in two attacks, vanishing the monster.\n\nSample Input 3\n\n4 1000000000\n1 1\n1 10000000\n1 30000000\n1 99999999\n\nSample Output 3\n\n860000004\n\nSample Input 4\n\n5 500\n35 44\n28 83\n46 62\n31 79\n40 43\n\nSample Output 4\n\n9", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1380, "cpu_time_ms": 61, "memory_kb": 5120}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s256823875", "group_id": "codeNet:p03472", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar n, h int\n\tfmt.Scan(&n, &h)\n\ta := make([]int, n)\n\tb := make([]int, n)\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tfor i := 0; i < n; i++ {\n\t\tsc.Scan()\n\t\ta[i], _ = strconv.Atoi(sc.Text())\n\t\tsc.Scan()\n\t\tb[i], _ = strconv.Atoi(sc.Text())\n\t}\n\tamax := a[0]\n\tfor _, e := range a {\n\t\tif amax < e {\n\t\t\tamax = e\n\t\t}\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(b)))\n\tans := 0\n\tfor _, e := range b {\n\t\tif amax < e {\n\t\t\th -= e\n\t\t\tans++\n\t\t\tif h <= 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tif h > 0 {\n\t\tans += (h + amax - 1) / amax\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1569973457, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03472.html", "problem_id": "p03472", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03472/input.txt", "sample_output_relpath": "derived/input_output/data/p03472/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03472/Go/s256823875.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s256823875", "user_id": "u150861392"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar n, h int\n\tfmt.Scan(&n, &h)\n\ta := make([]int, n)\n\tb := make([]int, n)\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tfor i := 0; i < n; i++ {\n\t\tsc.Scan()\n\t\ta[i], _ = strconv.Atoi(sc.Text())\n\t\tsc.Scan()\n\t\tb[i], _ = strconv.Atoi(sc.Text())\n\t}\n\tamax := a[0]\n\tfor _, e := range a {\n\t\tif amax < e {\n\t\t\tamax = e\n\t\t}\n\t}\n\tsort.Sort(sort.Reverse(sort.IntSlice(b)))\n\tans := 0\n\tfor _, e := range b {\n\t\tif amax < e {\n\t\t\th -= e\n\t\t\tans++\n\t\t\tif h <= 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\tif h > 0 {\n\t\tans += (h + amax - 1) / amax\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are going out for a walk, when you suddenly encounter a monster. Fortunately, you have N katana (swords), Katana 1, Katana 2, …, Katana N, and can perform the following two kinds of attacks in any order:\n\nWield one of the katana you have. When you wield Katana i (1 ≤ i ≤ N), the monster receives a_i points of damage. The same katana can be wielded any number of times.\n\nThrow one of the katana you have. When you throw Katana i (1 ≤ i ≤ N) at the monster, it receives b_i points of damage, and you lose the katana. That is, you can no longer wield or throw that katana.\n\nThe monster will vanish when the total damage it has received is H points or more. At least how many attacks do you need in order to vanish it in total?\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n1 ≤ H ≤ 10^9\n\n1 ≤ a_i ≤ 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 H\na_1 b_1\n:\na_N b_N\n\nOutput\n\nPrint the minimum total number of attacks required to vanish the monster.\n\nSample Input 1\n\n1 10\n3 5\n\nSample Output 1\n\n3\n\nYou have one katana. Wielding it deals 3 points of damage, and throwing it deals 5 points of damage. By wielding it twice and then throwing it, you will deal 3 + 3 + 5 = 11 points of damage in a total of three attacks, vanishing the monster.\n\nSample Input 2\n\n2 10\n3 5\n2 6\n\nSample Output 2\n\n2\n\nIn addition to the katana above, you also have another katana. Wielding it deals 2 points of damage, and throwing it deals 6 points of damage. By throwing both katana, you will deal 5 + 6 = 11 points of damage in two attacks, vanishing the monster.\n\nSample Input 3\n\n4 1000000000\n1 1\n1 10000000\n1 30000000\n1 99999999\n\nSample Output 3\n\n860000004\n\nSample Input 4\n\n5 500\n35 44\n28 83\n46 62\n31 79\n40 43\n\nSample Output 4\n\n9", "sample_input": "1 10\n3 5\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03472", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are going out for a walk, when you suddenly encounter a monster. Fortunately, you have N katana (swords), Katana 1, Katana 2, …, Katana N, and can perform the following two kinds of attacks in any order:\n\nWield one of the katana you have. When you wield Katana i (1 ≤ i ≤ N), the monster receives a_i points of damage. The same katana can be wielded any number of times.\n\nThrow one of the katana you have. When you throw Katana i (1 ≤ i ≤ N) at the monster, it receives b_i points of damage, and you lose the katana. That is, you can no longer wield or throw that katana.\n\nThe monster will vanish when the total damage it has received is H points or more. At least how many attacks do you need in order to vanish it in total?\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n1 ≤ H ≤ 10^9\n\n1 ≤ a_i ≤ 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 H\na_1 b_1\n:\na_N b_N\n\nOutput\n\nPrint the minimum total number of attacks required to vanish the monster.\n\nSample Input 1\n\n1 10\n3 5\n\nSample Output 1\n\n3\n\nYou have one katana. Wielding it deals 3 points of damage, and throwing it deals 5 points of damage. By wielding it twice and then throwing it, you will deal 3 + 3 + 5 = 11 points of damage in a total of three attacks, vanishing the monster.\n\nSample Input 2\n\n2 10\n3 5\n2 6\n\nSample Output 2\n\n2\n\nIn addition to the katana above, you also have another katana. Wielding it deals 2 points of damage, and throwing it deals 6 points of damage. By throwing both katana, you will deal 5 + 6 = 11 points of damage in two attacks, vanishing the monster.\n\nSample Input 3\n\n4 1000000000\n1 1\n1 10000000\n1 30000000\n1 99999999\n\nSample Output 3\n\n860000004\n\nSample Input 4\n\n5 500\n35 44\n28 83\n46 62\n31 79\n40 43\n\nSample Output 4\n\n9", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 627, "cpu_time_ms": 65, "memory_kb": 4608}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s535207443", "group_id": "codeNet:p03472", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tN, H := nextInt(), nextInt()\n\ta := make([]int, N)\n\tb := make([]int, N)\n\tmaxA := 0\n\tfor i := 0; i < N; i++ {\n\t\ta[i] = nextInt()\n\t\tb[i] = nextInt()\n\t\tif a[i] > maxA {\n\t\t\t maxA = a[i]\n\t\t}\n\t}\n\tsort.Ints(b)\n\n\tres := 0\n\tfor i := len(b) - 1; i >= 0 && H > 0; i-- {\n\t\tif maxA > b[i] {\n\t\t\tbreak\n\t\t} else {\n\t\t\tres++\n\t\t\tH -= b[i]\n\t\t}\n\t}\n\n\tif H > 0 {\n\t\tres += (H + maxA - 1) / maxA\n\t}\n\tfmt.Println(res)\n}\n\n\n// -------- Library --------\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tv, err := strconv.Atoi(next())\n\tif err != nil {\n\t\tfmt.Println(\"Failed to read int\", err)\n\t\tos.Exit(1)\n\t}\n\treturn v\n}\n\nfunc nextIntArray(size int) []int {\n\tres := make([]int, size)\n\tfor i := 0; i < size; i++ {\n\t\tres[i] = nextInt()\n\t}\n\treturn res\n}", "language": "Go", "metadata": {"date": 1515387457, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03472.html", "problem_id": "p03472", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03472/input.txt", "sample_output_relpath": "derived/input_output/data/p03472/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03472/Go/s535207443.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s535207443", "user_id": "u617255029"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tN, H := nextInt(), nextInt()\n\ta := make([]int, N)\n\tb := make([]int, N)\n\tmaxA := 0\n\tfor i := 0; i < N; i++ {\n\t\ta[i] = nextInt()\n\t\tb[i] = nextInt()\n\t\tif a[i] > maxA {\n\t\t\t maxA = a[i]\n\t\t}\n\t}\n\tsort.Ints(b)\n\n\tres := 0\n\tfor i := len(b) - 1; i >= 0 && H > 0; i-- {\n\t\tif maxA > b[i] {\n\t\t\tbreak\n\t\t} else {\n\t\t\tres++\n\t\t\tH -= b[i]\n\t\t}\n\t}\n\n\tif H > 0 {\n\t\tres += (H + maxA - 1) / maxA\n\t}\n\tfmt.Println(res)\n}\n\n\n// -------- Library --------\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tv, err := strconv.Atoi(next())\n\tif err != nil {\n\t\tfmt.Println(\"Failed to read int\", err)\n\t\tos.Exit(1)\n\t}\n\treturn v\n}\n\nfunc nextIntArray(size int) []int {\n\tres := make([]int, size)\n\tfor i := 0; i < size; i++ {\n\t\tres[i] = nextInt()\n\t}\n\treturn res\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are going out for a walk, when you suddenly encounter a monster. Fortunately, you have N katana (swords), Katana 1, Katana 2, …, Katana N, and can perform the following two kinds of attacks in any order:\n\nWield one of the katana you have. When you wield Katana i (1 ≤ i ≤ N), the monster receives a_i points of damage. The same katana can be wielded any number of times.\n\nThrow one of the katana you have. When you throw Katana i (1 ≤ i ≤ N) at the monster, it receives b_i points of damage, and you lose the katana. That is, you can no longer wield or throw that katana.\n\nThe monster will vanish when the total damage it has received is H points or more. At least how many attacks do you need in order to vanish it in total?\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n1 ≤ H ≤ 10^9\n\n1 ≤ a_i ≤ 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 H\na_1 b_1\n:\na_N b_N\n\nOutput\n\nPrint the minimum total number of attacks required to vanish the monster.\n\nSample Input 1\n\n1 10\n3 5\n\nSample Output 1\n\n3\n\nYou have one katana. Wielding it deals 3 points of damage, and throwing it deals 5 points of damage. By wielding it twice and then throwing it, you will deal 3 + 3 + 5 = 11 points of damage in a total of three attacks, vanishing the monster.\n\nSample Input 2\n\n2 10\n3 5\n2 6\n\nSample Output 2\n\n2\n\nIn addition to the katana above, you also have another katana. Wielding it deals 2 points of damage, and throwing it deals 6 points of damage. By throwing both katana, you will deal 5 + 6 = 11 points of damage in two attacks, vanishing the monster.\n\nSample Input 3\n\n4 1000000000\n1 1\n1 10000000\n1 30000000\n1 99999999\n\nSample Output 3\n\n860000004\n\nSample Input 4\n\n5 500\n35 44\n28 83\n46 62\n31 79\n40 43\n\nSample Output 4\n\n9", "sample_input": "1 10\n3 5\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03472", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are going out for a walk, when you suddenly encounter a monster. Fortunately, you have N katana (swords), Katana 1, Katana 2, …, Katana N, and can perform the following two kinds of attacks in any order:\n\nWield one of the katana you have. When you wield Katana i (1 ≤ i ≤ N), the monster receives a_i points of damage. The same katana can be wielded any number of times.\n\nThrow one of the katana you have. When you throw Katana i (1 ≤ i ≤ N) at the monster, it receives b_i points of damage, and you lose the katana. That is, you can no longer wield or throw that katana.\n\nThe monster will vanish when the total damage it has received is H points or more. At least how many attacks do you need in order to vanish it in total?\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n1 ≤ H ≤ 10^9\n\n1 ≤ a_i ≤ 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 H\na_1 b_1\n:\na_N b_N\n\nOutput\n\nPrint the minimum total number of attacks required to vanish the monster.\n\nSample Input 1\n\n1 10\n3 5\n\nSample Output 1\n\n3\n\nYou have one katana. Wielding it deals 3 points of damage, and throwing it deals 5 points of damage. By wielding it twice and then throwing it, you will deal 3 + 3 + 5 = 11 points of damage in a total of three attacks, vanishing the monster.\n\nSample Input 2\n\n2 10\n3 5\n2 6\n\nSample Output 2\n\n2\n\nIn addition to the katana above, you also have another katana. Wielding it deals 2 points of damage, and throwing it deals 6 points of damage. By throwing both katana, you will deal 5 + 6 = 11 points of damage in two attacks, vanishing the monster.\n\nSample Input 3\n\n4 1000000000\n1 1\n1 10000000\n1 30000000\n1 99999999\n\nSample Output 3\n\n860000004\n\nSample Input 4\n\n5 500\n35 44\n28 83\n46 62\n31 79\n40 43\n\nSample Output 4\n\n9", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 891, "cpu_time_ms": 59, "memory_kb": 4608}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s029664920", "group_id": "codeNet:p03472", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\ntype Sord struct {\n\ta int64\n\tb int64\n}\n\ntype Sords []Sord\n\nfunc (a Sords) Len() int {\n\treturn len(a)\n}\n\nfunc (a Sords) Swap(i, j int) {\n\ta[i], a[j] = a[j], a[i]\n}\n\nfunc (a Sords) Less(i, j int) bool {\n\treturn a[i].b > a[j].b\n}\n\nfunc main() {\n\tvar N int\n\tvar H int64\n\n\tfmt.Scanf(\"%d %d\", &N, &H)\n\n\tsords := make(Sords, N)\n\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scanf(\"%d %d\", &sords[i].a, &sords[i].b)\n\t}\n\n\tsort.Sort(sords)\n\n\tmax := sords[0].a\n\tfor i := 0; i < N; i++ {\n\t\tif sords[i].a > max {\n\t\t\tmax = sords[i].a\n\t\t}\n\t}\n\n\tattack := 0\n\tdamage := int64(0)\n\tfor i := 0; i < N; i++ {\n\t\tif damage >= H || sords[i].b < sords[max].a {\n\t\t\tbreak\n\t\t}\n\n\t\tdamage += sords[i].b\n\t\tattack++\n\t}\n\n\tif damage < H {\n\t\tmore := int((H - damage) / sords[max].a)\n\t\tif (H-damage)%sords[max].a != 0 {\n\t\t\tmore++\n\t\t}\n\t\tattack += more\n\t\tdamage += sords[max].a * int64(more)\n\t}\n\n\tif attack <= 0 {\n\t\tfmt.Println(1)\n\t} else {\n\t\tfmt.Println(attack)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1515386250, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03472.html", "problem_id": "p03472", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03472/input.txt", "sample_output_relpath": "derived/input_output/data/p03472/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03472/Go/s029664920.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s029664920", "user_id": "u434572230"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\ntype Sord struct {\n\ta int64\n\tb int64\n}\n\ntype Sords []Sord\n\nfunc (a Sords) Len() int {\n\treturn len(a)\n}\n\nfunc (a Sords) Swap(i, j int) {\n\ta[i], a[j] = a[j], a[i]\n}\n\nfunc (a Sords) Less(i, j int) bool {\n\treturn a[i].b > a[j].b\n}\n\nfunc main() {\n\tvar N int\n\tvar H int64\n\n\tfmt.Scanf(\"%d %d\", &N, &H)\n\n\tsords := make(Sords, N)\n\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Scanf(\"%d %d\", &sords[i].a, &sords[i].b)\n\t}\n\n\tsort.Sort(sords)\n\n\tmax := sords[0].a\n\tfor i := 0; i < N; i++ {\n\t\tif sords[i].a > max {\n\t\t\tmax = sords[i].a\n\t\t}\n\t}\n\n\tattack := 0\n\tdamage := int64(0)\n\tfor i := 0; i < N; i++ {\n\t\tif damage >= H || sords[i].b < sords[max].a {\n\t\t\tbreak\n\t\t}\n\n\t\tdamage += sords[i].b\n\t\tattack++\n\t}\n\n\tif damage < H {\n\t\tmore := int((H - damage) / sords[max].a)\n\t\tif (H-damage)%sords[max].a != 0 {\n\t\t\tmore++\n\t\t}\n\t\tattack += more\n\t\tdamage += sords[max].a * int64(more)\n\t}\n\n\tif attack <= 0 {\n\t\tfmt.Println(1)\n\t} else {\n\t\tfmt.Println(attack)\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are going out for a walk, when you suddenly encounter a monster. Fortunately, you have N katana (swords), Katana 1, Katana 2, …, Katana N, and can perform the following two kinds of attacks in any order:\n\nWield one of the katana you have. When you wield Katana i (1 ≤ i ≤ N), the monster receives a_i points of damage. The same katana can be wielded any number of times.\n\nThrow one of the katana you have. When you throw Katana i (1 ≤ i ≤ N) at the monster, it receives b_i points of damage, and you lose the katana. That is, you can no longer wield or throw that katana.\n\nThe monster will vanish when the total damage it has received is H points or more. At least how many attacks do you need in order to vanish it in total?\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n1 ≤ H ≤ 10^9\n\n1 ≤ a_i ≤ 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 H\na_1 b_1\n:\na_N b_N\n\nOutput\n\nPrint the minimum total number of attacks required to vanish the monster.\n\nSample Input 1\n\n1 10\n3 5\n\nSample Output 1\n\n3\n\nYou have one katana. Wielding it deals 3 points of damage, and throwing it deals 5 points of damage. By wielding it twice and then throwing it, you will deal 3 + 3 + 5 = 11 points of damage in a total of three attacks, vanishing the monster.\n\nSample Input 2\n\n2 10\n3 5\n2 6\n\nSample Output 2\n\n2\n\nIn addition to the katana above, you also have another katana. Wielding it deals 2 points of damage, and throwing it deals 6 points of damage. By throwing both katana, you will deal 5 + 6 = 11 points of damage in two attacks, vanishing the monster.\n\nSample Input 3\n\n4 1000000000\n1 1\n1 10000000\n1 30000000\n1 99999999\n\nSample Output 3\n\n860000004\n\nSample Input 4\n\n5 500\n35 44\n28 83\n46 62\n31 79\n40 43\n\nSample Output 4\n\n9", "sample_input": "1 10\n3 5\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03472", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are going out for a walk, when you suddenly encounter a monster. Fortunately, you have N katana (swords), Katana 1, Katana 2, …, Katana N, and can perform the following two kinds of attacks in any order:\n\nWield one of the katana you have. When you wield Katana i (1 ≤ i ≤ N), the monster receives a_i points of damage. The same katana can be wielded any number of times.\n\nThrow one of the katana you have. When you throw Katana i (1 ≤ i ≤ N) at the monster, it receives b_i points of damage, and you lose the katana. That is, you can no longer wield or throw that katana.\n\nThe monster will vanish when the total damage it has received is H points or more. At least how many attacks do you need in order to vanish it in total?\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n1 ≤ H ≤ 10^9\n\n1 ≤ a_i ≤ 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 H\na_1 b_1\n:\na_N b_N\n\nOutput\n\nPrint the minimum total number of attacks required to vanish the monster.\n\nSample Input 1\n\n1 10\n3 5\n\nSample Output 1\n\n3\n\nYou have one katana. Wielding it deals 3 points of damage, and throwing it deals 5 points of damage. By wielding it twice and then throwing it, you will deal 3 + 3 + 5 = 11 points of damage in a total of three attacks, vanishing the monster.\n\nSample Input 2\n\n2 10\n3 5\n2 6\n\nSample Output 2\n\n2\n\nIn addition to the katana above, you also have another katana. Wielding it deals 2 points of damage, and throwing it deals 6 points of damage. By throwing both katana, you will deal 5 + 6 = 11 points of damage in two attacks, vanishing the monster.\n\nSample Input 3\n\n4 1000000000\n1 1\n1 10000000\n1 30000000\n1 99999999\n\nSample Output 3\n\n860000004\n\nSample Input 4\n\n5 500\n35 44\n28 83\n46 62\n31 79\n40 43\n\nSample Output 4\n\n9", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 957, "cpu_time_ms": 1389, "memory_kb": 4992}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s661057504", "group_id": "codeNet:p03478", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tscanInit()\n\n\tn := nextInt()\n\ta := nextInt()\n\tb := nextInt()\n\n\tsum := 0\n\tfor i := 1; i <= n; i++ {\n\t\ttmp := sumKeta(i)\n\t\tif a <= tmp && tmp <= b {\n\t\t\tsum += i\n\t\t}\n\t}\n\n\tfmt.Println(sum)\n\n}\n\n// 各桁の和\nfunc sumKeta(n int) int {\n\tketa := 0\n\tfor n > 0 {\n\t\tketa += n % 10\n\t\tn /= 10\n\t}\n\treturn keta\n}\n\n// ---- readfunc\nfunc scanInit() {\n\tconst cap = 200 * 1024 // Default=64\n\tvar buf = make([]byte, cap)\n\tsc.Buffer(buf, cap)\n\tsc.Split(bufio.ScanWords)\n\treturn\n}\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "language": "Go", "metadata": {"date": 1595466886, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03478.html", "problem_id": "p03478", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03478/input.txt", "sample_output_relpath": "derived/input_output/data/p03478/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03478/Go/s661057504.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s661057504", "user_id": "u756000295"}, "prompt_components": {"gold_output": "84\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tscanInit()\n\n\tn := nextInt()\n\ta := nextInt()\n\tb := nextInt()\n\n\tsum := 0\n\tfor i := 1; i <= n; i++ {\n\t\ttmp := sumKeta(i)\n\t\tif a <= tmp && tmp <= b {\n\t\t\tsum += i\n\t\t}\n\t}\n\n\tfmt.Println(sum)\n\n}\n\n// 各桁の和\nfunc sumKeta(n int) int {\n\tketa := 0\n\tfor n > 0 {\n\t\tketa += n % 10\n\t\tn /= 10\n\t}\n\treturn keta\n}\n\n// ---- readfunc\nfunc scanInit() {\n\tconst cap = 200 * 1024 // Default=64\n\tvar buf = make([]byte, cap)\n\tsc.Buffer(buf, cap)\n\tsc.Split(bufio.ScanWords)\n\treturn\n}\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nFind the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A \\leq B \\leq 36\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 sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nSample Input 1\n\n20 2 5\n\nSample Output 1\n\n84\n\nAmong the integers not greater than 20, the ones whose sums of digits are between 2 and 5, are: 2,3,4,5,11,12,13,14 and 20. We should print the sum of these, 84.\n\nSample Input 2\n\n10 1 2\n\nSample Output 2\n\n13\n\nSample Input 3\n\n100 4 16\n\nSample Output 3\n\n4554", "sample_input": "20 2 5\n"}, "reference_outputs": ["84\n"], "source_document_id": "p03478", "source_text": "Score : 200 points\n\nProblem Statement\n\nFind the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A \\leq B \\leq 36\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 sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nSample Input 1\n\n20 2 5\n\nSample Output 1\n\n84\n\nAmong the integers not greater than 20, the ones whose sums of digits are between 2 and 5, are: 2,3,4,5,11,12,13,14 and 20. We should print the sum of these, 84.\n\nSample Input 2\n\n10 1 2\n\nSample Output 2\n\n13\n\nSample Input 3\n\n100 4 16\n\nSample Output 3\n\n4554", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 732, "cpu_time_ms": 6, "memory_kb": 1780}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s760503129", "group_id": "codeNet:p03478", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tsc = initScanner(os.Stdin)\n\tn, a, b := scanInt(sc), scanInt(sc), scanInt(sc)\n\tfmt.Println(resolve(n, a, b))\n}\n\nfunc resolve(n, a, b int) int {\n\tvar tmp, sum int\n\tfor i := 1; i <= n; i++ {\n\t\ttmp = 0\n\t\tis := strings.Split(strconv.Itoa(i), \"\")\n\t\tfor _, v:= range is {\n\t\t\tvi, _ := strconv.Atoi(v)\n\t\t\ttmp += vi\n\t\t}\n\t\tif a <= tmp && tmp <= b {\n\t\t\tsum += i\n\t\t}\n\t}\n\n\treturn sum\n}\n\n// --------------- BASE DEFINITIONS ---------------\n\nconst (\n\tinitialBufSize = 100000\n\tmaxBufSize = 1000000\n)\n\nvar sc *bufio.Scanner\n\nfunc initScanner(r io.Reader) *bufio.Scanner {\n\tbuf := make([]byte, initialBufSize)\n\n\tsc := bufio.NewScanner(r)\n\tsc.Buffer(buf, maxBufSize)\n\tsc.Split(bufio.ScanWords)\n\treturn sc\n}\n\nfunc scanInt(sc *bufio.Scanner) int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n\nfunc scanIntSlice(sc *bufio.Scanner, n int) []int {\n\tis := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tis[i] = scanInt(sc)\n\t}\n\n\treturn is\n}\n\nfunc scanString(sc *bufio.Scanner) string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc scanStringSlice(sc *bufio.Scanner, n int) []string {\n\tss := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tsc.Scan()\n\t\tss[i] = sc.Text()\n\t}\n\n\treturn ss\n}\n", "language": "Go", "metadata": {"date": 1595118804, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03478.html", "problem_id": "p03478", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03478/input.txt", "sample_output_relpath": "derived/input_output/data/p03478/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03478/Go/s760503129.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s760503129", "user_id": "u149448956"}, "prompt_components": {"gold_output": "84\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tsc = initScanner(os.Stdin)\n\tn, a, b := scanInt(sc), scanInt(sc), scanInt(sc)\n\tfmt.Println(resolve(n, a, b))\n}\n\nfunc resolve(n, a, b int) int {\n\tvar tmp, sum int\n\tfor i := 1; i <= n; i++ {\n\t\ttmp = 0\n\t\tis := strings.Split(strconv.Itoa(i), \"\")\n\t\tfor _, v:= range is {\n\t\t\tvi, _ := strconv.Atoi(v)\n\t\t\ttmp += vi\n\t\t}\n\t\tif a <= tmp && tmp <= b {\n\t\t\tsum += i\n\t\t}\n\t}\n\n\treturn sum\n}\n\n// --------------- BASE DEFINITIONS ---------------\n\nconst (\n\tinitialBufSize = 100000\n\tmaxBufSize = 1000000\n)\n\nvar sc *bufio.Scanner\n\nfunc initScanner(r io.Reader) *bufio.Scanner {\n\tbuf := make([]byte, initialBufSize)\n\n\tsc := bufio.NewScanner(r)\n\tsc.Buffer(buf, maxBufSize)\n\tsc.Split(bufio.ScanWords)\n\treturn sc\n}\n\nfunc scanInt(sc *bufio.Scanner) int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n\nfunc scanIntSlice(sc *bufio.Scanner, n int) []int {\n\tis := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tis[i] = scanInt(sc)\n\t}\n\n\treturn is\n}\n\nfunc scanString(sc *bufio.Scanner) string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc scanStringSlice(sc *bufio.Scanner, n int) []string {\n\tss := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tsc.Scan()\n\t\tss[i] = sc.Text()\n\t}\n\n\treturn ss\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nFind the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A \\leq B \\leq 36\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 sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nSample Input 1\n\n20 2 5\n\nSample Output 1\n\n84\n\nAmong the integers not greater than 20, the ones whose sums of digits are between 2 and 5, are: 2,3,4,5,11,12,13,14 and 20. We should print the sum of these, 84.\n\nSample Input 2\n\n10 1 2\n\nSample Output 2\n\n13\n\nSample Input 3\n\n100 4 16\n\nSample Output 3\n\n4554", "sample_input": "20 2 5\n"}, "reference_outputs": ["84\n"], "source_document_id": "p03478", "source_text": "Score : 200 points\n\nProblem Statement\n\nFind the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A \\leq B \\leq 36\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 sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nSample Input 1\n\n20 2 5\n\nSample Output 1\n\n84\n\nAmong the integers not greater than 20, the ones whose sums of digits are between 2 and 5, are: 2,3,4,5,11,12,13,14 and 20. We should print the sum of these, 84.\n\nSample Input 2\n\n10 1 2\n\nSample Output 2\n\n13\n\nSample Input 3\n\n100 4 16\n\nSample Output 3\n\n4554", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1252, "cpu_time_ms": 7, "memory_kb": 2448}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s052487756", "group_id": "codeNet:p03478", "input_text": "package main\nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n \"strconv\"\n)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n sc.Split(bufio.ScanWords)\n n := nextInt()\n\n a := nextInt()\n b := nextInt()\n\n sum := 0\n for i := 1; i <= n; i++ {\n\t if a <= i && i <= b && i < 10{\n\t\tsum = sum + i\n\t } else {\n\t\tpartSum := 0\n for _, v := range strconv.Itoa(i) {\n v, _ := strconv.Atoi(string(v))\n partSum = partSum + v\n }\n\t if a <= partSum && partSum <= b {\n\t\t sum = sum + i\n\t\t}\n\t }\n }\n fmt.Println(sum)\n\n}\n\nfunc nextString() (string) {\n\tsc.Scan()\n\tv := sc.Text()\n\treturn v\n}\n\nfunc nextInt() (int) {\n\tsc.Scan()\n\tv, e := strconv.Atoi(sc.Text())\n if e != nil { panic(e) }\n return v\n}\n\nfunc nextFloat() (float64) {\n\tsc.Scan()\n\tv, e := strconv.ParseFloat(sc.Text(), 64)\n if e != nil { panic(e) }\n return v\n}\n", "language": "Go", "metadata": {"date": 1584337781, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03478.html", "problem_id": "p03478", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03478/input.txt", "sample_output_relpath": "derived/input_output/data/p03478/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03478/Go/s052487756.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s052487756", "user_id": "u027449325"}, "prompt_components": {"gold_output": "84\n", "input_to_evaluate": "package main\nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n \"strconv\"\n)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n sc.Split(bufio.ScanWords)\n n := nextInt()\n\n a := nextInt()\n b := nextInt()\n\n sum := 0\n for i := 1; i <= n; i++ {\n\t if a <= i && i <= b && i < 10{\n\t\tsum = sum + i\n\t } else {\n\t\tpartSum := 0\n for _, v := range strconv.Itoa(i) {\n v, _ := strconv.Atoi(string(v))\n partSum = partSum + v\n }\n\t if a <= partSum && partSum <= b {\n\t\t sum = sum + i\n\t\t}\n\t }\n }\n fmt.Println(sum)\n\n}\n\nfunc nextString() (string) {\n\tsc.Scan()\n\tv := sc.Text()\n\treturn v\n}\n\nfunc nextInt() (int) {\n\tsc.Scan()\n\tv, e := strconv.Atoi(sc.Text())\n if e != nil { panic(e) }\n return v\n}\n\nfunc nextFloat() (float64) {\n\tsc.Scan()\n\tv, e := strconv.ParseFloat(sc.Text(), 64)\n if e != nil { panic(e) }\n return v\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nFind the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A \\leq B \\leq 36\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 sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nSample Input 1\n\n20 2 5\n\nSample Output 1\n\n84\n\nAmong the integers not greater than 20, the ones whose sums of digits are between 2 and 5, are: 2,3,4,5,11,12,13,14 and 20. We should print the sum of these, 84.\n\nSample Input 2\n\n10 1 2\n\nSample Output 2\n\n13\n\nSample Input 3\n\n100 4 16\n\nSample Output 3\n\n4554", "sample_input": "20 2 5\n"}, "reference_outputs": ["84\n"], "source_document_id": "p03478", "source_text": "Score : 200 points\n\nProblem Statement\n\nFind the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A \\leq B \\leq 36\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 sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nSample Input 1\n\n20 2 5\n\nSample Output 1\n\n84\n\nAmong the integers not greater than 20, the ones whose sums of digits are between 2 and 5, are: 2,3,4,5,11,12,13,14 and 20. We should print the sum of these, 84.\n\nSample Input 2\n\n10 1 2\n\nSample Output 2\n\n13\n\nSample Input 3\n\n100 4 16\n\nSample Output 3\n\n4554", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 840, "cpu_time_ms": 4, "memory_kb": 768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s968350159", "group_id": "codeNet:p03478", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsolve(os.Stdin, os.Stdout)\n}\n\nfunc solve(in io.Reader, out io.Writer) {\n\tbs := NewBufScanner(in)\n\tbw := NewBufWriter(out)\n\tdefer bw.w.Flush()\n\tn, a, b := bs.IntScan(), bs.IntScan(), bs.IntScan()\n\n\tsum := 0\n\tfor i := 1; i <= n; i++ {\n\t\tr4 := i / 1000\n\t\tr3 := (i - r4 * 1000) / 100\n\t\tr2 := (i - r4 * 1000 - r3 * 100) / 10\n\t\tr1 := i - r4 * 1000 - r3 * 100 - r2 * 10\n\t\ts := r1 + r2 + r3 + r4\n\t\tif a <= s && s <= b {\n\t\t\tsum += i\n\t\t}\n\t}\n\n\tbw.Printf(\"%v\\n\", sum)\n}\n\nfunc sumDigits(n int) int {\n\tsum := 0\n\tfor n > 0 {\n\t\tsum += n % 10\n\t\tn /= 10\n\t}\n\treturn sum\n}\n\n// BufScanner original scanner\ntype BufScanner struct {\n\ts *bufio.Scanner\n}\n\n// NewBufScanner constructer\nfunc NewBufScanner(in io.Reader) *BufScanner {\n\ts := bufio.NewScanner(in)\n\ts.Buffer(make([]byte, 1024), 1e+9)\n\ts.Split(bufio.ScanWords)\n\treturn &BufScanner{\n\t\ts: s,\n\t}\n}\n\n// Scan Scan Data\nfunc (b *BufScanner) Scan() string {\n\tb.s.Scan()\n\treturn b.s.Text()\n}\n\n// IntScan Scan Data\nfunc (b *BufScanner) IntScan() int {\n\tv, err := strconv.Atoi(b.Scan())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\n// BufWriter original writer\ntype BufWriter struct {\n\tw *bufio.Writer\n}\n\n// NewBufWriter constructer\nfunc NewBufWriter(out io.Writer) *BufWriter {\n\tw := bufio.NewWriter(out)\n\treturn &BufWriter{\n\t\tw: w,\n\t}\n}\n\n// Printf Output file\nfunc (b *BufWriter) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(b.w, format, a...)\n}", "language": "Go", "metadata": {"date": 1582995964, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03478.html", "problem_id": "p03478", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03478/input.txt", "sample_output_relpath": "derived/input_output/data/p03478/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03478/Go/s968350159.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s968350159", "user_id": "u647304231"}, "prompt_components": {"gold_output": "84\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsolve(os.Stdin, os.Stdout)\n}\n\nfunc solve(in io.Reader, out io.Writer) {\n\tbs := NewBufScanner(in)\n\tbw := NewBufWriter(out)\n\tdefer bw.w.Flush()\n\tn, a, b := bs.IntScan(), bs.IntScan(), bs.IntScan()\n\n\tsum := 0\n\tfor i := 1; i <= n; i++ {\n\t\tr4 := i / 1000\n\t\tr3 := (i - r4 * 1000) / 100\n\t\tr2 := (i - r4 * 1000 - r3 * 100) / 10\n\t\tr1 := i - r4 * 1000 - r3 * 100 - r2 * 10\n\t\ts := r1 + r2 + r3 + r4\n\t\tif a <= s && s <= b {\n\t\t\tsum += i\n\t\t}\n\t}\n\n\tbw.Printf(\"%v\\n\", sum)\n}\n\nfunc sumDigits(n int) int {\n\tsum := 0\n\tfor n > 0 {\n\t\tsum += n % 10\n\t\tn /= 10\n\t}\n\treturn sum\n}\n\n// BufScanner original scanner\ntype BufScanner struct {\n\ts *bufio.Scanner\n}\n\n// NewBufScanner constructer\nfunc NewBufScanner(in io.Reader) *BufScanner {\n\ts := bufio.NewScanner(in)\n\ts.Buffer(make([]byte, 1024), 1e+9)\n\ts.Split(bufio.ScanWords)\n\treturn &BufScanner{\n\t\ts: s,\n\t}\n}\n\n// Scan Scan Data\nfunc (b *BufScanner) Scan() string {\n\tb.s.Scan()\n\treturn b.s.Text()\n}\n\n// IntScan Scan Data\nfunc (b *BufScanner) IntScan() int {\n\tv, err := strconv.Atoi(b.Scan())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn v\n}\n\n// BufWriter original writer\ntype BufWriter struct {\n\tw *bufio.Writer\n}\n\n// NewBufWriter constructer\nfunc NewBufWriter(out io.Writer) *BufWriter {\n\tw := bufio.NewWriter(out)\n\treturn &BufWriter{\n\t\tw: w,\n\t}\n}\n\n// Printf Output file\nfunc (b *BufWriter) Printf(format string, a ...interface{}) {\n\tfmt.Fprintf(b.w, format, a...)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nFind the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A \\leq B \\leq 36\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 sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nSample Input 1\n\n20 2 5\n\nSample Output 1\n\n84\n\nAmong the integers not greater than 20, the ones whose sums of digits are between 2 and 5, are: 2,3,4,5,11,12,13,14 and 20. We should print the sum of these, 84.\n\nSample Input 2\n\n10 1 2\n\nSample Output 2\n\n13\n\nSample Input 3\n\n100 4 16\n\nSample Output 3\n\n4554", "sample_input": "20 2 5\n"}, "reference_outputs": ["84\n"], "source_document_id": "p03478", "source_text": "Score : 200 points\n\nProblem Statement\n\nFind the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A \\leq B \\leq 36\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 sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nSample Input 1\n\n20 2 5\n\nSample Output 1\n\n84\n\nAmong the integers not greater than 20, the ones whose sums of digits are between 2 and 5, are: 2,3,4,5,11,12,13,14 and 20. We should print the sum of these, 84.\n\nSample Input 2\n\n10 1 2\n\nSample Output 2\n\n13\n\nSample Input 3\n\n100 4 16\n\nSample Output 3\n\n4554", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1464, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s145270586", "group_id": "codeNet:p03478", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, a, b int\n\n\tfmt.Scan(&n, &a, &b)\n\n\tvar result int\n\tfor i := 0; i <= n; i++ {\n\t\tdigitSum := digitSum(i)\n\t\tif a <= digitSum && digitSum <= b {\n\t\t\tresult += i\n\t\t}\n\t}\n\tfmt.Println(result)\n}\n\nfunc digitSum(n int) int {\n\tvar sum int\n\n\tfor {\n\t\tdigit := n % 10\n\t\tsum += digit\n\t\tif n/10 == 0 {\n\t\t\tbreak\n\t\t}\n\t\tn = n / 10\n\t}\n\n\treturn sum\n}\n", "language": "Go", "metadata": {"date": 1581572325, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03478.html", "problem_id": "p03478", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03478/input.txt", "sample_output_relpath": "derived/input_output/data/p03478/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03478/Go/s145270586.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s145270586", "user_id": "u753867091"}, "prompt_components": {"gold_output": "84\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, a, b int\n\n\tfmt.Scan(&n, &a, &b)\n\n\tvar result int\n\tfor i := 0; i <= n; i++ {\n\t\tdigitSum := digitSum(i)\n\t\tif a <= digitSum && digitSum <= b {\n\t\t\tresult += i\n\t\t}\n\t}\n\tfmt.Println(result)\n}\n\nfunc digitSum(n int) int {\n\tvar sum int\n\n\tfor {\n\t\tdigit := n % 10\n\t\tsum += digit\n\t\tif n/10 == 0 {\n\t\t\tbreak\n\t\t}\n\t\tn = n / 10\n\t}\n\n\treturn sum\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nFind the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A \\leq B \\leq 36\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 sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nSample Input 1\n\n20 2 5\n\nSample Output 1\n\n84\n\nAmong the integers not greater than 20, the ones whose sums of digits are between 2 and 5, are: 2,3,4,5,11,12,13,14 and 20. We should print the sum of these, 84.\n\nSample Input 2\n\n10 1 2\n\nSample Output 2\n\n13\n\nSample Input 3\n\n100 4 16\n\nSample Output 3\n\n4554", "sample_input": "20 2 5\n"}, "reference_outputs": ["84\n"], "source_document_id": "p03478", "source_text": "Score : 200 points\n\nProblem Statement\n\nFind the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A \\leq B \\leq 36\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 sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nSample Input 1\n\n20 2 5\n\nSample Output 1\n\n84\n\nAmong the integers not greater than 20, the ones whose sums of digits are between 2 and 5, are: 2,3,4,5,11,12,13,14 and 20. We should print the sum of these, 84.\n\nSample Input 2\n\n10 1 2\n\nSample Output 2\n\n13\n\nSample Input 3\n\n100 4 16\n\nSample Output 3\n\n4554", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 378, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s083837044", "group_id": "codeNet:p03478", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar (\n\t\tn, a, b int\n\t)\n\tfmt.Scan(&n, &a, &b)\n\n\tres := 0\n\tfor x := 1; x <= n; x++ {\n\t\tv := x\n\t\tsum := 0\n\t\tfor v > 0 {\n\t\t\tsum += v % 10\n\t\t\tv /= 10\n\t\t}\n\t\tif a <= sum && sum <= b {\n\t\t\tres += x\n\t\t}\n\t}\n\tfmt.Println(res)\n}\n", "language": "Go", "metadata": {"date": 1577187131, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03478.html", "problem_id": "p03478", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03478/input.txt", "sample_output_relpath": "derived/input_output/data/p03478/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03478/Go/s083837044.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s083837044", "user_id": "u875972329"}, "prompt_components": {"gold_output": "84\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar (\n\t\tn, a, b int\n\t)\n\tfmt.Scan(&n, &a, &b)\n\n\tres := 0\n\tfor x := 1; x <= n; x++ {\n\t\tv := x\n\t\tsum := 0\n\t\tfor v > 0 {\n\t\t\tsum += v % 10\n\t\t\tv /= 10\n\t\t}\n\t\tif a <= sum && sum <= b {\n\t\t\tres += x\n\t\t}\n\t}\n\tfmt.Println(res)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nFind the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A \\leq B \\leq 36\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 sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nSample Input 1\n\n20 2 5\n\nSample Output 1\n\n84\n\nAmong the integers not greater than 20, the ones whose sums of digits are between 2 and 5, are: 2,3,4,5,11,12,13,14 and 20. We should print the sum of these, 84.\n\nSample Input 2\n\n10 1 2\n\nSample Output 2\n\n13\n\nSample Input 3\n\n100 4 16\n\nSample Output 3\n\n4554", "sample_input": "20 2 5\n"}, "reference_outputs": ["84\n"], "source_document_id": "p03478", "source_text": "Score : 200 points\n\nProblem Statement\n\nFind the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A \\leq B \\leq 36\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 sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nSample Input 1\n\n20 2 5\n\nSample Output 1\n\n84\n\nAmong the integers not greater than 20, the ones whose sums of digits are between 2 and 5, are: 2,3,4,5,11,12,13,14 and 20. We should print the sum of these, 84.\n\nSample Input 2\n\n10 1 2\n\nSample Output 2\n\n13\n\nSample Input 3\n\n100 4 16\n\nSample Output 3\n\n4554", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 264, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s445485370", "group_id": "codeNet:p03478", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc sumOfDegit(n int) int {\n var sum int\n for n > 0 {\n sum += n % 10\n n /= 10\n }\n return sum\n}\n\nfunc main() {\n var n, a, b, sum int\n fmt.Scan(&n, &a, &b)\n for i := 1; i < n+1; i++ {\n if v := sumOfDegit(i); a <= v && v <= b {\n sum += i\n }\n }\n fmt.Println(sum)\n}", "language": "Go", "metadata": {"date": 1575568844, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03478.html", "problem_id": "p03478", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03478/input.txt", "sample_output_relpath": "derived/input_output/data/p03478/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03478/Go/s445485370.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s445485370", "user_id": "u699111327"}, "prompt_components": {"gold_output": "84\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc sumOfDegit(n int) int {\n var sum int\n for n > 0 {\n sum += n % 10\n n /= 10\n }\n return sum\n}\n\nfunc main() {\n var n, a, b, sum int\n fmt.Scan(&n, &a, &b)\n for i := 1; i < n+1; i++ {\n if v := sumOfDegit(i); a <= v && v <= b {\n sum += i\n }\n }\n fmt.Println(sum)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nFind the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A \\leq B \\leq 36\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 sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nSample Input 1\n\n20 2 5\n\nSample Output 1\n\n84\n\nAmong the integers not greater than 20, the ones whose sums of digits are between 2 and 5, are: 2,3,4,5,11,12,13,14 and 20. We should print the sum of these, 84.\n\nSample Input 2\n\n10 1 2\n\nSample Output 2\n\n13\n\nSample Input 3\n\n100 4 16\n\nSample Output 3\n\n4554", "sample_input": "20 2 5\n"}, "reference_outputs": ["84\n"], "source_document_id": "p03478", "source_text": "Score : 200 points\n\nProblem Statement\n\nFind the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A \\leq B \\leq 36\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 sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nSample Input 1\n\n20 2 5\n\nSample Output 1\n\n84\n\nAmong the integers not greater than 20, the ones whose sums of digits are between 2 and 5, are: 2,3,4,5,11,12,13,14 and 20. We should print the sum of these, 84.\n\nSample Input 2\n\n10 1 2\n\nSample Output 2\n\n13\n\nSample Input 3\n\n100 4 16\n\nSample Output 3\n\n4554", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s868718865", "group_id": "codeNet:p03478", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n,a,b int\n\tfmt.Scan(&n, &a, &b)\n\n\ttotal := 0\n\tfor i := 1; i <= n; i++ {\n\t\tsum := calc(i)\n\t\tif a <= sum && sum <= b {\n\t\t\ttotal += i\n\t\t}\n\t}\n\tfmt.Println(total)\n}\n\nfunc calc(n int) int{\n\tsum := 0\n\tfor {\n\t\tif n == 0 {\n\t\t\tbreak\n\t\t}\n\t\tsum += n % 10\n\t\tn = n / 10\n\t}\n\treturn sum\n}", "language": "Go", "metadata": {"date": 1568339410, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03478.html", "problem_id": "p03478", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03478/input.txt", "sample_output_relpath": "derived/input_output/data/p03478/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03478/Go/s868718865.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s868718865", "user_id": "u390374229"}, "prompt_components": {"gold_output": "84\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n,a,b int\n\tfmt.Scan(&n, &a, &b)\n\n\ttotal := 0\n\tfor i := 1; i <= n; i++ {\n\t\tsum := calc(i)\n\t\tif a <= sum && sum <= b {\n\t\t\ttotal += i\n\t\t}\n\t}\n\tfmt.Println(total)\n}\n\nfunc calc(n int) int{\n\tsum := 0\n\tfor {\n\t\tif n == 0 {\n\t\t\tbreak\n\t\t}\n\t\tsum += n % 10\n\t\tn = n / 10\n\t}\n\treturn sum\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nFind the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A \\leq B \\leq 36\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 sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nSample Input 1\n\n20 2 5\n\nSample Output 1\n\n84\n\nAmong the integers not greater than 20, the ones whose sums of digits are between 2 and 5, are: 2,3,4,5,11,12,13,14 and 20. We should print the sum of these, 84.\n\nSample Input 2\n\n10 1 2\n\nSample Output 2\n\n13\n\nSample Input 3\n\n100 4 16\n\nSample Output 3\n\n4554", "sample_input": "20 2 5\n"}, "reference_outputs": ["84\n"], "source_document_id": "p03478", "source_text": "Score : 200 points\n\nProblem Statement\n\nFind the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A \\leq B \\leq 36\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 sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nSample Input 1\n\n20 2 5\n\nSample Output 1\n\n84\n\nAmong the integers not greater than 20, the ones whose sums of digits are between 2 and 5, are: 2,3,4,5,11,12,13,14 and 20. We should print the sum of these, 84.\n\nSample Input 2\n\n10 1 2\n\nSample Output 2\n\n13\n\nSample Input 3\n\n100 4 16\n\nSample Output 3\n\n4554", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s480718686", "group_id": "codeNet:p03478", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n)\n\nfunc main() {\n\tvar n, a, b, total int\n\tfmt.Scanf(\"%d %d %d\", &n, &a, &b)\n\n\tfor i := 1; i < (n + 1); i++ {\n\t\tvar x [3]int\n\t\tvar y [3]int\n\t\tif i > 1000 {\n\t\t\tx[0] = i / 1000\n\t\t\ty[0] = i % 1000\n\t\t}\n\t\tif i > 100 {\n\t\t\tx[1] = i / 100\n\t\t\ty[1] = i % 100\n\t\t}\n\n\t\tx[2] = i / 10\n\t\ty[2] = i % 10\n\n\t\tres := x[0] + x[1] + x[2] + y[0] + y[1] + y[2]\n\n\t\tif res >= a && res <= b {\n\t\t\ttotal += i\n\t\t\tlog.Printf(\"n = %d -> res:%d\", i, res)\n\n\t\t}\n\t}\n\tfmt.Print(total)\n}\n", "language": "Go", "metadata": {"date": 1567811248, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03478.html", "problem_id": "p03478", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03478/input.txt", "sample_output_relpath": "derived/input_output/data/p03478/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03478/Go/s480718686.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s480718686", "user_id": "u514178143"}, "prompt_components": {"gold_output": "84\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n)\n\nfunc main() {\n\tvar n, a, b, total int\n\tfmt.Scanf(\"%d %d %d\", &n, &a, &b)\n\n\tfor i := 1; i < (n + 1); i++ {\n\t\tvar x [3]int\n\t\tvar y [3]int\n\t\tif i > 1000 {\n\t\t\tx[0] = i / 1000\n\t\t\ty[0] = i % 1000\n\t\t}\n\t\tif i > 100 {\n\t\t\tx[1] = i / 100\n\t\t\ty[1] = i % 100\n\t\t}\n\n\t\tx[2] = i / 10\n\t\ty[2] = i % 10\n\n\t\tres := x[0] + x[1] + x[2] + y[0] + y[1] + y[2]\n\n\t\tif res >= a && res <= b {\n\t\t\ttotal += i\n\t\t\tlog.Printf(\"n = %d -> res:%d\", i, res)\n\n\t\t}\n\t}\n\tfmt.Print(total)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nFind the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A \\leq B \\leq 36\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 sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nSample Input 1\n\n20 2 5\n\nSample Output 1\n\n84\n\nAmong the integers not greater than 20, the ones whose sums of digits are between 2 and 5, are: 2,3,4,5,11,12,13,14 and 20. We should print the sum of these, 84.\n\nSample Input 2\n\n10 1 2\n\nSample Output 2\n\n13\n\nSample Input 3\n\n100 4 16\n\nSample Output 3\n\n4554", "sample_input": "20 2 5\n"}, "reference_outputs": ["84\n"], "source_document_id": "p03478", "source_text": "Score : 200 points\n\nProblem Statement\n\nFind the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A \\leq B \\leq 36\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 sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nSample Input 1\n\n20 2 5\n\nSample Output 1\n\n84\n\nAmong the integers not greater than 20, the ones whose sums of digits are between 2 and 5, are: 2,3,4,5,11,12,13,14 and 20. We should print the sum of these, 84.\n\nSample Input 2\n\n10 1 2\n\nSample Output 2\n\n13\n\nSample Input 3\n\n100 4 16\n\nSample Output 3\n\n4554", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 485, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s490906493", "group_id": "codeNet:p03478", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar stdin = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tvar o int\n\tarr := scanArrayInt()\n\tn, a, b := arr[0], arr[1], arr[2]\n\tfor i := 1; i <= n; i++ {\n\t\tt, d := 0, i\n\t\tfor {\n\t\t\tt, d = t+d%10, d/10\n\t\t\tif d == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif a <= t && t <= b {\n\t\t\to += i\n\t\t}\n\t}\n\tfmt.Println(o)\n}\n\nfunc scanArrayInt() []int {\n\tvar ret = []int{}\n\tstdin.Scan()\n\tfor _, s := range strings.Split(stdin.Text(), \" \") {\n\t\ti, _ := strconv.Atoi(s)\n\t\tret = append(ret, i)\n\t}\n\treturn ret\n}\n", "language": "Go", "metadata": {"date": 1567741264, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03478.html", "problem_id": "p03478", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03478/input.txt", "sample_output_relpath": "derived/input_output/data/p03478/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03478/Go/s490906493.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s490906493", "user_id": "u564244597"}, "prompt_components": {"gold_output": "84\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar stdin = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\tvar o int\n\tarr := scanArrayInt()\n\tn, a, b := arr[0], arr[1], arr[2]\n\tfor i := 1; i <= n; i++ {\n\t\tt, d := 0, i\n\t\tfor {\n\t\t\tt, d = t+d%10, d/10\n\t\t\tif d == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif a <= t && t <= b {\n\t\t\to += i\n\t\t}\n\t}\n\tfmt.Println(o)\n}\n\nfunc scanArrayInt() []int {\n\tvar ret = []int{}\n\tstdin.Scan()\n\tfor _, s := range strings.Split(stdin.Text(), \" \") {\n\t\ti, _ := strconv.Atoi(s)\n\t\tret = append(ret, i)\n\t}\n\treturn ret\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nFind the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A \\leq B \\leq 36\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 sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nSample Input 1\n\n20 2 5\n\nSample Output 1\n\n84\n\nAmong the integers not greater than 20, the ones whose sums of digits are between 2 and 5, are: 2,3,4,5,11,12,13,14 and 20. We should print the sum of these, 84.\n\nSample Input 2\n\n10 1 2\n\nSample Output 2\n\n13\n\nSample Input 3\n\n100 4 16\n\nSample Output 3\n\n4554", "sample_input": "20 2 5\n"}, "reference_outputs": ["84\n"], "source_document_id": "p03478", "source_text": "Score : 200 points\n\nProblem Statement\n\nFind the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A \\leq B \\leq 36\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 sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nSample Input 1\n\n20 2 5\n\nSample Output 1\n\n84\n\nAmong the integers not greater than 20, the ones whose sums of digits are between 2 and 5, are: 2,3,4,5,11,12,13,14 and 20. We should print the sum of these, 84.\n\nSample Input 2\n\n10 1 2\n\nSample Output 2\n\n13\n\nSample Input 3\n\n100 4 16\n\nSample Output 3\n\n4554", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 541, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s866489585", "group_id": "codeNet:p03478", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc sum_of_digit(n int) int {\n\tvar sum int\n\tfor n > 0 {\n\t\tsum += n % 10\n\t\tn /= 10\n\t}\n\treturn sum\n}\nfunc main() {\n\tvar n, a, b, sum int\n\tfmt.Scan(&n, &a, &b)\n\tfor i := 1; i < n+1; i++ {\n\t\tif v := sum_of_digit(i); a <= v && v <= b {\n\t\t\tsum += i\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n", "language": "Go", "metadata": {"date": 1559436138, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03478.html", "problem_id": "p03478", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03478/input.txt", "sample_output_relpath": "derived/input_output/data/p03478/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03478/Go/s866489585.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s866489585", "user_id": "u843722521"}, "prompt_components": {"gold_output": "84\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc sum_of_digit(n int) int {\n\tvar sum int\n\tfor n > 0 {\n\t\tsum += n % 10\n\t\tn /= 10\n\t}\n\treturn sum\n}\nfunc main() {\n\tvar n, a, b, sum int\n\tfmt.Scan(&n, &a, &b)\n\tfor i := 1; i < n+1; i++ {\n\t\tif v := sum_of_digit(i); a <= v && v <= b {\n\t\t\tsum += i\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nFind the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A \\leq B \\leq 36\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 sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nSample Input 1\n\n20 2 5\n\nSample Output 1\n\n84\n\nAmong the integers not greater than 20, the ones whose sums of digits are between 2 and 5, are: 2,3,4,5,11,12,13,14 and 20. We should print the sum of these, 84.\n\nSample Input 2\n\n10 1 2\n\nSample Output 2\n\n13\n\nSample Input 3\n\n100 4 16\n\nSample Output 3\n\n4554", "sample_input": "20 2 5\n"}, "reference_outputs": ["84\n"], "source_document_id": "p03478", "source_text": "Score : 200 points\n\nProblem Statement\n\nFind the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A \\leq B \\leq 36\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 sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nSample Input 1\n\n20 2 5\n\nSample Output 1\n\n84\n\nAmong the integers not greater than 20, the ones whose sums of digits are between 2 and 5, are: 2,3,4,5,11,12,13,14 and 20. We should print the sum of these, 84.\n\nSample Input 2\n\n10 1 2\n\nSample Output 2\n\n13\n\nSample Input 3\n\n100 4 16\n\nSample Output 3\n\n4554", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 304, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s733044055", "group_id": "codeNet:p03478", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, a, b int\n\tfmt.Scan(&n, &a, &b)\n\n\tvar inRanges []int\n\n\tfor i := n; i > 0; i-- {\n\t\tsum := 0\n\t\tnum := i\n\t\tfor num > 0 {\n\t\t\tsum += num%10\n\t\t\tnum /= 10\n\t\t}\n\t\tif a <= sum && sum <= b {\n\t\t\tinRanges = append(inRanges, i)\n\t\t}\n\t}\n\n\tans := 0\n\tfor _, value := range inRanges {\n\t\tans += value\n\t}\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1555988264, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03478.html", "problem_id": "p03478", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03478/input.txt", "sample_output_relpath": "derived/input_output/data/p03478/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03478/Go/s733044055.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s733044055", "user_id": "u463644733"}, "prompt_components": {"gold_output": "84\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar n, a, b int\n\tfmt.Scan(&n, &a, &b)\n\n\tvar inRanges []int\n\n\tfor i := n; i > 0; i-- {\n\t\tsum := 0\n\t\tnum := i\n\t\tfor num > 0 {\n\t\t\tsum += num%10\n\t\t\tnum /= 10\n\t\t}\n\t\tif a <= sum && sum <= b {\n\t\t\tinRanges = append(inRanges, i)\n\t\t}\n\t}\n\n\tans := 0\n\tfor _, value := range inRanges {\n\t\tans += value\n\t}\n\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nFind the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A \\leq B \\leq 36\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 sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nSample Input 1\n\n20 2 5\n\nSample Output 1\n\n84\n\nAmong the integers not greater than 20, the ones whose sums of digits are between 2 and 5, are: 2,3,4,5,11,12,13,14 and 20. We should print the sum of these, 84.\n\nSample Input 2\n\n10 1 2\n\nSample Output 2\n\n13\n\nSample Input 3\n\n100 4 16\n\nSample Output 3\n\n4554", "sample_input": "20 2 5\n"}, "reference_outputs": ["84\n"], "source_document_id": "p03478", "source_text": "Score : 200 points\n\nProblem Statement\n\nFind the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A \\leq B \\leq 36\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 sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nSample Input 1\n\n20 2 5\n\nSample Output 1\n\n84\n\nAmong the integers not greater than 20, the ones whose sums of digits are between 2 and 5, are: 2,3,4,5,11,12,13,14 and 20. We should print the sum of these, 84.\n\nSample Input 2\n\n10 1 2\n\nSample Output 2\n\n13\n\nSample Input 3\n\n100 4 16\n\nSample Output 3\n\n4554", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 896}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s345648070", "group_id": "codeNet:p03478", "input_text": "// Package main provides\n//\n// File: b.go\n// Author: ymiyamoto\n//\n// Created on Thu Jan 3 17:24:32 2019\n//\npackage main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar N, A, B int\n\tfmt.Scan(&N, &A, &B)\n\n\tans := 0\n\tfor i := 1; i <= N; i++ {\n\t\ts := strconv.Itoa(i)\n\n\t\tsum := 0\n\t\tfor i := range s {\n\t\t\tsum += int(s[i] - '0')\n\t\t}\n\t\tif A <= sum && sum <= B {\n\t\t\tans += i\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1546554411, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03478.html", "problem_id": "p03478", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03478/input.txt", "sample_output_relpath": "derived/input_output/data/p03478/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03478/Go/s345648070.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s345648070", "user_id": "u802614675"}, "prompt_components": {"gold_output": "84\n", "input_to_evaluate": "// Package main provides\n//\n// File: b.go\n// Author: ymiyamoto\n//\n// Created on Thu Jan 3 17:24:32 2019\n//\npackage main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar N, A, B int\n\tfmt.Scan(&N, &A, &B)\n\n\tans := 0\n\tfor i := 1; i <= N; i++ {\n\t\ts := strconv.Itoa(i)\n\n\t\tsum := 0\n\t\tfor i := range s {\n\t\t\tsum += int(s[i] - '0')\n\t\t}\n\t\tif A <= sum && sum <= B {\n\t\t\tans += i\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nFind the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A \\leq B \\leq 36\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 sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nSample Input 1\n\n20 2 5\n\nSample Output 1\n\n84\n\nAmong the integers not greater than 20, the ones whose sums of digits are between 2 and 5, are: 2,3,4,5,11,12,13,14 and 20. We should print the sum of these, 84.\n\nSample Input 2\n\n10 1 2\n\nSample Output 2\n\n13\n\nSample Input 3\n\n100 4 16\n\nSample Output 3\n\n4554", "sample_input": "20 2 5\n"}, "reference_outputs": ["84\n"], "source_document_id": "p03478", "source_text": "Score : 200 points\n\nProblem Statement\n\nFind the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A \\leq B \\leq 36\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 sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nSample Input 1\n\n20 2 5\n\nSample Output 1\n\n84\n\nAmong the integers not greater than 20, the ones whose sums of digits are between 2 and 5, are: 2,3,4,5,11,12,13,14 and 20. We should print the sum of these, 84.\n\nSample Input 2\n\n10 1 2\n\nSample Output 2\n\n13\n\nSample Input 3\n\n100 4 16\n\nSample Output 3\n\n4554", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 397, "cpu_time_ms": 2, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s415087703", "group_id": "codeNet:p03478", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tvar N, A, B int\n\tfmt.Scan(&N, &A, &B)\n\n\tans := 0\n\tfor i := 1; i <= N; i++ {\n\t\tsi := strconv.FormatInt(int64(i), 10)\n\t\tc := 0\n\t\tfor _, s := range si {\n\t\t\tpo, _ := strconv.ParseInt(string(s), 10, 64)\n\t\t\tc += int(po)\n\t\t}\n\t\tif A <= c && c <= B {\n\t\t\tans += i\n\t\t}\n\n\t}\n\tfmt.Println(ans)\n}\n\nfunc main() {\n\tsolve()\n}\n", "language": "Go", "metadata": {"date": 1520672824, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03478.html", "problem_id": "p03478", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03478/input.txt", "sample_output_relpath": "derived/input_output/data/p03478/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03478/Go/s415087703.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s415087703", "user_id": "u061935128"}, "prompt_components": {"gold_output": "84\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tvar N, A, B int\n\tfmt.Scan(&N, &A, &B)\n\n\tans := 0\n\tfor i := 1; i <= N; i++ {\n\t\tsi := strconv.FormatInt(int64(i), 10)\n\t\tc := 0\n\t\tfor _, s := range si {\n\t\t\tpo, _ := strconv.ParseInt(string(s), 10, 64)\n\t\t\tc += int(po)\n\t\t}\n\t\tif A <= c && c <= B {\n\t\t\tans += i\n\t\t}\n\n\t}\n\tfmt.Println(ans)\n}\n\nfunc main() {\n\tsolve()\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nFind the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A \\leq B \\leq 36\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 sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nSample Input 1\n\n20 2 5\n\nSample Output 1\n\n84\n\nAmong the integers not greater than 20, the ones whose sums of digits are between 2 and 5, are: 2,3,4,5,11,12,13,14 and 20. We should print the sum of these, 84.\n\nSample Input 2\n\n10 1 2\n\nSample Output 2\n\n13\n\nSample Input 3\n\n100 4 16\n\nSample Output 3\n\n4554", "sample_input": "20 2 5\n"}, "reference_outputs": ["84\n"], "source_document_id": "p03478", "source_text": "Score : 200 points\n\nProblem Statement\n\nFind the sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A \\leq B \\leq 36\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 sum of the integers between 1 and N (inclusive), whose sum of digits written in base 10 is between A and B (inclusive).\n\nSample Input 1\n\n20 2 5\n\nSample Output 1\n\n84\n\nAmong the integers not greater than 20, the ones whose sums of digits are between 2 and 5, are: 2,3,4,5,11,12,13,14 and 20. We should print the sum of these, 84.\n\nSample Input 2\n\n10 1 2\n\nSample Output 2\n\n13\n\nSample Input 3\n\n100 4 16\n\nSample Output 3\n\n4554", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s771917431", "group_id": "codeNet:p03493", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tA(sc)\n}\n\nfunc A(sc *bufio.Scanner) (cnt int) {\n\tsc.Scan()\n\ts := sc.Text()\n\tfor _, t := range strings.Split(s, \"\") {\n\t\tif t == \"1\" {\n\t\t\tcnt++\n\t\t}\n\t}\n\treturn\n}\n", "language": "Go", "metadata": {"date": 1592424357, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03493.html", "problem_id": "p03493", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03493/input.txt", "sample_output_relpath": "derived/input_output/data/p03493/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03493/Go/s771917431.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s771917431", "user_id": "u283155180"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tA(sc)\n}\n\nfunc A(sc *bufio.Scanner) (cnt int) {\n\tsc.Scan()\n\ts := sc.Text()\n\tfor _, t := range strings.Split(s, \"\") {\n\t\tif t == \"1\" {\n\t\t\tcnt++\n\t\t}\n\t}\n\treturn\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "sample_input": "101\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03493", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s168456517", "group_id": "codeNet:p03493", "input_text": "package main\nimport \"fmt\"\n\nfunc main(){\n\tvar s string\n\tans := 0\n\tfmt.Scan(&s)\n\tfor i:=0;i<=2;i++{\n\t\tif s[i] == '1'{\n\t\t\tans ++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1592343973, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03493.html", "problem_id": "p03493", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03493/input.txt", "sample_output_relpath": "derived/input_output/data/p03493/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03493/Go/s168456517.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s168456517", "user_id": "u192154323"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\nimport \"fmt\"\n\nfunc main(){\n\tvar s string\n\tans := 0\n\tfmt.Scan(&s)\n\tfor i:=0;i<=2;i++{\n\t\tif s[i] == '1'{\n\t\t\tans ++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "sample_input": "101\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03493", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s328878233", "group_id": "codeNet:p03493", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nvar (\n\treader io.Reader = os.Stdin\n\twriter io.Writer = os.Stdout\n)\n\nfunc main() {\n\trun()\n}\n\nfunc run() {\n\tvar str string\n\tfmt.Fscan(reader, &str)\n\tvar count int\n\n\tfor _, r := range str {\n\t\tif r == '1' {\n\t\t\tcount++\n\t\t}\n\t}\n\n\tfmt.Fprintln(writer, count)\n}\n", "language": "Go", "metadata": {"date": 1589282461, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03493.html", "problem_id": "p03493", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03493/input.txt", "sample_output_relpath": "derived/input_output/data/p03493/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03493/Go/s328878233.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s328878233", "user_id": "u177410652"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\nvar (\n\treader io.Reader = os.Stdin\n\twriter io.Writer = os.Stdout\n)\n\nfunc main() {\n\trun()\n}\n\nfunc run() {\n\tvar str string\n\tfmt.Fscan(reader, &str)\n\tvar count int\n\n\tfor _, r := range str {\n\t\tif r == '1' {\n\t\t\tcount++\n\t\t}\n\t}\n\n\tfmt.Fprintln(writer, count)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "sample_input": "101\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03493", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s744728447", "group_id": "codeNet:p03493", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tvar s1 int\n\tvar s2 int\n\tvar s3 int\n\n\ts1, _ = strconv.Atoi(string(s[0]))\n\ts2, _ = strconv.Atoi(string(s[1]))\n\ts3, _ = strconv.Atoi(string(s[2]))\n\tfmt.Println(s1 + s2 + s3)\n\n}", "language": "Go", "metadata": {"date": 1583889070, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03493.html", "problem_id": "p03493", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03493/input.txt", "sample_output_relpath": "derived/input_output/data/p03493/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03493/Go/s744728447.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s744728447", "user_id": "u197394058"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tvar s1 int\n\tvar s2 int\n\tvar s3 int\n\n\ts1, _ = strconv.Atoi(string(s[0]))\n\ts2, _ = strconv.Atoi(string(s[1]))\n\ts3, _ = strconv.Atoi(string(s[2]))\n\tfmt.Println(s1 + s2 + s3)\n\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "sample_input": "101\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03493", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s709852861", "group_id": "codeNet:p03493", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar a string\n\tfmt.Scan(&a)\n\tfmt.Printf(\"%d\\n\", strings.Count(a, \"1\"))\n}\n", "language": "Go", "metadata": {"date": 1583089620, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03493.html", "problem_id": "p03493", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03493/input.txt", "sample_output_relpath": "derived/input_output/data/p03493/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03493/Go/s709852861.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s709852861", "user_id": "u322744344"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar a string\n\tfmt.Scan(&a)\n\tfmt.Printf(\"%d\\n\", strings.Count(a, \"1\"))\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "sample_input": "101\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03493", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s645722935", "group_id": "codeNet:p03493", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar flds string\n\n\tfmt.Scan(&flds)\n\tgrid := []rune(flds)\n\tcount := 0\n\tfor _, v := range grid {\n\t\tif v == '1' {\n\t\t\tcount++\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\\n\", count)\n}\n", "language": "Go", "metadata": {"date": 1582408469, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03493.html", "problem_id": "p03493", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03493/input.txt", "sample_output_relpath": "derived/input_output/data/p03493/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03493/Go/s645722935.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s645722935", "user_id": "u067604172"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar flds string\n\n\tfmt.Scan(&flds)\n\tgrid := []rune(flds)\n\tcount := 0\n\tfor _, v := range grid {\n\t\tif v == '1' {\n\t\t\tcount++\n\t\t}\n\t}\n\n\tfmt.Printf(\"%d\\n\", count)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "sample_input": "101\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03493", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 206, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s494443712", "group_id": "codeNet:p03493", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\ntype Pair struct {\n\tp1, p2 interface{}\n}\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n)\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tscanner.Buffer(buf, maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\n\ta := readString()\n\tfmt.Println(strings.Count(a, \"1\"))\n}\n\n/*==========================================\n * Library\n *==========================================*/\nfunc write(s string) {\n\twriter.WriteString(s)\n}\n\nfunc print() {\n\twriter.Flush()\n}\n\n// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可\nfunc readLine() (s string) {\n\tif scanner.Scan() {\n\t\ts = scanner.Text()\n\t}\n\treturn s\n}\n\nfunc readInt() (read int) {\n\tscanner.Scan()\n\tread, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readFloat() (read float64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readRunes() (read []rune) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, v)\n\t}\n\treturn\n}\n\nfunc readString() (read string) {\n\tscanner.Scan()\n\tread = scanner.Text()\n\treturn\n}\n\nfunc readStrings() (read []string) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, string(v))\n\t}\n\treturn\n}\n\nfunc s2i(s string) int {\n\tvar intVal, e = strconv.Atoi(s)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int) string {\n\tvar strVal = strconv.Itoa(i)\n\treturn strVal\n}\n\nfunc s2f(s string) float64 {\n\tvar floatVal, e = strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn floatVal\n}\n\nfunc sum(i []int) int {\n\tsum := 0\n\tfor _, val := range i {\n\t\tsum += val\n\t}\n\treturn sum\n}\n\nfunc split(s string) []string {\n\treturn strings.Fields(s)\n}\n\nfunc strAry2intAry(strs []string) []int {\n\tvar ret = make([]int, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal, e = strconv.Atoi(string(str))\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = strconv.Itoa(num)\n\t\tret = append(ret, strVal)\n\t}\n\treturn ret\n}\n\nfunc ary2str(strs []string) string {\n\treturn strings.Join(strs, \" \")\n}\n\nfunc reverse(res []int) []int {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\n\nfunc initalize(res []int, init int) {\n\tif len(res) == 0 {\n\t\treturn\n\t}\n\tres[0] = init\n\tfor i := 0; i < len(res); i++ {\n\t\tcopy(res[i:], res[:i])\n\t}\n}\n\n//\n// func regexpExample() {\n// // Your code here!\n// var str = \"13:20\"\n// r := regexp.MustCompile(`(\\d+):(\\d+)`)\n// fmt.Println(r.FindStringSubmatch(str))\n// }\n\n// type Country struct {\n// gold int\n// silver int\n// blonze int\n// }\n\n// // 複数ソートのサンプル\n// func stableSortExample() []Country{\n// var country = []Country {\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:3, blonze:2},\n// {gold:1, silver:3, blonze:3},\n// }\n// sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })\n// return country\n// }\n", "language": "Go", "metadata": {"date": 1580848668, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03493.html", "problem_id": "p03493", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03493/input.txt", "sample_output_relpath": "derived/input_output/data/p03493/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03493/Go/s494443712.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s494443712", "user_id": "u967669872"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n\t// \"regexp\"\n)\n\ntype Pair struct {\n\tp1, p2 interface{}\n}\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e8\n)\n\nvar (\n\tscanner = bufio.NewScanner(os.Stdin)\n\twriter = bufio.NewWriter(os.Stdout)\n)\n\nfunc main() {\n\tbuf := make([]byte, initialBufSize)\n\tscanner.Buffer(buf, maxBufSize)\n\tscanner.Split(bufio.ScanWords)\n\n\ta := readString()\n\tfmt.Println(strings.Count(a, \"1\"))\n}\n\n/*==========================================\n * Library\n *==========================================*/\nfunc write(s string) {\n\twriter.WriteString(s)\n}\n\nfunc print() {\n\twriter.Flush()\n}\n\n// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可\nfunc readLine() (s string) {\n\tif scanner.Scan() {\n\t\ts = scanner.Text()\n\t}\n\treturn s\n}\n\nfunc readInt() (read int) {\n\tscanner.Scan()\n\tread, err := strconv.Atoi(scanner.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readFloat() (read float64) {\n\tscanner.Scan()\n\tread, err := strconv.ParseFloat(scanner.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn\n}\n\nfunc readRunes() (read []rune) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, v)\n\t}\n\treturn\n}\n\nfunc readString() (read string) {\n\tscanner.Scan()\n\tread = scanner.Text()\n\treturn\n}\n\nfunc readStrings() (read []string) {\n\tscanner.Scan()\n\tfor _, v := range scanner.Text() {\n\t\tread = append(read, string(v))\n\t}\n\treturn\n}\n\nfunc s2i(s string) int {\n\tvar intVal, e = strconv.Atoi(s)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn intVal\n}\n\nfunc i2s(i int) string {\n\tvar strVal = strconv.Itoa(i)\n\treturn strVal\n}\n\nfunc s2f(s string) float64 {\n\tvar floatVal, e = strconv.ParseFloat(s, 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn floatVal\n}\n\nfunc sum(i []int) int {\n\tsum := 0\n\tfor _, val := range i {\n\t\tsum += val\n\t}\n\treturn sum\n}\n\nfunc split(s string) []string {\n\treturn strings.Fields(s)\n}\n\nfunc strAry2intAry(strs []string) []int {\n\tvar ret = make([]int, 0, len(strs))\n\tfor _, str := range strs {\n\t\tvar intVal, e = strconv.Atoi(string(str))\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tret = append(ret, intVal)\n\t}\n\treturn ret\n}\n\nfunc intAry2strAry(nums []int) []string {\n\tvar ret = make([]string, 0, len(nums))\n\tfor _, num := range nums {\n\t\tvar strVal = strconv.Itoa(num)\n\t\tret = append(ret, strVal)\n\t}\n\treturn ret\n}\n\nfunc ary2str(strs []string) string {\n\treturn strings.Join(strs, \" \")\n}\n\nfunc reverse(res []int) []int {\n\tfor i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {\n\t\tres[i], res[j] = res[j], res[i]\n\t}\n\treturn res\n}\n\nfunc initalize(res []int, init int) {\n\tif len(res) == 0 {\n\t\treturn\n\t}\n\tres[0] = init\n\tfor i := 0; i < len(res); i++ {\n\t\tcopy(res[i:], res[:i])\n\t}\n}\n\n//\n// func regexpExample() {\n// // Your code here!\n// var str = \"13:20\"\n// r := regexp.MustCompile(`(\\d+):(\\d+)`)\n// fmt.Println(r.FindStringSubmatch(str))\n// }\n\n// type Country struct {\n// gold int\n// silver int\n// blonze int\n// }\n\n// // 複数ソートのサンプル\n// func stableSortExample() []Country{\n// var country = []Country {\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:2, blonze:3},\n// {gold:1, silver:3, blonze:2},\n// {gold:1, silver:3, blonze:3},\n// }\n// sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })\n// sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })\n// return country\n// }\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "sample_input": "101\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03493", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3533, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s497136103", "group_id": "codeNet:p03493", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\t//sc.Split(bufio.ScanWords)\n\tvar a string\n\tans := 0\n\ta = next()\n\tfor i := 0; i < 3; i++ {\n\t\tif string(a[i]) == \"1\" {\n\t\t\tans++\n\t\t}\n\t}\n\tout.Flush()\n\tfmt.Println(ans)\n}\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc nextInt() int {\n\ta, e := strconv.Atoi(next())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn a\n}\n", "language": "Go", "metadata": {"date": 1578962911, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03493.html", "problem_id": "p03493", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03493/input.txt", "sample_output_relpath": "derived/input_output/data/p03493/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03493/Go/s497136103.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s497136103", "user_id": "u814986259"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\t//sc.Split(bufio.ScanWords)\n\tvar a string\n\tans := 0\n\ta = next()\n\tfor i := 0; i < 3; i++ {\n\t\tif string(a[i]) == \"1\" {\n\t\t\tans++\n\t\t}\n\t}\n\tout.Flush()\n\tfmt.Println(ans)\n}\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc nextInt() int {\n\ta, e := strconv.Atoi(next())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn a\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "sample_input": "101\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03493", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 458, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s752866665", "group_id": "codeNet:p03493", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a string\n\tfmt.Scan(&a)\n\tcounter := 0\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == '1' {\n\t\t\tcounter++\n\t\t}\n\t}\n\tfmt.Println(counter)\n}", "language": "Go", "metadata": {"date": 1575604860, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03493.html", "problem_id": "p03493", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03493/input.txt", "sample_output_relpath": "derived/input_output/data/p03493/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03493/Go/s752866665.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s752866665", "user_id": "u322744344"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar a string\n\tfmt.Scan(&a)\n\tcounter := 0\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == '1' {\n\t\t\tcounter++\n\t\t}\n\t}\n\tfmt.Println(counter)\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "sample_input": "101\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03493", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s327980218", "group_id": "codeNet:p03493", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a int\n\n\tfmt.Scan(&a)\n\n\tvar count int = 0\n\n\tif a/100 == 1 {\n\t\tcount++\n\t\ta -= 100\n\t}\n\tif a/10 == 1 {\n\t\tcount++\n\t\ta -= 10\n\t}\n\tif a == 1 {\n\t\tcount++\n\t}\n\n\tfmt.Printf(\"%d\\n\", count)\n}", "language": "Go", "metadata": {"date": 1573500303, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03493.html", "problem_id": "p03493", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03493/input.txt", "sample_output_relpath": "derived/input_output/data/p03493/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03493/Go/s327980218.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s327980218", "user_id": "u209193252"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar a int\n\n\tfmt.Scan(&a)\n\n\tvar count int = 0\n\n\tif a/100 == 1 {\n\t\tcount++\n\t\ta -= 100\n\t}\n\tif a/10 == 1 {\n\t\tcount++\n\t\ta -= 10\n\t}\n\tif a == 1 {\n\t\tcount++\n\t}\n\n\tfmt.Printf(\"%d\\n\", count)\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "sample_input": "101\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03493", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s164641439", "group_id": "codeNet:p03493", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar (\n\t\ta string\n\t\tans = 0\n\t)\n\tfmt.Scan(&a)\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == '1' {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1566195891, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03493.html", "problem_id": "p03493", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03493/input.txt", "sample_output_relpath": "derived/input_output/data/p03493/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03493/Go/s164641439.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s164641439", "user_id": "u367259152"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar (\n\t\ta string\n\t\tans = 0\n\t)\n\tfmt.Scan(&a)\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == '1' {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "sample_input": "101\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03493", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s140801273", "group_id": "codeNet:p03493", "input_text": "package main\n \nimport (\n\t\"fmt\"\n)\n \nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n count := 0\n\tif s[0:1] == \"1\" {\n\t\tcount++\n\t}\n\tif s[1:2] == \"1\" {\n\t\tcount++\n\t}\n\tif s[2:3] == \"1\" {\n\t\tcount++\n\t}\n\tfmt.Println(count)\n}", "language": "Go", "metadata": {"date": 1566164165, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03493.html", "problem_id": "p03493", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03493/input.txt", "sample_output_relpath": "derived/input_output/data/p03493/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03493/Go/s140801273.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s140801273", "user_id": "u422999773"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n \nimport (\n\t\"fmt\"\n)\n \nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n count := 0\n\tif s[0:1] == \"1\" {\n\t\tcount++\n\t}\n\tif s[1:2] == \"1\" {\n\t\tcount++\n\t}\n\tif s[2:3] == \"1\" {\n\t\tcount++\n\t}\n\tfmt.Println(count)\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "sample_input": "101\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03493", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s703671336", "group_id": "codeNet:p03493", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scanf(\"%s\", &s)\n\tfmt.Println(mass(s))\n}\n\nfunc mass(s string) int {\n\treturn strings.Count(s, \"1\")\n}", "language": "Go", "metadata": {"date": 1565019182, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03493.html", "problem_id": "p03493", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03493/input.txt", "sample_output_relpath": "derived/input_output/data/p03493/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03493/Go/s703671336.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s703671336", "user_id": "u119830165"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scanf(\"%s\", &s)\n\tfmt.Println(mass(s))\n}\n\nfunc mass(s string) int {\n\treturn strings.Count(s, \"1\")\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "sample_input": "101\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03493", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s430271869", "group_id": "codeNet:p03493", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\n\tfmt.Scan(&s)\n\n\tres := 0\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i:i+1] == \"1\" {\n\t\t\tres += 1\n\t\t}\n\t}\n\tfmt.Println(res)\n}", "language": "Go", "metadata": {"date": 1562268611, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03493.html", "problem_id": "p03493", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03493/input.txt", "sample_output_relpath": "derived/input_output/data/p03493/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03493/Go/s430271869.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s430271869", "user_id": "u411858517"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\n\tfmt.Scan(&s)\n\n\tres := 0\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i:i+1] == \"1\" {\n\t\t\tres += 1\n\t\t}\n\t}\n\tfmt.Println(res)\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "sample_input": "101\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03493", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s952163441", "group_id": "codeNet:p03493", "input_text": "package main\n\nimport \"fmt\"\n\nfunc stringToRunes(s string) (runes []rune) {\n\trunes = make([]rune, len(s))\n\tfor i, r := range s {\n\t\trunes[i] = r\n\t}\n\treturn\n}\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\trunes := stringToRunes(s)\n\tcnt := 0\n\tfor i := 0; i < len(runes); i++ {\n\t\tif runes[i] == '1' {\n\t\t\tcnt++\n\t\t}\n\t}\n\tfmt.Println(cnt)\n}\n", "language": "Go", "metadata": {"date": 1556373194, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03493.html", "problem_id": "p03493", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03493/input.txt", "sample_output_relpath": "derived/input_output/data/p03493/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03493/Go/s952163441.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s952163441", "user_id": "u004288099"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc stringToRunes(s string) (runes []rune) {\n\trunes = make([]rune, len(s))\n\tfor i, r := range s {\n\t\trunes[i] = r\n\t}\n\treturn\n}\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\trunes := stringToRunes(s)\n\tcnt := 0\n\tfor i := 0; i < len(runes); i++ {\n\t\tif runes[i] == '1' {\n\t\t\tcnt++\n\t\t}\n\t}\n\tfmt.Println(cnt)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "sample_input": "101\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03493", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 329, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s707931095", "group_id": "codeNet:p03493", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tcount := 0\n\tfmt.Scan(&s)\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] == '1' {\n\t\t\tcount++\n\t\t}\n\t}\n\tfmt.Println(count)\n}\n", "language": "Go", "metadata": {"date": 1547328863, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03493.html", "problem_id": "p03493", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03493/input.txt", "sample_output_relpath": "derived/input_output/data/p03493/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03493/Go/s707931095.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s707931095", "user_id": "u237362582"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tcount := 0\n\tfmt.Scan(&s)\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] == '1' {\n\t\t\tcount++\n\t\t}\n\t}\n\tfmt.Println(count)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "sample_input": "101\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03493", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 172, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s281225519", "group_id": "codeNet:p03493", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\ts := nextString()\n\tvar sum int\n\tfor i := 0; i < 3; i++ {\n\t\tif s[i:i+1] == \"1\" {\n\t\t\tsum++\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n\n// 以下がテンプレート\n\nvar nextReader func() string\n\nfunc init() {\n\tnextReader = NewScanner()\n}\n\nfunc NewScanner() func() string {\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\treturn func() string {\n\t\tr.Scan()\n\t\treturn r.Text()\n\t}\n}\nfunc nextString() string {\n\treturn nextReader()\n}\nfunc nextInt64() int64 {\n\tv, _ := strconv.ParseInt(nextReader(), 10, 64)\n\treturn v\n}\nfunc nextInt() int {\n\tv, _ := strconv.Atoi(nextReader())\n\treturn v\n}\nfunc nextInts(n int) []int {\n\tr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt()\n\t}\n\treturn r\n}\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(nextReader(), 64)\n\treturn f\n}", "language": "Go", "metadata": {"date": 1540935249, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03493.html", "problem_id": "p03493", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03493/input.txt", "sample_output_relpath": "derived/input_output/data/p03493/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03493/Go/s281225519.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s281225519", "user_id": "u331811000"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\ts := nextString()\n\tvar sum int\n\tfor i := 0; i < 3; i++ {\n\t\tif s[i:i+1] == \"1\" {\n\t\t\tsum++\n\t\t}\n\t}\n\tfmt.Println(sum)\n}\n\n// 以下がテンプレート\n\nvar nextReader func() string\n\nfunc init() {\n\tnextReader = NewScanner()\n}\n\nfunc NewScanner() func() string {\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\tr.Split(bufio.ScanWords)\n\treturn func() string {\n\t\tr.Scan()\n\t\treturn r.Text()\n\t}\n}\nfunc nextString() string {\n\treturn nextReader()\n}\nfunc nextInt64() int64 {\n\tv, _ := strconv.ParseInt(nextReader(), 10, 64)\n\treturn v\n}\nfunc nextInt() int {\n\tv, _ := strconv.Atoi(nextReader())\n\treturn v\n}\nfunc nextInts(n int) []int {\n\tr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tr[i] = nextInt()\n\t}\n\treturn r\n}\nfunc nextFloat64() float64 {\n\tf, _ := strconv.ParseFloat(nextReader(), 64)\n\treturn f\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "sample_input": "101\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03493", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 890, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s315608034", "group_id": "codeNet:p03493", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"reflect\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush() // !!!!coution!!!! you must use Fprint(out, ) not Print()\n\t/* --- code ---*/\n\ts := next()\n\tc := 0\n\tfor _, v := range s {\n\t\tif v == '1' {\n\t\t\tc++\n\t\t}\n\t}\n\tfmt.Println(c)\n}\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextFloat64() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\nfunc nextFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextFloat64()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\n// Genericsがないので筋肉で...\n// interfaceでの取扱がようわからんし\nfunc containStr(arr []string, target string) bool {\n\tfor _, v := range arr {\n\t\tif v == target {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc PrintOut(src interface{}, joinner string) {\n\tswitch reflect.TypeOf(src).Kind() {\n\tcase reflect.Slice:\n\t\ts := reflect.ValueOf(src)\n\t\tfor idx := 0; idx < s.Len(); idx++ {\n\t\t\tfmt.Fprintf(out, \"%v\", s.Index(idx))\n\t\t\tif idx < s.Len()-1 {\n\t\t\t\tfmt.Fprintf(out, \"%s\", joinner)\n\t\t\t} else {\n\t\t\t\tfmt.Fprintln(out)\n\t\t\t}\n\t\t}\n\tdefault:\n\t\tfmt.Fprintln(out, \"fuck\")\n\t}\n}\n\n// mapからkeysとvaluesを返す感じのやつ\n// なんかしらんけどmap[interface{}]interface{}しか受け付けない。なんのためのinterface{}やねん\n// なので呼ぶときのmapはmap[int]stringとかじゃダメ\nfunc splitKeyValue(m map[interface{}]interface{}) (keys, values []interface{}) {\n\tswitch reflect.TypeOf(m).Kind() {\n\tcase reflect.Map:\n\t\ts := reflect.ValueOf(m)\n\t\tfor _, v := range s.MapKeys() {\n\t\t\tkeys = append(keys, v)\n\t\t\tvalues = append(values, s.MapIndex(v))\n\t\t}\n\tdefault:\n\t\tfmt.Fprintln(out, \"fuck\")\n\t}\n\treturn\n}\n", "language": "Go", "metadata": {"date": 1521999677, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03493.html", "problem_id": "p03493", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03493/input.txt", "sample_output_relpath": "derived/input_output/data/p03493/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03493/Go/s315608034.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s315608034", "user_id": "u445624660"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"reflect\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\nvar out = bufio.NewWriter(os.Stdout)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tdefer out.Flush() // !!!!coution!!!! you must use Fprint(out, ) not Print()\n\t/* --- code ---*/\n\ts := next()\n\tc := 0\n\tfor _, v := range s {\n\t\tif v == '1' {\n\t\t\tc++\n\t\t}\n\t}\n\tfmt.Println(c)\n}\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\ta, _ := strconv.Atoi(next())\n\treturn a\n}\n\nfunc nextFloat64() float64 {\n\ta, _ := strconv.ParseFloat(next(), 64)\n\treturn a\n}\n\nfunc nextInts(n int) []int {\n\tret := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextInt()\n\t}\n\treturn ret\n}\nfunc nextFloats(n int) []float64 {\n\tret := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = nextFloat64()\n\t}\n\treturn ret\n}\nfunc nextStrings(n int) []string {\n\tret := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tret[i] = next()\n\t}\n\treturn ret\n}\n\n// Genericsがないので筋肉で...\n// interfaceでの取扱がようわからんし\nfunc containStr(arr []string, target string) bool {\n\tfor _, v := range arr {\n\t\tif v == target {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc PrintOut(src interface{}, joinner string) {\n\tswitch reflect.TypeOf(src).Kind() {\n\tcase reflect.Slice:\n\t\ts := reflect.ValueOf(src)\n\t\tfor idx := 0; idx < s.Len(); idx++ {\n\t\t\tfmt.Fprintf(out, \"%v\", s.Index(idx))\n\t\t\tif idx < s.Len()-1 {\n\t\t\t\tfmt.Fprintf(out, \"%s\", joinner)\n\t\t\t} else {\n\t\t\t\tfmt.Fprintln(out)\n\t\t\t}\n\t\t}\n\tdefault:\n\t\tfmt.Fprintln(out, \"fuck\")\n\t}\n}\n\n// mapからkeysとvaluesを返す感じのやつ\n// なんかしらんけどmap[interface{}]interface{}しか受け付けない。なんのためのinterface{}やねん\n// なので呼ぶときのmapはmap[int]stringとかじゃダメ\nfunc splitKeyValue(m map[interface{}]interface{}) (keys, values []interface{}) {\n\tswitch reflect.TypeOf(m).Kind() {\n\tcase reflect.Map:\n\t\ts := reflect.ValueOf(m)\n\t\tfor _, v := range s.MapKeys() {\n\t\t\tkeys = append(keys, v)\n\t\t\tvalues = append(values, s.MapIndex(v))\n\t\t}\n\tdefault:\n\t\tfmt.Fprintln(out, \"fuck\")\n\t}\n\treturn\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "sample_input": "101\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03493", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2080, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s698302008", "group_id": "codeNet:p03493", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tans := 0\n\tfor _, c := range s {\n\t\tif c == '0' {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1513135813, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03493.html", "problem_id": "p03493", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03493/input.txt", "sample_output_relpath": "derived/input_output/data/p03493/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03493/Go/s698302008.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s698302008", "user_id": "u258647915"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tans := 0\n\tfor _, c := range s {\n\t\tif c == '0' {\n\t\t\tans++\n\t\t}\n\t}\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "sample_input": "101\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03493", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke has a grid consisting of three squares numbered 1, 2 and 3.\nIn each square, either 0 or 1 is written. The number written in Square i is s_i.\n\nSnuke will place a marble on each square that says 1.\nFind the number of squares on which Snuke will place a marble.\n\nConstraints\n\nEach of s_1, s_2 and s_3 is either 1 or 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns_{1}s_{2}s_{3}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n101\n\nSample Output 1\n\n2\n\nA marble will be placed on Square 1 and 3.\n\nSample Input 2\n\n000\n\nSample Output 2\n\n0\n\nNo marble will be placed on any square.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 160, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s490093324", "group_id": "codeNet:p03565", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc configure(scanner *bufio.Scanner) {\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 1000005), 1000005)\n}\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanned := scanner.Scan()\n\tif !scanned {\n\t\tpanic(\"scan failed\")\n\t}\n\treturn scanner.Text()\n}\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\nfunc getNextFloat64(scanner *bufio.Scanner) float64 {\n\ti, _ := strconv.ParseFloat(getNextString(scanner), 64)\n\treturn i\n}\nfunc main() {\n\tfp := os.Stdin\n\twfp := os.Stdout\n\textra := 0\n\tif os.Getenv(\"I\") == \"IronMan\" {\n\t\tfp, _ = os.Open(os.Getenv(\"END_GAME\"))\n\t\textra = 100\n\t}\n\tscanner := bufio.NewScanner(fp)\n\tconfigure(scanner)\n\twriter := bufio.NewWriter(wfp)\n\tdefer func() {\n\t\tr := recover()\n\t\tif r != nil {\n\t\t\tfmt.Fprintln(writer, r)\n\t\t}\n\t\twriter.Flush()\n\t}()\n\tsolve(scanner, writer)\n\tfor i := 0; i < extra; i++ {\n\t\tfmt.Fprintln(writer, \"-----------------------------------\")\n\t\tsolve(scanner, writer)\n\t}\n}\nfunc solve(scanner *bufio.Scanner, writer *bufio.Writer) {\n\ts := getNextString(scanner)\n\tt := getNextString(scanner)\n\tn := len(s)\n\tm := len(t)\n\tfor i := 0; i < n-m+1; i++ {\n\t\tif ok(s[i:], t) {\n\t\t\tfor j := 0; j < i; j++ {\n\t\t\t\tif s[j] == '?' {\n\t\t\t\t\tfmt.Fprint(writer, \"a\")\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tfmt.Fprintf(writer, \"%c\", s[j])\n\t\t\t}\n\t\t\tfmt.Fprint(writer, t)\n\t\t\tfor j := i + m; j < n; j++ {\n\t\t\t\tif s[j] == '?' {\n\t\t\t\t\tfmt.Fprint(writer, \"a\")\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tfmt.Fprintf(writer, \"%c\", s[j])\n\t\t\t}\n\t\t\tfmt.Fprintln(writer, \"\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Fprintln(writer, \"UNRESTORABLE\")\n}\nfunc ok(s, t string) bool {\n\tn := len(t)\n\tfor i := 0; i < n; i++ {\n\t\tif s[i] == '?' {\n\t\t\tcontinue\n\t\t}\n\t\tif s[i] != t[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n", "language": "Go", "metadata": {"date": 1597878687, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03565.html", "problem_id": "p03565", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03565/input.txt", "sample_output_relpath": "derived/input_output/data/p03565/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03565/Go/s490093324.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s490093324", "user_id": "u150542210"}, "prompt_components": {"gold_output": "atcoder\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc configure(scanner *bufio.Scanner) {\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 1000005), 1000005)\n}\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanned := scanner.Scan()\n\tif !scanned {\n\t\tpanic(\"scan failed\")\n\t}\n\treturn scanner.Text()\n}\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\nfunc getNextFloat64(scanner *bufio.Scanner) float64 {\n\ti, _ := strconv.ParseFloat(getNextString(scanner), 64)\n\treturn i\n}\nfunc main() {\n\tfp := os.Stdin\n\twfp := os.Stdout\n\textra := 0\n\tif os.Getenv(\"I\") == \"IronMan\" {\n\t\tfp, _ = os.Open(os.Getenv(\"END_GAME\"))\n\t\textra = 100\n\t}\n\tscanner := bufio.NewScanner(fp)\n\tconfigure(scanner)\n\twriter := bufio.NewWriter(wfp)\n\tdefer func() {\n\t\tr := recover()\n\t\tif r != nil {\n\t\t\tfmt.Fprintln(writer, r)\n\t\t}\n\t\twriter.Flush()\n\t}()\n\tsolve(scanner, writer)\n\tfor i := 0; i < extra; i++ {\n\t\tfmt.Fprintln(writer, \"-----------------------------------\")\n\t\tsolve(scanner, writer)\n\t}\n}\nfunc solve(scanner *bufio.Scanner, writer *bufio.Writer) {\n\ts := getNextString(scanner)\n\tt := getNextString(scanner)\n\tn := len(s)\n\tm := len(t)\n\tfor i := 0; i < n-m+1; i++ {\n\t\tif ok(s[i:], t) {\n\t\t\tfor j := 0; j < i; j++ {\n\t\t\t\tif s[j] == '?' {\n\t\t\t\t\tfmt.Fprint(writer, \"a\")\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tfmt.Fprintf(writer, \"%c\", s[j])\n\t\t\t}\n\t\t\tfmt.Fprint(writer, t)\n\t\t\tfor j := i + m; j < n; j++ {\n\t\t\t\tif s[j] == '?' {\n\t\t\t\t\tfmt.Fprint(writer, \"a\")\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tfmt.Fprintf(writer, \"%c\", s[j])\n\t\t\t}\n\t\t\tfmt.Fprintln(writer, \"\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Fprintln(writer, \"UNRESTORABLE\")\n}\nfunc ok(s, t string) bool {\n\tn := len(t)\n\tfor i := 0; i < n; i++ {\n\t\tif s[i] == '?' {\n\t\t\tcontinue\n\t\t}\n\t\tif s[i] != t[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nE869120 found a chest which is likely to contain treasure.\n\nHowever, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters.\n\nHe also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with ?.\n\nOne more thing he found is a sheet of paper with the following facts written on it:\n\nCondition 1: The string S contains a string T as a contiguous substring.\n\nCondition 2: S is the lexicographically smallest string among the ones that satisfy Condition 1.\n\nPrint the string S.\n\nIf such a string does not exist, print UNRESTORABLE.\n\nConstraints\n\n1 \\leq |S'|, |T| \\leq 50\n\nS' consists of lowercase English letters and ?.\n\nT consists 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 string S.\n\nIf such a string does not exist, print UNRESTORABLE instead.\n\nSample Input 1\n\n?tc????\ncoder\n\nSample Output 1\n\natcoder\n\nThere are 26 strings that satisfy Condition 1: atcoder, btcoder, ctcoder,..., ztcoder.\nAmong them, the lexicographically smallest is atcoder, so we can say S = atcoder.\n\nSample Input 2\n\n??p??d??\nabc\n\nSample Output 2\n\nUNRESTORABLE\n\nThere is no string that satisfies Condition 1, so the string S does not exist.", "sample_input": "?tc????\ncoder\n"}, "reference_outputs": ["atcoder\n"], "source_document_id": "p03565", "source_text": "Score : 300 points\n\nProblem Statement\n\nE869120 found a chest which is likely to contain treasure.\n\nHowever, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters.\n\nHe also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with ?.\n\nOne more thing he found is a sheet of paper with the following facts written on it:\n\nCondition 1: The string S contains a string T as a contiguous substring.\n\nCondition 2: S is the lexicographically smallest string among the ones that satisfy Condition 1.\n\nPrint the string S.\n\nIf such a string does not exist, print UNRESTORABLE.\n\nConstraints\n\n1 \\leq |S'|, |T| \\leq 50\n\nS' consists of lowercase English letters and ?.\n\nT consists 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 string S.\n\nIf such a string does not exist, print UNRESTORABLE instead.\n\nSample Input 1\n\n?tc????\ncoder\n\nSample Output 1\n\natcoder\n\nThere are 26 strings that satisfy Condition 1: atcoder, btcoder, ctcoder,..., ztcoder.\nAmong them, the lexicographically smallest is atcoder, so we can say S = atcoder.\n\nSample Input 2\n\n??p??d??\nabc\n\nSample Output 2\n\nUNRESTORABLE\n\nThere is no string that satisfies Condition 1, so the string S does not exist.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1903, "cpu_time_ms": 7, "memory_kb": 1824}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s438340774", "group_id": "codeNet:p03565", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n//Util\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc maxInt(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc minInt(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absInt(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc absFloat64(a float64) float64 {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc minFloat64(a, b float64) float64 {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\n\n//Main\nvar sc = bufio.NewScanner(os.Stdin)\nvar S, T []string\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\ttmpS, tmpT := nextStr(), nextStr()\n\n\tS = strings.Split(tmpS, \"\")\n\tT = strings.Split(tmpT, \"\")\n\n\tvar indxs []int\n\tnext := 0\n\tfor i := 0; i < len(S); i++ {\n\t\tif S[i] == T[next] || string(S[i]) == \"?\" {\n\t\t\t//fmt.Println(string(S[i]), S[i], T[next], next, i)\n\t\t\tif next == len(T)-1 {\n\t\t\t\tindxs = append(indxs, i)\n\t\t\t\tnext = 0\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tnext++\n\t\t\tcontinue\n\t\t}\n\t\tnext = 0\n\t}\n\n\tif len(indxs) == 0 {\n\t\tfmt.Println(\"UNRESTORABLE\")\n\t\treturn\n\t}\n\n\tvar cad []string\n\tfor _, indx := range indxs {\n\t\tj := 0\n\t\ttmpStr := \"\"\n\t\tfor i := 0; i < len(S); i++ {\n\t\t\tif i >= indx-len(T)+1 && i <= indx {\n\t\t\t\ttmps := string(T[j])\n\t\t\t\ttmpStr += tmps\n\t\t\t\tj++\n\t\t\t} else if string(S[i]) == \"?\" {\n\t\t\t\ttmpStr += \"a\"\n\t\t\t} else {\n\t\t\t\ttmpStr += S[i]\n\t\t\t}\n\t\t}\n\t\tcad = append(cad, tmpStr)\n\t}\n\t//fmt.Println(cad)\n\tsort.Strings(cad)\n\tfmt.Println(cad[0])\n}\n", "language": "Go", "metadata": {"date": 1590212993, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03565.html", "problem_id": "p03565", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03565/input.txt", "sample_output_relpath": "derived/input_output/data/p03565/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03565/Go/s438340774.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s438340774", "user_id": "u432333240"}, "prompt_components": {"gold_output": "atcoder\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n//Util\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc maxInt(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t} else {\n\t\treturn b\n\t}\n}\n\nfunc minInt(a, b int) int {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\n\nfunc absInt(a int) int {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc absFloat64(a float64) float64 {\n\tif a >= 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc minFloat64(a, b float64) float64 {\n\tif a > b {\n\t\treturn b\n\t} else {\n\t\treturn a\n\t}\n}\n\n//Main\nvar sc = bufio.NewScanner(os.Stdin)\nvar S, T []string\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\ttmpS, tmpT := nextStr(), nextStr()\n\n\tS = strings.Split(tmpS, \"\")\n\tT = strings.Split(tmpT, \"\")\n\n\tvar indxs []int\n\tnext := 0\n\tfor i := 0; i < len(S); i++ {\n\t\tif S[i] == T[next] || string(S[i]) == \"?\" {\n\t\t\t//fmt.Println(string(S[i]), S[i], T[next], next, i)\n\t\t\tif next == len(T)-1 {\n\t\t\t\tindxs = append(indxs, i)\n\t\t\t\tnext = 0\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tnext++\n\t\t\tcontinue\n\t\t}\n\t\tnext = 0\n\t}\n\n\tif len(indxs) == 0 {\n\t\tfmt.Println(\"UNRESTORABLE\")\n\t\treturn\n\t}\n\n\tvar cad []string\n\tfor _, indx := range indxs {\n\t\tj := 0\n\t\ttmpStr := \"\"\n\t\tfor i := 0; i < len(S); i++ {\n\t\t\tif i >= indx-len(T)+1 && i <= indx {\n\t\t\t\ttmps := string(T[j])\n\t\t\t\ttmpStr += tmps\n\t\t\t\tj++\n\t\t\t} else if string(S[i]) == \"?\" {\n\t\t\t\ttmpStr += \"a\"\n\t\t\t} else {\n\t\t\t\ttmpStr += S[i]\n\t\t\t}\n\t\t}\n\t\tcad = append(cad, tmpStr)\n\t}\n\t//fmt.Println(cad)\n\tsort.Strings(cad)\n\tfmt.Println(cad[0])\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nE869120 found a chest which is likely to contain treasure.\n\nHowever, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters.\n\nHe also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with ?.\n\nOne more thing he found is a sheet of paper with the following facts written on it:\n\nCondition 1: The string S contains a string T as a contiguous substring.\n\nCondition 2: S is the lexicographically smallest string among the ones that satisfy Condition 1.\n\nPrint the string S.\n\nIf such a string does not exist, print UNRESTORABLE.\n\nConstraints\n\n1 \\leq |S'|, |T| \\leq 50\n\nS' consists of lowercase English letters and ?.\n\nT consists 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 string S.\n\nIf such a string does not exist, print UNRESTORABLE instead.\n\nSample Input 1\n\n?tc????\ncoder\n\nSample Output 1\n\natcoder\n\nThere are 26 strings that satisfy Condition 1: atcoder, btcoder, ctcoder,..., ztcoder.\nAmong them, the lexicographically smallest is atcoder, so we can say S = atcoder.\n\nSample Input 2\n\n??p??d??\nabc\n\nSample Output 2\n\nUNRESTORABLE\n\nThere is no string that satisfies Condition 1, so the string S does not exist.", "sample_input": "?tc????\ncoder\n"}, "reference_outputs": ["atcoder\n"], "source_document_id": "p03565", "source_text": "Score : 300 points\n\nProblem Statement\n\nE869120 found a chest which is likely to contain treasure.\n\nHowever, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters.\n\nHe also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with ?.\n\nOne more thing he found is a sheet of paper with the following facts written on it:\n\nCondition 1: The string S contains a string T as a contiguous substring.\n\nCondition 2: S is the lexicographically smallest string among the ones that satisfy Condition 1.\n\nPrint the string S.\n\nIf such a string does not exist, print UNRESTORABLE.\n\nConstraints\n\n1 \\leq |S'|, |T| \\leq 50\n\nS' consists of lowercase English letters and ?.\n\nT consists 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 string S.\n\nIf such a string does not exist, print UNRESTORABLE instead.\n\nSample Input 1\n\n?tc????\ncoder\n\nSample Output 1\n\natcoder\n\nThere are 26 strings that satisfy Condition 1: atcoder, btcoder, ctcoder,..., ztcoder.\nAmong them, the lexicographically smallest is atcoder, so we can say S = atcoder.\n\nSample Input 2\n\n??p??d??\nabc\n\nSample Output 2\n\nUNRESTORABLE\n\nThere is no string that satisfies Condition 1, so the string S does not exist.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1592, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s104134146", "group_id": "codeNet:p03565", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tSd := getString()\n\tT := getString()\n\n\tvar candidates []string\n\tfor i := 0; i <= len(Sd) - len(T); i++ {\n\t\tflag := true\n\t\tfor j := 0; j < len(T); j++ {\n\t\t\tfmt.Println(string(Sd[i+j]), \", \", string(T[j]))\n\t\t\tif Sd[i+j] != T[j] && Sd[i+j] != '?' {\n\t\t\t\tflag = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tfmt.Println()\n\t\tif flag {\n\t\t\tcandidate := strings.Replace(Sd, Sd[i:i+len(T)], T, 1)\n\t\t\tcandidate = strings.Replace(candidate, \"?\", \"a\", -1)\n\t\t\tcandidates = append(candidates, candidate)\n\t\t}\n\t}\n\n\tif len(candidates) == 0 {\n\t\tfmt.Println(\"UNRESTORABLE\")\n\t} else {\n\t\tsort.Sort(sort.StringSlice(candidates))\n\n\t\tfor _, candidate := range candidates {\n\t\t\tfmt.Println(candidate)\n\t\t}\n\n\t\tfmt.Println(candidates[0])\n\t}\n}\n\ntype Graph struct {\n\tn int\n\tedges [][]int\n}\n\nfunc NewGraph(n int) *Graph {\n\tg := &Graph{\n\t\tn: n,\n\t\tedges: make([][]int, n),\n\t}\n\treturn g\n}\n\nfunc (g *Graph) AddEdge(u, v int) {\n\tg.edges[v] = append(g.edges[v], u)\n\tg.edges[u] = append(g.edges[u], v)\n}\n\nfunc dfs(c int, edges [][]int, visited map[int]struct{}) {\n\tvisited[c] = struct{}{}\n\n\tfor _, v := range edges[c] {\n\t\t_, flag := visited[v]\n\t\tif flag {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(v, edges, visited)\n\t}\n}\n\nfunc bfs(c int, graph *Graph) {\n\tnext := make([]int, 0)\n\tnext = append(next, c)\n\tvisited := make(map[int]struct{})\n\n\tfor ; len(next) != 0; {\n\t\tu := next[0]\n\t\tnext = next[1:]\n\t\tvisited[u] = struct{}{}\n\n\t\tfor _, v := range graph.edges[u] {\n\t\t\t_, flag := visited[v]\n\t\t\tif flag {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// なにか処理\n\n\t\t\tnext = append(next, v)\n\t\t}\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getIntArray(n int) []int {\n\tarray := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getInt()\n\t}\n\treturn array\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc getStringArray(n int) []string {\n\tarray := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getString()\n\t}\n\treturn array\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc powMod(n, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 0 {\n\t\tt := powMod(n, p/2)\n\t\treturn calcMod(t * t)\n\t} else {\n\t\treturn calcMod(n * powMod(n, p-1))\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n % 2 == 0 {\n\t\treturn false\n\t}\n\n\tsqrtN := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sqrtN; i += 2 {\n\t\tif n % i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}\n\nfunc powerset2(nums []int) [][]int {\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tindex := 0\n\tresult[index] = []int{}\n\tindex++\n\n\tfor _, n := range nums {\n\t\tmax := index\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[index] = copyAndAppend(result[i], n)\n\t\t\tindex++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc calcGcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t} else if x >= y {\n\t\treturn calcGcd(y, x % y)\n\t} else {\n\t\treturn calcGcd(x, y % x)\n\t}\n}\n\nfunc getDivisor(n int) []int {\n\tvar divisor []int\n\tdivisor = append(divisor, 1)\n\tif n != 1 {\n\t\tdivisor = append(divisor, n)\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n % i == 0 {\n\t\t\tdivisor = append(divisor, i)\n\t\t\tdivisor = append(divisor, n/i)\n\t\t}\n\t}\n\treturn divisor\n}\n\ntype intHeap []int\n\nfunc (h intHeap) Len() int {\n\treturn len(h)\n}\n\nfunc (h intHeap) Less(i, j int) bool {\n\treturn h[i] > h[j]\n}\n\nfunc (h intHeap) Swap(i, j int) {\n\th[i], h[j] = h[j], h[i]\n}\n\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc initHeap() *intHeap {\n\tih := &intHeap{}\n\theap.Init(ih)\n\treturn ih\n}\n\nfunc (h *intHeap) pushHeap(n int) {\n\theap.Push(h, n)\n}\n\nfunc (h *intHeap) popHeap() int {\n\treturn heap.Pop(h).(int)\n}\n\nfunc factMod(n int) int {\n\tvalue := 1\n\tfor ; n > 1; n-- {\n\t\tvalue = calcMod(value * n)\n\t}\n\treturn value\n}\n\nfunc combinationMod(n, k int) int {\n\tfactN := factMod(n)\n\tfactK := factMod(k)\n\tfactNK := factMod(n - k)\n\tfactKR := powMod(factK, mod - 2)\n\tfactNKR := powMod(factNK, mod - 2)\n\treturn calcMod(factN * calcMod(factKR * factNKR))\n}\n", "language": "Go", "metadata": {"date": 1588045537, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03565.html", "problem_id": "p03565", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03565/input.txt", "sample_output_relpath": "derived/input_output/data/p03565/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03565/Go/s104134146.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s104134146", "user_id": "u964273035"}, "prompt_components": {"gold_output": "atcoder\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nconst (\n\tinitialBufSize = 10000\n\tmaxBufSize = 1000000\n\tmod = 1e9 + 7\n)\n\nvar (\n\tsc *bufio.Scanner = func() *bufio.Scanner {\n\t\tsc := bufio.NewScanner(os.Stdin)\n\t\tbuf := make([]byte, initialBufSize)\n\t\tsc.Buffer(buf, maxBufSize)\n\t\tsc.Split(bufio.ScanWords)\n\t\treturn sc\n\t}()\n)\n\nfunc main() {\n\tSd := getString()\n\tT := getString()\n\n\tvar candidates []string\n\tfor i := 0; i <= len(Sd) - len(T); i++ {\n\t\tflag := true\n\t\tfor j := 0; j < len(T); j++ {\n\t\t\tfmt.Println(string(Sd[i+j]), \", \", string(T[j]))\n\t\t\tif Sd[i+j] != T[j] && Sd[i+j] != '?' {\n\t\t\t\tflag = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tfmt.Println()\n\t\tif flag {\n\t\t\tcandidate := strings.Replace(Sd, Sd[i:i+len(T)], T, 1)\n\t\t\tcandidate = strings.Replace(candidate, \"?\", \"a\", -1)\n\t\t\tcandidates = append(candidates, candidate)\n\t\t}\n\t}\n\n\tif len(candidates) == 0 {\n\t\tfmt.Println(\"UNRESTORABLE\")\n\t} else {\n\t\tsort.Sort(sort.StringSlice(candidates))\n\n\t\tfor _, candidate := range candidates {\n\t\t\tfmt.Println(candidate)\n\t\t}\n\n\t\tfmt.Println(candidates[0])\n\t}\n}\n\ntype Graph struct {\n\tn int\n\tedges [][]int\n}\n\nfunc NewGraph(n int) *Graph {\n\tg := &Graph{\n\t\tn: n,\n\t\tedges: make([][]int, n),\n\t}\n\treturn g\n}\n\nfunc (g *Graph) AddEdge(u, v int) {\n\tg.edges[v] = append(g.edges[v], u)\n\tg.edges[u] = append(g.edges[u], v)\n}\n\nfunc dfs(c int, edges [][]int, visited map[int]struct{}) {\n\tvisited[c] = struct{}{}\n\n\tfor _, v := range edges[c] {\n\t\t_, flag := visited[v]\n\t\tif flag {\n\t\t\tcontinue\n\t\t}\n\t\tdfs(v, edges, visited)\n\t}\n}\n\nfunc bfs(c int, graph *Graph) {\n\tnext := make([]int, 0)\n\tnext = append(next, c)\n\tvisited := make(map[int]struct{})\n\n\tfor ; len(next) != 0; {\n\t\tu := next[0]\n\t\tnext = next[1:]\n\t\tvisited[u] = struct{}{}\n\n\t\tfor _, v := range graph.edges[u] {\n\t\t\t_, flag := visited[v]\n\t\t\tif flag {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// なにか処理\n\n\t\t\tnext = append(next, v)\n\t\t}\n\t}\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getIntArray(n int) []int {\n\tarray := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getInt()\n\t}\n\treturn array\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc getStringArray(n int) []string {\n\tarray := make([]string, n)\n\tfor i := 0; i < n; i++ {\n\t\tarray[i] = getString()\n\t}\n\treturn array\n}\n\nfunc abs(a int) int {\n\treturn int(math.Abs(float64(a)))\n}\n\nfunc pow(p, q int) int {\n\treturn int(math.Pow(float64(p), float64(q)))\n}\n\nfunc powMod(n, p int) int {\n\tif p == 0 {\n\t\treturn 1\n\t} else if p%2 == 0 {\n\t\tt := powMod(n, p/2)\n\t\treturn calcMod(t * t)\n\t} else {\n\t\treturn calcMod(n * powMod(n, p-1))\n\t}\n}\n\nfunc min(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton min() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Min(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc max(nums ...int) int {\n\tif len(nums) == 0 {\n\t\tpanic(\"funciton max() requires at least one argument.\")\n\t}\n\tres := nums[0]\n\tfor i := 0; i < len(nums); i++ {\n\t\tres = int(math.Max(float64(res), float64(nums[i])))\n\t}\n\treturn res\n}\n\nfunc strSearch(a []string, b string) bool {\n\tfor i := 0; i < len(a); i++ {\n\t\tif a[i] == b {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc printIntArray(array []int) {\n\tstrArray := fmt.Sprint(array)\n\tfmt.Println(strArray[1 : len(strArray)-1])\n}\n\nfunc calcMod(x int) int {\n\treturn x % mod\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc isPrime(n int) bool {\n\tif n < 2 {\n\t\treturn false\n\t} else if n == 2 {\n\t\treturn true\n\t} else if n % 2 == 0 {\n\t\treturn false\n\t}\n\n\tsqrtN := int(math.Sqrt(float64(n)))\n\tfor i := 3; i <= sqrtN; i += 2 {\n\t\tif n % i == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn true\n}\n\nfunc contains(s []int, e int) bool {\n\tfor _, v := range s {\n\t\tif e == v {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}\n\nfunc makeRange(min, max int) []int {\n\ta := make([]int, max-min+1)\n\tfor i := range a {\n\t\ta[i] = min + i\n\t}\n\treturn a\n}\n\nfunc powerset2(nums []int) [][]int {\n\tlength := int(math.Pow(2, float64(len(nums))))\n\tresult := make([][]int, length)\n\n\tindex := 0\n\tresult[index] = []int{}\n\tindex++\n\n\tfor _, n := range nums {\n\t\tmax := index\n\t\tfor i := 0; i < max; i++ {\n\t\t\tresult[index] = copyAndAppend(result[i], n)\n\t\t\tindex++\n\t\t}\n\t}\n\n\treturn result\n}\n\nfunc copyAndAppend(nums []int, n int) []int {\n\tdst := make([]int, len(nums)+1)\n\tcopy(dst, nums)\n\tdst[len(nums)] = n\n\treturn dst\n}\n\nfunc calcGcd(x, y int) int {\n\tif y == 0 {\n\t\treturn x\n\t} else if x >= y {\n\t\treturn calcGcd(y, x % y)\n\t} else {\n\t\treturn calcGcd(x, y % x)\n\t}\n}\n\nfunc getDivisor(n int) []int {\n\tvar divisor []int\n\tdivisor = append(divisor, 1)\n\tif n != 1 {\n\t\tdivisor = append(divisor, n)\n\t}\n\n\tsqrt := int(math.Sqrt(float64(n)))\n\tfor i := 2; i <= sqrt; i++ {\n\t\tif n % i == 0 {\n\t\t\tdivisor = append(divisor, i)\n\t\t\tdivisor = append(divisor, n/i)\n\t\t}\n\t}\n\treturn divisor\n}\n\ntype intHeap []int\n\nfunc (h intHeap) Len() int {\n\treturn len(h)\n}\n\nfunc (h intHeap) Less(i, j int) bool {\n\treturn h[i] > h[j]\n}\n\nfunc (h intHeap) Swap(i, j int) {\n\th[i], h[j] = h[j], h[i]\n}\n\nfunc (h *intHeap) Push(x interface{}) {\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *intHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n\nfunc initHeap() *intHeap {\n\tih := &intHeap{}\n\theap.Init(ih)\n\treturn ih\n}\n\nfunc (h *intHeap) pushHeap(n int) {\n\theap.Push(h, n)\n}\n\nfunc (h *intHeap) popHeap() int {\n\treturn heap.Pop(h).(int)\n}\n\nfunc factMod(n int) int {\n\tvalue := 1\n\tfor ; n > 1; n-- {\n\t\tvalue = calcMod(value * n)\n\t}\n\treturn value\n}\n\nfunc combinationMod(n, k int) int {\n\tfactN := factMod(n)\n\tfactK := factMod(k)\n\tfactNK := factMod(n - k)\n\tfactKR := powMod(factK, mod - 2)\n\tfactNKR := powMod(factNK, mod - 2)\n\treturn calcMod(factN * calcMod(factKR * factNKR))\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nE869120 found a chest which is likely to contain treasure.\n\nHowever, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters.\n\nHe also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with ?.\n\nOne more thing he found is a sheet of paper with the following facts written on it:\n\nCondition 1: The string S contains a string T as a contiguous substring.\n\nCondition 2: S is the lexicographically smallest string among the ones that satisfy Condition 1.\n\nPrint the string S.\n\nIf such a string does not exist, print UNRESTORABLE.\n\nConstraints\n\n1 \\leq |S'|, |T| \\leq 50\n\nS' consists of lowercase English letters and ?.\n\nT consists 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 string S.\n\nIf such a string does not exist, print UNRESTORABLE instead.\n\nSample Input 1\n\n?tc????\ncoder\n\nSample Output 1\n\natcoder\n\nThere are 26 strings that satisfy Condition 1: atcoder, btcoder, ctcoder,..., ztcoder.\nAmong them, the lexicographically smallest is atcoder, so we can say S = atcoder.\n\nSample Input 2\n\n??p??d??\nabc\n\nSample Output 2\n\nUNRESTORABLE\n\nThere is no string that satisfies Condition 1, so the string S does not exist.", "sample_input": "?tc????\ncoder\n"}, "reference_outputs": ["atcoder\n"], "source_document_id": "p03565", "source_text": "Score : 300 points\n\nProblem Statement\n\nE869120 found a chest which is likely to contain treasure.\n\nHowever, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters.\n\nHe also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with ?.\n\nOne more thing he found is a sheet of paper with the following facts written on it:\n\nCondition 1: The string S contains a string T as a contiguous substring.\n\nCondition 2: S is the lexicographically smallest string among the ones that satisfy Condition 1.\n\nPrint the string S.\n\nIf such a string does not exist, print UNRESTORABLE.\n\nConstraints\n\n1 \\leq |S'|, |T| \\leq 50\n\nS' consists of lowercase English letters and ?.\n\nT consists 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 string S.\n\nIf such a string does not exist, print UNRESTORABLE instead.\n\nSample Input 1\n\n?tc????\ncoder\n\nSample Output 1\n\natcoder\n\nThere are 26 strings that satisfy Condition 1: atcoder, btcoder, ctcoder,..., ztcoder.\nAmong them, the lexicographically smallest is atcoder, so we can say S = atcoder.\n\nSample Input 2\n\n??p??d??\nabc\n\nSample Output 2\n\nUNRESTORABLE\n\nThere is no string that satisfies Condition 1, so the string S does not exist.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5861, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s538258100", "group_id": "codeNet:p03565", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s, t string\n\tfmt.Scan(&s, &t)\n\n\tans := make([]rune, len(s))\n\tj := 0\n\tfor i := range s {\n\t\tif j == len(t) {\n\t\t\tif s[i] == '?' {\n\t\t\t\tans[i] = 'a'\n\t\t\t} else {\n\t\t\t\tans[i] = rune(s[i])\n\t\t\t}\n\n\t\t\tcontinue\n\t\t}\n\n\t\tif s[i] == '?' {\n\t\t\tans[i] = 'a'\n\t\t} else if s[i] == t[j] {\n\t\t\tans[i] = rune(s[i])\n\t\t} else {\n\t\t\tans[i] = rune(s[i])\n\t\t\tif s[i] == t[0] {\n\t\t\t\tj = 1\n\t\t\t} else {\n\t\t\t\tj = 0\n\t\t\t}\n\n\t\t\tcontinue\n\t\t}\n\n\t\tj++\n\t\tif j == len(t) {\n\t\t\tfor k := 0; k < j; k++ {\n\t\t\t\tans[i-j+1+k] = rune(t[k])\n\t\t\t}\n\t\t}\n\t}\n\n\tif j == len(t) {\n\t\tfmt.Println(string(ans))\n\t} else {\n\t\tfmt.Println(\"UNRESTORABLE\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1582416201, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03565.html", "problem_id": "p03565", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03565/input.txt", "sample_output_relpath": "derived/input_output/data/p03565/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03565/Go/s538258100.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s538258100", "user_id": "u461993794"}, "prompt_components": {"gold_output": "atcoder\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s, t string\n\tfmt.Scan(&s, &t)\n\n\tans := make([]rune, len(s))\n\tj := 0\n\tfor i := range s {\n\t\tif j == len(t) {\n\t\t\tif s[i] == '?' {\n\t\t\t\tans[i] = 'a'\n\t\t\t} else {\n\t\t\t\tans[i] = rune(s[i])\n\t\t\t}\n\n\t\t\tcontinue\n\t\t}\n\n\t\tif s[i] == '?' {\n\t\t\tans[i] = 'a'\n\t\t} else if s[i] == t[j] {\n\t\t\tans[i] = rune(s[i])\n\t\t} else {\n\t\t\tans[i] = rune(s[i])\n\t\t\tif s[i] == t[0] {\n\t\t\t\tj = 1\n\t\t\t} else {\n\t\t\t\tj = 0\n\t\t\t}\n\n\t\t\tcontinue\n\t\t}\n\n\t\tj++\n\t\tif j == len(t) {\n\t\t\tfor k := 0; k < j; k++ {\n\t\t\t\tans[i-j+1+k] = rune(t[k])\n\t\t\t}\n\t\t}\n\t}\n\n\tif j == len(t) {\n\t\tfmt.Println(string(ans))\n\t} else {\n\t\tfmt.Println(\"UNRESTORABLE\")\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nE869120 found a chest which is likely to contain treasure.\n\nHowever, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters.\n\nHe also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with ?.\n\nOne more thing he found is a sheet of paper with the following facts written on it:\n\nCondition 1: The string S contains a string T as a contiguous substring.\n\nCondition 2: S is the lexicographically smallest string among the ones that satisfy Condition 1.\n\nPrint the string S.\n\nIf such a string does not exist, print UNRESTORABLE.\n\nConstraints\n\n1 \\leq |S'|, |T| \\leq 50\n\nS' consists of lowercase English letters and ?.\n\nT consists 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 string S.\n\nIf such a string does not exist, print UNRESTORABLE instead.\n\nSample Input 1\n\n?tc????\ncoder\n\nSample Output 1\n\natcoder\n\nThere are 26 strings that satisfy Condition 1: atcoder, btcoder, ctcoder,..., ztcoder.\nAmong them, the lexicographically smallest is atcoder, so we can say S = atcoder.\n\nSample Input 2\n\n??p??d??\nabc\n\nSample Output 2\n\nUNRESTORABLE\n\nThere is no string that satisfies Condition 1, so the string S does not exist.", "sample_input": "?tc????\ncoder\n"}, "reference_outputs": ["atcoder\n"], "source_document_id": "p03565", "source_text": "Score : 300 points\n\nProblem Statement\n\nE869120 found a chest which is likely to contain treasure.\n\nHowever, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters.\n\nHe also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with ?.\n\nOne more thing he found is a sheet of paper with the following facts written on it:\n\nCondition 1: The string S contains a string T as a contiguous substring.\n\nCondition 2: S is the lexicographically smallest string among the ones that satisfy Condition 1.\n\nPrint the string S.\n\nIf such a string does not exist, print UNRESTORABLE.\n\nConstraints\n\n1 \\leq |S'|, |T| \\leq 50\n\nS' consists of lowercase English letters and ?.\n\nT consists 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 string S.\n\nIf such a string does not exist, print UNRESTORABLE instead.\n\nSample Input 1\n\n?tc????\ncoder\n\nSample Output 1\n\natcoder\n\nThere are 26 strings that satisfy Condition 1: atcoder, btcoder, ctcoder,..., ztcoder.\nAmong them, the lexicographically smallest is atcoder, so we can say S = atcoder.\n\nSample Input 2\n\n??p??d??\nabc\n\nSample Output 2\n\nUNRESTORABLE\n\nThere is no string that satisfies Condition 1, so the string S does not exist.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s533141944", "group_id": "codeNet:p03565", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s, t string\n\tfmt.Scan(&s, &t)\n\n\ts, t = reverse(s), reverse(t)\n\n\tti := 0\n\tng := true\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] == '?' || (i < len(t)-1 && s[i] == t[i]) {\n\t\t\tok := true\n\t\t\tfor j := 0; j < len(t); j++ {\n\t\t\t\tif len(s)-1 <= i+j {\n\t\t\t\t\tok = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif s[i+j] == '?' {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tif s[i+j] != t[j] {\n\t\t\t\t\tok = false\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ok {\n\t\t\t\tti = i\n\t\t\t\tng = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tif ng {\n\t\tfmt.Println(\"UNRESTORABLE\")\n\t\treturn\n\t}\n\n\tans := \"\"\n\tfor i := 0; i < len(s); i++ {\n\t\tif i == ti {\n\t\t\tfor j := 0; j < len(t); j++ {\n\t\t\t\tans += string(t[j])\n\t\t\t}\n\t\t\ti += len(t) - 1\n\t\t} else {\n\t\t\tif s[i] == '?' {\n\t\t\t\tans += \"a\"\n\t\t\t} else {\n\t\t\t\tans += string(s[i])\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(reverse(ans))\n}\n\nfunc reverse(s string) string {\n\tt := \"\"\n\tfor _, c := range s {\n\t\tt = string(c) + t\n\t}\n\treturn t\n}\n", "language": "Go", "metadata": {"date": 1580704947, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03565.html", "problem_id": "p03565", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03565/input.txt", "sample_output_relpath": "derived/input_output/data/p03565/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03565/Go/s533141944.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s533141944", "user_id": "u902409225"}, "prompt_components": {"gold_output": "atcoder\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s, t string\n\tfmt.Scan(&s, &t)\n\n\ts, t = reverse(s), reverse(t)\n\n\tti := 0\n\tng := true\n\tfor i := 0; i < len(s); i++ {\n\t\tif s[i] == '?' || (i < len(t)-1 && s[i] == t[i]) {\n\t\t\tok := true\n\t\t\tfor j := 0; j < len(t); j++ {\n\t\t\t\tif len(s)-1 <= i+j {\n\t\t\t\t\tok = false\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tif s[i+j] == '?' {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tif s[i+j] != t[j] {\n\t\t\t\t\tok = false\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ok {\n\t\t\t\tti = i\n\t\t\t\tng = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tif ng {\n\t\tfmt.Println(\"UNRESTORABLE\")\n\t\treturn\n\t}\n\n\tans := \"\"\n\tfor i := 0; i < len(s); i++ {\n\t\tif i == ti {\n\t\t\tfor j := 0; j < len(t); j++ {\n\t\t\t\tans += string(t[j])\n\t\t\t}\n\t\t\ti += len(t) - 1\n\t\t} else {\n\t\t\tif s[i] == '?' {\n\t\t\t\tans += \"a\"\n\t\t\t} else {\n\t\t\t\tans += string(s[i])\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Println(reverse(ans))\n}\n\nfunc reverse(s string) string {\n\tt := \"\"\n\tfor _, c := range s {\n\t\tt = string(c) + t\n\t}\n\treturn t\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nE869120 found a chest which is likely to contain treasure.\n\nHowever, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters.\n\nHe also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with ?.\n\nOne more thing he found is a sheet of paper with the following facts written on it:\n\nCondition 1: The string S contains a string T as a contiguous substring.\n\nCondition 2: S is the lexicographically smallest string among the ones that satisfy Condition 1.\n\nPrint the string S.\n\nIf such a string does not exist, print UNRESTORABLE.\n\nConstraints\n\n1 \\leq |S'|, |T| \\leq 50\n\nS' consists of lowercase English letters and ?.\n\nT consists 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 string S.\n\nIf such a string does not exist, print UNRESTORABLE instead.\n\nSample Input 1\n\n?tc????\ncoder\n\nSample Output 1\n\natcoder\n\nThere are 26 strings that satisfy Condition 1: atcoder, btcoder, ctcoder,..., ztcoder.\nAmong them, the lexicographically smallest is atcoder, so we can say S = atcoder.\n\nSample Input 2\n\n??p??d??\nabc\n\nSample Output 2\n\nUNRESTORABLE\n\nThere is no string that satisfies Condition 1, so the string S does not exist.", "sample_input": "?tc????\ncoder\n"}, "reference_outputs": ["atcoder\n"], "source_document_id": "p03565", "source_text": "Score : 300 points\n\nProblem Statement\n\nE869120 found a chest which is likely to contain treasure.\n\nHowever, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters.\n\nHe also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with ?.\n\nOne more thing he found is a sheet of paper with the following facts written on it:\n\nCondition 1: The string S contains a string T as a contiguous substring.\n\nCondition 2: S is the lexicographically smallest string among the ones that satisfy Condition 1.\n\nPrint the string S.\n\nIf such a string does not exist, print UNRESTORABLE.\n\nConstraints\n\n1 \\leq |S'|, |T| \\leq 50\n\nS' consists of lowercase English letters and ?.\n\nT consists 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 string S.\n\nIf such a string does not exist, print UNRESTORABLE instead.\n\nSample Input 1\n\n?tc????\ncoder\n\nSample Output 1\n\natcoder\n\nThere are 26 strings that satisfy Condition 1: atcoder, btcoder, ctcoder,..., ztcoder.\nAmong them, the lexicographically smallest is atcoder, so we can say S = atcoder.\n\nSample Input 2\n\n??p??d??\nabc\n\nSample Output 2\n\nUNRESTORABLE\n\nThere is no string that satisfies Condition 1, so the string S does not exist.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 889, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s510668777", "group_id": "codeNet:p03565", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nvar (\n\tsDash string\n\tt string\n\ts string\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\tsDash = scanner.Text()\n\tscanner.Scan()\n\tt = scanner.Text()\n\n\t//check if t can apply to sDash\n\tfor i := len(sDash) - len(t); 0 <= i; i-- {\n\t\tk := 0\n\t\tmatch := false\n\t\tfor j := i; j < i+len(t); j++ {\n\t\t\tfmt.Printf(\"i %d, j %d, k %d\\n\", i, j, k)\n\t\t\tif sDash[j] != '?' && sDash[j] != t[k] {\n\t\t\t\tmatch = false\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tk++\n\t\t\tmatch = true\n\t\t}\n\t\tif match {\n\t\t\ts = sDash[:i] + t + sDash[(i+len(t)):]\n\t\t\ts = strings.Replace(s, \"?\", \"a\", -1)\n\t\t\tfmt.Println(s)\n\t\t\treturn\n\t\t}\n\n\t}\n\tfmt.Println(\"UNRESTORABLE\")\n}\n", "language": "Go", "metadata": {"date": 1579198875, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03565.html", "problem_id": "p03565", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03565/input.txt", "sample_output_relpath": "derived/input_output/data/p03565/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03565/Go/s510668777.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s510668777", "user_id": "u261090677"}, "prompt_components": {"gold_output": "atcoder\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nvar (\n\tsDash string\n\tt string\n\ts string\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\tsDash = scanner.Text()\n\tscanner.Scan()\n\tt = scanner.Text()\n\n\t//check if t can apply to sDash\n\tfor i := len(sDash) - len(t); 0 <= i; i-- {\n\t\tk := 0\n\t\tmatch := false\n\t\tfor j := i; j < i+len(t); j++ {\n\t\t\tfmt.Printf(\"i %d, j %d, k %d\\n\", i, j, k)\n\t\t\tif sDash[j] != '?' && sDash[j] != t[k] {\n\t\t\t\tmatch = false\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tk++\n\t\t\tmatch = true\n\t\t}\n\t\tif match {\n\t\t\ts = sDash[:i] + t + sDash[(i+len(t)):]\n\t\t\ts = strings.Replace(s, \"?\", \"a\", -1)\n\t\t\tfmt.Println(s)\n\t\t\treturn\n\t\t}\n\n\t}\n\tfmt.Println(\"UNRESTORABLE\")\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nE869120 found a chest which is likely to contain treasure.\n\nHowever, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters.\n\nHe also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with ?.\n\nOne more thing he found is a sheet of paper with the following facts written on it:\n\nCondition 1: The string S contains a string T as a contiguous substring.\n\nCondition 2: S is the lexicographically smallest string among the ones that satisfy Condition 1.\n\nPrint the string S.\n\nIf such a string does not exist, print UNRESTORABLE.\n\nConstraints\n\n1 \\leq |S'|, |T| \\leq 50\n\nS' consists of lowercase English letters and ?.\n\nT consists 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 string S.\n\nIf such a string does not exist, print UNRESTORABLE instead.\n\nSample Input 1\n\n?tc????\ncoder\n\nSample Output 1\n\natcoder\n\nThere are 26 strings that satisfy Condition 1: atcoder, btcoder, ctcoder,..., ztcoder.\nAmong them, the lexicographically smallest is atcoder, so we can say S = atcoder.\n\nSample Input 2\n\n??p??d??\nabc\n\nSample Output 2\n\nUNRESTORABLE\n\nThere is no string that satisfies Condition 1, so the string S does not exist.", "sample_input": "?tc????\ncoder\n"}, "reference_outputs": ["atcoder\n"], "source_document_id": "p03565", "source_text": "Score : 300 points\n\nProblem Statement\n\nE869120 found a chest which is likely to contain treasure.\n\nHowever, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters.\n\nHe also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with ?.\n\nOne more thing he found is a sheet of paper with the following facts written on it:\n\nCondition 1: The string S contains a string T as a contiguous substring.\n\nCondition 2: S is the lexicographically smallest string among the ones that satisfy Condition 1.\n\nPrint the string S.\n\nIf such a string does not exist, print UNRESTORABLE.\n\nConstraints\n\n1 \\leq |S'|, |T| \\leq 50\n\nS' consists of lowercase English letters and ?.\n\nT consists 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 string S.\n\nIf such a string does not exist, print UNRESTORABLE instead.\n\nSample Input 1\n\n?tc????\ncoder\n\nSample Output 1\n\natcoder\n\nThere are 26 strings that satisfy Condition 1: atcoder, btcoder, ctcoder,..., ztcoder.\nAmong them, the lexicographically smallest is atcoder, so we can say S = atcoder.\n\nSample Input 2\n\n??p??d??\nabc\n\nSample Output 2\n\nUNRESTORABLE\n\nThere is no string that satisfies Condition 1, so the string S does not exist.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s110158997", "group_id": "codeNet:p03565", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s, t string\n\tfmt.Scan(&s, &t)\n\ts = reverse(s)\n\tt = reverse(t)\n\n\tfor i := 0; i < len(s); i++ {\n\t\tok := true\n\t\tfor j := 0; j < len(t); j++ {\n\t\t\tif len(s) <= i+j {\n\t\t\t\tok = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t\ttt := t[j]\n\t\t\tss := s[i+j]\n\t\t\tif !(ss == tt || ss == '?') {\n\t\t\t\tok = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif ok {\n\t\t\tans := \"\"\n\t\t\tfor j := 0; j < len(s); j++ {\n\t\t\t\tc := s[j]\n\t\t\t\tif i <= j && j < i+len(t) {\n\t\t\t\t\tc = t[j-i]\n\t\t\t\t} else if c == '?' {\n\t\t\t\t\tc = 'a'\n\t\t\t\t}\n\t\t\t\tans += string(c)\n\t\t\t}\n\t\t\tfmt.Println(reverse(ans))\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"UNRESTORABLE\")\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n", "language": "Go", "metadata": {"date": 1578667690, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03565.html", "problem_id": "p03565", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03565/input.txt", "sample_output_relpath": "derived/input_output/data/p03565/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03565/Go/s110158997.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s110158997", "user_id": "u902409225"}, "prompt_components": {"gold_output": "atcoder\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s, t string\n\tfmt.Scan(&s, &t)\n\ts = reverse(s)\n\tt = reverse(t)\n\n\tfor i := 0; i < len(s); i++ {\n\t\tok := true\n\t\tfor j := 0; j < len(t); j++ {\n\t\t\tif len(s) <= i+j {\n\t\t\t\tok = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t\ttt := t[j]\n\t\t\tss := s[i+j]\n\t\t\tif !(ss == tt || ss == '?') {\n\t\t\t\tok = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif ok {\n\t\t\tans := \"\"\n\t\t\tfor j := 0; j < len(s); j++ {\n\t\t\t\tc := s[j]\n\t\t\t\tif i <= j && j < i+len(t) {\n\t\t\t\t\tc = t[j-i]\n\t\t\t\t} else if c == '?' {\n\t\t\t\t\tc = 'a'\n\t\t\t\t}\n\t\t\t\tans += string(c)\n\t\t\t}\n\t\t\tfmt.Println(reverse(ans))\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"UNRESTORABLE\")\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nE869120 found a chest which is likely to contain treasure.\n\nHowever, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters.\n\nHe also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with ?.\n\nOne more thing he found is a sheet of paper with the following facts written on it:\n\nCondition 1: The string S contains a string T as a contiguous substring.\n\nCondition 2: S is the lexicographically smallest string among the ones that satisfy Condition 1.\n\nPrint the string S.\n\nIf such a string does not exist, print UNRESTORABLE.\n\nConstraints\n\n1 \\leq |S'|, |T| \\leq 50\n\nS' consists of lowercase English letters and ?.\n\nT consists 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 string S.\n\nIf such a string does not exist, print UNRESTORABLE instead.\n\nSample Input 1\n\n?tc????\ncoder\n\nSample Output 1\n\natcoder\n\nThere are 26 strings that satisfy Condition 1: atcoder, btcoder, ctcoder,..., ztcoder.\nAmong them, the lexicographically smallest is atcoder, so we can say S = atcoder.\n\nSample Input 2\n\n??p??d??\nabc\n\nSample Output 2\n\nUNRESTORABLE\n\nThere is no string that satisfies Condition 1, so the string S does not exist.", "sample_input": "?tc????\ncoder\n"}, "reference_outputs": ["atcoder\n"], "source_document_id": "p03565", "source_text": "Score : 300 points\n\nProblem Statement\n\nE869120 found a chest which is likely to contain treasure.\n\nHowever, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters.\n\nHe also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with ?.\n\nOne more thing he found is a sheet of paper with the following facts written on it:\n\nCondition 1: The string S contains a string T as a contiguous substring.\n\nCondition 2: S is the lexicographically smallest string among the ones that satisfy Condition 1.\n\nPrint the string S.\n\nIf such a string does not exist, print UNRESTORABLE.\n\nConstraints\n\n1 \\leq |S'|, |T| \\leq 50\n\nS' consists of lowercase English letters and ?.\n\nT consists 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 string S.\n\nIf such a string does not exist, print UNRESTORABLE instead.\n\nSample Input 1\n\n?tc????\ncoder\n\nSample Output 1\n\natcoder\n\nThere are 26 strings that satisfy Condition 1: atcoder, btcoder, ctcoder,..., ztcoder.\nAmong them, the lexicographically smallest is atcoder, so we can say S = atcoder.\n\nSample Input 2\n\n??p??d??\nabc\n\nSample Output 2\n\nUNRESTORABLE\n\nThere is no string that satisfies Condition 1, so the string S does not exist.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 777, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s501212813", "group_id": "codeNet:p03565", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar S, T string\n\tfmt.Scan(&S, &T)\n\tstart := len(S) - len(T)\n\tif start < 0 {\n\t\tfmt.Println(\"UNRESTORABLE\")\n\t}\n\tfor s := start; s >= 0; s-- {\n\t\ti := 0\n\t\tfor i = 0; i < len(T); i++ {\n\t\t\tif string(S[s+i]) != \"?\" && S[s+i] != T[i] {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif i == len(T) {\n\t\t\tresult := \"\"\n\t\t\tfor j := 0; j < start; j++ {\n\t\t\t\tif string(S[j]) == \"?\" {\n\t\t\t\t\tresult += \"a\"\n\t\t\t\t} else {\n\t\t\t\t\tresult += string(S[j])\n\t\t\t\t}\n\t\t\t}\n\t\t\tresult += T\n\t\t\tfmt.Println(result)\n\t\t\tos.Exit(0)\n\t\t}\n\t}\n\tfmt.Println(\"UNRESTORABLE\")\n}\n", "language": "Go", "metadata": {"date": 1574261164, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03565.html", "problem_id": "p03565", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03565/input.txt", "sample_output_relpath": "derived/input_output/data/p03565/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03565/Go/s501212813.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s501212813", "user_id": "u761488152"}, "prompt_components": {"gold_output": "atcoder\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar S, T string\n\tfmt.Scan(&S, &T)\n\tstart := len(S) - len(T)\n\tif start < 0 {\n\t\tfmt.Println(\"UNRESTORABLE\")\n\t}\n\tfor s := start; s >= 0; s-- {\n\t\ti := 0\n\t\tfor i = 0; i < len(T); i++ {\n\t\t\tif string(S[s+i]) != \"?\" && S[s+i] != T[i] {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif i == len(T) {\n\t\t\tresult := \"\"\n\t\t\tfor j := 0; j < start; j++ {\n\t\t\t\tif string(S[j]) == \"?\" {\n\t\t\t\t\tresult += \"a\"\n\t\t\t\t} else {\n\t\t\t\t\tresult += string(S[j])\n\t\t\t\t}\n\t\t\t}\n\t\t\tresult += T\n\t\t\tfmt.Println(result)\n\t\t\tos.Exit(0)\n\t\t}\n\t}\n\tfmt.Println(\"UNRESTORABLE\")\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nE869120 found a chest which is likely to contain treasure.\n\nHowever, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters.\n\nHe also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with ?.\n\nOne more thing he found is a sheet of paper with the following facts written on it:\n\nCondition 1: The string S contains a string T as a contiguous substring.\n\nCondition 2: S is the lexicographically smallest string among the ones that satisfy Condition 1.\n\nPrint the string S.\n\nIf such a string does not exist, print UNRESTORABLE.\n\nConstraints\n\n1 \\leq |S'|, |T| \\leq 50\n\nS' consists of lowercase English letters and ?.\n\nT consists 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 string S.\n\nIf such a string does not exist, print UNRESTORABLE instead.\n\nSample Input 1\n\n?tc????\ncoder\n\nSample Output 1\n\natcoder\n\nThere are 26 strings that satisfy Condition 1: atcoder, btcoder, ctcoder,..., ztcoder.\nAmong them, the lexicographically smallest is atcoder, so we can say S = atcoder.\n\nSample Input 2\n\n??p??d??\nabc\n\nSample Output 2\n\nUNRESTORABLE\n\nThere is no string that satisfies Condition 1, so the string S does not exist.", "sample_input": "?tc????\ncoder\n"}, "reference_outputs": ["atcoder\n"], "source_document_id": "p03565", "source_text": "Score : 300 points\n\nProblem Statement\n\nE869120 found a chest which is likely to contain treasure.\n\nHowever, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters.\n\nHe also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with ?.\n\nOne more thing he found is a sheet of paper with the following facts written on it:\n\nCondition 1: The string S contains a string T as a contiguous substring.\n\nCondition 2: S is the lexicographically smallest string among the ones that satisfy Condition 1.\n\nPrint the string S.\n\nIf such a string does not exist, print UNRESTORABLE.\n\nConstraints\n\n1 \\leq |S'|, |T| \\leq 50\n\nS' consists of lowercase English letters and ?.\n\nT consists 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 string S.\n\nIf such a string does not exist, print UNRESTORABLE instead.\n\nSample Input 1\n\n?tc????\ncoder\n\nSample Output 1\n\natcoder\n\nThere are 26 strings that satisfy Condition 1: atcoder, btcoder, ctcoder,..., ztcoder.\nAmong them, the lexicographically smallest is atcoder, so we can say S = atcoder.\n\nSample Input 2\n\n??p??d??\nabc\n\nSample Output 2\n\nUNRESTORABLE\n\nThere is no string that satisfies Condition 1, so the string S does not exist.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 558, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s688533909", "group_id": "codeNet:p03565", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar sp, t string\n\tfmt.Scan(&sp, &t)\n\n\tbegin := make([]int, 0)\n\tfor i := 0; i < len(sp); i++ {\n\t\tflag := false\n\t\tfor j := 0; j < len(t) && i+j < len(sp); j++ {\n\t\t\tif !(sp[i+j] == t[j] || sp[i+j] == '?') {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif j == len(t)-1 {\n\t\t\t\tflag = true\n\t\t\t}\n\t\t}\n\t\tif flag {\n\t\t\tbegin = append(begin, i)\n\t\t}\n\t}\n\n\tif len(begin) == 0 {\n\t\tfmt.Println(\"UNRESTORABLE\")\n\t\treturn\n\t}\n\n\tcandinates := make([]string, len(begin))\n\tfor j, k := range begin {\n\t\ts := \"\"\n\t\tfor i := range sp {\n\t\t\tif i >= k && i < k+len(t) {\n\t\t\t\ts += string(t[i-k])\n\t\t\t} else if sp[i] == '?' {\n\t\t\t\ts += string('a')\n\t\t\t} else {\n\t\t\t\ts += string(sp[i])\n\t\t\t}\n\t\t}\n\t\tcandinates[j] = s\n\t}\n\n\tvar min string\n\tfor i, str := range candinates {\n\t\tif i == 0 || str < min {\n\t\t\tmin = str\n\t\t}\n\t}\n\tfmt.Println(min)\n}\n", "language": "Go", "metadata": {"date": 1572157266, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03565.html", "problem_id": "p03565", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03565/input.txt", "sample_output_relpath": "derived/input_output/data/p03565/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03565/Go/s688533909.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s688533909", "user_id": "u275316733"}, "prompt_components": {"gold_output": "atcoder\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar sp, t string\n\tfmt.Scan(&sp, &t)\n\n\tbegin := make([]int, 0)\n\tfor i := 0; i < len(sp); i++ {\n\t\tflag := false\n\t\tfor j := 0; j < len(t) && i+j < len(sp); j++ {\n\t\t\tif !(sp[i+j] == t[j] || sp[i+j] == '?') {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif j == len(t)-1 {\n\t\t\t\tflag = true\n\t\t\t}\n\t\t}\n\t\tif flag {\n\t\t\tbegin = append(begin, i)\n\t\t}\n\t}\n\n\tif len(begin) == 0 {\n\t\tfmt.Println(\"UNRESTORABLE\")\n\t\treturn\n\t}\n\n\tcandinates := make([]string, len(begin))\n\tfor j, k := range begin {\n\t\ts := \"\"\n\t\tfor i := range sp {\n\t\t\tif i >= k && i < k+len(t) {\n\t\t\t\ts += string(t[i-k])\n\t\t\t} else if sp[i] == '?' {\n\t\t\t\ts += string('a')\n\t\t\t} else {\n\t\t\t\ts += string(sp[i])\n\t\t\t}\n\t\t}\n\t\tcandinates[j] = s\n\t}\n\n\tvar min string\n\tfor i, str := range candinates {\n\t\tif i == 0 || str < min {\n\t\t\tmin = str\n\t\t}\n\t}\n\tfmt.Println(min)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nE869120 found a chest which is likely to contain treasure.\n\nHowever, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters.\n\nHe also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with ?.\n\nOne more thing he found is a sheet of paper with the following facts written on it:\n\nCondition 1: The string S contains a string T as a contiguous substring.\n\nCondition 2: S is the lexicographically smallest string among the ones that satisfy Condition 1.\n\nPrint the string S.\n\nIf such a string does not exist, print UNRESTORABLE.\n\nConstraints\n\n1 \\leq |S'|, |T| \\leq 50\n\nS' consists of lowercase English letters and ?.\n\nT consists 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 string S.\n\nIf such a string does not exist, print UNRESTORABLE instead.\n\nSample Input 1\n\n?tc????\ncoder\n\nSample Output 1\n\natcoder\n\nThere are 26 strings that satisfy Condition 1: atcoder, btcoder, ctcoder,..., ztcoder.\nAmong them, the lexicographically smallest is atcoder, so we can say S = atcoder.\n\nSample Input 2\n\n??p??d??\nabc\n\nSample Output 2\n\nUNRESTORABLE\n\nThere is no string that satisfies Condition 1, so the string S does not exist.", "sample_input": "?tc????\ncoder\n"}, "reference_outputs": ["atcoder\n"], "source_document_id": "p03565", "source_text": "Score : 300 points\n\nProblem Statement\n\nE869120 found a chest which is likely to contain treasure.\n\nHowever, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters.\n\nHe also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with ?.\n\nOne more thing he found is a sheet of paper with the following facts written on it:\n\nCondition 1: The string S contains a string T as a contiguous substring.\n\nCondition 2: S is the lexicographically smallest string among the ones that satisfy Condition 1.\n\nPrint the string S.\n\nIf such a string does not exist, print UNRESTORABLE.\n\nConstraints\n\n1 \\leq |S'|, |T| \\leq 50\n\nS' consists of lowercase English letters and ?.\n\nT consists 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 string S.\n\nIf such a string does not exist, print UNRESTORABLE instead.\n\nSample Input 1\n\n?tc????\ncoder\n\nSample Output 1\n\natcoder\n\nThere are 26 strings that satisfy Condition 1: atcoder, btcoder, ctcoder,..., ztcoder.\nAmong them, the lexicographically smallest is atcoder, so we can say S = atcoder.\n\nSample Input 2\n\n??p??d??\nabc\n\nSample Output 2\n\nUNRESTORABLE\n\nThere is no string that satisfies Condition 1, so the string S does not exist.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s232347122", "group_id": "codeNet:p03565", "input_text": "// ProblemURL : https://atcoder.jp/contests/abc076/tasks/abc076_c\n// ---------------------------------------------\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\nfunc diff(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\nfunc larger(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc smaller(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc largest(a, b, c int) (lgst int) {\n\tif a > b {\n\t\tlgst = a\n\t} else {\n\t\tlgst = b\n\t}\n\tif c > lgst {\n\t\tlgst = c\n\t}\n\treturn\n}\nfunc smallerst(a, b, c int) (slst int) {\n\tif a < b {\n\t\tslst = a\n\t} else {\n\t\tslst = b\n\t}\n\tif c < slst {\n\t\tslst = c\n\t}\n\treturn\n}\nfunc intsMax(a []int) (idx, val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func max: argument slice length must not be zero\")\n\t}\n\tval = a[0]\n\tfor i, aa := range a {\n\t\tif aa > val {\n\t\t\tidx, val = i, aa\n\t\t}\n\t}\n\treturn\n}\nfunc intsMin(a []int) (idx, val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func min: argument slice length must not be zero\")\n\t}\n\tval = a[0]\n\tfor i, aa := range a {\n\t\tif aa < val {\n\t\t\tidx, val = i, aa\n\t\t}\n\t}\n\treturn\n}\nfunc intsSum(a []int) int {\n\tres := 0\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\nfunc intsSigma(x int) int { return x * (x + 1) / 2 }\nfunc isEven(n int) bool { return n&1 == 0 }\nfunc isOdd(n int) bool { return n&1 == 1 }\nfunc swap(a int, b int) (int, int) { return b, a }\nfunc calcMod(n int) int { return n % mod }\nfunc ceil(x float64) int { return int(math.Ceil(x)) }\nfunc pow(x, y int) int {\n\tif y < 0 {\n\t\tpanic(\"Exponent must be a natural number\")\n\t}\n\tz := 1\n\tfor i := y; i != 0; i >>= 1 {\n\t\tif i&1 == 1 {\n\t\t\tz *= x\n\t\t}\n\t\tx *= x\n\t}\n\treturn z\n}\nfunc powMod(x, y int) int {\n\tif y < 0 {\n\t\tpanic(\"Exponent must be a natural number\")\n\t}\n\tz := 1\n\tfor i := y; i != 0; i >>= 1 {\n\t\tif i&1 == 1 {\n\t\t\tz = (z * x) % mod\n\t\t}\n\t\tx = (x * x) % mod\n\t}\n\treturn z\n}\nfunc intsJoin(a, b []int) []int { return append(a, b...) }\nfunc intsClear(a []int) []int { return a[:0] }\nfunc intsCopy(a []int) []int { return append([]int(nil), a...) }\nfunc intsSorted(a []int) []int {\n\ts := intsCopy(a)\n\tsort.Ints(s)\n\treturn s\n}\nfunc intsReverse(a []int) {\n\tfor i, j := 0, len(a)-1; i < j; i, j = i+1, j-1 {\n\t\ta[i], a[j] = a[j], a[i]\n\t}\n\treturn\n}\nfunc intsFill(a []int, val int) {\n\tfor i := 0; i < len(a); i++ {\n\t\ta[i] = val\n\t}\n\treturn\n}\nfunc intsPeekBack(a []int) int {\n\tif len(a) == 0 {\n\t\tpanic(\"func peekBack: zero length slice\")\n\t}\n\treturn a[len(a)-1]\n}\nfunc intsPeekFront(a []int) int {\n\tif len(a) == 0 {\n\t\tpanic(\"func peekFront: zero length slice\")\n\t}\n\treturn a[0]\n}\nfunc intsPopBack(a []int) (int, []int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func popBack: zero length slice\")\n\t}\n\treturn a[len(a)-1], a[:len(a)-1]\n}\nfunc intsPopFront(a []int) (int, []int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func popFront: zero length slice\")\n\t}\n\treturn a[0], a[1:]\n}\nfunc intsPushBack(a []int, x int) []int { return append(a, x) }\nfunc intsPushFront(a []int, x int) []int { return append([]int{x}, a...) }\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\tbw = bufio.NewWriterSize(os.Stdout, maxBufSize)\n)\n\nfunc init() {}\nfunc ru() (n int) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tfor _, v := range sc.Bytes() {\n\t\tn = n*10 + int(v-48)\n\t}\n\treturn\n}\nfunc ri() (n int) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tb := sc.Bytes()\n\tneg := false\n\tif b[0] == 45 {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tfor _, v := range b {\n\t\tn = n*10 + int(v-48)\n\t}\n\tif neg {\n\t\tn = -n\n\t}\n\treturn\n}\nfunc ri64() (n int64) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tb := sc.Bytes()\n\tneg := false\n\tif b[0] == 45 {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tfor _, v := range b {\n\t\tn = n*10 + int64(v-48)\n\t}\n\tif neg {\n\t\tn = -n\n\t}\n\treturn\n}\nfunc rf() float64 {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tf, err := strconv.ParseFloat(sc.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn f\n}\nfunc rs() string {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn sc.Text()\n}\nfunc rb() []byte {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn sc.Bytes()\n}\nfunc rr() []rune {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn []rune(sc.Text())\n}\nfunc ris(n int) []int {\n\ts := make([]int, n)\n\tfor i := range s {\n\t\ts[i] = ri()\n\t}\n\treturn s\n}\nfunc risZeroBased(n int) []int {\n\ts := make([]int, n)\n\tfor i := range s {\n\t\ts[i] = ri() - 1\n\t}\n\treturn s\n}\nfunc ri64s(n int) []int64 {\n\ts := make([]int64, n)\n\tfor i := range s {\n\t\ts[i] = ri64()\n\t}\n\treturn s\n}\nfunc rss(n int) []string {\n\ts := make([]string, n)\n\tfor i := range s {\n\t\ts[i] = rs()\n\t}\n\treturn s\n}\nfunc pf(format string, a ...interface{}) {\n\tif _, err := fmt.Fprintf(bw, format, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc pln(a ...interface{}) {\n\tif _, err := fmt.Fprintln(bw, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc pall(a []int) {\n\tfor _, v := range a {\n\t\tfmt.Fprintln(bw, v)\n\t}\n}\nfunc pallol(a []int) {\n\ts := fmt.Sprint(a)\n\tif _, err := fmt.Fprintln(bw, s[1:len(s)-1]); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc dbg(a ...interface{}) {\n\tif _, err := fmt.Fprintln(os.Stderr, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1e7), 1e7)\n\tsolve()\n\tbw.Flush()\n}\n\nconst (\n\tmaxBufSize = 1e6\n\n\t// maxInt64 = 9223372036854775807 // 9e18\n\t// maxInt32 = 2147483647 // 2e9\n\t// maxUint64 = 18446744073709551615 // 1e19\n\tinf = 1 << 60\n\tmod = 1e9 + 7\n)\n\ntype pair struct{ a, b int }\ntype point struct{ x, y int }\n\nfunc solve() {\n\ts, t := rs(), rs()\n\n\tif len(t) > len(s) {\n\t\tpln(\"UNRESTORABLE\")\n\t\treturn\n\t}\n\n\tcheck := func(i int) bool {\n\t\tfor j := range t {\n\t\t\tif s[i+j] != '?' && s[i+j] != t[j] {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\treturn true\n\t}\n\tks := make([]int, 0, 50)\n\tfor i := 0; i < len(s)-len(t)+1; i++ {\n\t\tif check(i) {\n\t\t\tks = append(ks, i)\n\t\t}\n\t}\n\tif len(ks) == 0 {\n\t\tpln(\"UNRESTORABLE\")\n\t\treturn\n\t}\n\n\tanss := make([]string, 0, 50)\n\tfor _, k := range ks {\n\t\ttmp := []byte(s)\n\t\tfor j := 0; j < len(t); j++ {\n\t\t\ttmp[k+j] = t[j]\n\t\t}\n\t\tfor i := range tmp {\n\t\t\tif tmp[i] == '?' {\n\t\t\t\ttmp[i] = 'a'\n\t\t\t}\n\t\t}\n\t\tanss = append(anss, string(tmp))\n\t}\n\tsort.Strings(anss)\n\tpln(anss[0])\n}\n", "language": "Go", "metadata": {"date": 1568135212, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03565.html", "problem_id": "p03565", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03565/input.txt", "sample_output_relpath": "derived/input_output/data/p03565/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03565/Go/s232347122.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s232347122", "user_id": "u554269352"}, "prompt_components": {"gold_output": "atcoder\n", "input_to_evaluate": "// ProblemURL : https://atcoder.jp/contests/abc076/tasks/abc076_c\n// ---------------------------------------------\npackage main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nfunc abs(x int) int {\n\tif x < 0 {\n\t\treturn -x\n\t}\n\treturn x\n}\nfunc diff(a, b int) int {\n\tif a > b {\n\t\treturn a - b\n\t}\n\treturn b - a\n}\nfunc larger(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc smaller(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\nfunc largest(a, b, c int) (lgst int) {\n\tif a > b {\n\t\tlgst = a\n\t} else {\n\t\tlgst = b\n\t}\n\tif c > lgst {\n\t\tlgst = c\n\t}\n\treturn\n}\nfunc smallerst(a, b, c int) (slst int) {\n\tif a < b {\n\t\tslst = a\n\t} else {\n\t\tslst = b\n\t}\n\tif c < slst {\n\t\tslst = c\n\t}\n\treturn\n}\nfunc intsMax(a []int) (idx, val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func max: argument slice length must not be zero\")\n\t}\n\tval = a[0]\n\tfor i, aa := range a {\n\t\tif aa > val {\n\t\t\tidx, val = i, aa\n\t\t}\n\t}\n\treturn\n}\nfunc intsMin(a []int) (idx, val int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func min: argument slice length must not be zero\")\n\t}\n\tval = a[0]\n\tfor i, aa := range a {\n\t\tif aa < val {\n\t\t\tidx, val = i, aa\n\t\t}\n\t}\n\treturn\n}\nfunc intsSum(a []int) int {\n\tres := 0\n\tfor _, v := range a {\n\t\tres += v\n\t}\n\treturn res\n}\nfunc intsSigma(x int) int { return x * (x + 1) / 2 }\nfunc isEven(n int) bool { return n&1 == 0 }\nfunc isOdd(n int) bool { return n&1 == 1 }\nfunc swap(a int, b int) (int, int) { return b, a }\nfunc calcMod(n int) int { return n % mod }\nfunc ceil(x float64) int { return int(math.Ceil(x)) }\nfunc pow(x, y int) int {\n\tif y < 0 {\n\t\tpanic(\"Exponent must be a natural number\")\n\t}\n\tz := 1\n\tfor i := y; i != 0; i >>= 1 {\n\t\tif i&1 == 1 {\n\t\t\tz *= x\n\t\t}\n\t\tx *= x\n\t}\n\treturn z\n}\nfunc powMod(x, y int) int {\n\tif y < 0 {\n\t\tpanic(\"Exponent must be a natural number\")\n\t}\n\tz := 1\n\tfor i := y; i != 0; i >>= 1 {\n\t\tif i&1 == 1 {\n\t\t\tz = (z * x) % mod\n\t\t}\n\t\tx = (x * x) % mod\n\t}\n\treturn z\n}\nfunc intsJoin(a, b []int) []int { return append(a, b...) }\nfunc intsClear(a []int) []int { return a[:0] }\nfunc intsCopy(a []int) []int { return append([]int(nil), a...) }\nfunc intsSorted(a []int) []int {\n\ts := intsCopy(a)\n\tsort.Ints(s)\n\treturn s\n}\nfunc intsReverse(a []int) {\n\tfor i, j := 0, len(a)-1; i < j; i, j = i+1, j-1 {\n\t\ta[i], a[j] = a[j], a[i]\n\t}\n\treturn\n}\nfunc intsFill(a []int, val int) {\n\tfor i := 0; i < len(a); i++ {\n\t\ta[i] = val\n\t}\n\treturn\n}\nfunc intsPeekBack(a []int) int {\n\tif len(a) == 0 {\n\t\tpanic(\"func peekBack: zero length slice\")\n\t}\n\treturn a[len(a)-1]\n}\nfunc intsPeekFront(a []int) int {\n\tif len(a) == 0 {\n\t\tpanic(\"func peekFront: zero length slice\")\n\t}\n\treturn a[0]\n}\nfunc intsPopBack(a []int) (int, []int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func popBack: zero length slice\")\n\t}\n\treturn a[len(a)-1], a[:len(a)-1]\n}\nfunc intsPopFront(a []int) (int, []int) {\n\tif len(a) == 0 {\n\t\tpanic(\"func popFront: zero length slice\")\n\t}\n\treturn a[0], a[1:]\n}\nfunc intsPushBack(a []int, x int) []int { return append(a, x) }\nfunc intsPushFront(a []int, x int) []int { return append([]int{x}, a...) }\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\tbw = bufio.NewWriterSize(os.Stdout, maxBufSize)\n)\n\nfunc init() {}\nfunc ru() (n int) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tfor _, v := range sc.Bytes() {\n\t\tn = n*10 + int(v-48)\n\t}\n\treturn\n}\nfunc ri() (n int) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tb := sc.Bytes()\n\tneg := false\n\tif b[0] == 45 {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tfor _, v := range b {\n\t\tn = n*10 + int(v-48)\n\t}\n\tif neg {\n\t\tn = -n\n\t}\n\treturn\n}\nfunc ri64() (n int64) {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tb := sc.Bytes()\n\tneg := false\n\tif b[0] == 45 {\n\t\tneg = true\n\t\tb = b[1:]\n\t}\n\tfor _, v := range b {\n\t\tn = n*10 + int64(v-48)\n\t}\n\tif neg {\n\t\tn = -n\n\t}\n\treturn\n}\nfunc rf() float64 {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\tf, err := strconv.ParseFloat(sc.Text(), 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn f\n}\nfunc rs() string {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn sc.Text()\n}\nfunc rb() []byte {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn sc.Bytes()\n}\nfunc rr() []rune {\n\tsc.Scan()\n\tif err := sc.Err(); err != nil {\n\t\tpanic(err)\n\t}\n\treturn []rune(sc.Text())\n}\nfunc ris(n int) []int {\n\ts := make([]int, n)\n\tfor i := range s {\n\t\ts[i] = ri()\n\t}\n\treturn s\n}\nfunc risZeroBased(n int) []int {\n\ts := make([]int, n)\n\tfor i := range s {\n\t\ts[i] = ri() - 1\n\t}\n\treturn s\n}\nfunc ri64s(n int) []int64 {\n\ts := make([]int64, n)\n\tfor i := range s {\n\t\ts[i] = ri64()\n\t}\n\treturn s\n}\nfunc rss(n int) []string {\n\ts := make([]string, n)\n\tfor i := range s {\n\t\ts[i] = rs()\n\t}\n\treturn s\n}\nfunc pf(format string, a ...interface{}) {\n\tif _, err := fmt.Fprintf(bw, format, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc pln(a ...interface{}) {\n\tif _, err := fmt.Fprintln(bw, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc pall(a []int) {\n\tfor _, v := range a {\n\t\tfmt.Fprintln(bw, v)\n\t}\n}\nfunc pallol(a []int) {\n\ts := fmt.Sprint(a)\n\tif _, err := fmt.Fprintln(bw, s[1:len(s)-1]); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc dbg(a ...interface{}) {\n\tif _, err := fmt.Fprintln(os.Stderr, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1e7), 1e7)\n\tsolve()\n\tbw.Flush()\n}\n\nconst (\n\tmaxBufSize = 1e6\n\n\t// maxInt64 = 9223372036854775807 // 9e18\n\t// maxInt32 = 2147483647 // 2e9\n\t// maxUint64 = 18446744073709551615 // 1e19\n\tinf = 1 << 60\n\tmod = 1e9 + 7\n)\n\ntype pair struct{ a, b int }\ntype point struct{ x, y int }\n\nfunc solve() {\n\ts, t := rs(), rs()\n\n\tif len(t) > len(s) {\n\t\tpln(\"UNRESTORABLE\")\n\t\treturn\n\t}\n\n\tcheck := func(i int) bool {\n\t\tfor j := range t {\n\t\t\tif s[i+j] != '?' && s[i+j] != t[j] {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\treturn true\n\t}\n\tks := make([]int, 0, 50)\n\tfor i := 0; i < len(s)-len(t)+1; i++ {\n\t\tif check(i) {\n\t\t\tks = append(ks, i)\n\t\t}\n\t}\n\tif len(ks) == 0 {\n\t\tpln(\"UNRESTORABLE\")\n\t\treturn\n\t}\n\n\tanss := make([]string, 0, 50)\n\tfor _, k := range ks {\n\t\ttmp := []byte(s)\n\t\tfor j := 0; j < len(t); j++ {\n\t\t\ttmp[k+j] = t[j]\n\t\t}\n\t\tfor i := range tmp {\n\t\t\tif tmp[i] == '?' {\n\t\t\t\ttmp[i] = 'a'\n\t\t\t}\n\t\t}\n\t\tanss = append(anss, string(tmp))\n\t}\n\tsort.Strings(anss)\n\tpln(anss[0])\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nE869120 found a chest which is likely to contain treasure.\n\nHowever, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters.\n\nHe also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with ?.\n\nOne more thing he found is a sheet of paper with the following facts written on it:\n\nCondition 1: The string S contains a string T as a contiguous substring.\n\nCondition 2: S is the lexicographically smallest string among the ones that satisfy Condition 1.\n\nPrint the string S.\n\nIf such a string does not exist, print UNRESTORABLE.\n\nConstraints\n\n1 \\leq |S'|, |T| \\leq 50\n\nS' consists of lowercase English letters and ?.\n\nT consists 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 string S.\n\nIf such a string does not exist, print UNRESTORABLE instead.\n\nSample Input 1\n\n?tc????\ncoder\n\nSample Output 1\n\natcoder\n\nThere are 26 strings that satisfy Condition 1: atcoder, btcoder, ctcoder,..., ztcoder.\nAmong them, the lexicographically smallest is atcoder, so we can say S = atcoder.\n\nSample Input 2\n\n??p??d??\nabc\n\nSample Output 2\n\nUNRESTORABLE\n\nThere is no string that satisfies Condition 1, so the string S does not exist.", "sample_input": "?tc????\ncoder\n"}, "reference_outputs": ["atcoder\n"], "source_document_id": "p03565", "source_text": "Score : 300 points\n\nProblem Statement\n\nE869120 found a chest which is likely to contain treasure.\n\nHowever, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters.\n\nHe also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with ?.\n\nOne more thing he found is a sheet of paper with the following facts written on it:\n\nCondition 1: The string S contains a string T as a contiguous substring.\n\nCondition 2: S is the lexicographically smallest string among the ones that satisfy Condition 1.\n\nPrint the string S.\n\nIf such a string does not exist, print UNRESTORABLE.\n\nConstraints\n\n1 \\leq |S'|, |T| \\leq 50\n\nS' consists of lowercase English letters and ?.\n\nT consists 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 string S.\n\nIf such a string does not exist, print UNRESTORABLE instead.\n\nSample Input 1\n\n?tc????\ncoder\n\nSample Output 1\n\natcoder\n\nThere are 26 strings that satisfy Condition 1: atcoder, btcoder, ctcoder,..., ztcoder.\nAmong them, the lexicographically smallest is atcoder, so we can say S = atcoder.\n\nSample Input 2\n\n??p??d??\nabc\n\nSample Output 2\n\nUNRESTORABLE\n\nThere is no string that satisfies Condition 1, so the string S does not exist.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6198, "cpu_time_ms": 11, "memory_kb": 1024}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s293701620", "group_id": "codeNet:p03565", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s, t string\n\tfmt.Scan(&s, &t)\n\tfor i := len(s) - len(t); i >= 0; i-- {\n\t\tcom := true\n\t\tfor j := 0; j < len(t); j++ {\n\t\t\tif s[i+j] == '?' {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif t[j] != s[i+j] {\n\t\t\t\tcom = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif com {\n\t\t\tv := s[:i] + t + s[i+len(t):]\n\t\t\tans := \"\"\n\t\t\tfor _, c := range v {\n\t\t\t\tif c == '?' {\n\t\t\t\t\tans += \"a\"\n\t\t\t\t} else {\n\t\t\t\t\tans += string(c)\n\t\t\t\t}\n\t\t\t}\n\t\t\tfmt.Println(ans)\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"UNRESTORABLE\")\n}\n", "language": "Go", "metadata": {"date": 1558539835, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03565.html", "problem_id": "p03565", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03565/input.txt", "sample_output_relpath": "derived/input_output/data/p03565/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03565/Go/s293701620.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s293701620", "user_id": "u375977529"}, "prompt_components": {"gold_output": "atcoder\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s, t string\n\tfmt.Scan(&s, &t)\n\tfor i := len(s) - len(t); i >= 0; i-- {\n\t\tcom := true\n\t\tfor j := 0; j < len(t); j++ {\n\t\t\tif s[i+j] == '?' {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif t[j] != s[i+j] {\n\t\t\t\tcom = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif com {\n\t\t\tv := s[:i] + t + s[i+len(t):]\n\t\t\tans := \"\"\n\t\t\tfor _, c := range v {\n\t\t\t\tif c == '?' {\n\t\t\t\t\tans += \"a\"\n\t\t\t\t} else {\n\t\t\t\t\tans += string(c)\n\t\t\t\t}\n\t\t\t}\n\t\t\tfmt.Println(ans)\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"UNRESTORABLE\")\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nE869120 found a chest which is likely to contain treasure.\n\nHowever, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters.\n\nHe also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with ?.\n\nOne more thing he found is a sheet of paper with the following facts written on it:\n\nCondition 1: The string S contains a string T as a contiguous substring.\n\nCondition 2: S is the lexicographically smallest string among the ones that satisfy Condition 1.\n\nPrint the string S.\n\nIf such a string does not exist, print UNRESTORABLE.\n\nConstraints\n\n1 \\leq |S'|, |T| \\leq 50\n\nS' consists of lowercase English letters and ?.\n\nT consists 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 string S.\n\nIf such a string does not exist, print UNRESTORABLE instead.\n\nSample Input 1\n\n?tc????\ncoder\n\nSample Output 1\n\natcoder\n\nThere are 26 strings that satisfy Condition 1: atcoder, btcoder, ctcoder,..., ztcoder.\nAmong them, the lexicographically smallest is atcoder, so we can say S = atcoder.\n\nSample Input 2\n\n??p??d??\nabc\n\nSample Output 2\n\nUNRESTORABLE\n\nThere is no string that satisfies Condition 1, so the string S does not exist.", "sample_input": "?tc????\ncoder\n"}, "reference_outputs": ["atcoder\n"], "source_document_id": "p03565", "source_text": "Score : 300 points\n\nProblem Statement\n\nE869120 found a chest which is likely to contain treasure.\n\nHowever, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters.\n\nHe also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with ?.\n\nOne more thing he found is a sheet of paper with the following facts written on it:\n\nCondition 1: The string S contains a string T as a contiguous substring.\n\nCondition 2: S is the lexicographically smallest string among the ones that satisfy Condition 1.\n\nPrint the string S.\n\nIf such a string does not exist, print UNRESTORABLE.\n\nConstraints\n\n1 \\leq |S'|, |T| \\leq 50\n\nS' consists of lowercase English letters and ?.\n\nT consists 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 string S.\n\nIf such a string does not exist, print UNRESTORABLE instead.\n\nSample Input 1\n\n?tc????\ncoder\n\nSample Output 1\n\natcoder\n\nThere are 26 strings that satisfy Condition 1: atcoder, btcoder, ctcoder,..., ztcoder.\nAmong them, the lexicographically smallest is atcoder, so we can say S = atcoder.\n\nSample Input 2\n\n??p??d??\nabc\n\nSample Output 2\n\nUNRESTORABLE\n\nThere is no string that satisfies Condition 1, so the string S does not exist.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 492, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s885413044", "group_id": "codeNet:p03565", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"bufio\"\n\t\"strings\"\n)\n\n// define\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n)\n\nfunc bordersInt(in_map [][]int, invalid int) [][]int{\n\tH, W := len(in_map), len(in_map[0])\n\tout_map := make([][]int, H+2)\n\tfor h:=0; h= 0; i-- {\n if str[i] != '?' {\n cnt = 0\n } else {\n cnt += 1\n quest[i] = cnt\n }\n }\n idx := -1\n for i := 0; i < len(str); i++ {\n if(check(i)) {\n idx = i\n }\n }\n if idx == -1 {\n fmt.Println(\"UNRESTORABLE\")\n } else {\n for i := 0; i < len(str); i++ {\n if i == idx {\n fmt.Print(t)\n i += len(t)\n } else if str[i] == '?' {\n fmt.Print(\"a\")\n } else {\n fmt.Print(string(str[i]))\n }\n }\n fmt.Println()\n }\n\n}\n", "language": "Go", "metadata": {"date": 1540865813, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03565.html", "problem_id": "p03565", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03565/input.txt", "sample_output_relpath": "derived/input_output/data/p03565/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03565/Go/s075579414.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s075579414", "user_id": "u285118720"}, "prompt_components": {"gold_output": "atcoder\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\nvar str, t string\nvar quest []int\n\nfunc check(idx int) bool {\n if len(str) - idx < len(t) {\n return false\n }\n for i := idx; i < idx + len(t); i++{\n if str[i] != t[i-idx] && str[i] != '?' {\n return false\n }\n }\n return true\n}\n\nfunc main() {\n fmt.Scanf(\"%s\\n%s\", &str, &t)\n if str == t {\n fmt.Println(str)\n return\n }\n\n quest = make([]int, len(str))\n cnt := 0\n for i := len(str) - 1; i >= 0; i-- {\n if str[i] != '?' {\n cnt = 0\n } else {\n cnt += 1\n quest[i] = cnt\n }\n }\n idx := -1\n for i := 0; i < len(str); i++ {\n if(check(i)) {\n idx = i\n }\n }\n if idx == -1 {\n fmt.Println(\"UNRESTORABLE\")\n } else {\n for i := 0; i < len(str); i++ {\n if i == idx {\n fmt.Print(t)\n i += len(t)\n } else if str[i] == '?' {\n fmt.Print(\"a\")\n } else {\n fmt.Print(string(str[i]))\n }\n }\n fmt.Println()\n }\n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nE869120 found a chest which is likely to contain treasure.\n\nHowever, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters.\n\nHe also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with ?.\n\nOne more thing he found is a sheet of paper with the following facts written on it:\n\nCondition 1: The string S contains a string T as a contiguous substring.\n\nCondition 2: S is the lexicographically smallest string among the ones that satisfy Condition 1.\n\nPrint the string S.\n\nIf such a string does not exist, print UNRESTORABLE.\n\nConstraints\n\n1 \\leq |S'|, |T| \\leq 50\n\nS' consists of lowercase English letters and ?.\n\nT consists 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 string S.\n\nIf such a string does not exist, print UNRESTORABLE instead.\n\nSample Input 1\n\n?tc????\ncoder\n\nSample Output 1\n\natcoder\n\nThere are 26 strings that satisfy Condition 1: atcoder, btcoder, ctcoder,..., ztcoder.\nAmong them, the lexicographically smallest is atcoder, so we can say S = atcoder.\n\nSample Input 2\n\n??p??d??\nabc\n\nSample Output 2\n\nUNRESTORABLE\n\nThere is no string that satisfies Condition 1, so the string S does not exist.", "sample_input": "?tc????\ncoder\n"}, "reference_outputs": ["atcoder\n"], "source_document_id": "p03565", "source_text": "Score : 300 points\n\nProblem Statement\n\nE869120 found a chest which is likely to contain treasure.\n\nHowever, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters.\n\nHe also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with ?.\n\nOne more thing he found is a sheet of paper with the following facts written on it:\n\nCondition 1: The string S contains a string T as a contiguous substring.\n\nCondition 2: S is the lexicographically smallest string among the ones that satisfy Condition 1.\n\nPrint the string S.\n\nIf such a string does not exist, print UNRESTORABLE.\n\nConstraints\n\n1 \\leq |S'|, |T| \\leq 50\n\nS' consists of lowercase English letters and ?.\n\nT consists 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 string S.\n\nIf such a string does not exist, print UNRESTORABLE instead.\n\nSample Input 1\n\n?tc????\ncoder\n\nSample Output 1\n\natcoder\n\nThere are 26 strings that satisfy Condition 1: atcoder, btcoder, ctcoder,..., ztcoder.\nAmong them, the lexicographically smallest is atcoder, so we can say S = atcoder.\n\nSample Input 2\n\n??p??d??\nabc\n\nSample Output 2\n\nUNRESTORABLE\n\nThere is no string that satisfies Condition 1, so the string S does not exist.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 943, "cpu_time_ms": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s423453715", "group_id": "codeNet:p03565", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar S, T string\n\tfmt.Scan(&S, &T)\n\n\tindex := -1\n\tfor i := range S {\n\t\tvar j int\n\t\tfor ; j < len(T); j++ {\n\t\t\tif i+j < len(S) && (S[i+j] == '?' || S[i+j] == T[j]) {\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif j == len(T) {\n\t\t\tindex = i\n\t\t}\n\t}\n\n\tif index == -1 {\n\t\tfmt.Println(\"UNRESTORABLE\")\n\t} else {\n\t\ts := S[:index] + T + S[index+len(T):]\n\t\tfor i := range s {\n\t\t\tif s[i] == '?' {\n\t\t\t\tfmt.Print(\"a\")\n\t\t\t} else {\n\t\t\t\tfmt.Print(string(s[i]))\n\t\t\t}\n\t\t}\n\t\tfmt.Println()\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1520660077, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03565.html", "problem_id": "p03565", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03565/input.txt", "sample_output_relpath": "derived/input_output/data/p03565/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03565/Go/s423453715.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s423453715", "user_id": "u802614675"}, "prompt_components": {"gold_output": "atcoder\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar S, T string\n\tfmt.Scan(&S, &T)\n\n\tindex := -1\n\tfor i := range S {\n\t\tvar j int\n\t\tfor ; j < len(T); j++ {\n\t\t\tif i+j < len(S) && (S[i+j] == '?' || S[i+j] == T[j]) {\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\n\t\tif j == len(T) {\n\t\t\tindex = i\n\t\t}\n\t}\n\n\tif index == -1 {\n\t\tfmt.Println(\"UNRESTORABLE\")\n\t} else {\n\t\ts := S[:index] + T + S[index+len(T):]\n\t\tfor i := range s {\n\t\t\tif s[i] == '?' {\n\t\t\t\tfmt.Print(\"a\")\n\t\t\t} else {\n\t\t\t\tfmt.Print(string(s[i]))\n\t\t\t}\n\t\t}\n\t\tfmt.Println()\n\t}\n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nE869120 found a chest which is likely to contain treasure.\n\nHowever, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters.\n\nHe also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with ?.\n\nOne more thing he found is a sheet of paper with the following facts written on it:\n\nCondition 1: The string S contains a string T as a contiguous substring.\n\nCondition 2: S is the lexicographically smallest string among the ones that satisfy Condition 1.\n\nPrint the string S.\n\nIf such a string does not exist, print UNRESTORABLE.\n\nConstraints\n\n1 \\leq |S'|, |T| \\leq 50\n\nS' consists of lowercase English letters and ?.\n\nT consists 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 string S.\n\nIf such a string does not exist, print UNRESTORABLE instead.\n\nSample Input 1\n\n?tc????\ncoder\n\nSample Output 1\n\natcoder\n\nThere are 26 strings that satisfy Condition 1: atcoder, btcoder, ctcoder,..., ztcoder.\nAmong them, the lexicographically smallest is atcoder, so we can say S = atcoder.\n\nSample Input 2\n\n??p??d??\nabc\n\nSample Output 2\n\nUNRESTORABLE\n\nThere is no string that satisfies Condition 1, so the string S does not exist.", "sample_input": "?tc????\ncoder\n"}, "reference_outputs": ["atcoder\n"], "source_document_id": "p03565", "source_text": "Score : 300 points\n\nProblem Statement\n\nE869120 found a chest which is likely to contain treasure.\n\nHowever, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters.\n\nHe also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with ?.\n\nOne more thing he found is a sheet of paper with the following facts written on it:\n\nCondition 1: The string S contains a string T as a contiguous substring.\n\nCondition 2: S is the lexicographically smallest string among the ones that satisfy Condition 1.\n\nPrint the string S.\n\nIf such a string does not exist, print UNRESTORABLE.\n\nConstraints\n\n1 \\leq |S'|, |T| \\leq 50\n\nS' consists of lowercase English letters and ?.\n\nT consists 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 string S.\n\nIf such a string does not exist, print UNRESTORABLE instead.\n\nSample Input 1\n\n?tc????\ncoder\n\nSample Output 1\n\natcoder\n\nThere are 26 strings that satisfy Condition 1: atcoder, btcoder, ctcoder,..., ztcoder.\nAmong them, the lexicographically smallest is atcoder, so we can say S = atcoder.\n\nSample Input 2\n\n??p??d??\nabc\n\nSample Output 2\n\nUNRESTORABLE\n\nThere is no string that satisfies Condition 1, so the string S does not exist.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s095012991", "group_id": "codeNet:p03565", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\tS, T := sc.Next(), sc.Next()\n\n\tfor i := 0; i <= len(S)-len(T); i++ {\n\t\tcount := 0\n\t\tfor j := 0; j < len(T); j++ {\n\t\t\tif S[i+j] == T[j] || S[i+j] == '?' {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t\tif count == len(T) {\n\t\t\tans := make([]byte, len(S))\n\t\t\tfor p := 0; p < len(S); p++ {\n\t\t\t\tif i <= p && p < i+len(T) {\n\t\t\t\t\tans[p] = T[p-i]\n\t\t\t\t} else {\n\t\t\t\t\tif S[p] == '?' {\n\t\t\t\t\t\tans[p] = 'a'\n\t\t\t\t\t} else {\n\t\t\t\t\t\tans[p] = S[p]\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfmt.Println(string(ans))\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(\"UNRESTORABLE\")\n\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *Scanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)\n\t\t\tresult = append(result, int(v))\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\n\treturn result\n}\nfunc (s *Scanner) NextInt64Array() []int64 {\n\ts.pre()\n\tstart := s.p\n\tresult := []int64{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1509241556, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03565.html", "problem_id": "p03565", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03565/input.txt", "sample_output_relpath": "derived/input_output/data/p03565/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03565/Go/s095012991.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s095012991", "user_id": "u504669764"}, "prompt_components": {"gold_output": "atcoder\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\tS, T := sc.Next(), sc.Next()\n\n\tfor i := 0; i <= len(S)-len(T); i++ {\n\t\tcount := 0\n\t\tfor j := 0; j < len(T); j++ {\n\t\t\tif S[i+j] == T[j] || S[i+j] == '?' {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t\tif count == len(T) {\n\t\t\tans := make([]byte, len(S))\n\t\t\tfor p := 0; p < len(S); p++ {\n\t\t\t\tif i <= p && p < i+len(T) {\n\t\t\t\t\tans[p] = T[p-i]\n\t\t\t\t} else {\n\t\t\t\t\tif S[p] == '?' {\n\t\t\t\t\t\tans[p] = 'a'\n\t\t\t\t\t} else {\n\t\t\t\t\t\tans[p] = S[p]\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfmt.Println(string(ans))\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(\"UNRESTORABLE\")\n\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *Scanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)\n\t\t\tresult = append(result, int(v))\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\n\treturn result\n}\nfunc (s *Scanner) NextInt64Array() []int64 {\n\ts.pre()\n\tstart := s.p\n\tresult := []int64{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nE869120 found a chest which is likely to contain treasure.\n\nHowever, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters.\n\nHe also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with ?.\n\nOne more thing he found is a sheet of paper with the following facts written on it:\n\nCondition 1: The string S contains a string T as a contiguous substring.\n\nCondition 2: S is the lexicographically smallest string among the ones that satisfy Condition 1.\n\nPrint the string S.\n\nIf such a string does not exist, print UNRESTORABLE.\n\nConstraints\n\n1 \\leq |S'|, |T| \\leq 50\n\nS' consists of lowercase English letters and ?.\n\nT consists 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 string S.\n\nIf such a string does not exist, print UNRESTORABLE instead.\n\nSample Input 1\n\n?tc????\ncoder\n\nSample Output 1\n\natcoder\n\nThere are 26 strings that satisfy Condition 1: atcoder, btcoder, ctcoder,..., ztcoder.\nAmong them, the lexicographically smallest is atcoder, so we can say S = atcoder.\n\nSample Input 2\n\n??p??d??\nabc\n\nSample Output 2\n\nUNRESTORABLE\n\nThere is no string that satisfies Condition 1, so the string S does not exist.", "sample_input": "?tc????\ncoder\n"}, "reference_outputs": ["atcoder\n"], "source_document_id": "p03565", "source_text": "Score : 300 points\n\nProblem Statement\n\nE869120 found a chest which is likely to contain treasure.\n\nHowever, the chest is locked. In order to open it, he needs to enter a string S consisting of lowercase English letters.\n\nHe also found a string S', which turns out to be the string S with some of its letters (possibly all or none) replaced with ?.\n\nOne more thing he found is a sheet of paper with the following facts written on it:\n\nCondition 1: The string S contains a string T as a contiguous substring.\n\nCondition 2: S is the lexicographically smallest string among the ones that satisfy Condition 1.\n\nPrint the string S.\n\nIf such a string does not exist, print UNRESTORABLE.\n\nConstraints\n\n1 \\leq |S'|, |T| \\leq 50\n\nS' consists of lowercase English letters and ?.\n\nT consists 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 string S.\n\nIf such a string does not exist, print UNRESTORABLE instead.\n\nSample Input 1\n\n?tc????\ncoder\n\nSample Output 1\n\natcoder\n\nThere are 26 strings that satisfy Condition 1: atcoder, btcoder, ctcoder,..., ztcoder.\nAmong them, the lexicographically smallest is atcoder, so we can say S = atcoder.\n\nSample Input 2\n\n??p??d??\nabc\n\nSample Output 2\n\nUNRESTORABLE\n\nThere is no string that satisfies Condition 1, so the string S does not exist.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2420, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s390865211", "group_id": "codeNet:p03574", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\n// H =height/witdh\nvar H int\n\n// W =height/witdh\nvar W int\n\nfunc main() {\n\tscanInit()\n\n\tH = nextInt()\n\tW = nextInt()\n\ts := nextGrid(H, W)\n\n\tfor i := 0; i < H; i++ {\n\t\tfor j := 0; j < W; j++ {\n\t\t\tif s[i][j] == \".\" {\n\t\t\t\ts[i][j] = getBombnum(i, j, s)\n\t\t\t}\n\t\t}\n\t}\n\n\tDBGprintGrid(s)\n\n}\n\n// DBGprintGrid print the grid\n//! DBG\nfunc DBGprintGrid(g [][]string) {\n\tfor i := 0; i < H; i++ {\n\t\tfor j := 0; j < W; j++ {\n\t\t\tfmt.Printf(\"%s\", g[i][j])\n\t\t}\n\t\tfmt.Printf(\"\\n\")\n\t}\n}\nfunc getBombnum(i, j int, s [][]string) string {\n\tcnt := 0\n\n\t// 上段\n\tif i > 0 && j > 0 {\n\t\tif s[i-1][j-1] == \"#\" {\n\t\t\tcnt++\n\t\t}\n\t}\n\tif i > 0 {\n\t\tif s[i-1][j] == \"#\" {\n\t\t\tcnt++\n\t\t}\n\t}\n\tif i > 0 && j < W-1 {\n\t\tif s[i-1][j+1] == \"#\" {\n\t\t\tcnt++\n\t\t}\n\t}\n\t// 中段\n\tif j > 0 {\n\t\tif s[i][j-1] == \"#\" {\n\t\t\tcnt++\n\t\t}\n\t}\n\tif j < W-1 {\n\t\tif s[i][j+1] == \"#\" {\n\t\t\tcnt++\n\t\t}\n\t}\n\t// 下段\n\tif i < H-1 && j > 0 {\n\t\tif s[i+1][j-1] == \"#\" {\n\t\t\tcnt++\n\t\t}\n\t}\n\tif i < H-1 {\n\t\tif s[i+1][j] == \"#\" {\n\t\t\tcnt++\n\t\t}\n\t}\n\tif i < H-1 && j < W-1 {\n\t\tif s[i+1][j+1] == \"#\" {\n\t\t\tcnt++\n\t\t}\n\t}\n\n\treturn fmt.Sprintf(\"%d\", cnt)\n}\n\n// ---- readfunc\nfunc scanInit() {\n\tconst cap = 200 * 1024 // default=64*1024\n\tvar buf = make([]byte, cap)\n\tsc.Buffer(buf, cap)\n\tsc.Split(bufio.ScanWords)\n\treturn\n}\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc nextGrid(a int, b int) [][]string {\n\tmat := make([][]string, a)\n\tfor i := 0; i < a; i++ {\n\t\tmat[i] = make([]string, b)\n\t\ttmp := nextStr()\n\t\tmat[i] = strings.Split(tmp, \"\")\n\t}\n\treturn mat\n}\n", "language": "Go", "metadata": {"date": 1598060021, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03574.html", "problem_id": "p03574", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03574/input.txt", "sample_output_relpath": "derived/input_output/data/p03574/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03574/Go/s390865211.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s390865211", "user_id": "u756000295"}, "prompt_components": {"gold_output": "11211\n1#2#1\n11211\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\n// H =height/witdh\nvar H int\n\n// W =height/witdh\nvar W int\n\nfunc main() {\n\tscanInit()\n\n\tH = nextInt()\n\tW = nextInt()\n\ts := nextGrid(H, W)\n\n\tfor i := 0; i < H; i++ {\n\t\tfor j := 0; j < W; j++ {\n\t\t\tif s[i][j] == \".\" {\n\t\t\t\ts[i][j] = getBombnum(i, j, s)\n\t\t\t}\n\t\t}\n\t}\n\n\tDBGprintGrid(s)\n\n}\n\n// DBGprintGrid print the grid\n//! DBG\nfunc DBGprintGrid(g [][]string) {\n\tfor i := 0; i < H; i++ {\n\t\tfor j := 0; j < W; j++ {\n\t\t\tfmt.Printf(\"%s\", g[i][j])\n\t\t}\n\t\tfmt.Printf(\"\\n\")\n\t}\n}\nfunc getBombnum(i, j int, s [][]string) string {\n\tcnt := 0\n\n\t// 上段\n\tif i > 0 && j > 0 {\n\t\tif s[i-1][j-1] == \"#\" {\n\t\t\tcnt++\n\t\t}\n\t}\n\tif i > 0 {\n\t\tif s[i-1][j] == \"#\" {\n\t\t\tcnt++\n\t\t}\n\t}\n\tif i > 0 && j < W-1 {\n\t\tif s[i-1][j+1] == \"#\" {\n\t\t\tcnt++\n\t\t}\n\t}\n\t// 中段\n\tif j > 0 {\n\t\tif s[i][j-1] == \"#\" {\n\t\t\tcnt++\n\t\t}\n\t}\n\tif j < W-1 {\n\t\tif s[i][j+1] == \"#\" {\n\t\t\tcnt++\n\t\t}\n\t}\n\t// 下段\n\tif i < H-1 && j > 0 {\n\t\tif s[i+1][j-1] == \"#\" {\n\t\t\tcnt++\n\t\t}\n\t}\n\tif i < H-1 {\n\t\tif s[i+1][j] == \"#\" {\n\t\t\tcnt++\n\t\t}\n\t}\n\tif i < H-1 && j < W-1 {\n\t\tif s[i+1][j+1] == \"#\" {\n\t\t\tcnt++\n\t\t}\n\t}\n\n\treturn fmt.Sprintf(\"%d\", cnt)\n}\n\n// ---- readfunc\nfunc scanInit() {\n\tconst cap = 200 * 1024 // default=64*1024\n\tvar buf = make([]byte, cap)\n\tsc.Buffer(buf, cap)\n\tsc.Split(bufio.ScanWords)\n\treturn\n}\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc nextStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\nfunc nextGrid(a int, b int) [][]string {\n\tmat := make([][]string, a)\n\tfor i := 0; i < a; i++ {\n\t\tmat[i] = make([]string, b)\n\t\ttmp := nextStr()\n\t\tmat[i] = strings.Split(tmp, \"\")\n\t}\n\treturn mat\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given an H × W grid.\n\nThe squares in the grid are described by H strings, S_1,...,S_H.\n\nThe j-th character in the string S_i corresponds to the square at the i-th row from the top and j-th column from the left (1 \\leq i \\leq H,1 \\leq j \\leq W).\n\n. stands for an empty square, and # stands for a square containing a bomb.\n\nDolphin is interested in how many bomb squares are horizontally, vertically or diagonally adjacent to each empty square.\n\n(Below, we will simply say \"adjacent\" for this meaning. For each square, there are at most eight adjacent squares.)\n\nHe decides to replace each . in our H strings with a digit that represents the number of bomb squares adjacent to the corresponding empty square.\n\nPrint the strings after the process.\n\nConstraints\n\n1 \\leq H,W \\leq 50\n\nS_i is a string of length W consisting of # and ..\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nS_1\n:\nS_H\n\nOutput\n\nPrint the H strings after the process.\n\nThe i-th line should contain a string T_i of length W, where the j-th character in T_i corresponds to the square at the i-th row from the top and j-th row from the left in the grid (1 \\leq i \\leq H, 1 \\leq j \\leq W).\n\nSample Input 1\n\n3 5\n.....\n.#.#.\n.....\n\nSample Output 1\n\n11211\n1#2#1\n11211\n\nFor example, let us observe the empty square at the first row from the top and first column from the left.\n\nThere is one bomb square adjacent to this empty square: the square at the second row and second column.\n\nThus, the . corresponding to this empty square is replaced with 1.\n\nSample Input 2\n\n3 5\n#####\n#####\n#####\n\nSample Output 2\n\n#####\n#####\n#####\n\nIt is possible that there is no empty square.\n\nSample Input 3\n\n6 6\n#####.\n#.#.##\n####.#\n.#..#.\n#.##..\n#.#...\n\nSample Output 3\n\n#####3\n#8#7##\n####5#\n4#65#2\n#5##21\n#4#310", "sample_input": "3 5\n.....\n.#.#.\n.....\n"}, "reference_outputs": ["11211\n1#2#1\n11211\n"], "source_document_id": "p03574", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given an H × W grid.\n\nThe squares in the grid are described by H strings, S_1,...,S_H.\n\nThe j-th character in the string S_i corresponds to the square at the i-th row from the top and j-th column from the left (1 \\leq i \\leq H,1 \\leq j \\leq W).\n\n. stands for an empty square, and # stands for a square containing a bomb.\n\nDolphin is interested in how many bomb squares are horizontally, vertically or diagonally adjacent to each empty square.\n\n(Below, we will simply say \"adjacent\" for this meaning. For each square, there are at most eight adjacent squares.)\n\nHe decides to replace each . in our H strings with a digit that represents the number of bomb squares adjacent to the corresponding empty square.\n\nPrint the strings after the process.\n\nConstraints\n\n1 \\leq H,W \\leq 50\n\nS_i is a string of length W consisting of # and ..\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nS_1\n:\nS_H\n\nOutput\n\nPrint the H strings after the process.\n\nThe i-th line should contain a string T_i of length W, where the j-th character in T_i corresponds to the square at the i-th row from the top and j-th row from the left in the grid (1 \\leq i \\leq H, 1 \\leq j \\leq W).\n\nSample Input 1\n\n3 5\n.....\n.#.#.\n.....\n\nSample Output 1\n\n11211\n1#2#1\n11211\n\nFor example, let us observe the empty square at the first row from the top and first column from the left.\n\nThere is one bomb square adjacent to this empty square: the square at the second row and second column.\n\nThus, the . corresponding to this empty square is replaced with 1.\n\nSample Input 2\n\n3 5\n#####\n#####\n#####\n\nSample Output 2\n\n#####\n#####\n#####\n\nIt is possible that there is no empty square.\n\nSample Input 3\n\n6 6\n#####.\n#.#.##\n####.#\n.#..#.\n#.##..\n#.#...\n\nSample Output 3\n\n#####3\n#8#7##\n####5#\n4#65#2\n#5##21\n#4#310", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1693, "cpu_time_ms": 12, "memory_kb": 1884}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s075611907", "group_id": "codeNet:p03574", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tH, W := ReadInt(), ReadInt()\n\tS := make([]string, H)\n\tfor i := 0; i < H; i++ {\n\t\tS[i] = ReadString()\n\t}\n\tdx := []int{1, 0, -1, 1, -1, 1, 0, -1}\n\tdy := []int{1, 1, 1, 0, 0, -1, -1, -1}\n\tfor y := 0; y < H; y++ {\n\t\tl := make([]byte, W)\n\t\tfor x := 0; x < W; x++ {\n\t\t\tif S[y][x] == '#' {\n\t\t\t\tl[x] = '#'\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tc := 0\n\t\t\tfor i := 0; i < 8; i++ {\n\t\t\t\tnx, ny := x+dx[i], y+dy[i]\n\t\t\t\tif 0 <= nx && nx < W && 0 <= ny && ny < H {\n\t\t\t\t\tif S[ny][nx] == '#' {\n\t\t\t\t\t\tc++\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tl[x] = byte(c + '0')\n\t\t}\n\t\tfmt.Println(string(l))\n\t}\n}\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadString() (s string) { Scan(&s); return }\nfunc ReadInts(n int) []int {\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tScan(&v[i])\n\t}\n\treturn v\n}\n", "language": "Go", "metadata": {"date": 1596342468, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03574.html", "problem_id": "p03574", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03574/input.txt", "sample_output_relpath": "derived/input_output/data/p03574/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03574/Go/s075611907.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s075611907", "user_id": "u328656362"}, "prompt_components": {"gold_output": "11211\n1#2#1\n11211\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tH, W := ReadInt(), ReadInt()\n\tS := make([]string, H)\n\tfor i := 0; i < H; i++ {\n\t\tS[i] = ReadString()\n\t}\n\tdx := []int{1, 0, -1, 1, -1, 1, 0, -1}\n\tdy := []int{1, 1, 1, 0, 0, -1, -1, -1}\n\tfor y := 0; y < H; y++ {\n\t\tl := make([]byte, W)\n\t\tfor x := 0; x < W; x++ {\n\t\t\tif S[y][x] == '#' {\n\t\t\t\tl[x] = '#'\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tc := 0\n\t\t\tfor i := 0; i < 8; i++ {\n\t\t\t\tnx, ny := x+dx[i], y+dy[i]\n\t\t\t\tif 0 <= nx && nx < W && 0 <= ny && ny < H {\n\t\t\t\t\tif S[ny][nx] == '#' {\n\t\t\t\t\t\tc++\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tl[x] = byte(c + '0')\n\t\t}\n\t\tfmt.Println(string(l))\n\t}\n}\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadString() (s string) { Scan(&s); return }\nfunc ReadInts(n int) []int {\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tScan(&v[i])\n\t}\n\treturn v\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given an H × W grid.\n\nThe squares in the grid are described by H strings, S_1,...,S_H.\n\nThe j-th character in the string S_i corresponds to the square at the i-th row from the top and j-th column from the left (1 \\leq i \\leq H,1 \\leq j \\leq W).\n\n. stands for an empty square, and # stands for a square containing a bomb.\n\nDolphin is interested in how many bomb squares are horizontally, vertically or diagonally adjacent to each empty square.\n\n(Below, we will simply say \"adjacent\" for this meaning. For each square, there are at most eight adjacent squares.)\n\nHe decides to replace each . in our H strings with a digit that represents the number of bomb squares adjacent to the corresponding empty square.\n\nPrint the strings after the process.\n\nConstraints\n\n1 \\leq H,W \\leq 50\n\nS_i is a string of length W consisting of # and ..\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nS_1\n:\nS_H\n\nOutput\n\nPrint the H strings after the process.\n\nThe i-th line should contain a string T_i of length W, where the j-th character in T_i corresponds to the square at the i-th row from the top and j-th row from the left in the grid (1 \\leq i \\leq H, 1 \\leq j \\leq W).\n\nSample Input 1\n\n3 5\n.....\n.#.#.\n.....\n\nSample Output 1\n\n11211\n1#2#1\n11211\n\nFor example, let us observe the empty square at the first row from the top and first column from the left.\n\nThere is one bomb square adjacent to this empty square: the square at the second row and second column.\n\nThus, the . corresponding to this empty square is replaced with 1.\n\nSample Input 2\n\n3 5\n#####\n#####\n#####\n\nSample Output 2\n\n#####\n#####\n#####\n\nIt is possible that there is no empty square.\n\nSample Input 3\n\n6 6\n#####.\n#.#.##\n####.#\n.#..#.\n#.##..\n#.#...\n\nSample Output 3\n\n#####3\n#8#7##\n####5#\n4#65#2\n#5##21\n#4#310", "sample_input": "3 5\n.....\n.#.#.\n.....\n"}, "reference_outputs": ["11211\n1#2#1\n11211\n"], "source_document_id": "p03574", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given an H × W grid.\n\nThe squares in the grid are described by H strings, S_1,...,S_H.\n\nThe j-th character in the string S_i corresponds to the square at the i-th row from the top and j-th column from the left (1 \\leq i \\leq H,1 \\leq j \\leq W).\n\n. stands for an empty square, and # stands for a square containing a bomb.\n\nDolphin is interested in how many bomb squares are horizontally, vertically or diagonally adjacent to each empty square.\n\n(Below, we will simply say \"adjacent\" for this meaning. For each square, there are at most eight adjacent squares.)\n\nHe decides to replace each . in our H strings with a digit that represents the number of bomb squares adjacent to the corresponding empty square.\n\nPrint the strings after the process.\n\nConstraints\n\n1 \\leq H,W \\leq 50\n\nS_i is a string of length W consisting of # and ..\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nS_1\n:\nS_H\n\nOutput\n\nPrint the H strings after the process.\n\nThe i-th line should contain a string T_i of length W, where the j-th character in T_i corresponds to the square at the i-th row from the top and j-th row from the left in the grid (1 \\leq i \\leq H, 1 \\leq j \\leq W).\n\nSample Input 1\n\n3 5\n.....\n.#.#.\n.....\n\nSample Output 1\n\n11211\n1#2#1\n11211\n\nFor example, let us observe the empty square at the first row from the top and first column from the left.\n\nThere is one bomb square adjacent to this empty square: the square at the second row and second column.\n\nThus, the . corresponding to this empty square is replaced with 1.\n\nSample Input 2\n\n3 5\n#####\n#####\n#####\n\nSample Output 2\n\n#####\n#####\n#####\n\nIt is possible that there is no empty square.\n\nSample Input 3\n\n6 6\n#####.\n#.#.##\n####.#\n.#..#.\n#.##..\n#.#...\n\nSample Output 3\n\n#####3\n#8#7##\n####5#\n4#65#2\n#5##21\n#4#310", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 955, "cpu_time_ms": 8, "memory_kb": 1852}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s712941241", "group_id": "codeNet:p03574", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar h, w int\n\tfmt.Scan(&h, &w)\n\ts := make([]string, h)\n\tfor i := 0; i < h; i++ {\n\t\tfmt.Scan(&s[i])\n\t}\n\n\ta := make([]string, h)\n\tfor i := 0; i < h; i++ {\n\t\tfor j := 0; j < w; j++ {\n\t\t\tif s[i][j] == '#' {\n\t\t\t\ta[i] += \"#\"\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tc := 0\n\t\t\tfor y := -1; y <= 1; y++ {\n\t\t\t\tif i+y < 0 || i+y > h-1 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tfor x := -1; x <= 1; x++ {\n\t\t\t\t\tif j+x < 0 || j+x > w-1 {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tif s[i+y][j+x] == '#' {\n\t\t\t\t\t\tc++\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ta[i] += fmt.Sprintf(\"%d\", c)\n\t\t}\n\t}\n\n\tfor _, r := range a {\n\t\tfmt.Println(r)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1576276907, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03574.html", "problem_id": "p03574", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03574/input.txt", "sample_output_relpath": "derived/input_output/data/p03574/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03574/Go/s712941241.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s712941241", "user_id": "u902409225"}, "prompt_components": {"gold_output": "11211\n1#2#1\n11211\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar h, w int\n\tfmt.Scan(&h, &w)\n\ts := make([]string, h)\n\tfor i := 0; i < h; i++ {\n\t\tfmt.Scan(&s[i])\n\t}\n\n\ta := make([]string, h)\n\tfor i := 0; i < h; i++ {\n\t\tfor j := 0; j < w; j++ {\n\t\t\tif s[i][j] == '#' {\n\t\t\t\ta[i] += \"#\"\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tc := 0\n\t\t\tfor y := -1; y <= 1; y++ {\n\t\t\t\tif i+y < 0 || i+y > h-1 {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tfor x := -1; x <= 1; x++ {\n\t\t\t\t\tif j+x < 0 || j+x > w-1 {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tif s[i+y][j+x] == '#' {\n\t\t\t\t\t\tc++\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ta[i] += fmt.Sprintf(\"%d\", c)\n\t\t}\n\t}\n\n\tfor _, r := range a {\n\t\tfmt.Println(r)\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given an H × W grid.\n\nThe squares in the grid are described by H strings, S_1,...,S_H.\n\nThe j-th character in the string S_i corresponds to the square at the i-th row from the top and j-th column from the left (1 \\leq i \\leq H,1 \\leq j \\leq W).\n\n. stands for an empty square, and # stands for a square containing a bomb.\n\nDolphin is interested in how many bomb squares are horizontally, vertically or diagonally adjacent to each empty square.\n\n(Below, we will simply say \"adjacent\" for this meaning. For each square, there are at most eight adjacent squares.)\n\nHe decides to replace each . in our H strings with a digit that represents the number of bomb squares adjacent to the corresponding empty square.\n\nPrint the strings after the process.\n\nConstraints\n\n1 \\leq H,W \\leq 50\n\nS_i is a string of length W consisting of # and ..\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nS_1\n:\nS_H\n\nOutput\n\nPrint the H strings after the process.\n\nThe i-th line should contain a string T_i of length W, where the j-th character in T_i corresponds to the square at the i-th row from the top and j-th row from the left in the grid (1 \\leq i \\leq H, 1 \\leq j \\leq W).\n\nSample Input 1\n\n3 5\n.....\n.#.#.\n.....\n\nSample Output 1\n\n11211\n1#2#1\n11211\n\nFor example, let us observe the empty square at the first row from the top and first column from the left.\n\nThere is one bomb square adjacent to this empty square: the square at the second row and second column.\n\nThus, the . corresponding to this empty square is replaced with 1.\n\nSample Input 2\n\n3 5\n#####\n#####\n#####\n\nSample Output 2\n\n#####\n#####\n#####\n\nIt is possible that there is no empty square.\n\nSample Input 3\n\n6 6\n#####.\n#.#.##\n####.#\n.#..#.\n#.##..\n#.#...\n\nSample Output 3\n\n#####3\n#8#7##\n####5#\n4#65#2\n#5##21\n#4#310", "sample_input": "3 5\n.....\n.#.#.\n.....\n"}, "reference_outputs": ["11211\n1#2#1\n11211\n"], "source_document_id": "p03574", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given an H × W grid.\n\nThe squares in the grid are described by H strings, S_1,...,S_H.\n\nThe j-th character in the string S_i corresponds to the square at the i-th row from the top and j-th column from the left (1 \\leq i \\leq H,1 \\leq j \\leq W).\n\n. stands for an empty square, and # stands for a square containing a bomb.\n\nDolphin is interested in how many bomb squares are horizontally, vertically or diagonally adjacent to each empty square.\n\n(Below, we will simply say \"adjacent\" for this meaning. For each square, there are at most eight adjacent squares.)\n\nHe decides to replace each . in our H strings with a digit that represents the number of bomb squares adjacent to the corresponding empty square.\n\nPrint the strings after the process.\n\nConstraints\n\n1 \\leq H,W \\leq 50\n\nS_i is a string of length W consisting of # and ..\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nS_1\n:\nS_H\n\nOutput\n\nPrint the H strings after the process.\n\nThe i-th line should contain a string T_i of length W, where the j-th character in T_i corresponds to the square at the i-th row from the top and j-th row from the left in the grid (1 \\leq i \\leq H, 1 \\leq j \\leq W).\n\nSample Input 1\n\n3 5\n.....\n.#.#.\n.....\n\nSample Output 1\n\n11211\n1#2#1\n11211\n\nFor example, let us observe the empty square at the first row from the top and first column from the left.\n\nThere is one bomb square adjacent to this empty square: the square at the second row and second column.\n\nThus, the . corresponding to this empty square is replaced with 1.\n\nSample Input 2\n\n3 5\n#####\n#####\n#####\n\nSample Output 2\n\n#####\n#####\n#####\n\nIt is possible that there is no empty square.\n\nSample Input 3\n\n6 6\n#####.\n#.#.##\n####.#\n.#..#.\n#.##..\n#.#...\n\nSample Output 3\n\n#####3\n#8#7##\n####5#\n4#65#2\n#5##21\n#4#310", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 4, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s444521612", "group_id": "codeNet:p03574", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar h, w int\n\tfmt.Scan(&h, &w)\n\tgrid := make([]string, h+2)\n\twall := createWall(w)\n\tgrid[0] = wall\n\tgrid[h+1] = wall\n\tsc := bufio.NewScanner(os.Stdin)\n\tfor i := 1; i <= h; i++ {\n\t\tsc.Scan()\n\t\tgrid[i] = \".\" + sc.Text() + \".\"\n\t}\n\tfor i := 1; i <= h; i++ {\n\t\tbuf := bytes.NewBuffer([]byte{})\n\t\tfor j := 1; j <= w; j++ {\n\t\t\tif grid[i][j] == '#' {\n\t\t\t\tbuf.Write([]byte{'#'})\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tn := bombNum(grid, i, j)\n\t\t\tbuf.WriteString(fmt.Sprintf(\"%d\", n))\n\t\t}\n\t\tfmt.Println(buf.String())\n\t}\n}\n\nfunc bombNum(grid []string, i, j int) (num int) {\n\ttype pos struct{ y, x int }\n\tfor _, p := range []pos{\n\t\t{i - 1, j - 1}, {i - 1, j}, {i - 1, j + 1},\n\t\t{i, j - 1}, {i, j + 1},\n\t\t{i + 1, j - 1}, {i + 1, j}, {i + 1, j + 1},\n\t} {\n\t\tif grid[p.y][p.x] == '#' {\n\t\t\tnum++\n\t\t}\n\t}\n\treturn\n}\n\nfunc createWall(w int) string {\n\tbuf := bytes.NewBuffer([]byte{})\n\tfor i := 0; i < w+2; i++ {\n\t\tbuf.Write([]byte{'.'})\n\t}\n\treturn buf.String()\n}\n", "language": "Go", "metadata": {"date": 1554088674, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03574.html", "problem_id": "p03574", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03574/input.txt", "sample_output_relpath": "derived/input_output/data/p03574/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03574/Go/s444521612.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s444521612", "user_id": "u623007471"}, "prompt_components": {"gold_output": "11211\n1#2#1\n11211\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tvar h, w int\n\tfmt.Scan(&h, &w)\n\tgrid := make([]string, h+2)\n\twall := createWall(w)\n\tgrid[0] = wall\n\tgrid[h+1] = wall\n\tsc := bufio.NewScanner(os.Stdin)\n\tfor i := 1; i <= h; i++ {\n\t\tsc.Scan()\n\t\tgrid[i] = \".\" + sc.Text() + \".\"\n\t}\n\tfor i := 1; i <= h; i++ {\n\t\tbuf := bytes.NewBuffer([]byte{})\n\t\tfor j := 1; j <= w; j++ {\n\t\t\tif grid[i][j] == '#' {\n\t\t\t\tbuf.Write([]byte{'#'})\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tn := bombNum(grid, i, j)\n\t\t\tbuf.WriteString(fmt.Sprintf(\"%d\", n))\n\t\t}\n\t\tfmt.Println(buf.String())\n\t}\n}\n\nfunc bombNum(grid []string, i, j int) (num int) {\n\ttype pos struct{ y, x int }\n\tfor _, p := range []pos{\n\t\t{i - 1, j - 1}, {i - 1, j}, {i - 1, j + 1},\n\t\t{i, j - 1}, {i, j + 1},\n\t\t{i + 1, j - 1}, {i + 1, j}, {i + 1, j + 1},\n\t} {\n\t\tif grid[p.y][p.x] == '#' {\n\t\t\tnum++\n\t\t}\n\t}\n\treturn\n}\n\nfunc createWall(w int) string {\n\tbuf := bytes.NewBuffer([]byte{})\n\tfor i := 0; i < w+2; i++ {\n\t\tbuf.Write([]byte{'.'})\n\t}\n\treturn buf.String()\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given an H × W grid.\n\nThe squares in the grid are described by H strings, S_1,...,S_H.\n\nThe j-th character in the string S_i corresponds to the square at the i-th row from the top and j-th column from the left (1 \\leq i \\leq H,1 \\leq j \\leq W).\n\n. stands for an empty square, and # stands for a square containing a bomb.\n\nDolphin is interested in how many bomb squares are horizontally, vertically or diagonally adjacent to each empty square.\n\n(Below, we will simply say \"adjacent\" for this meaning. For each square, there are at most eight adjacent squares.)\n\nHe decides to replace each . in our H strings with a digit that represents the number of bomb squares adjacent to the corresponding empty square.\n\nPrint the strings after the process.\n\nConstraints\n\n1 \\leq H,W \\leq 50\n\nS_i is a string of length W consisting of # and ..\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nS_1\n:\nS_H\n\nOutput\n\nPrint the H strings after the process.\n\nThe i-th line should contain a string T_i of length W, where the j-th character in T_i corresponds to the square at the i-th row from the top and j-th row from the left in the grid (1 \\leq i \\leq H, 1 \\leq j \\leq W).\n\nSample Input 1\n\n3 5\n.....\n.#.#.\n.....\n\nSample Output 1\n\n11211\n1#2#1\n11211\n\nFor example, let us observe the empty square at the first row from the top and first column from the left.\n\nThere is one bomb square adjacent to this empty square: the square at the second row and second column.\n\nThus, the . corresponding to this empty square is replaced with 1.\n\nSample Input 2\n\n3 5\n#####\n#####\n#####\n\nSample Output 2\n\n#####\n#####\n#####\n\nIt is possible that there is no empty square.\n\nSample Input 3\n\n6 6\n#####.\n#.#.##\n####.#\n.#..#.\n#.##..\n#.#...\n\nSample Output 3\n\n#####3\n#8#7##\n####5#\n4#65#2\n#5##21\n#4#310", "sample_input": "3 5\n.....\n.#.#.\n.....\n"}, "reference_outputs": ["11211\n1#2#1\n11211\n"], "source_document_id": "p03574", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given an H × W grid.\n\nThe squares in the grid are described by H strings, S_1,...,S_H.\n\nThe j-th character in the string S_i corresponds to the square at the i-th row from the top and j-th column from the left (1 \\leq i \\leq H,1 \\leq j \\leq W).\n\n. stands for an empty square, and # stands for a square containing a bomb.\n\nDolphin is interested in how many bomb squares are horizontally, vertically or diagonally adjacent to each empty square.\n\n(Below, we will simply say \"adjacent\" for this meaning. For each square, there are at most eight adjacent squares.)\n\nHe decides to replace each . in our H strings with a digit that represents the number of bomb squares adjacent to the corresponding empty square.\n\nPrint the strings after the process.\n\nConstraints\n\n1 \\leq H,W \\leq 50\n\nS_i is a string of length W consisting of # and ..\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nS_1\n:\nS_H\n\nOutput\n\nPrint the H strings after the process.\n\nThe i-th line should contain a string T_i of length W, where the j-th character in T_i corresponds to the square at the i-th row from the top and j-th row from the left in the grid (1 \\leq i \\leq H, 1 \\leq j \\leq W).\n\nSample Input 1\n\n3 5\n.....\n.#.#.\n.....\n\nSample Output 1\n\n11211\n1#2#1\n11211\n\nFor example, let us observe the empty square at the first row from the top and first column from the left.\n\nThere is one bomb square adjacent to this empty square: the square at the second row and second column.\n\nThus, the . corresponding to this empty square is replaced with 1.\n\nSample Input 2\n\n3 5\n#####\n#####\n#####\n\nSample Output 2\n\n#####\n#####\n#####\n\nIt is possible that there is no empty square.\n\nSample Input 3\n\n6 6\n#####.\n#.#.##\n####.#\n.#..#.\n#.##..\n#.#...\n\nSample Output 3\n\n#####3\n#8#7##\n####5#\n4#65#2\n#5##21\n#4#310", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 996, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s338371965", "group_id": "codeNet:p03574", "input_text": "package main\n\nimport(\n\t\"bufio\"\n\t\"strconv\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc readBigLine() string {\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc checkBomb(h int, w int, arr [][]string) string {\n\tif arr[h][w] == \"#\" {\n\t\treturn \"#\"\n\t}\n\n\tres := 0\n\tfor i := h-1; i <= h+1; i++ {\n\t\tfor j := w-1; j <= w+1; j++ {\n\t\t\tif arr[i][j] == \"#\" {\n\t\t\t\tres++\n\t\t\t}\n\t\t}\n\t}\n\treturn strconv.Itoa(res)\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\th, w := nextInt(), nextInt()\n\n\tgrid := make([][]string, h+2)\n\tgrid[0] = make([]string, w+2)\n\tgrid[h+1] = make([]string, w+2)\n\n\tfor i := 0; i < h; i++ {\n\t\trow := strings.Split(nextLine(), \"\")\n\t\ttmp := make([]string, w+2)\n\t\tfor j := 0; j < w; j++ {\n\t\t\ttmp[j+1] = row[j]\n\t\t}\n\t\tgrid[i+1] = tmp\n\t}\n\n\tans := \"\"\n\tfor i := 1; i < h+1; i++ {\n\t\ttmp := \"\"\n\t\tfor j := 1; j < w+1; j++ {\n\t\t\ttmp += checkBomb(i, j, grid)\n\t\t}\n\t\tans += tmp + \"\\n\"\n\t}\n\tfmt.Println(strings.TrimSuffix(ans, \"\\n\"))\n}", "language": "Go", "metadata": {"date": 1552965589, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03574.html", "problem_id": "p03574", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03574/input.txt", "sample_output_relpath": "derived/input_output/data/p03574/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03574/Go/s338371965.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s338371965", "user_id": "u498436815"}, "prompt_components": {"gold_output": "11211\n1#2#1\n11211\n", "input_to_evaluate": "package main\n\nimport(\n\t\"bufio\"\n\t\"strconv\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc readBigLine() string {\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc checkBomb(h int, w int, arr [][]string) string {\n\tif arr[h][w] == \"#\" {\n\t\treturn \"#\"\n\t}\n\n\tres := 0\n\tfor i := h-1; i <= h+1; i++ {\n\t\tfor j := w-1; j <= w+1; j++ {\n\t\t\tif arr[i][j] == \"#\" {\n\t\t\t\tres++\n\t\t\t}\n\t\t}\n\t}\n\treturn strconv.Itoa(res)\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\th, w := nextInt(), nextInt()\n\n\tgrid := make([][]string, h+2)\n\tgrid[0] = make([]string, w+2)\n\tgrid[h+1] = make([]string, w+2)\n\n\tfor i := 0; i < h; i++ {\n\t\trow := strings.Split(nextLine(), \"\")\n\t\ttmp := make([]string, w+2)\n\t\tfor j := 0; j < w; j++ {\n\t\t\ttmp[j+1] = row[j]\n\t\t}\n\t\tgrid[i+1] = tmp\n\t}\n\n\tans := \"\"\n\tfor i := 1; i < h+1; i++ {\n\t\ttmp := \"\"\n\t\tfor j := 1; j < w+1; j++ {\n\t\t\ttmp += checkBomb(i, j, grid)\n\t\t}\n\t\tans += tmp + \"\\n\"\n\t}\n\tfmt.Println(strings.TrimSuffix(ans, \"\\n\"))\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given an H × W grid.\n\nThe squares in the grid are described by H strings, S_1,...,S_H.\n\nThe j-th character in the string S_i corresponds to the square at the i-th row from the top and j-th column from the left (1 \\leq i \\leq H,1 \\leq j \\leq W).\n\n. stands for an empty square, and # stands for a square containing a bomb.\n\nDolphin is interested in how many bomb squares are horizontally, vertically or diagonally adjacent to each empty square.\n\n(Below, we will simply say \"adjacent\" for this meaning. For each square, there are at most eight adjacent squares.)\n\nHe decides to replace each . in our H strings with a digit that represents the number of bomb squares adjacent to the corresponding empty square.\n\nPrint the strings after the process.\n\nConstraints\n\n1 \\leq H,W \\leq 50\n\nS_i is a string of length W consisting of # and ..\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nS_1\n:\nS_H\n\nOutput\n\nPrint the H strings after the process.\n\nThe i-th line should contain a string T_i of length W, where the j-th character in T_i corresponds to the square at the i-th row from the top and j-th row from the left in the grid (1 \\leq i \\leq H, 1 \\leq j \\leq W).\n\nSample Input 1\n\n3 5\n.....\n.#.#.\n.....\n\nSample Output 1\n\n11211\n1#2#1\n11211\n\nFor example, let us observe the empty square at the first row from the top and first column from the left.\n\nThere is one bomb square adjacent to this empty square: the square at the second row and second column.\n\nThus, the . corresponding to this empty square is replaced with 1.\n\nSample Input 2\n\n3 5\n#####\n#####\n#####\n\nSample Output 2\n\n#####\n#####\n#####\n\nIt is possible that there is no empty square.\n\nSample Input 3\n\n6 6\n#####.\n#.#.##\n####.#\n.#..#.\n#.##..\n#.#...\n\nSample Output 3\n\n#####3\n#8#7##\n####5#\n4#65#2\n#5##21\n#4#310", "sample_input": "3 5\n.....\n.#.#.\n.....\n"}, "reference_outputs": ["11211\n1#2#1\n11211\n"], "source_document_id": "p03574", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given an H × W grid.\n\nThe squares in the grid are described by H strings, S_1,...,S_H.\n\nThe j-th character in the string S_i corresponds to the square at the i-th row from the top and j-th column from the left (1 \\leq i \\leq H,1 \\leq j \\leq W).\n\n. stands for an empty square, and # stands for a square containing a bomb.\n\nDolphin is interested in how many bomb squares are horizontally, vertically or diagonally adjacent to each empty square.\n\n(Below, we will simply say \"adjacent\" for this meaning. For each square, there are at most eight adjacent squares.)\n\nHe decides to replace each . in our H strings with a digit that represents the number of bomb squares adjacent to the corresponding empty square.\n\nPrint the strings after the process.\n\nConstraints\n\n1 \\leq H,W \\leq 50\n\nS_i is a string of length W consisting of # and ..\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nS_1\n:\nS_H\n\nOutput\n\nPrint the H strings after the process.\n\nThe i-th line should contain a string T_i of length W, where the j-th character in T_i corresponds to the square at the i-th row from the top and j-th row from the left in the grid (1 \\leq i \\leq H, 1 \\leq j \\leq W).\n\nSample Input 1\n\n3 5\n.....\n.#.#.\n.....\n\nSample Output 1\n\n11211\n1#2#1\n11211\n\nFor example, let us observe the empty square at the first row from the top and first column from the left.\n\nThere is one bomb square adjacent to this empty square: the square at the second row and second column.\n\nThus, the . corresponding to this empty square is replaced with 1.\n\nSample Input 2\n\n3 5\n#####\n#####\n#####\n\nSample Output 2\n\n#####\n#####\n#####\n\nIt is possible that there is no empty square.\n\nSample Input 3\n\n6 6\n#####.\n#.#.##\n####.#\n.#..#.\n#.##..\n#.#...\n\nSample Output 3\n\n#####3\n#8#7##\n####5#\n4#65#2\n#5##21\n#4#310", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1464, "cpu_time_ms": 2, "memory_kb": 1024}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s299540548", "group_id": "codeNet:p03574", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc mine(f, w int, maps []string) []string {\n\tdx := []int{-1, 0, 1, -1, 1, -1, 0, 1}\n\tdy := []int{1, 1, 1, 0, 0, -1, -1, -1}\n\n\tminemap := make([]string, f)\n\tfor i := 0; i < f; i++ {\n\t\tfor j := 0; j < w; j++ {\n\t\t\tif string(maps[i][j]) == \"#\" {\n\t\t\t\tminemap[i] += \"#\"\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tvar mine int\n\t\t\tfor d := 0; d < 8; d++ {\n\t\t\t\tposx := i + dx[d]\n\t\t\t\tposy := j + dy[d]\n\t\t\t\tif posx < 0 || f <= posx {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif posy < 0 || w <= posy {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif string(maps[posx][posy]) == \"#\" {\n\t\t\t\t\tmine++\n\t\t\t\t}\n\t\t\t}\n\t\t\tminemap[i] += strconv.Itoa(mine)\n\t\t}\n\t}\n\treturn minemap\n}\n\nfunc main() {\n\tvar f, w int\n\tfmt.Scan(&f, &w)\n\tmaps := make([]string, f)\n\tfor i := range maps {\n\t\tfmt.Scan(&maps[i])\n\t}\n\tfor _, out := range mine(f, w, maps) {\n\t\tfmt.Println(out)\n\t}\n}\n", "language": "Go", "metadata": {"date": 1544515025, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03574.html", "problem_id": "p03574", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03574/input.txt", "sample_output_relpath": "derived/input_output/data/p03574/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03574/Go/s299540548.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s299540548", "user_id": "u767936647"}, "prompt_components": {"gold_output": "11211\n1#2#1\n11211\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strconv\"\n)\n\nfunc mine(f, w int, maps []string) []string {\n\tdx := []int{-1, 0, 1, -1, 1, -1, 0, 1}\n\tdy := []int{1, 1, 1, 0, 0, -1, -1, -1}\n\n\tminemap := make([]string, f)\n\tfor i := 0; i < f; i++ {\n\t\tfor j := 0; j < w; j++ {\n\t\t\tif string(maps[i][j]) == \"#\" {\n\t\t\t\tminemap[i] += \"#\"\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tvar mine int\n\t\t\tfor d := 0; d < 8; d++ {\n\t\t\t\tposx := i + dx[d]\n\t\t\t\tposy := j + dy[d]\n\t\t\t\tif posx < 0 || f <= posx {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif posy < 0 || w <= posy {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif string(maps[posx][posy]) == \"#\" {\n\t\t\t\t\tmine++\n\t\t\t\t}\n\t\t\t}\n\t\t\tminemap[i] += strconv.Itoa(mine)\n\t\t}\n\t}\n\treturn minemap\n}\n\nfunc main() {\n\tvar f, w int\n\tfmt.Scan(&f, &w)\n\tmaps := make([]string, f)\n\tfor i := range maps {\n\t\tfmt.Scan(&maps[i])\n\t}\n\tfor _, out := range mine(f, w, maps) {\n\t\tfmt.Println(out)\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given an H × W grid.\n\nThe squares in the grid are described by H strings, S_1,...,S_H.\n\nThe j-th character in the string S_i corresponds to the square at the i-th row from the top and j-th column from the left (1 \\leq i \\leq H,1 \\leq j \\leq W).\n\n. stands for an empty square, and # stands for a square containing a bomb.\n\nDolphin is interested in how many bomb squares are horizontally, vertically or diagonally adjacent to each empty square.\n\n(Below, we will simply say \"adjacent\" for this meaning. For each square, there are at most eight adjacent squares.)\n\nHe decides to replace each . in our H strings with a digit that represents the number of bomb squares adjacent to the corresponding empty square.\n\nPrint the strings after the process.\n\nConstraints\n\n1 \\leq H,W \\leq 50\n\nS_i is a string of length W consisting of # and ..\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nS_1\n:\nS_H\n\nOutput\n\nPrint the H strings after the process.\n\nThe i-th line should contain a string T_i of length W, where the j-th character in T_i corresponds to the square at the i-th row from the top and j-th row from the left in the grid (1 \\leq i \\leq H, 1 \\leq j \\leq W).\n\nSample Input 1\n\n3 5\n.....\n.#.#.\n.....\n\nSample Output 1\n\n11211\n1#2#1\n11211\n\nFor example, let us observe the empty square at the first row from the top and first column from the left.\n\nThere is one bomb square adjacent to this empty square: the square at the second row and second column.\n\nThus, the . corresponding to this empty square is replaced with 1.\n\nSample Input 2\n\n3 5\n#####\n#####\n#####\n\nSample Output 2\n\n#####\n#####\n#####\n\nIt is possible that there is no empty square.\n\nSample Input 3\n\n6 6\n#####.\n#.#.##\n####.#\n.#..#.\n#.##..\n#.#...\n\nSample Output 3\n\n#####3\n#8#7##\n####5#\n4#65#2\n#5##21\n#4#310", "sample_input": "3 5\n.....\n.#.#.\n.....\n"}, "reference_outputs": ["11211\n1#2#1\n11211\n"], "source_document_id": "p03574", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given an H × W grid.\n\nThe squares in the grid are described by H strings, S_1,...,S_H.\n\nThe j-th character in the string S_i corresponds to the square at the i-th row from the top and j-th column from the left (1 \\leq i \\leq H,1 \\leq j \\leq W).\n\n. stands for an empty square, and # stands for a square containing a bomb.\n\nDolphin is interested in how many bomb squares are horizontally, vertically or diagonally adjacent to each empty square.\n\n(Below, we will simply say \"adjacent\" for this meaning. For each square, there are at most eight adjacent squares.)\n\nHe decides to replace each . in our H strings with a digit that represents the number of bomb squares adjacent to the corresponding empty square.\n\nPrint the strings after the process.\n\nConstraints\n\n1 \\leq H,W \\leq 50\n\nS_i is a string of length W consisting of # and ..\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nS_1\n:\nS_H\n\nOutput\n\nPrint the H strings after the process.\n\nThe i-th line should contain a string T_i of length W, where the j-th character in T_i corresponds to the square at the i-th row from the top and j-th row from the left in the grid (1 \\leq i \\leq H, 1 \\leq j \\leq W).\n\nSample Input 1\n\n3 5\n.....\n.#.#.\n.....\n\nSample Output 1\n\n11211\n1#2#1\n11211\n\nFor example, let us observe the empty square at the first row from the top and first column from the left.\n\nThere is one bomb square adjacent to this empty square: the square at the second row and second column.\n\nThus, the . corresponding to this empty square is replaced with 1.\n\nSample Input 2\n\n3 5\n#####\n#####\n#####\n\nSample Output 2\n\n#####\n#####\n#####\n\nIt is possible that there is no empty square.\n\nSample Input 3\n\n6 6\n#####.\n#.#.##\n####.#\n.#..#.\n#.##..\n#.#...\n\nSample Output 3\n\n#####3\n#8#7##\n####5#\n4#65#2\n#5##21\n#4#310", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s712704202", "group_id": "codeNet:p03574", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n/*\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n// readLine can read long line string (at least 10^5)\nfunc readLine() string {\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n// NextLine reads a line text from stdin, and then returns its string.\nfunc NextLine() string {\n\treturn readLine()\n}\n*/\n\nvar sc = bufio.NewScanner(os.Stdin)\n\n// NextLine reads a line text from stdin, and then returns its string.\nfunc NextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// NextIntsLine reads a line text, that consists of **ONLY INTEGERS DELIMITED BY SPACES**, from stdin.\n// And then returns intergers slice.\nfunc NextIntsLine() []int {\n\tints := []int{}\n\tintsStr := NextLine()\n\ttmp := strings.Split(intsStr, \" \")\n\tfor _, s := range tmp {\n\t\tinteger, _ := strconv.Atoi(s)\n\t\tints = append(ints, integer)\n\t}\n\treturn ints\n}\n\n// NextStringsLine reads a line text, that consists of **STRINGS DELIMITED BY SPACES**, from stdin.\n// And then returns strings slice.\nfunc NextStringsLine() []string {\n\tstr := NextLine()\n\treturn strings.Split(str, \" \")\n}\n\n// NextRunesLine reads a line text, that consists of **ONLY CHARACTERS ARRANGED CONTINUOUSLY**, from stdin.\n// Ant then returns runes slice.\nfunc NextRunesLine() []rune {\n\treturn []rune(NextLine())\n}\n\n// Max returns the max integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Max(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m < integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// Min returns the min integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Min(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m > integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// PowInt is integer version of math.Pow\nfunc PowInt(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(errors.New(\"[argument error]: PowInt does not accept negative integers\"))\n\t}\n\tfa := float64(a)\n\tfe := float64(e)\n\tfanswer := math.Pow(fa, fe)\n\treturn int(fanswer)\n}\n\n// AbsInt is integer version of math.Abs\nfunc AbsInt(a int) int {\n\tfa := float64(a)\n\tfanswer := math.Abs(fa)\n\treturn int(fanswer)\n}\n\n// DeleteElement returns a *NEW* slice, that have the same and minimum length and capacity.\n// DeleteElement makes a new slice by using easy slice literal.\nfunc DeleteElement(s []int, i int) []int {\n\tif i < 0 || len(s) <= i {\n\t\tpanic(errors.New(\"[index error]\"))\n\t}\n\t// appendのみの実装\n\tn := make([]int, 0, len(s)-1)\n\tn = append(n, s[:i]...)\n\tn = append(n, s[i+1:]...)\n\treturn n\n}\n\n// Concat returns a *NEW* slice, that have the same and minimum length and capacity.\nfunc Concat(s, t []rune) []rune {\n\tn := make([]rune, 0, len(s)+len(t))\n\tn = append(n, s...)\n\tn = append(n, t...)\n\treturn n\n}\n\n// UpperRune is rune version of `strings.ToUpper()`.\nfunc UpperRune(r rune) rune {\n\tstr := strings.ToUpper(string(r))\n\treturn []rune(str)[0]\n}\n\n// LowerRune is rune version of `strings.ToLower()`.\nfunc LowerRune(r rune) rune {\n\tstr := strings.ToLower(string(r))\n\treturn []rune(str)[0]\n}\n\n// ToggleRune returns a upper case if an input is a lower case, v.v.\nfunc ToggleRune(r rune) rune {\n\tvar str string\n\tif 'a' <= r && r <= 'z' {\n\t\tstr = strings.ToUpper(string(r))\n\t} else if 'A' <= r && r <= 'Z' {\n\t\tstr = strings.ToLower(string(r))\n\t} else {\n\t\tstr = string(r)\n\t}\n\treturn []rune(str)[0]\n}\n\n// ToggleString iteratively calls ToggleRune, and returns the toggled string.\nfunc ToggleString(s string) string {\n\tinputRunes := []rune(s)\n\toutputRunes := make([]rune, 0, len(inputRunes))\n\tfor _, r := range inputRunes {\n\t\toutputRunes = append(outputRunes, ToggleRune(r))\n\t}\n\treturn string(outputRunes)\n}\n\n// Strtoi is a wrapper of `strconv.Atoi()`.\n// If `strconv.Atoi()` returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// sort package (snippets)\n//sort.Sort(sort.IntSlice(s))\n//sort.Sort(sort.Reverse(sort.IntSlice(s)))\n//sort.Sort(sort.Float64Slice(s))\n//sort.Sort(sort.StringSlice(s))\n\n// copy function\n//a = []int{0, 1, 2}\n//b = make([]int, len(a))\n//copy(b, a)\n\n/*******************************************************************/\n\nvar h, w int\nvar S [][]rune\n\nfunc main() {\n\ttmp := NextIntsLine()\n\th, w = tmp[0], tmp[1]\n\tfor i := 0; i < h; i++ {\n\t\tline := NextRunesLine()\n\t\tS = append(S, line)\n\t}\n\tstep := [][]int{\n\t\t{-1, -1}, {0, -1}, {1, -1},\n\t\t{-1, 0}, {1, 0},\n\t\t{-1, 1}, {0, 1}, {1, 1},\n\t}\n\tfor i := 0; i < w; i++ {\n\t\tfor j := 0; j < h; j++ {\n\t\t\tif S[j][i] == '#' {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tnum := 0\n\t\t\tfor _, s := range step {\n\t\t\t\tx := i + s[0]\n\t\t\t\ty := j + s[1]\n\t\t\t\tif 0 <= x && x < w && 0 <= y && y < h && S[y][x] == '#' {\n\t\t\t\t\tnum++\n\t\t\t\t}\n\t\t\t}\n\t\t\tnumStr := strconv.Itoa(num)\n\t\t\tfor _, r := range numStr {\n\t\t\t\tS[j][i] = r\n\t\t\t}\n\t\t}\n\t}\n\tfor i := 0; i < h; i++ {\n\t\tfmt.Println(string(S[i]))\n\t}\n}\n", "language": "Go", "metadata": {"date": 1541891824, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03574.html", "problem_id": "p03574", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03574/input.txt", "sample_output_relpath": "derived/input_output/data/p03574/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03574/Go/s712704202.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s712704202", "user_id": "u103600314"}, "prompt_components": {"gold_output": "11211\n1#2#1\n11211\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"errors\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\n/*\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n// readLine can read long line string (at least 10^5)\nfunc readLine() string {\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn string(buf)\n}\n// NextLine reads a line text from stdin, and then returns its string.\nfunc NextLine() string {\n\treturn readLine()\n}\n*/\n\nvar sc = bufio.NewScanner(os.Stdin)\n\n// NextLine reads a line text from stdin, and then returns its string.\nfunc NextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\n// NextIntsLine reads a line text, that consists of **ONLY INTEGERS DELIMITED BY SPACES**, from stdin.\n// And then returns intergers slice.\nfunc NextIntsLine() []int {\n\tints := []int{}\n\tintsStr := NextLine()\n\ttmp := strings.Split(intsStr, \" \")\n\tfor _, s := range tmp {\n\t\tinteger, _ := strconv.Atoi(s)\n\t\tints = append(ints, integer)\n\t}\n\treturn ints\n}\n\n// NextStringsLine reads a line text, that consists of **STRINGS DELIMITED BY SPACES**, from stdin.\n// And then returns strings slice.\nfunc NextStringsLine() []string {\n\tstr := NextLine()\n\treturn strings.Split(str, \" \")\n}\n\n// NextRunesLine reads a line text, that consists of **ONLY CHARACTERS ARRANGED CONTINUOUSLY**, from stdin.\n// Ant then returns runes slice.\nfunc NextRunesLine() []rune {\n\treturn []rune(NextLine())\n}\n\n// Max returns the max integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Max(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m < integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// Min returns the min integer among input set.\n// This function needs at least 1 argument (no argument causes panic).\nfunc Min(integers ...int) int {\n\tm := integers[0]\n\tfor i, integer := range integers {\n\t\tif i == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif m > integer {\n\t\t\tm = integer\n\t\t}\n\t}\n\treturn m\n}\n\n// PowInt is integer version of math.Pow\nfunc PowInt(a, e int) int {\n\tif a < 0 || e < 0 {\n\t\tpanic(errors.New(\"[argument error]: PowInt does not accept negative integers\"))\n\t}\n\tfa := float64(a)\n\tfe := float64(e)\n\tfanswer := math.Pow(fa, fe)\n\treturn int(fanswer)\n}\n\n// AbsInt is integer version of math.Abs\nfunc AbsInt(a int) int {\n\tfa := float64(a)\n\tfanswer := math.Abs(fa)\n\treturn int(fanswer)\n}\n\n// DeleteElement returns a *NEW* slice, that have the same and minimum length and capacity.\n// DeleteElement makes a new slice by using easy slice literal.\nfunc DeleteElement(s []int, i int) []int {\n\tif i < 0 || len(s) <= i {\n\t\tpanic(errors.New(\"[index error]\"))\n\t}\n\t// appendのみの実装\n\tn := make([]int, 0, len(s)-1)\n\tn = append(n, s[:i]...)\n\tn = append(n, s[i+1:]...)\n\treturn n\n}\n\n// Concat returns a *NEW* slice, that have the same and minimum length and capacity.\nfunc Concat(s, t []rune) []rune {\n\tn := make([]rune, 0, len(s)+len(t))\n\tn = append(n, s...)\n\tn = append(n, t...)\n\treturn n\n}\n\n// UpperRune is rune version of `strings.ToUpper()`.\nfunc UpperRune(r rune) rune {\n\tstr := strings.ToUpper(string(r))\n\treturn []rune(str)[0]\n}\n\n// LowerRune is rune version of `strings.ToLower()`.\nfunc LowerRune(r rune) rune {\n\tstr := strings.ToLower(string(r))\n\treturn []rune(str)[0]\n}\n\n// ToggleRune returns a upper case if an input is a lower case, v.v.\nfunc ToggleRune(r rune) rune {\n\tvar str string\n\tif 'a' <= r && r <= 'z' {\n\t\tstr = strings.ToUpper(string(r))\n\t} else if 'A' <= r && r <= 'Z' {\n\t\tstr = strings.ToLower(string(r))\n\t} else {\n\t\tstr = string(r)\n\t}\n\treturn []rune(str)[0]\n}\n\n// ToggleString iteratively calls ToggleRune, and returns the toggled string.\nfunc ToggleString(s string) string {\n\tinputRunes := []rune(s)\n\toutputRunes := make([]rune, 0, len(inputRunes))\n\tfor _, r := range inputRunes {\n\t\toutputRunes = append(outputRunes, ToggleRune(r))\n\t}\n\treturn string(outputRunes)\n}\n\n// Strtoi is a wrapper of `strconv.Atoi()`.\n// If `strconv.Atoi()` returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// sort package (snippets)\n//sort.Sort(sort.IntSlice(s))\n//sort.Sort(sort.Reverse(sort.IntSlice(s)))\n//sort.Sort(sort.Float64Slice(s))\n//sort.Sort(sort.StringSlice(s))\n\n// copy function\n//a = []int{0, 1, 2}\n//b = make([]int, len(a))\n//copy(b, a)\n\n/*******************************************************************/\n\nvar h, w int\nvar S [][]rune\n\nfunc main() {\n\ttmp := NextIntsLine()\n\th, w = tmp[0], tmp[1]\n\tfor i := 0; i < h; i++ {\n\t\tline := NextRunesLine()\n\t\tS = append(S, line)\n\t}\n\tstep := [][]int{\n\t\t{-1, -1}, {0, -1}, {1, -1},\n\t\t{-1, 0}, {1, 0},\n\t\t{-1, 1}, {0, 1}, {1, 1},\n\t}\n\tfor i := 0; i < w; i++ {\n\t\tfor j := 0; j < h; j++ {\n\t\t\tif S[j][i] == '#' {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tnum := 0\n\t\t\tfor _, s := range step {\n\t\t\t\tx := i + s[0]\n\t\t\t\ty := j + s[1]\n\t\t\t\tif 0 <= x && x < w && 0 <= y && y < h && S[y][x] == '#' {\n\t\t\t\t\tnum++\n\t\t\t\t}\n\t\t\t}\n\t\t\tnumStr := strconv.Itoa(num)\n\t\t\tfor _, r := range numStr {\n\t\t\t\tS[j][i] = r\n\t\t\t}\n\t\t}\n\t}\n\tfor i := 0; i < h; i++ {\n\t\tfmt.Println(string(S[i]))\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given an H × W grid.\n\nThe squares in the grid are described by H strings, S_1,...,S_H.\n\nThe j-th character in the string S_i corresponds to the square at the i-th row from the top and j-th column from the left (1 \\leq i \\leq H,1 \\leq j \\leq W).\n\n. stands for an empty square, and # stands for a square containing a bomb.\n\nDolphin is interested in how many bomb squares are horizontally, vertically or diagonally adjacent to each empty square.\n\n(Below, we will simply say \"adjacent\" for this meaning. For each square, there are at most eight adjacent squares.)\n\nHe decides to replace each . in our H strings with a digit that represents the number of bomb squares adjacent to the corresponding empty square.\n\nPrint the strings after the process.\n\nConstraints\n\n1 \\leq H,W \\leq 50\n\nS_i is a string of length W consisting of # and ..\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nS_1\n:\nS_H\n\nOutput\n\nPrint the H strings after the process.\n\nThe i-th line should contain a string T_i of length W, where the j-th character in T_i corresponds to the square at the i-th row from the top and j-th row from the left in the grid (1 \\leq i \\leq H, 1 \\leq j \\leq W).\n\nSample Input 1\n\n3 5\n.....\n.#.#.\n.....\n\nSample Output 1\n\n11211\n1#2#1\n11211\n\nFor example, let us observe the empty square at the first row from the top and first column from the left.\n\nThere is one bomb square adjacent to this empty square: the square at the second row and second column.\n\nThus, the . corresponding to this empty square is replaced with 1.\n\nSample Input 2\n\n3 5\n#####\n#####\n#####\n\nSample Output 2\n\n#####\n#####\n#####\n\nIt is possible that there is no empty square.\n\nSample Input 3\n\n6 6\n#####.\n#.#.##\n####.#\n.#..#.\n#.##..\n#.#...\n\nSample Output 3\n\n#####3\n#8#7##\n####5#\n4#65#2\n#5##21\n#4#310", "sample_input": "3 5\n.....\n.#.#.\n.....\n"}, "reference_outputs": ["11211\n1#2#1\n11211\n"], "source_document_id": "p03574", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given an H × W grid.\n\nThe squares in the grid are described by H strings, S_1,...,S_H.\n\nThe j-th character in the string S_i corresponds to the square at the i-th row from the top and j-th column from the left (1 \\leq i \\leq H,1 \\leq j \\leq W).\n\n. stands for an empty square, and # stands for a square containing a bomb.\n\nDolphin is interested in how many bomb squares are horizontally, vertically or diagonally adjacent to each empty square.\n\n(Below, we will simply say \"adjacent\" for this meaning. For each square, there are at most eight adjacent squares.)\n\nHe decides to replace each . in our H strings with a digit that represents the number of bomb squares adjacent to the corresponding empty square.\n\nPrint the strings after the process.\n\nConstraints\n\n1 \\leq H,W \\leq 50\n\nS_i is a string of length W consisting of # and ..\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nS_1\n:\nS_H\n\nOutput\n\nPrint the H strings after the process.\n\nThe i-th line should contain a string T_i of length W, where the j-th character in T_i corresponds to the square at the i-th row from the top and j-th row from the left in the grid (1 \\leq i \\leq H, 1 \\leq j \\leq W).\n\nSample Input 1\n\n3 5\n.....\n.#.#.\n.....\n\nSample Output 1\n\n11211\n1#2#1\n11211\n\nFor example, let us observe the empty square at the first row from the top and first column from the left.\n\nThere is one bomb square adjacent to this empty square: the square at the second row and second column.\n\nThus, the . corresponding to this empty square is replaced with 1.\n\nSample Input 2\n\n3 5\n#####\n#####\n#####\n\nSample Output 2\n\n#####\n#####\n#####\n\nIt is possible that there is no empty square.\n\nSample Input 3\n\n6 6\n#####.\n#.#.##\n####.#\n.#..#.\n#.##..\n#.#...\n\nSample Output 3\n\n#####3\n#8#7##\n####5#\n4#65#2\n#5##21\n#4#310", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5190, "cpu_time_ms": 2, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s018730879", "group_id": "codeNet:p03606", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tN := nextInt()\n\tsum := 0\n\tfor i := 0; i < N; i++ {\n\t\tl, r := nextInt(), nextInt()\n\t\tsum += r - l + 1\n\t}\n\tfmt.Println(sum)\n}\n", "language": "Go", "metadata": {"date": 1560441668, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03606.html", "problem_id": "p03606", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03606/input.txt", "sample_output_relpath": "derived/input_output/data/p03606/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03606/Go/s018730879.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s018730879", "user_id": "u646352133"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tN := nextInt()\n\tsum := 0\n\tfor i := 0; i < N; i++ {\n\t\tl, r := nextInt(), nextInt()\n\t\tsum += r - l + 1\n\t}\n\tfmt.Println(sum)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nJoisino is working as a receptionist at a theater.\n\nThe theater has 100000 seats, numbered from 1 to 100000.\n\nAccording to her memo, N groups of audiences have come so far, and the i-th group occupies the consecutive seats from Seat l_i to Seat r_i (inclusive).\n\nHow many people are sitting at the theater now?\n\nConstraints\n\n1≤N≤1000\n\n1≤l_i≤r_i≤100000\n\nNo seat is occupied by more than one person.\n\nAll input values 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 number of people sitting at the theater.\n\nSample Input 1\n\n1\n24 30\n\nSample Output 1\n\n7\n\nThere are 7 people, sitting at Seat 24,25,26,27,28,29 and 30.\n\nSample Input 2\n\n2\n6 8\n3 3\n\nSample Output 2\n\n4", "sample_input": "1\n24 30\n"}, "reference_outputs": ["7\n"], "source_document_id": "p03606", "source_text": "Score : 200 points\n\nProblem Statement\n\nJoisino is working as a receptionist at a theater.\n\nThe theater has 100000 seats, numbered from 1 to 100000.\n\nAccording to her memo, N groups of audiences have come so far, and the i-th group occupies the consecutive seats from Seat l_i to Seat r_i (inclusive).\n\nHow many people are sitting at the theater now?\n\nConstraints\n\n1≤N≤1000\n\n1≤l_i≤r_i≤100000\n\nNo seat is occupied by more than one person.\n\nAll input values 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 number of people sitting at the theater.\n\nSample Input 1\n\n1\n24 30\n\nSample Output 1\n\n7\n\nThere are 7 people, sitting at Seat 24,25,26,27,28,29 and 30.\n\nSample Input 2\n\n2\n6 8\n3 3\n\nSample Output 2\n\n4", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s595597449", "group_id": "codeNet:p03606", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tvar l, r int\n\t\tfmt.Scan(&l, &r)\n\t\tans += (r - l) + 1\n\t}\n\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1556118095, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03606.html", "problem_id": "p03606", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03606/input.txt", "sample_output_relpath": "derived/input_output/data/p03606/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03606/Go/s595597449.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s595597449", "user_id": "u102310764"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar n int\n\tfmt.Scan(&n)\n\n\tans := 0\n\tfor i := 0; i < n; i++ {\n\t\tvar l, r int\n\t\tfmt.Scan(&l, &r)\n\t\tans += (r - l) + 1\n\t}\n\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nJoisino is working as a receptionist at a theater.\n\nThe theater has 100000 seats, numbered from 1 to 100000.\n\nAccording to her memo, N groups of audiences have come so far, and the i-th group occupies the consecutive seats from Seat l_i to Seat r_i (inclusive).\n\nHow many people are sitting at the theater now?\n\nConstraints\n\n1≤N≤1000\n\n1≤l_i≤r_i≤100000\n\nNo seat is occupied by more than one person.\n\nAll input values 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 number of people sitting at the theater.\n\nSample Input 1\n\n1\n24 30\n\nSample Output 1\n\n7\n\nThere are 7 people, sitting at Seat 24,25,26,27,28,29 and 30.\n\nSample Input 2\n\n2\n6 8\n3 3\n\nSample Output 2\n\n4", "sample_input": "1\n24 30\n"}, "reference_outputs": ["7\n"], "source_document_id": "p03606", "source_text": "Score : 200 points\n\nProblem Statement\n\nJoisino is working as a receptionist at a theater.\n\nThe theater has 100000 seats, numbered from 1 to 100000.\n\nAccording to her memo, N groups of audiences have come so far, and the i-th group occupies the consecutive seats from Seat l_i to Seat r_i (inclusive).\n\nHow many people are sitting at the theater now?\n\nConstraints\n\n1≤N≤1000\n\n1≤l_i≤r_i≤100000\n\nNo seat is occupied by more than one person.\n\nAll input values 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 number of people sitting at the theater.\n\nSample Input 1\n\n1\n24 30\n\nSample Output 1\n\n7\n\nThere are 7 people, sitting at Seat 24,25,26,27,28,29 and 30.\n\nSample Input 2\n\n2\n6 8\n3 3\n\nSample Output 2\n\n4", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 10, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s963618313", "group_id": "codeNet:p03606", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tl := make([]int, n)\n\tr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tl[i] = nextInt()\n\t\tr[i] = nextInt()\n\t}\n\tfmt.Println(n, l, r)\n\tres := 0\n\tfor i := 0; i < n; i++ {\n\t\tres += r[i] - l[i] + 1\n\t}\n\tfmt.Println(res)\n}\n\n// -------- Library --------\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tv, _ := strconv.Atoi(next())\n\treturn v\n}\n\nfunc nextIntArray(size int) []int {\n\tres := make([]int, size)\n\tfor i := 0; i < size; i++ {\n\t\tres[i] = nextInt()\n\t}\n\treturn res\n}\n", "language": "Go", "metadata": {"date": 1509596959, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03606.html", "problem_id": "p03606", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03606/input.txt", "sample_output_relpath": "derived/input_output/data/p03606/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03606/Go/s963618313.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s963618313", "user_id": "u617255029"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn := nextInt()\n\tl := make([]int, n)\n\tr := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tl[i] = nextInt()\n\t\tr[i] = nextInt()\n\t}\n\tfmt.Println(n, l, r)\n\tres := 0\n\tfor i := 0; i < n; i++ {\n\t\tres += r[i] - l[i] + 1\n\t}\n\tfmt.Println(res)\n}\n\n// -------- Library --------\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tv, _ := strconv.Atoi(next())\n\treturn v\n}\n\nfunc nextIntArray(size int) []int {\n\tres := make([]int, size)\n\tfor i := 0; i < size; i++ {\n\t\tres[i] = nextInt()\n\t}\n\treturn res\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nJoisino is working as a receptionist at a theater.\n\nThe theater has 100000 seats, numbered from 1 to 100000.\n\nAccording to her memo, N groups of audiences have come so far, and the i-th group occupies the consecutive seats from Seat l_i to Seat r_i (inclusive).\n\nHow many people are sitting at the theater now?\n\nConstraints\n\n1≤N≤1000\n\n1≤l_i≤r_i≤100000\n\nNo seat is occupied by more than one person.\n\nAll input values 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 number of people sitting at the theater.\n\nSample Input 1\n\n1\n24 30\n\nSample Output 1\n\n7\n\nThere are 7 people, sitting at Seat 24,25,26,27,28,29 and 30.\n\nSample Input 2\n\n2\n6 8\n3 3\n\nSample Output 2\n\n4", "sample_input": "1\n24 30\n"}, "reference_outputs": ["7\n"], "source_document_id": "p03606", "source_text": "Score : 200 points\n\nProblem Statement\n\nJoisino is working as a receptionist at a theater.\n\nThe theater has 100000 seats, numbered from 1 to 100000.\n\nAccording to her memo, N groups of audiences have come so far, and the i-th group occupies the consecutive seats from Seat l_i to Seat r_i (inclusive).\n\nHow many people are sitting at the theater now?\n\nConstraints\n\n1≤N≤1000\n\n1≤l_i≤r_i≤100000\n\nNo seat is occupied by more than one person.\n\nAll input values 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 number of people sitting at the theater.\n\nSample Input 1\n\n1\n24 30\n\nSample Output 1\n\n7\n\nThere are 7 people, sitting at Seat 24,25,26,27,28,29 and 30.\n\nSample Input 2\n\n2\n6 8\n3 3\n\nSample Output 2\n\n4", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 644, "cpu_time_ms": 2, "memory_kb": 768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s716521810", "group_id": "codeNet:p03606", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var N int\n fmt.Scan(&N)\n ans := 0\n for i := 0; i < N; i++ {\n var l, r int\n fmt.Scan(&l)\n fmt.Scan(&r)\n ans += r - l + 1\n }\n fmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1505005745, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03606.html", "problem_id": "p03606", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03606/input.txt", "sample_output_relpath": "derived/input_output/data/p03606/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03606/Go/s716521810.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s716521810", "user_id": "u988832865"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n var N int\n fmt.Scan(&N)\n ans := 0\n for i := 0; i < N; i++ {\n var l, r int\n fmt.Scan(&l)\n fmt.Scan(&r)\n ans += r - l + 1\n }\n fmt.Println(ans)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nJoisino is working as a receptionist at a theater.\n\nThe theater has 100000 seats, numbered from 1 to 100000.\n\nAccording to her memo, N groups of audiences have come so far, and the i-th group occupies the consecutive seats from Seat l_i to Seat r_i (inclusive).\n\nHow many people are sitting at the theater now?\n\nConstraints\n\n1≤N≤1000\n\n1≤l_i≤r_i≤100000\n\nNo seat is occupied by more than one person.\n\nAll input values 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 number of people sitting at the theater.\n\nSample Input 1\n\n1\n24 30\n\nSample Output 1\n\n7\n\nThere are 7 people, sitting at Seat 24,25,26,27,28,29 and 30.\n\nSample Input 2\n\n2\n6 8\n3 3\n\nSample Output 2\n\n4", "sample_input": "1\n24 30\n"}, "reference_outputs": ["7\n"], "source_document_id": "p03606", "source_text": "Score : 200 points\n\nProblem Statement\n\nJoisino is working as a receptionist at a theater.\n\nThe theater has 100000 seats, numbered from 1 to 100000.\n\nAccording to her memo, N groups of audiences have come so far, and the i-th group occupies the consecutive seats from Seat l_i to Seat r_i (inclusive).\n\nHow many people are sitting at the theater now?\n\nConstraints\n\n1≤N≤1000\n\n1≤l_i≤r_i≤100000\n\nNo seat is occupied by more than one person.\n\nAll input values 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 number of people sitting at the theater.\n\nSample Input 1\n\n1\n24 30\n\nSample Output 1\n\n7\n\nThere are 7 people, sitting at Seat 24,25,26,27,28,29 and 30.\n\nSample Input 2\n\n2\n6 8\n3 3\n\nSample Output 2\n\n4", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 11, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s522491346", "group_id": "codeNet:p03606", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\tN := sc.NextInt()\n\tans := 0\n\tfor i := 0; i < N; i++ {\n\t\tA, B := sc.NextInt(), sc.NextInt()\n\t\tans += B - A + 1\n\t}\n\tfmt.Println(ans)\n\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *Scanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)\n\t\t\tresult = append(result, int(v))\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\n\treturn result\n}\nfunc (s *Scanner) NextInt64Array() []int64 {\n\ts.pre()\n\tstart := s.p\n\tresult := []int64{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1505005334, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03606.html", "problem_id": "p03606", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03606/input.txt", "sample_output_relpath": "derived/input_output/data/p03606/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03606/Go/s522491346.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s522491346", "user_id": "u504669764"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"os\"\n\t\"strconv\"\n\t\"fmt\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\tN := sc.NextInt()\n\tans := 0\n\tfor i := 0; i < N; i++ {\n\t\tA, B := sc.NextInt(), sc.NextInt()\n\t\tans += B - A + 1\n\t}\n\tfmt.Println(ans)\n\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *Scanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)\n\t\t\tresult = append(result, int(v))\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\n\treturn result\n}\nfunc (s *Scanner) NextInt64Array() []int64 {\n\ts.pre()\n\tstart := s.p\n\tresult := []int64{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nJoisino is working as a receptionist at a theater.\n\nThe theater has 100000 seats, numbered from 1 to 100000.\n\nAccording to her memo, N groups of audiences have come so far, and the i-th group occupies the consecutive seats from Seat l_i to Seat r_i (inclusive).\n\nHow many people are sitting at the theater now?\n\nConstraints\n\n1≤N≤1000\n\n1≤l_i≤r_i≤100000\n\nNo seat is occupied by more than one person.\n\nAll input values 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 number of people sitting at the theater.\n\nSample Input 1\n\n1\n24 30\n\nSample Output 1\n\n7\n\nThere are 7 people, sitting at Seat 24,25,26,27,28,29 and 30.\n\nSample Input 2\n\n2\n6 8\n3 3\n\nSample Output 2\n\n4", "sample_input": "1\n24 30\n"}, "reference_outputs": ["7\n"], "source_document_id": "p03606", "source_text": "Score : 200 points\n\nProblem Statement\n\nJoisino is working as a receptionist at a theater.\n\nThe theater has 100000 seats, numbered from 1 to 100000.\n\nAccording to her memo, N groups of audiences have come so far, and the i-th group occupies the consecutive seats from Seat l_i to Seat r_i (inclusive).\n\nHow many people are sitting at the theater now?\n\nConstraints\n\n1≤N≤1000\n\n1≤l_i≤r_i≤100000\n\nNo seat is occupied by more than one person.\n\nAll input values 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 number of people sitting at the theater.\n\nSample Input 1\n\n1\n24 30\n\nSample Output 1\n\n7\n\nThere are 7 people, sitting at Seat 24,25,26,27,28,29 and 30.\n\nSample Input 2\n\n2\n6 8\n3 3\n\nSample Output 2\n\n4", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2055, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s806045660", "group_id": "codeNet:p03624", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\t// Code for B - Not Found\n\tvar S string\n\tfmt.Scanf(\"%s\", &S)\n\n\tans := make(map[string]int, len(S))\n\tfor i := 0; i < len(S); i++ {\n\t\tans[string(S[i])]++\n\t}\n\n\tfor i := 0; i < 26; i++ {\n\t\tchar := string('a' + i)\n\t\tif ans[char] == 0 {\n\t\t\tfmt.Println(char)\n\t\t\tbreak\n\t\t}\n\t\tif i == 25 {\n\t\t\tfmt.Println(\"None\")\n\t\t}\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1597165052, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03624.html", "problem_id": "p03624", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03624/input.txt", "sample_output_relpath": "derived/input_output/data/p03624/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03624/Go/s806045660.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s806045660", "user_id": "u128015095"}, "prompt_components": {"gold_output": "b\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\t// Code for B - Not Found\n\tvar S string\n\tfmt.Scanf(\"%s\", &S)\n\n\tans := make(map[string]int, len(S))\n\tfor i := 0; i < len(S); i++ {\n\t\tans[string(S[i])]++\n\t}\n\n\tfor i := 0; i < 26; i++ {\n\t\tchar := string('a' + i)\n\t\tif ans[char] == 0 {\n\t\t\tfmt.Println(char)\n\t\t\tbreak\n\t\t}\n\t\tif i == 25 {\n\t\t\tfmt.Println(\"None\")\n\t\t}\n\t}\n\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nFind the lexicographically (alphabetically) smallest lowercase English letter that does not occur in S.\nIf every lowercase English letter occurs in S, print None instead.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5 (|S| is the length of string 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 lexicographically smallest lowercase English letter that does not occur in S.\nIf every lowercase English letter occurs in S, print None instead.\n\nSample Input 1\n\natcoderregularcontest\n\nSample Output 1\n\nb\n\nThe string atcoderregularcontest contains a, but does not contain b.\n\nSample Input 2\n\nabcdefghijklmnopqrstuvwxyz\n\nSample Output 2\n\nNone\n\nThis string contains every lowercase English letter.\n\nSample Input 3\n\nfajsonlslfepbjtsaayxbymeskptcumtwrmkkinjxnnucagfrg\n\nSample Output 3\n\nd", "sample_input": "atcoderregularcontest\n"}, "reference_outputs": ["b\n"], "source_document_id": "p03624", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nFind the lexicographically (alphabetically) smallest lowercase English letter that does not occur in S.\nIf every lowercase English letter occurs in S, print None instead.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5 (|S| is the length of string 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 lexicographically smallest lowercase English letter that does not occur in S.\nIf every lowercase English letter occurs in S, print None instead.\n\nSample Input 1\n\natcoderregularcontest\n\nSample Output 1\n\nb\n\nThe string atcoderregularcontest contains a, but does not contain b.\n\nSample Input 2\n\nabcdefghijklmnopqrstuvwxyz\n\nSample Output 2\n\nNone\n\nThis string contains every lowercase English letter.\n\nSample Input 3\n\nfajsonlslfepbjtsaayxbymeskptcumtwrmkkinjxnnucagfrg\n\nSample Output 3\n\nd", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 361, "cpu_time_ms": 95, "memory_kb": 2828}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s551746806", "group_id": "codeNet:p03624", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tS := ReadString()\n\tm := make(map[byte]bool)\n\tfor _, c := range []byte(S) {\n\t\tm[c] = true\n\t}\n\tfor c := byte('a'); c <= 'z'; c++ {\n\t\tif !m[c] {\n\t\t\tfmt.Println(string(c))\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"None\")\n}\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadString() (s string) { Scan(&s); return }\nfunc ReadInts(n int) []int {\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tScan(&v[i])\n\t}\n\treturn v\n}\n", "language": "Go", "metadata": {"date": 1596092084, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03624.html", "problem_id": "p03624", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03624/input.txt", "sample_output_relpath": "derived/input_output/data/p03624/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03624/Go/s551746806.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s551746806", "user_id": "u328656362"}, "prompt_components": {"gold_output": "b\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tS := ReadString()\n\tm := make(map[byte]bool)\n\tfor _, c := range []byte(S) {\n\t\tm[c] = true\n\t}\n\tfor c := byte('a'); c <= 'z'; c++ {\n\t\tif !m[c] {\n\t\t\tfmt.Println(string(c))\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"None\")\n}\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadString() (s string) { Scan(&s); return }\nfunc ReadInts(n int) []int {\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tScan(&v[i])\n\t}\n\treturn v\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nFind the lexicographically (alphabetically) smallest lowercase English letter that does not occur in S.\nIf every lowercase English letter occurs in S, print None instead.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5 (|S| is the length of string 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 lexicographically smallest lowercase English letter that does not occur in S.\nIf every lowercase English letter occurs in S, print None instead.\n\nSample Input 1\n\natcoderregularcontest\n\nSample Output 1\n\nb\n\nThe string atcoderregularcontest contains a, but does not contain b.\n\nSample Input 2\n\nabcdefghijklmnopqrstuvwxyz\n\nSample Output 2\n\nNone\n\nThis string contains every lowercase English letter.\n\nSample Input 3\n\nfajsonlslfepbjtsaayxbymeskptcumtwrmkkinjxnnucagfrg\n\nSample Output 3\n\nd", "sample_input": "atcoderregularcontest\n"}, "reference_outputs": ["b\n"], "source_document_id": "p03624", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nFind the lexicographically (alphabetically) smallest lowercase English letter that does not occur in S.\nIf every lowercase English letter occurs in S, print None instead.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5 (|S| is the length of string 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 lexicographically smallest lowercase English letter that does not occur in S.\nIf every lowercase English letter occurs in S, print None instead.\n\nSample Input 1\n\natcoderregularcontest\n\nSample Output 1\n\nb\n\nThe string atcoderregularcontest contains a, but does not contain b.\n\nSample Input 2\n\nabcdefghijklmnopqrstuvwxyz\n\nSample Output 2\n\nNone\n\nThis string contains every lowercase English letter.\n\nSample Input 3\n\nfajsonlslfepbjtsaayxbymeskptcumtwrmkkinjxnnucagfrg\n\nSample Output 3\n\nd", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 617, "cpu_time_ms": 17, "memory_kb": 2492}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s353050501", "group_id": "codeNet:p03624", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tS := ReadString()\n\tm := make(map[byte]bool)\n\tfor _, c := range []byte(S) {\n\t\tm[c] = true\n\t}\n\tfor c := byte('a'); c <= 'z'; c++ {\n\t\tif !m[c] {\n\t\t\tfmt.Printf(\"%c\\n\", c)\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"None\")\n}\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadString() (s string) { Scan(&s); return }\nfunc ReadInts(n int) []int {\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tScan(&v[i])\n\t}\n\treturn v\n}\n", "language": "Go", "metadata": {"date": 1596092058, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03624.html", "problem_id": "p03624", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03624/input.txt", "sample_output_relpath": "derived/input_output/data/p03624/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03624/Go/s353050501.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s353050501", "user_id": "u328656362"}, "prompt_components": {"gold_output": "b\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tS := ReadString()\n\tm := make(map[byte]bool)\n\tfor _, c := range []byte(S) {\n\t\tm[c] = true\n\t}\n\tfor c := byte('a'); c <= 'z'; c++ {\n\t\tif !m[c] {\n\t\t\tfmt.Printf(\"%c\\n\", c)\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"None\")\n}\n\nvar reader = bufio.NewReader(os.Stdin)\n\nfunc Scan(a ...interface{}) {\n\tif _, err := fmt.Fscan(reader, a...); err != nil {\n\t\tpanic(err)\n\t}\n}\nfunc ReadInt() (i int) { Scan(&i); return }\nfunc ReadString() (s string) { Scan(&s); return }\nfunc ReadInts(n int) []int {\n\tv := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tScan(&v[i])\n\t}\n\treturn v\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nFind the lexicographically (alphabetically) smallest lowercase English letter that does not occur in S.\nIf every lowercase English letter occurs in S, print None instead.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5 (|S| is the length of string 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 lexicographically smallest lowercase English letter that does not occur in S.\nIf every lowercase English letter occurs in S, print None instead.\n\nSample Input 1\n\natcoderregularcontest\n\nSample Output 1\n\nb\n\nThe string atcoderregularcontest contains a, but does not contain b.\n\nSample Input 2\n\nabcdefghijklmnopqrstuvwxyz\n\nSample Output 2\n\nNone\n\nThis string contains every lowercase English letter.\n\nSample Input 3\n\nfajsonlslfepbjtsaayxbymeskptcumtwrmkkinjxnnucagfrg\n\nSample Output 3\n\nd", "sample_input": "atcoderregularcontest\n"}, "reference_outputs": ["b\n"], "source_document_id": "p03624", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nFind the lexicographically (alphabetically) smallest lowercase English letter that does not occur in S.\nIf every lowercase English letter occurs in S, print None instead.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5 (|S| is the length of string 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 lexicographically smallest lowercase English letter that does not occur in S.\nIf every lowercase English letter occurs in S, print None instead.\n\nSample Input 1\n\natcoderregularcontest\n\nSample Output 1\n\nb\n\nThe string atcoderregularcontest contains a, but does not contain b.\n\nSample Input 2\n\nabcdefghijklmnopqrstuvwxyz\n\nSample Output 2\n\nNone\n\nThis string contains every lowercase English letter.\n\nSample Input 3\n\nfajsonlslfepbjtsaayxbymeskptcumtwrmkkinjxnnucagfrg\n\nSample Output 3\n\nd", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 616, "cpu_time_ms": 19, "memory_kb": 2492}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s453061398", "group_id": "codeNet:p03624", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var s string \n fmt.Scan(&s)\n res := make(map[rune]bool)\n for _, c := range s {res[c] = true}\n ans := \"None\"\n for i := 'a'; i < 'z' + 1; i++ {\n if _, ok := res[i]; !ok {\n ans = string(i)\n break\n }\n }\n fmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1587875291, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03624.html", "problem_id": "p03624", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03624/input.txt", "sample_output_relpath": "derived/input_output/data/p03624/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03624/Go/s453061398.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s453061398", "user_id": "u254871849"}, "prompt_components": {"gold_output": "b\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var s string \n fmt.Scan(&s)\n res := make(map[rune]bool)\n for _, c := range s {res[c] = true}\n ans := \"None\"\n for i := 'a'; i < 'z' + 1; i++ {\n if _, ok := res[i]; !ok {\n ans = string(i)\n break\n }\n }\n fmt.Println(ans)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nFind the lexicographically (alphabetically) smallest lowercase English letter that does not occur in S.\nIf every lowercase English letter occurs in S, print None instead.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5 (|S| is the length of string 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 lexicographically smallest lowercase English letter that does not occur in S.\nIf every lowercase English letter occurs in S, print None instead.\n\nSample Input 1\n\natcoderregularcontest\n\nSample Output 1\n\nb\n\nThe string atcoderregularcontest contains a, but does not contain b.\n\nSample Input 2\n\nabcdefghijklmnopqrstuvwxyz\n\nSample Output 2\n\nNone\n\nThis string contains every lowercase English letter.\n\nSample Input 3\n\nfajsonlslfepbjtsaayxbymeskptcumtwrmkkinjxnnucagfrg\n\nSample Output 3\n\nd", "sample_input": "atcoderregularcontest\n"}, "reference_outputs": ["b\n"], "source_document_id": "p03624", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nFind the lexicographically (alphabetically) smallest lowercase English letter that does not occur in S.\nIf every lowercase English letter occurs in S, print None instead.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5 (|S| is the length of string 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 lexicographically smallest lowercase English letter that does not occur in S.\nIf every lowercase English letter occurs in S, print None instead.\n\nSample Input 1\n\natcoderregularcontest\n\nSample Output 1\n\nb\n\nThe string atcoderregularcontest contains a, but does not contain b.\n\nSample Input 2\n\nabcdefghijklmnopqrstuvwxyz\n\nSample Output 2\n\nNone\n\nThis string contains every lowercase English letter.\n\nSample Input 3\n\nfajsonlslfepbjtsaayxbymeskptcumtwrmkkinjxnnucagfrg\n\nSample Output 3\n\nd", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 291, "cpu_time_ms": 59, "memory_kb": 1280}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s151115604", "group_id": "codeNet:p03624", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, 1000000)\n\n\tS := getString()\n\tm := make([]int, 26)\n\tfor _, v := range S {\n\t\tm[v-'a'] = 1\n\t}\n\tans := \"None\"\n\tfor i := 0; i < 26; i++ {\n\t\tif m[i] == 0 {\n\t\t\tans = string('a' + i)\n\t\t\tbreak\n\t\t}\n\t}\n\tout(ans)\n}\n", "language": "Go", "metadata": {"date": 1583288763, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03624.html", "problem_id": "p03624", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03624/input.txt", "sample_output_relpath": "derived/input_output/data/p03624/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03624/Go/s151115604.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s151115604", "user_id": "u814575783"}, "prompt_components": {"gold_output": "b\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc out(x ...interface{}) {\n\tfmt.Println(x...)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc getString() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, 1000000)\n\n\tS := getString()\n\tm := make([]int, 26)\n\tfor _, v := range S {\n\t\tm[v-'a'] = 1\n\t}\n\tans := \"None\"\n\tfor i := 0; i < 26; i++ {\n\t\tif m[i] == 0 {\n\t\t\tans = string('a' + i)\n\t\t\tbreak\n\t\t}\n\t}\n\tout(ans)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nFind the lexicographically (alphabetically) smallest lowercase English letter that does not occur in S.\nIf every lowercase English letter occurs in S, print None instead.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5 (|S| is the length of string 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 lexicographically smallest lowercase English letter that does not occur in S.\nIf every lowercase English letter occurs in S, print None instead.\n\nSample Input 1\n\natcoderregularcontest\n\nSample Output 1\n\nb\n\nThe string atcoderregularcontest contains a, but does not contain b.\n\nSample Input 2\n\nabcdefghijklmnopqrstuvwxyz\n\nSample Output 2\n\nNone\n\nThis string contains every lowercase English letter.\n\nSample Input 3\n\nfajsonlslfepbjtsaayxbymeskptcumtwrmkkinjxnnucagfrg\n\nSample Output 3\n\nd", "sample_input": "atcoderregularcontest\n"}, "reference_outputs": ["b\n"], "source_document_id": "p03624", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nFind the lexicographically (alphabetically) smallest lowercase English letter that does not occur in S.\nIf every lowercase English letter occurs in S, print None instead.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5 (|S| is the length of string 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 lexicographically smallest lowercase English letter that does not occur in S.\nIf every lowercase English letter occurs in S, print None instead.\n\nSample Input 1\n\natcoderregularcontest\n\nSample Output 1\n\nb\n\nThe string atcoderregularcontest contains a, but does not contain b.\n\nSample Input 2\n\nabcdefghijklmnopqrstuvwxyz\n\nSample Output 2\n\nNone\n\nThis string contains every lowercase English letter.\n\nSample Input 3\n\nfajsonlslfepbjtsaayxbymeskptcumtwrmkkinjxnnucagfrg\n\nSample Output 3\n\nd", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 576, "cpu_time_ms": 5, "memory_kb": 896}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s609998721", "group_id": "codeNet:p03624", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tm := make(map[rune]int, 26)\n\tfor _, r := range s {\n\t\tm[r]++\n\t}\n\n\tif len(m) == 26 {\n\t\tfmt.Println(\"None\")\n\t} else {\n\t\taz := \"abcdefghijklmnopqrstuvwxyz\"\n\t\tfor _, r := range az {\n\t\t\tif _, ok := m[r]; !ok {\n\t\t\t\tfmt.Println(string(r))\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1582529441, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03624.html", "problem_id": "p03624", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03624/input.txt", "sample_output_relpath": "derived/input_output/data/p03624/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03624/Go/s609998721.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s609998721", "user_id": "u461993794"}, "prompt_components": {"gold_output": "b\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tm := make(map[rune]int, 26)\n\tfor _, r := range s {\n\t\tm[r]++\n\t}\n\n\tif len(m) == 26 {\n\t\tfmt.Println(\"None\")\n\t} else {\n\t\taz := \"abcdefghijklmnopqrstuvwxyz\"\n\t\tfor _, r := range az {\n\t\t\tif _, ok := m[r]; !ok {\n\t\t\t\tfmt.Println(string(r))\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nFind the lexicographically (alphabetically) smallest lowercase English letter that does not occur in S.\nIf every lowercase English letter occurs in S, print None instead.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5 (|S| is the length of string 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 lexicographically smallest lowercase English letter that does not occur in S.\nIf every lowercase English letter occurs in S, print None instead.\n\nSample Input 1\n\natcoderregularcontest\n\nSample Output 1\n\nb\n\nThe string atcoderregularcontest contains a, but does not contain b.\n\nSample Input 2\n\nabcdefghijklmnopqrstuvwxyz\n\nSample Output 2\n\nNone\n\nThis string contains every lowercase English letter.\n\nSample Input 3\n\nfajsonlslfepbjtsaayxbymeskptcumtwrmkkinjxnnucagfrg\n\nSample Output 3\n\nd", "sample_input": "atcoderregularcontest\n"}, "reference_outputs": ["b\n"], "source_document_id": "p03624", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nFind the lexicographically (alphabetically) smallest lowercase English letter that does not occur in S.\nIf every lowercase English letter occurs in S, print None instead.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5 (|S| is the length of string 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 lexicographically smallest lowercase English letter that does not occur in S.\nIf every lowercase English letter occurs in S, print None instead.\n\nSample Input 1\n\natcoderregularcontest\n\nSample Output 1\n\nb\n\nThe string atcoderregularcontest contains a, but does not contain b.\n\nSample Input 2\n\nabcdefghijklmnopqrstuvwxyz\n\nSample Output 2\n\nNone\n\nThis string contains every lowercase English letter.\n\nSample Input 3\n\nfajsonlslfepbjtsaayxbymeskptcumtwrmkkinjxnnucagfrg\n\nSample Output 3\n\nd", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 328, "cpu_time_ms": 63, "memory_kb": 1280}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s513852853", "group_id": "codeNet:p03624", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tvar str string\n\tfmt.Scan(&str)\n\n\tslice := make([]int, 26)\n\tfor _, v := range str {\n\t\tslice[int(v)-97] = 1\n\t}\n\n\tfor i, v := range slice {\n\t\tif v == 0 {\n\t\t\tfmt.Println(string(i + 97))\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(\"None\")\n\n}\n", "language": "Go", "metadata": {"date": 1560361758, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03624.html", "problem_id": "p03624", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03624/input.txt", "sample_output_relpath": "derived/input_output/data/p03624/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03624/Go/s513852853.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s513852853", "user_id": "u710190793"}, "prompt_components": {"gold_output": "b\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\tvar str string\n\tfmt.Scan(&str)\n\n\tslice := make([]int, 26)\n\tfor _, v := range str {\n\t\tslice[int(v)-97] = 1\n\t}\n\n\tfor i, v := range slice {\n\t\tif v == 0 {\n\t\t\tfmt.Println(string(i + 97))\n\t\t\treturn\n\t\t}\n\t}\n\n\tfmt.Println(\"None\")\n\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nFind the lexicographically (alphabetically) smallest lowercase English letter that does not occur in S.\nIf every lowercase English letter occurs in S, print None instead.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5 (|S| is the length of string 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 lexicographically smallest lowercase English letter that does not occur in S.\nIf every lowercase English letter occurs in S, print None instead.\n\nSample Input 1\n\natcoderregularcontest\n\nSample Output 1\n\nb\n\nThe string atcoderregularcontest contains a, but does not contain b.\n\nSample Input 2\n\nabcdefghijklmnopqrstuvwxyz\n\nSample Output 2\n\nNone\n\nThis string contains every lowercase English letter.\n\nSample Input 3\n\nfajsonlslfepbjtsaayxbymeskptcumtwrmkkinjxnnucagfrg\n\nSample Output 3\n\nd", "sample_input": "atcoderregularcontest\n"}, "reference_outputs": ["b\n"], "source_document_id": "p03624", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nFind the lexicographically (alphabetically) smallest lowercase English letter that does not occur in S.\nIf every lowercase English letter occurs in S, print None instead.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5 (|S| is the length of string 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 lexicographically smallest lowercase English letter that does not occur in S.\nIf every lowercase English letter occurs in S, print None instead.\n\nSample Input 1\n\natcoderregularcontest\n\nSample Output 1\n\nb\n\nThe string atcoderregularcontest contains a, but does not contain b.\n\nSample Input 2\n\nabcdefghijklmnopqrstuvwxyz\n\nSample Output 2\n\nNone\n\nThis string contains every lowercase English letter.\n\nSample Input 3\n\nfajsonlslfepbjtsaayxbymeskptcumtwrmkkinjxnnucagfrg\n\nSample Output 3\n\nd", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 54, "memory_kb": 1280}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s118598962", "group_id": "codeNet:p03624", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tbucket := make([]int, 26)\n\tfor _, i := range s {\n\t\tbucket[i-97]++\n\t}\n\n\tfor i, v := range bucket {\n\t\tif v == 0 {\n\t\t\tfmt.Printf(string(i + 97))\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"None\")\n}\n", "language": "Go", "metadata": {"date": 1549763405, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03624.html", "problem_id": "p03624", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03624/input.txt", "sample_output_relpath": "derived/input_output/data/p03624/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03624/Go/s118598962.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s118598962", "user_id": "u554269352"}, "prompt_components": {"gold_output": "b\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tbucket := make([]int, 26)\n\tfor _, i := range s {\n\t\tbucket[i-97]++\n\t}\n\n\tfor i, v := range bucket {\n\t\tif v == 0 {\n\t\t\tfmt.Printf(string(i + 97))\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"None\")\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nFind the lexicographically (alphabetically) smallest lowercase English letter that does not occur in S.\nIf every lowercase English letter occurs in S, print None instead.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5 (|S| is the length of string 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 lexicographically smallest lowercase English letter that does not occur in S.\nIf every lowercase English letter occurs in S, print None instead.\n\nSample Input 1\n\natcoderregularcontest\n\nSample Output 1\n\nb\n\nThe string atcoderregularcontest contains a, but does not contain b.\n\nSample Input 2\n\nabcdefghijklmnopqrstuvwxyz\n\nSample Output 2\n\nNone\n\nThis string contains every lowercase English letter.\n\nSample Input 3\n\nfajsonlslfepbjtsaayxbymeskptcumtwrmkkinjxnnucagfrg\n\nSample Output 3\n\nd", "sample_input": "atcoderregularcontest\n"}, "reference_outputs": ["b\n"], "source_document_id": "p03624", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nFind the lexicographically (alphabetically) smallest lowercase English letter that does not occur in S.\nIf every lowercase English letter occurs in S, print None instead.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5 (|S| is the length of string 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 lexicographically smallest lowercase English letter that does not occur in S.\nIf every lowercase English letter occurs in S, print None instead.\n\nSample Input 1\n\natcoderregularcontest\n\nSample Output 1\n\nb\n\nThe string atcoderregularcontest contains a, but does not contain b.\n\nSample Input 2\n\nabcdefghijklmnopqrstuvwxyz\n\nSample Output 2\n\nNone\n\nThis string contains every lowercase English letter.\n\nSample Input 3\n\nfajsonlslfepbjtsaayxbymeskptcumtwrmkkinjxnnucagfrg\n\nSample Output 3\n\nd", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 254, "cpu_time_ms": 55, "memory_kb": 1280}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s961724559", "group_id": "codeNet:p03624", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\tS := sc.NextLine()\n\n\tmp := make([]int, 26)\n\tfor i := 0; i < len(S); i++ {\n\t\tmp[S[i]-'a']++\n\t}\n\tfor i := 0; i < 26; i++ {\n\t\tif mp[i] == 0 {\n\t\t\tfmt.Println(string('a' + i))\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"None\")\n\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *Scanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)\n\t\t\tresult = append(result, int(v))\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\n\treturn result\n}\nfunc (s *Scanner) NextInt64Array() []int64 {\n\ts.pre()\n\tstart := s.p\n\tresult := []int64{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1503277550, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03624.html", "problem_id": "p03624", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03624/input.txt", "sample_output_relpath": "derived/input_output/data/p03624/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03624/Go/s961724559.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s961724559", "user_id": "u504669764"}, "prompt_components": {"gold_output": "b\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc main() {\n\tsc := NewScanner()\n\tS := sc.NextLine()\n\n\tmp := make([]int, 26)\n\tfor i := 0; i < len(S); i++ {\n\t\tmp[S[i]-'a']++\n\t}\n\tfor i := 0; i < 26; i++ {\n\t\tif mp[i] == 0 {\n\t\t\tfmt.Println(string('a' + i))\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"None\")\n\n}\n\ntype Scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc NewScanner() *Scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 1000)\n\treturn &Scanner{r: rdr}\n}\nfunc (s *Scanner) Next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *Scanner) NextLine() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *Scanner) NextInt() int {\n\tv, _ := strconv.Atoi(s.Next())\n\treturn v\n}\nfunc (s *Scanner) NextInt64() int64 {\n\tv, _ := strconv.ParseInt(s.Next(), 10, 64)\n\treturn v\n}\n\nfunc (s *Scanner) NextIntArray() []int {\n\ts.pre()\n\tstart := s.p\n\tresult := []int{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)\n\t\t\tresult = append(result, int(v))\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\n\treturn result\n}\nfunc (s *Scanner) NextInt64Array() []int64 {\n\ts.pre()\n\tstart := s.p\n\tresult := []int64{}\n\tfor ; s.p < len(s.buf)+1; s.p++ {\n\t\tif s.p == len(s.buf) || s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)\n\t\t\tresult = append(result, v)\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\treturn result\n}\n\nfunc (s *Scanner) NextMap() map[int]bool {\n\ts.pre()\n\tstart := s.p\n\tmp := map[int]bool{}\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\t\t\tmp[v] = true\n\t\t\tstart = s.p + 1\n\t\t}\n\t}\n\tv, _ := strconv.Atoi(string(s.buf[start:s.p]))\n\tmp[v] = true\n\n\treturn mp\n}\n\nfunc (s *Scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *Scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nFind the lexicographically (alphabetically) smallest lowercase English letter that does not occur in S.\nIf every lowercase English letter occurs in S, print None instead.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5 (|S| is the length of string 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 lexicographically smallest lowercase English letter that does not occur in S.\nIf every lowercase English letter occurs in S, print None instead.\n\nSample Input 1\n\natcoderregularcontest\n\nSample Output 1\n\nb\n\nThe string atcoderregularcontest contains a, but does not contain b.\n\nSample Input 2\n\nabcdefghijklmnopqrstuvwxyz\n\nSample Output 2\n\nNone\n\nThis string contains every lowercase English letter.\n\nSample Input 3\n\nfajsonlslfepbjtsaayxbymeskptcumtwrmkkinjxnnucagfrg\n\nSample Output 3\n\nd", "sample_input": "atcoderregularcontest\n"}, "reference_outputs": ["b\n"], "source_document_id": "p03624", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nFind the lexicographically (alphabetically) smallest lowercase English letter that does not occur in S.\nIf every lowercase English letter occurs in S, print None instead.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5 (|S| is the length of string 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 lexicographically smallest lowercase English letter that does not occur in S.\nIf every lowercase English letter occurs in S, print None instead.\n\nSample Input 1\n\natcoderregularcontest\n\nSample Output 1\n\nb\n\nThe string atcoderregularcontest contains a, but does not contain b.\n\nSample Input 2\n\nabcdefghijklmnopqrstuvwxyz\n\nSample Output 2\n\nNone\n\nThis string contains every lowercase English letter.\n\nSample Input 3\n\nfajsonlslfepbjtsaayxbymeskptcumtwrmkkinjxnnucagfrg\n\nSample Output 3\n\nd", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2133, "cpu_time_ms": 2, "memory_kb": 1280}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s076419963", "group_id": "codeNet:p03639", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e6 + 7\n)\n\nvar buf []byte = make([]byte, maxBufSize)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBufSize)\n}\n\nfunc main() {\n\tN := nextInt()\n\tcnt := map[int]int{\n\t\t1: 0,\n\t\t2: 0,\n\t\t4: 0,\n\t}\n\tfor i := 0; i < N; i++ {\n\t\ta := nextInt()\n\t\tif a%2 == 1 {\n\t\t\tcnt[1]++\n\t\t} else if a%4 == 0 {\n\t\t\tcnt[4]++\n\t\t} else {\n\t\t\tcnt[2]++\n\t\t}\n\t}\n\t// fmt.Println(cnt)\n\tif cnt[2] == 0 {\n\t\tcnt[4]++\n\t}\n\tif cnt[4] >= cnt[1] {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n\t// if cnt[2] == 0 {\n\t// \tif cnt[4]+1 >= cnt[1] {\n\t// \t\tfmt.Println(\"Yes\")\n\t// \t} else {\n\t// \t\tfmt.Println(\"No\")\n\t// \t}\n\t// } else {\n\t// \tif cnt[4] >= cnt[1] {\n\t// \t\tfmt.Println(\"Yes\")\n\t// \t} else {\n\t// \t\tfmt.Println(\"No\")\n\t// \t}\n\t// }\n\t// if (cnt[4]*2 >= cnt[1] && cnt[2]%2 == 0) || cnt[4]*2 >= cnt[1]+cnt[2] {\n\t// \tfmt.Println(\"Yes\")\n\t// } else {\n\t// \tfmt.Println(\"No\")\n\t// }\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc abs(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc pow(p, q int) int {\n\tres := p\n\tif q == 0 {\n\t\treturn 1\n\t}\n\tfor i := 0; i < q-1; i++ {\n\t\tres *= p\n\t}\n\treturn res\n}\n\nfunc MinOf(vars ...int) int {\n\tmin := vars[0]\n\tfor _, i := range vars {\n\t\tif min > i {\n\t\t\tmin = i\n\t\t}\n\t}\n\treturn min\n}\n\nfunc MaxOf(vars ...int) int {\n\tmax := vars[0]\n\tfor _, i := range vars {\n\t\tif max < i {\n\t\t\tmax = i\n\t\t}\n\t}\n\treturn max\n}\n\nfunc gcdof2numbers(a int, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcdof2numbers(b, a%b)\n}\n\nfunc lcmof2numbers(a int, b int) int {\n\treturn a / gcdof2numbers(a, b) * b\n}\n\n// マイナスの場合は考慮していない\nfunc fuctorial(a int) int {\n\tif a == 1 || a == 0 {\n\t\treturn 1\n\t} else {\n\t\treturn fuctorial(a-1) * a\n\t}\n}\n\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\n\n// 素因数分解したmapを返す\nfunc primeFuctorize(n int) map[int]int {\n\tpf := map[int]int{}\n\tfor i := 2; i*i <= n; i++ {\n\t\tfor n%i == 0 {\n\t\t\tpf[i]++\n\t\t\tn /= i\n\t\t}\n\t}\n\tif n != 1 {\n\t\tpf[n]++\n\t}\n\treturn pf\n}\n", "language": "Go", "metadata": {"date": 1591581701, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03639.html", "problem_id": "p03639", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03639/input.txt", "sample_output_relpath": "derived/input_output/data/p03639/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03639/Go/s076419963.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s076419963", "user_id": "u605443479"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nconst (\n\tinitialBufSize = 1e4\n\tmaxBufSize = 1e6 + 7\n)\n\nvar buf []byte = make([]byte, maxBufSize)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(buf, maxBufSize)\n}\n\nfunc main() {\n\tN := nextInt()\n\tcnt := map[int]int{\n\t\t1: 0,\n\t\t2: 0,\n\t\t4: 0,\n\t}\n\tfor i := 0; i < N; i++ {\n\t\ta := nextInt()\n\t\tif a%2 == 1 {\n\t\t\tcnt[1]++\n\t\t} else if a%4 == 0 {\n\t\t\tcnt[4]++\n\t\t} else {\n\t\t\tcnt[2]++\n\t\t}\n\t}\n\t// fmt.Println(cnt)\n\tif cnt[2] == 0 {\n\t\tcnt[4]++\n\t}\n\tif cnt[4] >= cnt[1] {\n\t\tfmt.Println(\"Yes\")\n\t} else {\n\t\tfmt.Println(\"No\")\n\t}\n\t// if cnt[2] == 0 {\n\t// \tif cnt[4]+1 >= cnt[1] {\n\t// \t\tfmt.Println(\"Yes\")\n\t// \t} else {\n\t// \t\tfmt.Println(\"No\")\n\t// \t}\n\t// } else {\n\t// \tif cnt[4] >= cnt[1] {\n\t// \t\tfmt.Println(\"Yes\")\n\t// \t} else {\n\t// \t\tfmt.Println(\"No\")\n\t// \t}\n\t// }\n\t// if (cnt[4]*2 >= cnt[1] && cnt[2]%2 == 0) || cnt[4]*2 >= cnt[1]+cnt[2] {\n\t// \tfmt.Println(\"Yes\")\n\t// } else {\n\t// \tfmt.Println(\"No\")\n\t// }\n}\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc abs(a int) int {\n\tif a > 0 {\n\t\treturn a\n\t} else {\n\t\treturn -a\n\t}\n}\n\nfunc pow(p, q int) int {\n\tres := p\n\tif q == 0 {\n\t\treturn 1\n\t}\n\tfor i := 0; i < q-1; i++ {\n\t\tres *= p\n\t}\n\treturn res\n}\n\nfunc MinOf(vars ...int) int {\n\tmin := vars[0]\n\tfor _, i := range vars {\n\t\tif min > i {\n\t\t\tmin = i\n\t\t}\n\t}\n\treturn min\n}\n\nfunc MaxOf(vars ...int) int {\n\tmax := vars[0]\n\tfor _, i := range vars {\n\t\tif max < i {\n\t\t\tmax = i\n\t\t}\n\t}\n\treturn max\n}\n\nfunc gcdof2numbers(a int, b int) int {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn gcdof2numbers(b, a%b)\n}\n\nfunc lcmof2numbers(a int, b int) int {\n\treturn a / gcdof2numbers(a, b) * b\n}\n\n// マイナスの場合は考慮していない\nfunc fuctorial(a int) int {\n\tif a == 1 || a == 0 {\n\t\treturn 1\n\t} else {\n\t\treturn fuctorial(a-1) * a\n\t}\n}\n\nfunc NextPermutation(x sort.Interface) bool {\n\tn := x.Len() - 1\n\tif n < 1 {\n\t\treturn false\n\t}\n\tj := n - 1\n\tfor ; !x.Less(j, j+1); j-- {\n\t\tif j == 0 {\n\t\t\treturn false\n\t\t}\n\t}\n\tl := n\n\tfor !x.Less(j, l) {\n\t\tl--\n\t}\n\tx.Swap(j, l)\n\tfor k, l := j+1, n; k < l; {\n\t\tx.Swap(k, l)\n\t\tk++\n\t\tl--\n\t}\n\treturn true\n}\n\n// 素因数分解したmapを返す\nfunc primeFuctorize(n int) map[int]int {\n\tpf := map[int]int{}\n\tfor i := 2; i*i <= n; i++ {\n\t\tfor n%i == 0 {\n\t\t\tpf[i]++\n\t\t\tn /= i\n\t\t}\n\t}\n\tif n != 1 {\n\t\tpf[n]++\n\t}\n\treturn pf\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a sequence of length N, a = (a_1, a_2, ..., a_N).\nEach a_i is a positive integer.\n\nSnuke's objective is to permute the element in a so that the following condition is satisfied:\n\nFor each 1 ≤ i ≤ N - 1, the product of a_i and a_{i + 1} is a multiple of 4.\n\nDetermine whether Snuke can achieve his objective.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\na_i is an integer.\n\n1 ≤ a_i ≤ 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nIf Snuke can achieve his objective, print Yes; otherwise, print No.\n\nSample Input 1\n\n3\n1 10 100\n\nSample Output 1\n\nYes\n\nOne solution is (1, 100, 10).\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\nNo\n\nIt is impossible to permute a so that the condition is satisfied.\n\nSample Input 3\n\n3\n1 4 1\n\nSample Output 3\n\nYes\n\nThe condition is already satisfied initially.\n\nSample Input 4\n\n2\n1 1\n\nSample Output 4\n\nNo\n\nSample Input 5\n\n6\n2 7 1 8 2 8\n\nSample Output 5\n\nYes", "sample_input": "3\n1 10 100\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03639", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a sequence of length N, a = (a_1, a_2, ..., a_N).\nEach a_i is a positive integer.\n\nSnuke's objective is to permute the element in a so that the following condition is satisfied:\n\nFor each 1 ≤ i ≤ N - 1, the product of a_i and a_{i + 1} is a multiple of 4.\n\nDetermine whether Snuke can achieve his objective.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\na_i is an integer.\n\n1 ≤ a_i ≤ 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nIf Snuke can achieve his objective, print Yes; otherwise, print No.\n\nSample Input 1\n\n3\n1 10 100\n\nSample Output 1\n\nYes\n\nOne solution is (1, 100, 10).\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\nNo\n\nIt is impossible to permute a so that the condition is satisfied.\n\nSample Input 3\n\n3\n1 4 1\n\nSample Output 3\n\nYes\n\nThe condition is already satisfied initially.\n\nSample Input 4\n\n2\n1 1\n\nSample Output 4\n\nNo\n\nSample Input 5\n\n6\n2 7 1 8 2 8\n\nSample Output 5\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2443, "cpu_time_ms": 31, "memory_kb": 3200}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s002243733", "group_id": "codeNet:p03639", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// const abcd = \"abcdefghijklnmopqrstuvwxyz\"\n// const ABCD = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n\n// var dy = [...]int{1, 1, 0, -1, -1, -1, 0, 1}\n// var dx = [...]int{0, 1, 1, 1, 0, -1, -1, -1}\n\n// var dx = [...]int{0, 1, 0, -1}\n// var dy = [...]int{1, 0, -1, 0}\n\n// var inf int = 1e9\n// var mod = 1000000007\n\n// ---------------------------------------------------------\nfunc main() {\n\tlog.SetFlags(log.Lshortfile)\n\tnext := newScanner()\n\tn := next.Int()\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = next.Int()\n\t}\n\tvar cnt [3]int\n\tfor i := 0; i < n; i++ {\n\t\tlog.Println(a[i], a[i]%4, a[i]/2)\n\t\tif a[i]%2 != 0 {\n\t\t\ta[i] = 1\n\t\t\tcnt[0]++\n\t\t} else if a[i]/2 == 1 {\n\t\t\ta[i] = 2\n\t\t\tcnt[1]++\n\t\t} else if a[i]/2 >= 2 {\n\t\t\ta[i] = 4\n\t\t\tcnt[2]++\n\t\t}\n\t}\n\tlog.Println(cnt)\n\tans := \"\"\n\tif cnt[1] == 0 {\n\t\tif cnt[0] <= cnt[2]+1 {\n\t\t\tans = \"Yes\"\n\t\t} else {\n\t\t\tans = \"No\"\n\t\t}\n\t} else {\n\t\tif cnt[0] <= cnt[2] {\n\t\t\tans = \"Yes\"\n\t\t} else {\n\t\t\tans = \"No\"\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\n// ---------------------------------------------------------\n\n// Pair is liked C++ pair\ntype Pair struct {\n\ta, b int\n}\n\n// Pairs is sorted by []Pair struct\ntype Pairs []Pair\n\nfunc (p Pairs) Len() int {\n\treturn len(p)\n}\nfunc (p Pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p Pairs) Less(i, j int) bool {\n\tif p[i].a < p[j].a {\n\t\treturn true\n\t} else if p[i].a == p[j].a {\n\t\treturn p[i].b < p[j].b\n\t}\n\treturn false\n}\n\n// -------------------------------\nfunc in(c, a, z int) bool {\n\treturn c >= a && c < z\n}\n\nfunc btoi(b bool) int {\n\tif b {\n\t\treturn 1\n\t}\n\treturn 0\n}\n\nfunc itob(a int) bool {\n\tif a == 0 {\n\t\treturn false\n\t}\n\treturn true\n}\n\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\n\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\n\nfunc minmax(a, b int) (int, int) {\n\tif a > b {\n\t\treturn b, a\n\t}\n\treturn a, b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// ---------- buffered scanner -----------------------------------------\ntype scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc newScanner() *scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 10000)\n\treturn &scanner{r: rdr}\n}\nfunc (s *scanner) next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *scanner) Line() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *scanner) Int() int {\n\tv, _ := strconv.Atoi(s.next())\n\treturn v\n}\nfunc (s *scanner) Int64() int64 {\n\tv, _ := strconv.ParseInt(s.next(), 10, 64)\n\treturn v\n}\nfunc (s *scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1508595917, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03639.html", "problem_id": "p03639", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03639/input.txt", "sample_output_relpath": "derived/input_output/data/p03639/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03639/Go/s002243733.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s002243733", "user_id": "u696272993"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n)\n\n// const abcd = \"abcdefghijklnmopqrstuvwxyz\"\n// const ABCD = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n\n// var dy = [...]int{1, 1, 0, -1, -1, -1, 0, 1}\n// var dx = [...]int{0, 1, 1, 1, 0, -1, -1, -1}\n\n// var dx = [...]int{0, 1, 0, -1}\n// var dy = [...]int{1, 0, -1, 0}\n\n// var inf int = 1e9\n// var mod = 1000000007\n\n// ---------------------------------------------------------\nfunc main() {\n\tlog.SetFlags(log.Lshortfile)\n\tnext := newScanner()\n\tn := next.Int()\n\ta := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\ta[i] = next.Int()\n\t}\n\tvar cnt [3]int\n\tfor i := 0; i < n; i++ {\n\t\tlog.Println(a[i], a[i]%4, a[i]/2)\n\t\tif a[i]%2 != 0 {\n\t\t\ta[i] = 1\n\t\t\tcnt[0]++\n\t\t} else if a[i]/2 == 1 {\n\t\t\ta[i] = 2\n\t\t\tcnt[1]++\n\t\t} else if a[i]/2 >= 2 {\n\t\t\ta[i] = 4\n\t\t\tcnt[2]++\n\t\t}\n\t}\n\tlog.Println(cnt)\n\tans := \"\"\n\tif cnt[1] == 0 {\n\t\tif cnt[0] <= cnt[2]+1 {\n\t\t\tans = \"Yes\"\n\t\t} else {\n\t\t\tans = \"No\"\n\t\t}\n\t} else {\n\t\tif cnt[0] <= cnt[2] {\n\t\t\tans = \"Yes\"\n\t\t} else {\n\t\t\tans = \"No\"\n\t\t}\n\t}\n\n\tfmt.Println(ans)\n}\n\n// ---------------------------------------------------------\n\n// Pair is liked C++ pair\ntype Pair struct {\n\ta, b int\n}\n\n// Pairs is sorted by []Pair struct\ntype Pairs []Pair\n\nfunc (p Pairs) Len() int {\n\treturn len(p)\n}\nfunc (p Pairs) Swap(i, j int) {\n\tp[i], p[j] = p[j], p[i]\n}\n\nfunc (p Pairs) Less(i, j int) bool {\n\tif p[i].a < p[j].a {\n\t\treturn true\n\t} else if p[i].a == p[j].a {\n\t\treturn p[i].b < p[j].b\n\t}\n\treturn false\n}\n\n// -------------------------------\nfunc in(c, a, z int) bool {\n\treturn c >= a && c < z\n}\n\nfunc btoi(b bool) int {\n\tif b {\n\t\treturn 1\n\t}\n\treturn 0\n}\n\nfunc itob(a int) bool {\n\tif a == 0 {\n\t\treturn false\n\t}\n\treturn true\n}\n\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\n\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\n\nfunc minmax(a, b int) (int, int) {\n\tif a > b {\n\t\treturn b, a\n\t}\n\treturn a, b\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// ---------- buffered scanner -----------------------------------------\ntype scanner struct {\n\tr *bufio.Reader\n\tbuf []byte\n\tp int\n}\n\nfunc newScanner() *scanner {\n\trdr := bufio.NewReaderSize(os.Stdin, 10000)\n\treturn &scanner{r: rdr}\n}\nfunc (s *scanner) next() string {\n\ts.pre()\n\tstart := s.p\n\tfor ; s.p < len(s.buf); s.p++ {\n\t\tif s.buf[s.p] == ' ' {\n\t\t\tbreak\n\t\t}\n\t}\n\tresult := string(s.buf[start:s.p])\n\ts.p++\n\treturn result\n}\nfunc (s *scanner) Line() string {\n\ts.pre()\n\tstart := s.p\n\ts.p = len(s.buf)\n\treturn string(s.buf[start:])\n}\nfunc (s *scanner) Int() int {\n\tv, _ := strconv.Atoi(s.next())\n\treturn v\n}\nfunc (s *scanner) Int64() int64 {\n\tv, _ := strconv.ParseInt(s.next(), 10, 64)\n\treturn v\n}\nfunc (s *scanner) pre() {\n\tif s.p >= len(s.buf) {\n\t\ts.readLine()\n\t\ts.p = 0\n\t}\n}\nfunc (s *scanner) readLine() {\n\ts.buf = make([]byte, 0)\n\tfor {\n\t\tl, p, e := s.r.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\ts.buf = append(s.buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a sequence of length N, a = (a_1, a_2, ..., a_N).\nEach a_i is a positive integer.\n\nSnuke's objective is to permute the element in a so that the following condition is satisfied:\n\nFor each 1 ≤ i ≤ N - 1, the product of a_i and a_{i + 1} is a multiple of 4.\n\nDetermine whether Snuke can achieve his objective.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\na_i is an integer.\n\n1 ≤ a_i ≤ 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nIf Snuke can achieve his objective, print Yes; otherwise, print No.\n\nSample Input 1\n\n3\n1 10 100\n\nSample Output 1\n\nYes\n\nOne solution is (1, 100, 10).\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\nNo\n\nIt is impossible to permute a so that the condition is satisfied.\n\nSample Input 3\n\n3\n1 4 1\n\nSample Output 3\n\nYes\n\nThe condition is already satisfied initially.\n\nSample Input 4\n\n2\n1 1\n\nSample Output 4\n\nNo\n\nSample Input 5\n\n6\n2 7 1 8 2 8\n\nSample Output 5\n\nYes", "sample_input": "3\n1 10 100\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03639", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a sequence of length N, a = (a_1, a_2, ..., a_N).\nEach a_i is a positive integer.\n\nSnuke's objective is to permute the element in a so that the following condition is satisfied:\n\nFor each 1 ≤ i ≤ N - 1, the product of a_i and a_{i + 1} is a multiple of 4.\n\nDetermine whether Snuke can achieve his objective.\n\nConstraints\n\n2 ≤ N ≤ 10^5\n\na_i is an integer.\n\n1 ≤ a_i ≤ 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nIf Snuke can achieve his objective, print Yes; otherwise, print No.\n\nSample Input 1\n\n3\n1 10 100\n\nSample Output 1\n\nYes\n\nOne solution is (1, 100, 10).\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\nNo\n\nIt is impossible to permute a so that the condition is satisfied.\n\nSample Input 3\n\n3\n1 4 1\n\nSample Output 3\n\nYes\n\nThe condition is already satisfied initially.\n\nSample Input 4\n\n2\n1 1\n\nSample Output 4\n\nNo\n\nSample Input 5\n\n6\n2 7 1 8 2 8\n\nSample Output 5\n\nYes", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3012, "cpu_time_ms": 310, "memory_kb": 6528}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s891079090", "group_id": "codeNet:p03705", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tconst maxWord = (1 << 30)\n\tbuf := []byte{}\n\tsc.Buffer(buf, maxWord)\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc input() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc solve(n, a, b int) int {\n\tif a > b {\n\t\treturn 0\n\t}\n\tif n == 1 && a != b {\n\t\treturn 0\n\t}\n\n\tminv := (n - 2) * a\n\tmaxv := (n - 2) * b\n\treturn maxv - minv + 1\n}\n\nfunc main() {\n\tn, _ := strconv.Atoi(input())\n\ta, _ := strconv.Atoi(input())\n\tb, _ := strconv.Atoi(input())\n\tfmt.Println(solve(n, a, b))\n}\n", "language": "Go", "metadata": {"date": 1588453076, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03705.html", "problem_id": "p03705", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03705/input.txt", "sample_output_relpath": "derived/input_output/data/p03705/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03705/Go/s891079090.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s891079090", "user_id": "u029315034"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tconst maxWord = (1 << 30)\n\tbuf := []byte{}\n\tsc.Buffer(buf, maxWord)\n\tsc.Split(bufio.ScanWords)\n}\n\nfunc input() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc solve(n, a, b int) int {\n\tif a > b {\n\t\treturn 0\n\t}\n\tif n == 1 && a != b {\n\t\treturn 0\n\t}\n\n\tminv := (n - 2) * a\n\tmaxv := (n - 2) * b\n\treturn maxv - minv + 1\n}\n\nfunc main() {\n\tn, _ := strconv.Atoi(input())\n\ta, _ := strconv.Atoi(input())\n\tb, _ := strconv.Atoi(input())\n\tfmt.Println(solve(n, a, b))\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nSnuke has N integers. Among them, the smallest is A, and the largest is B.\nWe are interested in the sum of those N integers. How many different possible sums there are?\n\nConstraints\n\n1 ≤ N,A,B ≤ 10^9\n\nA and B 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 the different possible sums.\n\nSample Input 1\n\n4 4 6\n\nSample Output 1\n\n5\n\nThere are five possible sums: 18=4+4+4+6, 19=4+4+5+6, 20=4+5+5+6, 21=4+5+6+6 and 22=4+6+6+6.\n\nSample Input 2\n\n5 4 3\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1 7 10\n\nSample Output 3\n\n0\n\nSample Input 4\n\n1 3 3\n\nSample Output 4\n\n1", "sample_input": "4 4 6\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03705", "source_text": "Score : 200 points\n\nProblem Statement\n\nSnuke has N integers. Among them, the smallest is A, and the largest is B.\nWe are interested in the sum of those N integers. How many different possible sums there are?\n\nConstraints\n\n1 ≤ N,A,B ≤ 10^9\n\nA and B 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 the different possible sums.\n\nSample Input 1\n\n4 4 6\n\nSample Output 1\n\n5\n\nThere are five possible sums: 18=4+4+4+6, 19=4+4+5+6, 20=4+5+5+6, 21=4+5+6+6 and 22=4+6+6+6.\n\nSample Input 2\n\n5 4 3\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1 7 10\n\nSample Output 3\n\n0\n\nSample Input 4\n\n1 3 3\n\nSample Output 4\n\n1", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 564, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s496327592", "group_id": "codeNet:p03705", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n\nfunc nextInts(n int) []int {\n\tslice := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tslice[i] = nextInt()\n\t}\n\treturn slice\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn, a, b := nextInt(), nextInt(), nextInt()\n\tif a > b {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tif n-2 < 0 && a == b {\n\t\tfmt.Println(1)\n\t\treturn\n\t}\n\n\tans := int64(n-2)*(int64(b-a)) + 1\n\tfmt.Println(ans)\n}\n", "language": "Go", "metadata": {"date": 1577550167, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03705.html", "problem_id": "p03705", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03705/input.txt", "sample_output_relpath": "derived/input_output/data/p03705/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03705/Go/s496327592.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s496327592", "user_id": "u502813058"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc next() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, _ := strconv.Atoi(sc.Text())\n\treturn i\n}\n\nfunc nextInts(n int) []int {\n\tslice := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tslice[i] = nextInt()\n\t}\n\treturn slice\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\tn, a, b := nextInt(), nextInt(), nextInt()\n\tif a > b {\n\t\tfmt.Println(0)\n\t\treturn\n\t}\n\tif n-2 < 0 && a == b {\n\t\tfmt.Println(1)\n\t\treturn\n\t}\n\n\tans := int64(n-2)*(int64(b-a)) + 1\n\tfmt.Println(ans)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nSnuke has N integers. Among them, the smallest is A, and the largest is B.\nWe are interested in the sum of those N integers. How many different possible sums there are?\n\nConstraints\n\n1 ≤ N,A,B ≤ 10^9\n\nA and B 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 the different possible sums.\n\nSample Input 1\n\n4 4 6\n\nSample Output 1\n\n5\n\nThere are five possible sums: 18=4+4+4+6, 19=4+4+5+6, 20=4+5+5+6, 21=4+5+6+6 and 22=4+6+6+6.\n\nSample Input 2\n\n5 4 3\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1 7 10\n\nSample Output 3\n\n0\n\nSample Input 4\n\n1 3 3\n\nSample Output 4\n\n1", "sample_input": "4 4 6\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03705", "source_text": "Score : 200 points\n\nProblem Statement\n\nSnuke has N integers. Among them, the smallest is A, and the largest is B.\nWe are interested in the sum of those N integers. How many different possible sums there are?\n\nConstraints\n\n1 ≤ N,A,B ≤ 10^9\n\nA and B 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 the different possible sums.\n\nSample Input 1\n\n4 4 6\n\nSample Output 1\n\n5\n\nThere are five possible sums: 18=4+4+4+6, 19=4+4+5+6, 20=4+5+5+6, 21=4+5+6+6 and 22=4+6+6+6.\n\nSample Input 2\n\n5 4 3\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1 7 10\n\nSample Output 3\n\n0\n\nSample Input 4\n\n1 3 3\n\nSample Output 4\n\n1", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s225916526", "group_id": "codeNet:p03705", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tN, A, B := nextInt(), nextInt(), nextInt()\n\tif A > B {\n\t\tfmt.Println(0)\n\t} else if N == 1 {\n\t\tif A == B {\n\t\t\tfmt.Println(1)\n\t\t} else {\n\t\t\tfmt.Println(0)\n\t\t}\n\t} else {\n\t\tfmt.Println((N-2)*(B-A) + 1)\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1565987428, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03705.html", "problem_id": "p03705", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03705/input.txt", "sample_output_relpath": "derived/input_output/data/p03705/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03705/Go/s225916526.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s225916526", "user_id": "u710190793"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextInt() int {\n\tsc.Scan()\n\ti, e := strconv.Atoi(sc.Text())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc main() {\n\tsc.Split(bufio.ScanWords)\n\n\tN, A, B := nextInt(), nextInt(), nextInt()\n\tif A > B {\n\t\tfmt.Println(0)\n\t} else if N == 1 {\n\t\tif A == B {\n\t\t\tfmt.Println(1)\n\t\t} else {\n\t\t\tfmt.Println(0)\n\t\t}\n\t} else {\n\t\tfmt.Println((N-2)*(B-A) + 1)\n\t}\n\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nSnuke has N integers. Among them, the smallest is A, and the largest is B.\nWe are interested in the sum of those N integers. How many different possible sums there are?\n\nConstraints\n\n1 ≤ N,A,B ≤ 10^9\n\nA and B 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 the different possible sums.\n\nSample Input 1\n\n4 4 6\n\nSample Output 1\n\n5\n\nThere are five possible sums: 18=4+4+4+6, 19=4+4+5+6, 20=4+5+5+6, 21=4+5+6+6 and 22=4+6+6+6.\n\nSample Input 2\n\n5 4 3\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1 7 10\n\nSample Output 3\n\n0\n\nSample Input 4\n\n1 3 3\n\nSample Output 4\n\n1", "sample_input": "4 4 6\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03705", "source_text": "Score : 200 points\n\nProblem Statement\n\nSnuke has N integers. Among them, the smallest is A, and the largest is B.\nWe are interested in the sum of those N integers. How many different possible sums there are?\n\nConstraints\n\n1 ≤ N,A,B ≤ 10^9\n\nA and B 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 the different possible sums.\n\nSample Input 1\n\n4 4 6\n\nSample Output 1\n\n5\n\nThere are five possible sums: 18=4+4+4+6, 19=4+4+5+6, 20=4+5+5+6, 21=4+5+6+6 and 22=4+6+6+6.\n\nSample Input 2\n\n5 4 3\n\nSample Output 2\n\n0\n\nSample Input 3\n\n1 7 10\n\nSample Output 3\n\n0\n\nSample Input 4\n\n1 3 3\n\nSample Output 4\n\n1", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 450, "cpu_time_ms": 1, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s858168211", "group_id": "codeNet:p03714", "input_text": "/*\nURL:\nhttps://atcoder.jp/contests/abc062/tasks/arc074_b\n*/\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n/********** FAU standard libraries **********/\n\n//fmt.Sprintf(\"%b\\n\", 255) \t// binary expression\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := ZeroPaddingRuneSlice(num, 32)\n//str := PrintIntsLine(X...)\n\n/*******************************************************************/\n\nconst (\n\t// General purpose\n\tMOD = 1000000000 + 7\n\tALPHABET_NUM = 26\n\tINF_INT64 = math.MaxInt64\n\tINF_BIT60 = 1 << 60\n\tINF_INT32 = math.MaxInt32\n\tINF_BIT30 = 1 << 30\n\tNIL = -1\n\n\t// for dijkstra, prim, and so on\n\tWHITE = 0\n\tGRAY = 1\n\tBLACK = 2\n)\n\nfunc init() {\n\t// bufio.ScanWords <---> bufio.ScanLines\n\tReadString = newReadString(os.Stdin, bufio.ScanWords)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nvar (\n\tn int\n\tA []int\n\n\tused [300000 + 50]bool\n\tbefSums [300000 + 50]int\n\taftSums [300000 + 50]int\n)\n\nfunc main() {\n\tn = ReadInt()\n\tA = ReadIntSlice(n * 3)\n\n\tbefPQ, aftPQ := NewBeforePQ(), NewAfterPQ()\n\n\tbefSum, aftSum := 0, 0\n\n\tfor i := 0; i < n; i++ {\n\t\tbefPQ.push(&Before{pri: A[i]})\n\t\tbefSum += A[i]\n\t\tused[i] = true\n\t}\n\tbefSums[n-1] = befSum\n\tfor i := n; i < 2*n; i++ {\n\t\tbp := befPQ.pop()\n\t\tif bp.pri < A[i] {\n\t\t\t// 交換\n\t\t\tbefSum -= bp.pri\n\t\t\tbefSum += A[i]\n\t\t\tbefPQ.push(&Before{pri: A[i]})\n\t\t} else {\n\t\t\t// もとに戻す\n\t\t\tbefPQ.push(bp)\n\t\t}\n\n\t\tbefSums[i] = befSum\n\t}\n\n\tfor i := 2 * n; i < 3*n; i++ {\n\t\taftPQ.push(&After{pri: A[i]})\n\t\taftSum += A[i]\n\t\tused[i] = true\n\t}\n\taftSums[2*n-1] = aftSum\n\tfor i := 2*n - 1; i >= n; i-- {\n\t\tap := aftPQ.pop()\n\t\tif ap.pri > A[i] {\n\t\t\t// 交換\n\t\t\taftSum -= ap.pri\n\t\t\taftSum += A[i]\n\t\t\taftPQ.push(&After{pri: A[i]})\n\t\t} else {\n\t\t\t// もとに戻す\n\t\t\taftPQ.push(ap)\n\t\t}\n\n\t\taftSums[i-1] = aftSum\n\t}\n\n\tans := -INF_BIT60\n\tfor i := n - 1; i < 2*n; i++ {\n\t\tChMax(&ans, befSums[i]-aftSums[i])\n\t}\n\tfmt.Println(ans)\n}\n\n// ChMax accepts a pointer of integer and a target value.\n// If target value is LARGER than the first argument,\n//\tthen the first argument will be updated by the second argument.\nfunc ChMax(updatedValue *int, target int) bool {\n\tif *updatedValue < target {\n\t\t*updatedValue = target\n\t\treturn true\n\t}\n\treturn false\n}\n\ntype After struct {\n\tpri int\n}\ntype AfterPQ []*After\n\n// Interfaces\nfunc NewAfterPQ() *AfterPQ {\n\ttemp := make(AfterPQ, 0)\n\tpq := &temp\n\theap.Init(pq)\n\n\treturn pq\n}\nfunc (pq *AfterPQ) push(target *After) {\n\theap.Push(pq, target)\n}\nfunc (pq *AfterPQ) pop() *After {\n\treturn heap.Pop(pq).(*After)\n}\n\nfunc (pq AfterPQ) Len() int { return len(pq) }\nfunc (pq AfterPQ) Less(i, j int) bool { return pq[i].pri > pq[j].pri } // <: ASC, >: DESC\nfunc (pq AfterPQ) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n}\nfunc (pq *AfterPQ) Push(x interface{}) {\n\titem := x.(*After)\n\t*pq = append(*pq, item)\n}\nfunc (pq *AfterPQ) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\ntype Before struct {\n\tpri int\n}\ntype BeforePQ []*Before\n\n// Interfaces\nfunc NewBeforePQ() *BeforePQ {\n\ttemp := make(BeforePQ, 0)\n\tpq := &temp\n\theap.Init(pq)\n\n\treturn pq\n}\nfunc (pq *BeforePQ) push(target *Before) {\n\theap.Push(pq, target)\n}\nfunc (pq *BeforePQ) pop() *Before {\n\treturn heap.Pop(pq).(*Before)\n}\n\nfunc (pq BeforePQ) Len() int { return len(pq) }\nfunc (pq BeforePQ) Less(i, j int) bool { return pq[i].pri < pq[j].pri } // <: ASC, >: DESC\nfunc (pq BeforePQ) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n}\nfunc (pq *BeforePQ) Push(x interface{}) {\n\titem := x.(*Before)\n\t*pq = append(*pq, item)\n}\nfunc (pq *BeforePQ) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\n/*******************************************************************/\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\n\tr.Split(sf)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\nfunc ReadInt2() (int, int) {\n\treturn int(readInt64()), int(readInt64())\n}\nfunc ReadInt3() (int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64())\n}\nfunc ReadInt4() (int, int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())\n}\n\n// ReadInt64 returns as integer as int64.\nfunc ReadInt64() int64 {\n\treturn readInt64()\n}\nfunc ReadInt64_2() (int64, int64) {\n\treturn readInt64(), readInt64()\n}\nfunc ReadInt64_3() (int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64()\n}\nfunc ReadInt64_4() (int64, int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64(), readInt64()\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadInt64Slice returns as int64 slice that has n integers.\nfunc ReadInt64Slice(n int) []int64 {\n\tb := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt64()\n\t}\n\treturn b\n}\n\n// ReadFloat64 returns an float64.\nfunc ReadFloat64() float64 {\n\treturn float64(readFloat64())\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(ReadString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// ReadFloatSlice returns an float64 slice that has n float64.\nfunc ReadFloat64Slice(n int) []float64 {\n\tb := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadFloat64()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n/*********** Debugging ***********/\n\n// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.\n// For debugging use.\nfunc ZeroPaddingRuneSlice(n, digitsNum int) []rune {\n\tsn := fmt.Sprintf(\"%b\", n)\n\n\tresidualLength := digitsNum - len(sn)\n\tif residualLength <= 0 {\n\t\treturn []rune(sn)\n\t}\n\n\tzeros := make([]rune, residualLength)\n\tfor i := 0; i < len(zeros); i++ {\n\t\tzeros[i] = '0'\n\t}\n\n\tres := []rune{}\n\tres = append(res, zeros...)\n\tres = append(res, []rune(sn)...)\n\n\treturn res\n}\n\n// Strtoi is a wrapper of strconv.Atoi().\n// If strconv.Atoi() returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintIntsLine(A ...int) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.Itoa(A[i])\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintInts64Line(A ...int64) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.FormatInt(A[i], 10) // 64bit int version\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)\nfunc PrintfDebug(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\n}\n\n// PrintfBufStdout is function for output strings to buffered os.Stdout.\n// You may have to call stdout.Flush() finally.\nfunc PrintfBufStdout(format string, a ...interface{}) {\n\tfmt.Fprintf(stdout, format, a...)\n}\n", "language": "Go", "metadata": {"date": 1588520601, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03714.html", "problem_id": "p03714", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03714/input.txt", "sample_output_relpath": "derived/input_output/data/p03714/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03714/Go/s858168211.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s858168211", "user_id": "u103600314"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "/*\nURL:\nhttps://atcoder.jp/contests/abc062/tasks/arc074_b\n*/\n\npackage main\n\nimport (\n\t\"bufio\"\n\t\"container/heap\"\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\n/********** FAU standard libraries **********/\n\n//fmt.Sprintf(\"%b\\n\", 255) \t// binary expression\n\n/********** I/O usage **********/\n\n//str := ReadString()\n//i := ReadInt()\n//X := ReadIntSlice(n)\n//S := ReadRuneSlice()\n//a := ReadFloat64()\n//A := ReadFloat64Slice(n)\n\n//str := ZeroPaddingRuneSlice(num, 32)\n//str := PrintIntsLine(X...)\n\n/*******************************************************************/\n\nconst (\n\t// General purpose\n\tMOD = 1000000000 + 7\n\tALPHABET_NUM = 26\n\tINF_INT64 = math.MaxInt64\n\tINF_BIT60 = 1 << 60\n\tINF_INT32 = math.MaxInt32\n\tINF_BIT30 = 1 << 30\n\tNIL = -1\n\n\t// for dijkstra, prim, and so on\n\tWHITE = 0\n\tGRAY = 1\n\tBLACK = 2\n)\n\nfunc init() {\n\t// bufio.ScanWords <---> bufio.ScanLines\n\tReadString = newReadString(os.Stdin, bufio.ScanWords)\n\tstdout = bufio.NewWriter(os.Stdout)\n}\n\nvar (\n\tn int\n\tA []int\n\n\tused [300000 + 50]bool\n\tbefSums [300000 + 50]int\n\taftSums [300000 + 50]int\n)\n\nfunc main() {\n\tn = ReadInt()\n\tA = ReadIntSlice(n * 3)\n\n\tbefPQ, aftPQ := NewBeforePQ(), NewAfterPQ()\n\n\tbefSum, aftSum := 0, 0\n\n\tfor i := 0; i < n; i++ {\n\t\tbefPQ.push(&Before{pri: A[i]})\n\t\tbefSum += A[i]\n\t\tused[i] = true\n\t}\n\tbefSums[n-1] = befSum\n\tfor i := n; i < 2*n; i++ {\n\t\tbp := befPQ.pop()\n\t\tif bp.pri < A[i] {\n\t\t\t// 交換\n\t\t\tbefSum -= bp.pri\n\t\t\tbefSum += A[i]\n\t\t\tbefPQ.push(&Before{pri: A[i]})\n\t\t} else {\n\t\t\t// もとに戻す\n\t\t\tbefPQ.push(bp)\n\t\t}\n\n\t\tbefSums[i] = befSum\n\t}\n\n\tfor i := 2 * n; i < 3*n; i++ {\n\t\taftPQ.push(&After{pri: A[i]})\n\t\taftSum += A[i]\n\t\tused[i] = true\n\t}\n\taftSums[2*n-1] = aftSum\n\tfor i := 2*n - 1; i >= n; i-- {\n\t\tap := aftPQ.pop()\n\t\tif ap.pri > A[i] {\n\t\t\t// 交換\n\t\t\taftSum -= ap.pri\n\t\t\taftSum += A[i]\n\t\t\taftPQ.push(&After{pri: A[i]})\n\t\t} else {\n\t\t\t// もとに戻す\n\t\t\taftPQ.push(ap)\n\t\t}\n\n\t\taftSums[i-1] = aftSum\n\t}\n\n\tans := -INF_BIT60\n\tfor i := n - 1; i < 2*n; i++ {\n\t\tChMax(&ans, befSums[i]-aftSums[i])\n\t}\n\tfmt.Println(ans)\n}\n\n// ChMax accepts a pointer of integer and a target value.\n// If target value is LARGER than the first argument,\n//\tthen the first argument will be updated by the second argument.\nfunc ChMax(updatedValue *int, target int) bool {\n\tif *updatedValue < target {\n\t\t*updatedValue = target\n\t\treturn true\n\t}\n\treturn false\n}\n\ntype After struct {\n\tpri int\n}\ntype AfterPQ []*After\n\n// Interfaces\nfunc NewAfterPQ() *AfterPQ {\n\ttemp := make(AfterPQ, 0)\n\tpq := &temp\n\theap.Init(pq)\n\n\treturn pq\n}\nfunc (pq *AfterPQ) push(target *After) {\n\theap.Push(pq, target)\n}\nfunc (pq *AfterPQ) pop() *After {\n\treturn heap.Pop(pq).(*After)\n}\n\nfunc (pq AfterPQ) Len() int { return len(pq) }\nfunc (pq AfterPQ) Less(i, j int) bool { return pq[i].pri > pq[j].pri } // <: ASC, >: DESC\nfunc (pq AfterPQ) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n}\nfunc (pq *AfterPQ) Push(x interface{}) {\n\titem := x.(*After)\n\t*pq = append(*pq, item)\n}\nfunc (pq *AfterPQ) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\ntype Before struct {\n\tpri int\n}\ntype BeforePQ []*Before\n\n// Interfaces\nfunc NewBeforePQ() *BeforePQ {\n\ttemp := make(BeforePQ, 0)\n\tpq := &temp\n\theap.Init(pq)\n\n\treturn pq\n}\nfunc (pq *BeforePQ) push(target *Before) {\n\theap.Push(pq, target)\n}\nfunc (pq *BeforePQ) pop() *Before {\n\treturn heap.Pop(pq).(*Before)\n}\n\nfunc (pq BeforePQ) Len() int { return len(pq) }\nfunc (pq BeforePQ) Less(i, j int) bool { return pq[i].pri < pq[j].pri } // <: ASC, >: DESC\nfunc (pq BeforePQ) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n}\nfunc (pq *BeforePQ) Push(x interface{}) {\n\titem := x.(*Before)\n\t*pq = append(*pq, item)\n}\nfunc (pq *BeforePQ) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\n/*******************************************************************/\n\n/*********** I/O ***********/\n\nvar (\n\t// ReadString returns a WORD string.\n\tReadString func() string\n\tstdout *bufio.Writer\n)\n\nfunc newReadString(ior io.Reader, sf bufio.SplitFunc) func() string {\n\tr := bufio.NewScanner(ior)\n\tr.Buffer(make([]byte, 1024), int(1e+9)) // for Codeforces\n\tr.Split(sf)\n\n\treturn func() string {\n\t\tif !r.Scan() {\n\t\t\tpanic(\"Scan failed\")\n\t\t}\n\t\treturn r.Text()\n\t}\n}\n\n// ReadInt returns an integer.\nfunc ReadInt() int {\n\treturn int(readInt64())\n}\nfunc ReadInt2() (int, int) {\n\treturn int(readInt64()), int(readInt64())\n}\nfunc ReadInt3() (int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64())\n}\nfunc ReadInt4() (int, int, int, int) {\n\treturn int(readInt64()), int(readInt64()), int(readInt64()), int(readInt64())\n}\n\n// ReadInt64 returns as integer as int64.\nfunc ReadInt64() int64 {\n\treturn readInt64()\n}\nfunc ReadInt64_2() (int64, int64) {\n\treturn readInt64(), readInt64()\n}\nfunc ReadInt64_3() (int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64()\n}\nfunc ReadInt64_4() (int64, int64, int64, int64) {\n\treturn readInt64(), readInt64(), readInt64(), readInt64()\n}\n\nfunc readInt64() int64 {\n\ti, err := strconv.ParseInt(ReadString(), 0, 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn i\n}\n\n// ReadIntSlice returns an integer slice that has n integers.\nfunc ReadIntSlice(n int) []int {\n\tb := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt()\n\t}\n\treturn b\n}\n\n// ReadInt64Slice returns as int64 slice that has n integers.\nfunc ReadInt64Slice(n int) []int64 {\n\tb := make([]int64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadInt64()\n\t}\n\treturn b\n}\n\n// ReadFloat64 returns an float64.\nfunc ReadFloat64() float64 {\n\treturn float64(readFloat64())\n}\n\nfunc readFloat64() float64 {\n\tf, err := strconv.ParseFloat(ReadString(), 64)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\treturn f\n}\n\n// ReadFloatSlice returns an float64 slice that has n float64.\nfunc ReadFloat64Slice(n int) []float64 {\n\tb := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tb[i] = ReadFloat64()\n\t}\n\treturn b\n}\n\n// ReadRuneSlice returns a rune slice.\nfunc ReadRuneSlice() []rune {\n\treturn []rune(ReadString())\n}\n\n/*********** Debugging ***********/\n\n// ZeroPaddingRuneSlice returns binary expressions of integer n with zero padding.\n// For debugging use.\nfunc ZeroPaddingRuneSlice(n, digitsNum int) []rune {\n\tsn := fmt.Sprintf(\"%b\", n)\n\n\tresidualLength := digitsNum - len(sn)\n\tif residualLength <= 0 {\n\t\treturn []rune(sn)\n\t}\n\n\tzeros := make([]rune, residualLength)\n\tfor i := 0; i < len(zeros); i++ {\n\t\tzeros[i] = '0'\n\t}\n\n\tres := []rune{}\n\tres = append(res, zeros...)\n\tres = append(res, []rune(sn)...)\n\n\treturn res\n}\n\n// Strtoi is a wrapper of strconv.Atoi().\n// If strconv.Atoi() returns an error, Strtoi calls panic.\nfunc Strtoi(s string) int {\n\tif i, err := strconv.Atoi(s); err != nil {\n\t\tpanic(errors.New(\"[argument error]: Strtoi only accepts integer string\"))\n\t} else {\n\t\treturn i\n\t}\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintIntsLine(A ...int) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.Itoa(A[i])\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintIntsLine returns integers string delimited by a space.\nfunc PrintInts64Line(A ...int64) string {\n\tres := []rune{}\n\n\tfor i := 0; i < len(A); i++ {\n\t\tstr := strconv.FormatInt(A[i], 10) // 64bit int version\n\t\tres = append(res, []rune(str)...)\n\n\t\tif i != len(A)-1 {\n\t\t\tres = append(res, ' ')\n\t\t}\n\t}\n\n\treturn string(res)\n}\n\n// PrintfDebug is wrapper of fmt.Fprintf(os.Stderr, format, a...)\nfunc PrintfDebug(format string, a ...interface{}) {\n\tfmt.Fprintf(os.Stderr, format, a...)\n}\n\n// PrintfBufStdout is function for output strings to buffered os.Stdout.\n// You may have to call stdout.Flush() finally.\nfunc PrintfBufStdout(format string, a ...interface{}) {\n\tfmt.Fprintf(stdout, format, a...)\n}\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": "p03714", "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": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 7820, "cpu_time_ms": 270, "memory_kb": 14080}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s906195684", "group_id": "codeNet:p03714", "input_text": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"fmt\"\n \"container/heap\"\n\n)\n\n/*********** PriorityQueue ***********/\ntype PriorityQueue struct {\n arr []interface{}\n comps []CompFunc\n}\n\n/*\np < q ... -1\np == q ... 0\np > q ... 1\n*/\ntype CompFunc func(p, q interface{}) int\n\nfunc NewPriorityQueue() *PriorityQueue {\n return new(PriorityQueue)\n}\n\nfunc (pq PriorityQueue) Len() int {\n return len(pq.arr)\n}\n\nfunc (pq PriorityQueue) Swap(i, j int) {\n pq.arr[i], pq.arr[j] = pq.arr[j], pq.arr[i]\n}\n\nfunc (pq PriorityQueue) Less(i, j int) bool{\n for _, comp := range pq.comps {\n result := comp(pq.arr[i], pq.arr[j])\n switch result {\n case -1: return true\n case 1: return false\n case 0: continue\n }\n }\n return true\n}\n\nfunc (pq *PriorityQueue) Push(x interface{}) {\n pq.arr = append(pq.arr, x)\n}\n\nfunc (pq *PriorityQueue) Pop() interface{} {\n n := pq.Len()\n item := pq.arr[n - 1]\n pq.arr = pq.arr[:n - 1]\n return item\n}\n\nfunc (pq *PriorityQueue) IsEmpty() bool {\n return pq.Len() == 0\n}\n\n/* input */\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc readInt() int {\n sc.Scan()\n n, _ := strconv.Atoi(sc.Text())\n return n\n}\n\nfunc main() {\n sc.Split(bufio.ScanWords)\n comp := func(p, q interface{}) int {\n if p.(int) < q.(int) {\n return -1\n } else if p.(int) == q.(int) {\n return 0\n } else {\n return 1\n }\n }\n n := readInt()\n preQue := new(PriorityQueue)\n preQue.comps = append(preQue.comps, comp)\n sufQue := new(PriorityQueue)\n sufQue.comps = append(sufQue.comps, comp)\n mid := make([]int, n)\n var preScore, sufScore int\n preScores := make([]int, n + 1)\n sufScores := make([]int, n + 1)\n for i := 0; i < n; i++ {\n v := readInt()\n preScore += v\n heap.Push(preQue, v)\n }\n for i := 0; i < n; i++ {\n mid[i] = readInt()\n }\n for i := 0; i < n; i++ {\n v := -readInt()\n sufScore += v\n heap.Push(sufQue, v)\n }\n \n preScores[0] = preScore\n for i, m := range mid {\n v := heap.Pop(preQue).(int)\n if v < m {\n preScore += (m - v)\n heap.Push(preQue, m)\n } else {\n heap.Push(preQue, v)\n }\n preScores[i + 1] = preScore\n }\n\n sufScores[0] = sufScore\n for i := n - 1; i >= 0; i-- {\n m := mid[i]\n v := heap.Pop(sufQue).(int)\n if -v > m {\n sufScore += -v - m\n heap.Push(sufQue, -m)\n } else {\n heap.Push(sufQue, v)\n }\n sufScores[n - i] = sufScore\n }\n ans := -10000000000000000\n for i := 0; i <= n; i++ {\n score := preScores[i] + sufScores[n - i]\n if ans < score {\n ans = score\n }\n }\n fmt.Println(ans)\n}", "language": "Go", "metadata": {"date": 1548625839, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03714.html", "problem_id": "p03714", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03714/input.txt", "sample_output_relpath": "derived/input_output/data/p03714/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03714/Go/s906195684.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s906195684", "user_id": "u145035045"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n \"bufio\"\n \"os\"\n \"strconv\"\n \"fmt\"\n \"container/heap\"\n\n)\n\n/*********** PriorityQueue ***********/\ntype PriorityQueue struct {\n arr []interface{}\n comps []CompFunc\n}\n\n/*\np < q ... -1\np == q ... 0\np > q ... 1\n*/\ntype CompFunc func(p, q interface{}) int\n\nfunc NewPriorityQueue() *PriorityQueue {\n return new(PriorityQueue)\n}\n\nfunc (pq PriorityQueue) Len() int {\n return len(pq.arr)\n}\n\nfunc (pq PriorityQueue) Swap(i, j int) {\n pq.arr[i], pq.arr[j] = pq.arr[j], pq.arr[i]\n}\n\nfunc (pq PriorityQueue) Less(i, j int) bool{\n for _, comp := range pq.comps {\n result := comp(pq.arr[i], pq.arr[j])\n switch result {\n case -1: return true\n case 1: return false\n case 0: continue\n }\n }\n return true\n}\n\nfunc (pq *PriorityQueue) Push(x interface{}) {\n pq.arr = append(pq.arr, x)\n}\n\nfunc (pq *PriorityQueue) Pop() interface{} {\n n := pq.Len()\n item := pq.arr[n - 1]\n pq.arr = pq.arr[:n - 1]\n return item\n}\n\nfunc (pq *PriorityQueue) IsEmpty() bool {\n return pq.Len() == 0\n}\n\n/* input */\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc readInt() int {\n sc.Scan()\n n, _ := strconv.Atoi(sc.Text())\n return n\n}\n\nfunc main() {\n sc.Split(bufio.ScanWords)\n comp := func(p, q interface{}) int {\n if p.(int) < q.(int) {\n return -1\n } else if p.(int) == q.(int) {\n return 0\n } else {\n return 1\n }\n }\n n := readInt()\n preQue := new(PriorityQueue)\n preQue.comps = append(preQue.comps, comp)\n sufQue := new(PriorityQueue)\n sufQue.comps = append(sufQue.comps, comp)\n mid := make([]int, n)\n var preScore, sufScore int\n preScores := make([]int, n + 1)\n sufScores := make([]int, n + 1)\n for i := 0; i < n; i++ {\n v := readInt()\n preScore += v\n heap.Push(preQue, v)\n }\n for i := 0; i < n; i++ {\n mid[i] = readInt()\n }\n for i := 0; i < n; i++ {\n v := -readInt()\n sufScore += v\n heap.Push(sufQue, v)\n }\n \n preScores[0] = preScore\n for i, m := range mid {\n v := heap.Pop(preQue).(int)\n if v < m {\n preScore += (m - v)\n heap.Push(preQue, m)\n } else {\n heap.Push(preQue, v)\n }\n preScores[i + 1] = preScore\n }\n\n sufScores[0] = sufScore\n for i := n - 1; i >= 0; i-- {\n m := mid[i]\n v := heap.Pop(sufQue).(int)\n if -v > m {\n sufScore += -v - m\n heap.Push(sufQue, -m)\n } else {\n heap.Push(sufQue, v)\n }\n sufScores[n - i] = sufScore\n }\n ans := -10000000000000000\n for i := 0; i <= n; i++ {\n score := preScores[i] + sufScores[n - i]\n if ans < score {\n ans = score\n }\n }\n fmt.Println(ans)\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": "p03714", "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": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2850, "cpu_time_ms": 1091, "memory_kb": 18708}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s463496673", "group_id": "codeNet:p03814", "input_text": "package main\n \nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n \nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n \t\n \thead := strings.Index(s, \"A\")\n \tend := strings.LastIndex(s, \"Z\")\n \n \tans := end - head + 1\n\tfmt.Printf(\"%d\\n\", ans)\n}", "language": "Go", "metadata": {"date": 1600436862, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p03814.html", "problem_id": "p03814", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03814/input.txt", "sample_output_relpath": "derived/input_output/data/p03814/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03814/Go/s463496673.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s463496673", "user_id": "u903153704"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n \nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n \nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n \t\n \thead := strings.Index(s, \"A\")\n \tend := strings.LastIndex(s, \"Z\")\n \n \tans := end - head + 1\n\tfmt.Printf(\"%d\\n\", ans)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nSnuke has decided to construct a string that starts with A and ends with Z, by taking out a substring of a string s (that is, a consecutive part of s).\n\nFind the greatest length of the string Snuke can construct. Here, the test set guarantees that there always exists a substring of s that starts with A and ends with Z.\n\nConstraints\n\n1 ≦ |s| ≦ 200{,}000\n\ns consists of uppercase English letters.\n\nThere exists a substring of s that starts with A and ends with Z.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\nQWERTYASDFZXCV\n\nSample Output 1\n\n5\n\nBy taking out the seventh through eleventh characters, it is possible to construct ASDFZ, which starts with A and ends with Z.\n\nSample Input 2\n\nZABCZ\n\nSample Output 2\n\n4\n\nSample Input 3\n\nHASFJGHOGAKZZFEGA\n\nSample Output 3\n\n12", "sample_input": "QWERTYASDFZXCV\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03814", "source_text": "Score : 200 points\n\nProblem Statement\n\nSnuke has decided to construct a string that starts with A and ends with Z, by taking out a substring of a string s (that is, a consecutive part of s).\n\nFind the greatest length of the string Snuke can construct. Here, the test set guarantees that there always exists a substring of s that starts with A and ends with Z.\n\nConstraints\n\n1 ≦ |s| ≦ 200{,}000\n\ns consists of uppercase English letters.\n\nThere exists a substring of s that starts with A and ends with Z.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\nQWERTYASDFZXCV\n\nSample Output 1\n\n5\n\nBy taking out the seventh through eleventh characters, it is possible to construct ASDFZ, which starts with A and ends with Z.\n\nSample Input 2\n\nZABCZ\n\nSample Output 2\n\n4\n\nSample Input 3\n\nHASFJGHOGAKZZFEGA\n\nSample Output 3\n\n12", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 172, "memory_kb": 3292}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s748945443", "group_id": "codeNet:p03814", "input_text": "package main\n\nimport (\n \"fmt\"\n \"strings\"\n)\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n\n findA := strings.Index(s, \"A\")\n findZ := strings.LastIndex(s, \"Z\")\n\n fmt.Println(findZ - findA + 1)\n}", "language": "Go", "metadata": {"date": 1589736933, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03814.html", "problem_id": "p03814", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03814/input.txt", "sample_output_relpath": "derived/input_output/data/p03814/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03814/Go/s748945443.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s748945443", "user_id": "u006371663"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"strings\"\n)\n\nfunc main() {\n var s string\n fmt.Scan(&s)\n\n findA := strings.Index(s, \"A\")\n findZ := strings.LastIndex(s, \"Z\")\n\n fmt.Println(findZ - findA + 1)\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nSnuke has decided to construct a string that starts with A and ends with Z, by taking out a substring of a string s (that is, a consecutive part of s).\n\nFind the greatest length of the string Snuke can construct. Here, the test set guarantees that there always exists a substring of s that starts with A and ends with Z.\n\nConstraints\n\n1 ≦ |s| ≦ 200{,}000\n\ns consists of uppercase English letters.\n\nThere exists a substring of s that starts with A and ends with Z.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\nQWERTYASDFZXCV\n\nSample Output 1\n\n5\n\nBy taking out the seventh through eleventh characters, it is possible to construct ASDFZ, which starts with A and ends with Z.\n\nSample Input 2\n\nZABCZ\n\nSample Output 2\n\n4\n\nSample Input 3\n\nHASFJGHOGAKZZFEGA\n\nSample Output 3\n\n12", "sample_input": "QWERTYASDFZXCV\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03814", "source_text": "Score : 200 points\n\nProblem Statement\n\nSnuke has decided to construct a string that starts with A and ends with Z, by taking out a substring of a string s (that is, a consecutive part of s).\n\nFind the greatest length of the string Snuke can construct. Here, the test set guarantees that there always exists a substring of s that starts with A and ends with Z.\n\nConstraints\n\n1 ≦ |s| ≦ 200{,}000\n\ns consists of uppercase English letters.\n\nThere exists a substring of s that starts with A and ends with Z.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\nQWERTYASDFZXCV\n\nSample Output 1\n\n5\n\nBy taking out the seventh through eleventh characters, it is possible to construct ASDFZ, which starts with A and ends with Z.\n\nSample Input 2\n\nZABCZ\n\nSample Output 2\n\n4\n\nSample Input 3\n\nHASFJGHOGAKZZFEGA\n\nSample Output 3\n\n12", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 112, "memory_kb": 2048}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s262086042", "group_id": "codeNet:p03814", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tfmt.Println(strings.LastIndex(s, \"Z\") - strings.Index(s, \"A\") + 1)\n}\n", "language": "Go", "metadata": {"date": 1586030734, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03814.html", "problem_id": "p03814", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03814/input.txt", "sample_output_relpath": "derived/input_output/data/p03814/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03814/Go/s262086042.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s262086042", "user_id": "u461993794"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\nfunc max(x, y int) int {\n\tif x > y {\n\t\treturn x\n\t}\n\treturn y\n}\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tfmt.Println(strings.LastIndex(s, \"Z\") - strings.Index(s, \"A\") + 1)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nSnuke has decided to construct a string that starts with A and ends with Z, by taking out a substring of a string s (that is, a consecutive part of s).\n\nFind the greatest length of the string Snuke can construct. Here, the test set guarantees that there always exists a substring of s that starts with A and ends with Z.\n\nConstraints\n\n1 ≦ |s| ≦ 200{,}000\n\ns consists of uppercase English letters.\n\nThere exists a substring of s that starts with A and ends with Z.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\nQWERTYASDFZXCV\n\nSample Output 1\n\n5\n\nBy taking out the seventh through eleventh characters, it is possible to construct ASDFZ, which starts with A and ends with Z.\n\nSample Input 2\n\nZABCZ\n\nSample Output 2\n\n4\n\nSample Input 3\n\nHASFJGHOGAKZZFEGA\n\nSample Output 3\n\n12", "sample_input": "QWERTYASDFZXCV\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03814", "source_text": "Score : 200 points\n\nProblem Statement\n\nSnuke has decided to construct a string that starts with A and ends with Z, by taking out a substring of a string s (that is, a consecutive part of s).\n\nFind the greatest length of the string Snuke can construct. Here, the test set guarantees that there always exists a substring of s that starts with A and ends with Z.\n\nConstraints\n\n1 ≦ |s| ≦ 200{,}000\n\ns consists of uppercase English letters.\n\nThere exists a substring of s that starts with A and ends with Z.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\nQWERTYASDFZXCV\n\nSample Output 1\n\n5\n\nBy taking out the seventh through eleventh characters, it is possible to construct ASDFZ, which starts with A and ends with Z.\n\nSample Input 2\n\nZABCZ\n\nSample Output 2\n\n4\n\nSample Input 3\n\nHASFJGHOGAKZZFEGA\n\nSample Output 3\n\n12", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 112, "memory_kb": 2048}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s063174018", "group_id": "codeNet:p03814", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"regexp\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tre := regexp.MustCompile(\"A.+Z\")\n\tss := re.FindString(s)\n\tfmt.Println(len(ss))\n}\n", "language": "Go", "metadata": {"date": 1576852567, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03814.html", "problem_id": "p03814", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03814/input.txt", "sample_output_relpath": "derived/input_output/data/p03814/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03814/Go/s063174018.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s063174018", "user_id": "u902409225"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"regexp\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tre := regexp.MustCompile(\"A.+Z\")\n\tss := re.FindString(s)\n\tfmt.Println(len(ss))\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nSnuke has decided to construct a string that starts with A and ends with Z, by taking out a substring of a string s (that is, a consecutive part of s).\n\nFind the greatest length of the string Snuke can construct. Here, the test set guarantees that there always exists a substring of s that starts with A and ends with Z.\n\nConstraints\n\n1 ≦ |s| ≦ 200{,}000\n\ns consists of uppercase English letters.\n\nThere exists a substring of s that starts with A and ends with Z.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\nQWERTYASDFZXCV\n\nSample Output 1\n\n5\n\nBy taking out the seventh through eleventh characters, it is possible to construct ASDFZ, which starts with A and ends with Z.\n\nSample Input 2\n\nZABCZ\n\nSample Output 2\n\n4\n\nSample Input 3\n\nHASFJGHOGAKZZFEGA\n\nSample Output 3\n\n12", "sample_input": "QWERTYASDFZXCV\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03814", "source_text": "Score : 200 points\n\nProblem Statement\n\nSnuke has decided to construct a string that starts with A and ends with Z, by taking out a substring of a string s (that is, a consecutive part of s).\n\nFind the greatest length of the string Snuke can construct. Here, the test set guarantees that there always exists a substring of s that starts with A and ends with Z.\n\nConstraints\n\n1 ≦ |s| ≦ 200{,}000\n\ns consists of uppercase English letters.\n\nThere exists a substring of s that starts with A and ends with Z.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\nQWERTYASDFZXCV\n\nSample Output 1\n\n5\n\nBy taking out the seventh through eleventh characters, it is possible to construct ASDFZ, which starts with A and ends with Z.\n\nSample Input 2\n\nZABCZ\n\nSample Output 2\n\n4\n\nSample Input 3\n\nHASFJGHOGAKZZFEGA\n\nSample Output 3\n\n12", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 132, "memory_kb": 2048}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s582851227", "group_id": "codeNet:p03814", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc main() {\n\tvar s string\n\tvar si, ei int = -1, -1\n\tfmt.Scan(&s)\n\n\tfor i :=0; i S {\n\t\tK = S\n\t}\n\tfor i := 0; i <= K; i++ {\n\t\tfor j := 0; j <= K; j++ {\n\t\t\tif k := S - (i + j); 0 <= k && k <= K {\n\t\t\t\tcnt++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(cnt)\n}\n", "language": "Go", "metadata": {"date": 1581232891, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03835.html", "problem_id": "p03835", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03835/input.txt", "sample_output_relpath": "derived/input_output/data/p03835/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03835/Go/s178173329.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s178173329", "user_id": "u363118893"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"math\"\n\t\"os\"\n\t\"strconv\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc init() {\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, math.MaxInt64)\n}\n\nfunc readInt() int {\n\tsc.Scan()\n\tr, _ := strconv.Atoi(sc.Text())\n\treturn r\n}\n\nfunc main() {\n\tvar K, S int\n\tK, S = readInt(), readInt()\n\tcnt := 0\n\tif K > S {\n\t\tK = S\n\t}\n\tfor i := 0; i <= K; i++ {\n\t\tfor j := 0; j <= K; j++ {\n\t\t\tif k := S - (i + j); 0 <= k && k <= K {\n\t\t\t\tcnt++\n\t\t\t}\n\t\t}\n\t}\n\tfmt.Println(cnt)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given two integers K and S.\n\nThree variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.\n\nHow many different assignments of values to X, Y and Z are there such that X + Y + Z = S?\n\nConstraints\n\n2≤K≤2500\n\n0≤S≤3K\n\nK and S are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nK S\n\nOutput\n\nPrint the number of the triples of X, Y and Z that satisfy the condition.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n6\n\nThere are six triples of X, Y and Z that satisfy the condition:\n\nX = 0, Y = 0, Z = 2\n\nX = 0, Y = 2, Z = 0\n\nX = 2, Y = 0, Z = 0\n\nX = 0, Y = 1, Z = 1\n\nX = 1, Y = 0, Z = 1\n\nX = 1, Y = 1, Z = 0\n\nSample Input 2\n\n5 15\n\nSample Output 2\n\n1\n\nThe maximum value of X + Y + Z is 15, achieved by one triple of X, Y and Z.", "sample_input": "2 2\n"}, "reference_outputs": ["6\n"], "source_document_id": "p03835", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given two integers K and S.\n\nThree variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.\n\nHow many different assignments of values to X, Y and Z are there such that X + Y + Z = S?\n\nConstraints\n\n2≤K≤2500\n\n0≤S≤3K\n\nK and S are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nK S\n\nOutput\n\nPrint the number of the triples of X, Y and Z that satisfy the condition.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n6\n\nThere are six triples of X, Y and Z that satisfy the condition:\n\nX = 0, Y = 0, Z = 2\n\nX = 0, Y = 2, Z = 0\n\nX = 2, Y = 0, Z = 0\n\nX = 0, Y = 1, Z = 1\n\nX = 1, Y = 0, Z = 1\n\nX = 1, Y = 1, Z = 0\n\nSample Input 2\n\n5 15\n\nSample Output 2\n\n1\n\nThe maximum value of X + Y + Z is 15, achieved by one triple of X, Y and Z.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 492, "cpu_time_ms": 7, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s621877034", "group_id": "codeNet:p03835", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\ntype contest struct {\n\tin io.Reader\n\tout io.Writer\n}\n\nfunc (con *contest) Scan(a ...interface{}) (int, error) {\n\treturn fmt.Fscan(con.in, a...)\n}\nfunc (con *contest) Scanln(a ...interface{}) (int, error) {\n\treturn fmt.Fscanln(con.in, a...)\n}\nfunc (con *contest) Scanf(f string, a ...interface{}) (int, error) {\n\treturn fmt.Fscanf(con.in, f, a...)\n}\nfunc (con *contest) Print(a ...interface{}) (int, error) {\n\treturn fmt.Fprint(con.out, a...)\n}\nfunc (con *contest) Println(a ...interface{}) (int, error) {\n\treturn fmt.Fprintln(con.out, a...)\n}\nfunc (con *contest) Printf(f string, a ...interface{}) (int, error) {\n\treturn fmt.Fprintf(con.out, f, a...)\n}\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tcon := &contest{in: in, out: out}\n\tcon.main()\n}\n\nfunc (con *contest) main() error {\n\tvar K, S int\n\tcon.Scan(&K, &S)\n\tif K > S {\n\t\tK = S\n\t}\n\tC := 0\n\tfor X := 0; X <= K; X++ {\n\t\tfor Y := 0; Y <= S-X && Y <= K; Y++ {\n\t\t\tif S-X-Y <= K {\n\t\t\t\tC++\n\t\t\t}\n\t\t}\n\t}\n\tcon.Println(C)\n\treturn nil\n}\n", "language": "Go", "metadata": {"date": 1581057628, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03835.html", "problem_id": "p03835", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03835/input.txt", "sample_output_relpath": "derived/input_output/data/p03835/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03835/Go/s621877034.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s621877034", "user_id": "u718747410"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"os\"\n)\n\ntype contest struct {\n\tin io.Reader\n\tout io.Writer\n}\n\nfunc (con *contest) Scan(a ...interface{}) (int, error) {\n\treturn fmt.Fscan(con.in, a...)\n}\nfunc (con *contest) Scanln(a ...interface{}) (int, error) {\n\treturn fmt.Fscanln(con.in, a...)\n}\nfunc (con *contest) Scanf(f string, a ...interface{}) (int, error) {\n\treturn fmt.Fscanf(con.in, f, a...)\n}\nfunc (con *contest) Print(a ...interface{}) (int, error) {\n\treturn fmt.Fprint(con.out, a...)\n}\nfunc (con *contest) Println(a ...interface{}) (int, error) {\n\treturn fmt.Fprintln(con.out, a...)\n}\nfunc (con *contest) Printf(f string, a ...interface{}) (int, error) {\n\treturn fmt.Fprintf(con.out, f, a...)\n}\nfunc main() {\n\tin := bufio.NewReader(os.Stdin)\n\tout := bufio.NewWriter(os.Stdout)\n\tdefer out.Flush()\n\tcon := &contest{in: in, out: out}\n\tcon.main()\n}\n\nfunc (con *contest) main() error {\n\tvar K, S int\n\tcon.Scan(&K, &S)\n\tif K > S {\n\t\tK = S\n\t}\n\tC := 0\n\tfor X := 0; X <= K; X++ {\n\t\tfor Y := 0; Y <= S-X && Y <= K; Y++ {\n\t\t\tif S-X-Y <= K {\n\t\t\t\tC++\n\t\t\t}\n\t\t}\n\t}\n\tcon.Println(C)\n\treturn nil\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given two integers K and S.\n\nThree variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.\n\nHow many different assignments of values to X, Y and Z are there such that X + Y + Z = S?\n\nConstraints\n\n2≤K≤2500\n\n0≤S≤3K\n\nK and S are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nK S\n\nOutput\n\nPrint the number of the triples of X, Y and Z that satisfy the condition.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n6\n\nThere are six triples of X, Y and Z that satisfy the condition:\n\nX = 0, Y = 0, Z = 2\n\nX = 0, Y = 2, Z = 0\n\nX = 2, Y = 0, Z = 0\n\nX = 0, Y = 1, Z = 1\n\nX = 1, Y = 0, Z = 1\n\nX = 1, Y = 1, Z = 0\n\nSample Input 2\n\n5 15\n\nSample Output 2\n\n1\n\nThe maximum value of X + Y + Z is 15, achieved by one triple of X, Y and Z.", "sample_input": "2 2\n"}, "reference_outputs": ["6\n"], "source_document_id": "p03835", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given two integers K and S.\n\nThree variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.\n\nHow many different assignments of values to X, Y and Z are there such that X + Y + Z = S?\n\nConstraints\n\n2≤K≤2500\n\n0≤S≤3K\n\nK and S are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nK S\n\nOutput\n\nPrint the number of the triples of X, Y and Z that satisfy the condition.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n6\n\nThere are six triples of X, Y and Z that satisfy the condition:\n\nX = 0, Y = 0, Z = 2\n\nX = 0, Y = 2, Z = 0\n\nX = 2, Y = 0, Z = 0\n\nX = 0, Y = 1, Z = 1\n\nX = 1, Y = 0, Z = 1\n\nX = 1, Y = 1, Z = 0\n\nSample Input 2\n\n5 15\n\nSample Output 2\n\n1\n\nThe maximum value of X + Y + Z is 15, achieved by one triple of X, Y and Z.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1093, "cpu_time_ms": 8, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s283592779", "group_id": "codeNet:p03835", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\n)\n\nfunc main() {\n\tvar k, s int\n\tfmt.Scanf(\"%d %d\", &k, &s)\n\n\tcount := 0\n\n\tfor x := 0; x <= k; x++ {\n\t\tfor y := x; y <= k; y++ {\n\t\t\tfor z := y; z <= k; z++ {\n\t\t\t\tif s == x + y + z {\n\t\t\t\t\tswitch compare(x, y, z) {\n\t\t\t\t\tcase \"three\":\n\t\t\t\t\t\tcount++\n\t\t\t\t\tcase \"two\":\n\t\t\t\t\t\tcount += 3\n\t\t\t\t\tcase \"diff\":\n\t\t\t\t\t\tcount += 6\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} \n\t\t}\n\t}\n}\n\nfunc compare(x, y, z int) string {\n\tif z == y || y == x {\n\t\tif z == x {\n\t\t\treturn \"three\"\n\t\t}\n\t\treturn \"two\"\n\t}\n\treturn \"diff\"\n} ", "language": "Go", "metadata": {"date": 1580695088, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03835.html", "problem_id": "p03835", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03835/input.txt", "sample_output_relpath": "derived/input_output/data/p03835/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03835/Go/s283592779.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s283592779", "user_id": "u449989979"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\n)\n\nfunc main() {\n\tvar k, s int\n\tfmt.Scanf(\"%d %d\", &k, &s)\n\n\tcount := 0\n\n\tfor x := 0; x <= k; x++ {\n\t\tfor y := x; y <= k; y++ {\n\t\t\tfor z := y; z <= k; z++ {\n\t\t\t\tif s == x + y + z {\n\t\t\t\t\tswitch compare(x, y, z) {\n\t\t\t\t\tcase \"three\":\n\t\t\t\t\t\tcount++\n\t\t\t\t\tcase \"two\":\n\t\t\t\t\t\tcount += 3\n\t\t\t\t\tcase \"diff\":\n\t\t\t\t\t\tcount += 6\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} \n\t\t}\n\t}\n}\n\nfunc compare(x, y, z int) string {\n\tif z == y || y == x {\n\t\tif z == x {\n\t\t\treturn \"three\"\n\t\t}\n\t\treturn \"two\"\n\t}\n\treturn \"diff\"\n} ", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given two integers K and S.\n\nThree variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.\n\nHow many different assignments of values to X, Y and Z are there such that X + Y + Z = S?\n\nConstraints\n\n2≤K≤2500\n\n0≤S≤3K\n\nK and S are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nK S\n\nOutput\n\nPrint the number of the triples of X, Y and Z that satisfy the condition.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n6\n\nThere are six triples of X, Y and Z that satisfy the condition:\n\nX = 0, Y = 0, Z = 2\n\nX = 0, Y = 2, Z = 0\n\nX = 2, Y = 0, Z = 0\n\nX = 0, Y = 1, Z = 1\n\nX = 1, Y = 0, Z = 1\n\nX = 1, Y = 1, Z = 0\n\nSample Input 2\n\n5 15\n\nSample Output 2\n\n1\n\nThe maximum value of X + Y + Z is 15, achieved by one triple of X, Y and Z.", "sample_input": "2 2\n"}, "reference_outputs": ["6\n"], "source_document_id": "p03835", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given two integers K and S.\n\nThree variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.\n\nHow many different assignments of values to X, Y and Z are there such that X + Y + Z = S?\n\nConstraints\n\n2≤K≤2500\n\n0≤S≤3K\n\nK and S are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nK S\n\nOutput\n\nPrint the number of the triples of X, Y and Z that satisfy the condition.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n6\n\nThere are six triples of X, Y and Z that satisfy the condition:\n\nX = 0, Y = 0, Z = 2\n\nX = 0, Y = 2, Z = 0\n\nX = 2, Y = 0, Z = 0\n\nX = 0, Y = 1, Z = 1\n\nX = 1, Y = 0, Z = 1\n\nX = 1, Y = 1, Z = 0\n\nSample Input 2\n\n5 15\n\nSample Output 2\n\n1\n\nThe maximum value of X + Y + Z is 15, achieved by one triple of X, Y and Z.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2107, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s401459020", "group_id": "codeNet:p03835", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tk, s := getInt(), getInt()\n\tm := min(k, s)\n\n\tans := 0\n\tfor x := 0; x <= m; x++ {\n\t\tfor y := 0; y <= m; y++ {\n\t\t\tz := s - (x + y)\n\t\t\tif (z >= 0) && (z <= k) {\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Fprintln(wr, ans)\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// -----------------------------------------\n\nconst (\n\tinf = 1 << 60\n\t// mod = 1000000007\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twr = bufio.NewWriter(os.Stdout)\n)\n\nfunc main() {\n\t// buf := 200001\n\t// sc.Buffer(make([]byte, buf), buf)\n\tsc.Split(bufio.ScanWords)\n\tsolve()\n\twr.Flush()\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc getIntSlice(n int) []int {\n\tis := make([]int, n)\n\tfor i := range is {\n\t\tis[i] = getInt()\n\t}\n\treturn is\n}\n\nfunc getString() string {\n\tsc.Scan()\n\ts := sc.Text()\n\treturn s\n}\n\nfunc getRunes() []rune {\n\treturn []rune(getString())\n}\n", "language": "Go", "metadata": {"date": 1574737603, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03835.html", "problem_id": "p03835", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03835/input.txt", "sample_output_relpath": "derived/input_output/data/p03835/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03835/Go/s401459020.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s401459020", "user_id": "u543933043"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\tk, s := getInt(), getInt()\n\tm := min(k, s)\n\n\tans := 0\n\tfor x := 0; x <= m; x++ {\n\t\tfor y := 0; y <= m; y++ {\n\t\t\tz := s - (x + y)\n\t\t\tif (z >= 0) && (z <= k) {\n\t\t\t\tans++\n\t\t\t}\n\t\t}\n\t}\n\n\tfmt.Fprintln(wr, ans)\n}\n\nfunc min(a, b int) int {\n\tif a < b {\n\t\treturn a\n\t}\n\treturn b\n}\n\nfunc max(a, b int) int {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n// -----------------------------------------\n\nconst (\n\tinf = 1 << 60\n\t// mod = 1000000007\n)\n\nvar (\n\tsc = bufio.NewScanner(os.Stdin)\n\twr = bufio.NewWriter(os.Stdout)\n)\n\nfunc main() {\n\t// buf := 200001\n\t// sc.Buffer(make([]byte, buf), buf)\n\tsc.Split(bufio.ScanWords)\n\tsolve()\n\twr.Flush()\n}\n\nfunc getInt() int {\n\tsc.Scan()\n\ti, err := strconv.Atoi(sc.Text())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn i\n}\n\nfunc getIntSlice(n int) []int {\n\tis := make([]int, n)\n\tfor i := range is {\n\t\tis[i] = getInt()\n\t}\n\treturn is\n}\n\nfunc getString() string {\n\tsc.Scan()\n\ts := sc.Text()\n\treturn s\n}\n\nfunc getRunes() []rune {\n\treturn []rune(getString())\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given two integers K and S.\n\nThree variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.\n\nHow many different assignments of values to X, Y and Z are there such that X + Y + Z = S?\n\nConstraints\n\n2≤K≤2500\n\n0≤S≤3K\n\nK and S are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nK S\n\nOutput\n\nPrint the number of the triples of X, Y and Z that satisfy the condition.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n6\n\nThere are six triples of X, Y and Z that satisfy the condition:\n\nX = 0, Y = 0, Z = 2\n\nX = 0, Y = 2, Z = 0\n\nX = 2, Y = 0, Z = 0\n\nX = 0, Y = 1, Z = 1\n\nX = 1, Y = 0, Z = 1\n\nX = 1, Y = 1, Z = 0\n\nSample Input 2\n\n5 15\n\nSample Output 2\n\n1\n\nThe maximum value of X + Y + Z is 15, achieved by one triple of X, Y and Z.", "sample_input": "2 2\n"}, "reference_outputs": ["6\n"], "source_document_id": "p03835", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given two integers K and S.\n\nThree variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.\n\nHow many different assignments of values to X, Y and Z are there such that X + Y + Z = S?\n\nConstraints\n\n2≤K≤2500\n\n0≤S≤3K\n\nK and S are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nK S\n\nOutput\n\nPrint the number of the triples of X, Y and Z that satisfy the condition.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n6\n\nThere are six triples of X, Y and Z that satisfy the condition:\n\nX = 0, Y = 0, Z = 2\n\nX = 0, Y = 2, Z = 0\n\nX = 2, Y = 0, Z = 0\n\nX = 0, Y = 1, Z = 1\n\nX = 1, Y = 0, Z = 1\n\nX = 1, Y = 1, Z = 0\n\nSample Input 2\n\n5 15\n\nSample Output 2\n\n1\n\nThe maximum value of X + Y + Z is 15, achieved by one triple of X, Y and Z.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1043, "cpu_time_ms": 8, "memory_kb": 640}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s773822689", "group_id": "codeNet:p03835", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar K, S int\n\tfmt.Scan(&K, &S)\n\tvar count int\n\tfor i := 0; i <= K; i++ {\n\t\tif K > S || K * 3 < S {\n\t\t\tbreak\n\t\t}\n\t\tfor j := 0; j <= K; j++ {\n\t\t\tif i + j + S == S {\n\t\t\t\tcount++\n\t\t\t} \n\t\t}\n\n\t}\n\tfmt.Println(count)\n}\n", "language": "Go", "metadata": {"date": 1568920318, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03835.html", "problem_id": "p03835", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03835/input.txt", "sample_output_relpath": "derived/input_output/data/p03835/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03835/Go/s773822689.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s773822689", "user_id": "u175397141"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main(){\n\tvar K, S int\n\tfmt.Scan(&K, &S)\n\tvar count int\n\tfor i := 0; i <= K; i++ {\n\t\tif K > S || K * 3 < S {\n\t\t\tbreak\n\t\t}\n\t\tfor j := 0; j <= K; j++ {\n\t\t\tif i + j + S == S {\n\t\t\t\tcount++\n\t\t\t} \n\t\t}\n\n\t}\n\tfmt.Println(count)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given two integers K and S.\n\nThree variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.\n\nHow many different assignments of values to X, Y and Z are there such that X + Y + Z = S?\n\nConstraints\n\n2≤K≤2500\n\n0≤S≤3K\n\nK and S are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nK S\n\nOutput\n\nPrint the number of the triples of X, Y and Z that satisfy the condition.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n6\n\nThere are six triples of X, Y and Z that satisfy the condition:\n\nX = 0, Y = 0, Z = 2\n\nX = 0, Y = 2, Z = 0\n\nX = 2, Y = 0, Z = 0\n\nX = 0, Y = 1, Z = 1\n\nX = 1, Y = 0, Z = 1\n\nX = 1, Y = 1, Z = 0\n\nSample Input 2\n\n5 15\n\nSample Output 2\n\n1\n\nThe maximum value of X + Y + Z is 15, achieved by one triple of X, Y and Z.", "sample_input": "2 2\n"}, "reference_outputs": ["6\n"], "source_document_id": "p03835", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given two integers K and S.\n\nThree variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.\n\nHow many different assignments of values to X, Y and Z are there such that X + Y + Z = S?\n\nConstraints\n\n2≤K≤2500\n\n0≤S≤3K\n\nK and S are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nK S\n\nOutput\n\nPrint the number of the triples of X, Y and Z that satisfy the condition.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n6\n\nThere are six triples of X, Y and Z that satisfy the condition:\n\nX = 0, Y = 0, Z = 2\n\nX = 0, Y = 2, Z = 0\n\nX = 2, Y = 0, Z = 0\n\nX = 0, Y = 1, Z = 1\n\nX = 1, Y = 0, Z = 1\n\nX = 1, Y = 1, Z = 0\n\nSample Input 2\n\n5 15\n\nSample Output 2\n\n1\n\nThe maximum value of X + Y + Z is 15, achieved by one triple of X, Y and Z.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 8, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s317910242", "group_id": "codeNet:p03835", "input_text": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var k, s int\n fmt.Scanf(\"%d %d\", &k, &s)\n\n var cnt int\n\n for i := 0; i <= k; i++ {\n for j := 0; j <= k && i+j <= s; j++ {\n for l := 0; l <= k; l++ {\n if i+j+l == s {\n cnt++\n }\n }\n }\n }\n fmt.Println(cnt)\n\n}\n", "language": "Go", "metadata": {"date": 1563874720, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03835.html", "problem_id": "p03835", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03835/input.txt", "sample_output_relpath": "derived/input_output/data/p03835/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03835/Go/s317910242.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s317910242", "user_id": "u772063717"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n)\n\nfunc main() {\n var k, s int\n fmt.Scanf(\"%d %d\", &k, &s)\n\n var cnt int\n\n for i := 0; i <= k; i++ {\n for j := 0; j <= k && i+j <= s; j++ {\n for l := 0; l <= k; l++ {\n if i+j+l == s {\n cnt++\n }\n }\n }\n }\n fmt.Println(cnt)\n\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given two integers K and S.\n\nThree variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.\n\nHow many different assignments of values to X, Y and Z are there such that X + Y + Z = S?\n\nConstraints\n\n2≤K≤2500\n\n0≤S≤3K\n\nK and S are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nK S\n\nOutput\n\nPrint the number of the triples of X, Y and Z that satisfy the condition.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n6\n\nThere are six triples of X, Y and Z that satisfy the condition:\n\nX = 0, Y = 0, Z = 2\n\nX = 0, Y = 2, Z = 0\n\nX = 2, Y = 0, Z = 0\n\nX = 0, Y = 1, Z = 1\n\nX = 1, Y = 0, Z = 1\n\nX = 1, Y = 1, Z = 0\n\nSample Input 2\n\n5 15\n\nSample Output 2\n\n1\n\nThe maximum value of X + Y + Z is 15, achieved by one triple of X, Y and Z.", "sample_input": "2 2\n"}, "reference_outputs": ["6\n"], "source_document_id": "p03835", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given two integers K and S.\n\nThree variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.\n\nHow many different assignments of values to X, Y and Z are there such that X + Y + Z = S?\n\nConstraints\n\n2≤K≤2500\n\n0≤S≤3K\n\nK and S are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nK S\n\nOutput\n\nPrint the number of the triples of X, Y and Z that satisfy the condition.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n6\n\nThere are six triples of X, Y and Z that satisfy the condition:\n\nX = 0, Y = 0, Z = 2\n\nX = 0, Y = 2, Z = 0\n\nX = 2, Y = 0, Z = 0\n\nX = 0, Y = 1, Z = 1\n\nX = 1, Y = 0, Z = 1\n\nX = 1, Y = 1, Z = 0\n\nSample Input 2\n\n5 15\n\nSample Output 2\n\n1\n\nThe maximum value of X + Y + Z is 15, achieved by one triple of X, Y and Z.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2107, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s493384030", "group_id": "codeNet:p03835", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar k, s int\n\tfmt.Scanf(\"%d %d\\n\", &k, &s)\n\tcnt := 0\n\tfor x := 0; x <= k; x++ {\n\t\tfor y := 0; y <= k-x; y++ {\n\t\t\tcnt++\n\t\t\t//for z := 0; z <= k; z++ {\n\t\t\t//\tif x+y+z == s {\n\t\t\t//\t\tcnt++\n\t\t\t//\t}\n\t\t\t//}\n\t\t}\n\t}\n\tfmt.Println(cnt)\n}\n", "language": "Go", "metadata": {"date": 1526536805, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03835.html", "problem_id": "p03835", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03835/input.txt", "sample_output_relpath": "derived/input_output/data/p03835/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03835/Go/s493384030.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s493384030", "user_id": "u609014603"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar k, s int\n\tfmt.Scanf(\"%d %d\\n\", &k, &s)\n\tcnt := 0\n\tfor x := 0; x <= k; x++ {\n\t\tfor y := 0; y <= k-x; y++ {\n\t\t\tcnt++\n\t\t\t//for z := 0; z <= k; z++ {\n\t\t\t//\tif x+y+z == s {\n\t\t\t//\t\tcnt++\n\t\t\t//\t}\n\t\t\t//}\n\t\t}\n\t}\n\tfmt.Println(cnt)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given two integers K and S.\n\nThree variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.\n\nHow many different assignments of values to X, Y and Z are there such that X + Y + Z = S?\n\nConstraints\n\n2≤K≤2500\n\n0≤S≤3K\n\nK and S are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nK S\n\nOutput\n\nPrint the number of the triples of X, Y and Z that satisfy the condition.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n6\n\nThere are six triples of X, Y and Z that satisfy the condition:\n\nX = 0, Y = 0, Z = 2\n\nX = 0, Y = 2, Z = 0\n\nX = 2, Y = 0, Z = 0\n\nX = 0, Y = 1, Z = 1\n\nX = 1, Y = 0, Z = 1\n\nX = 1, Y = 1, Z = 0\n\nSample Input 2\n\n5 15\n\nSample Output 2\n\n1\n\nThe maximum value of X + Y + Z is 15, achieved by one triple of X, Y and Z.", "sample_input": "2 2\n"}, "reference_outputs": ["6\n"], "source_document_id": "p03835", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given two integers K and S.\n\nThree variable X, Y and Z takes integer values satisfying 0≤X,Y,Z≤K.\n\nHow many different assignments of values to X, Y and Z are there such that X + Y + Z = S?\n\nConstraints\n\n2≤K≤2500\n\n0≤S≤3K\n\nK and S are integers.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nK S\n\nOutput\n\nPrint the number of the triples of X, Y and Z that satisfy the condition.\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n6\n\nThere are six triples of X, Y and Z that satisfy the condition:\n\nX = 0, Y = 0, Z = 2\n\nX = 0, Y = 2, Z = 0\n\nX = 2, Y = 0, Z = 0\n\nX = 0, Y = 1, Z = 1\n\nX = 1, Y = 0, Z = 1\n\nX = 1, Y = 1, Z = 0\n\nSample Input 2\n\n5 15\n\nSample Output 2\n\n1\n\nThe maximum value of X + Y + Z is 15, achieved by one triple of X, Y and Z.", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 512}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s432694869", "group_id": "codeNet:p03854", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\ts := scanStr()\n\tvar n string\n\tn = strings.Replace(s, \"drea\", \",drea\", -1)\n\tn = strings.Replace(n, \"eras\", \",eras\", -1)\n\n\tif n[0:1] == \",\" {\n\t\tn = strings.TrimLeft(n, \",\")\n\t}\n\t/*\n\t\tif n[len(n)-1:len(n)] == \",\" {\n\t\t\tn = strings.TrimRight(n, \",\")\n\t\t}\n\t*/\n\n\tl := strings.Split(n, \",\")\n\tfmt.Println(l)\n\n\tok := true\n\tfor _, i := range l {\n\t\tif i == \"eraser\" || i == \"erase\" || i == \"dream\" || i == \"dreamer\" {\n\t\t\tcontinue\n\t\t} else {\n\t\t\tok = false\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif ok {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1590622605, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03854.html", "problem_id": "p03854", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03854/input.txt", "sample_output_relpath": "derived/input_output/data/p03854/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03854/Go/s432694869.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s432694869", "user_id": "u473974118"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc scanStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\ts := scanStr()\n\tvar n string\n\tn = strings.Replace(s, \"drea\", \",drea\", -1)\n\tn = strings.Replace(n, \"eras\", \",eras\", -1)\n\n\tif n[0:1] == \",\" {\n\t\tn = strings.TrimLeft(n, \",\")\n\t}\n\t/*\n\t\tif n[len(n)-1:len(n)] == \",\" {\n\t\t\tn = strings.TrimRight(n, \",\")\n\t\t}\n\t*/\n\n\tl := strings.Split(n, \",\")\n\tfmt.Println(l)\n\n\tok := true\n\tfor _, i := range l {\n\t\tif i == \"eraser\" || i == \"erase\" || i == \"dream\" || i == \"dreamer\" {\n\t\t\tcontinue\n\t\t} else {\n\t\t\tok = false\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif ok {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "sample_input": "erasedream\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03854", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 3, "memory_kb": 768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s402152065", "group_id": "codeNet:p03854", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\ttext := scanner.Text()\n\n\ted := len(text)\n\tisYes := true\n\tfor ed > 0 {\n\t\tif ed-5 >= 0 && (text[ed-5:ed] == \"dream\" || text[ed-5:ed] == \"erase\") {\n\t\t\ted = ed - 5\n\t\t} else if ed-6 >= 0 && text[ed-6:ed] == \"eraser\" {\n\t\t\ted = ed - 6\n\t\t} else if ed-7 >= 0 && text[ed-7:ed] == \"dreamer\" {\n\t\t\ted = ed - 7\n\t\t} else {\n\t\t\tisYes = false\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif isYes {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1590369635, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03854.html", "problem_id": "p03854", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03854/input.txt", "sample_output_relpath": "derived/input_output/data/p03854/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03854/Go/s402152065.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s402152065", "user_id": "u177280335"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tscanner := bufio.NewScanner(os.Stdin)\n\tscanner.Scan()\n\ttext := scanner.Text()\n\n\ted := len(text)\n\tisYes := true\n\tfor ed > 0 {\n\t\tif ed-5 >= 0 && (text[ed-5:ed] == \"dream\" || text[ed-5:ed] == \"erase\") {\n\t\t\ted = ed - 5\n\t\t} else if ed-6 >= 0 && text[ed-6:ed] == \"eraser\" {\n\t\t\ted = ed - 6\n\t\t} else if ed-7 >= 0 && text[ed-7:ed] == \"dreamer\" {\n\t\t\ted = ed - 7\n\t\t} else {\n\t\t\tisYes = false\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif isYes {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "sample_input": "erasedream\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03854", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 1, "memory_kb": 768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s837467679", "group_id": "codeNet:p03854", "input_text": "package main\nimport (\n \"fmt\"\n \"os\"\n \"bufio\"\n \"strconv\"\n)\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n sc.Split(bufio.ScanWords)\n s := nextString()\n str := []string{\n\t //\"maerd\",\n\t \"dream\",\n\t //\"remaerd\",\n\t \"dreamer\",\n\t //\"esare\",\n\t \"erase\",\n\t \"eraser\",\n\t //\"resare\",\n }\n\n for i := 0; i = 7 && s[5:7] == \"er\" {\n\t\t\t\tif len(s) == 7 || s[7:8] == \"d\" || s[7:8] == \"e\" {\n\t\t\t\t\ts = s[7:]\n\t\t\t\t\tcheck = false\n\t\t\t\t} else if s[7:8] == \"a\" {\n\t\t\t\t\ts = s[5:]\n\t\t\t\t\tcheck = false\n\t\t\t\t}\n\t\t\t}\n\t\t} else if s[0:5] == \"erase\" {\n\t\t\tcheck = false\n\t\t\tif len(s) == 5 {\n\t\t\t\ts = s[5:]\n\t\t\t}\n\t\t\tif s[5:6] == \"r\" {\n\t\t\t\ts = s[6:]\n\t\t\t} else {\n\t\t\t\ts = s[5:]\n\t\t\t}\n\t\t}\n\t\tif check {\n\t\t\tfmt.Println(\"NO\")\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "language": "Go", "metadata": {"date": 1579994228, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03854.html", "problem_id": "p03854", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03854/input.txt", "sample_output_relpath": "derived/input_output/data/p03854/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03854/Go/s506394810.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s506394810", "user_id": "u145635628"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\tvar check bool\n\tfor ;; {\n\t\tcheck = true\n\t\tif len(s) == 0 {\n\t\t\tfmt.Println(\"YES\")\n\t\t\tbreak\n\t\t}\n\t\tif len(s) < 5 || len(s) == 8 || len(s) == 9{\n\t\t\tfmt.Println(\"NO\")\n\t\t\tbreak\n\t\t}\n\t\tif s[0:5] == \"dream\" {\n\t\t\tif len(s) == 5 || s[5:6] == \"d\" {\n\t\t\t\ts = s[5:]\n\t\t\t\tcheck = false\n\t\t\t} else if len(s) >= 7 && s[5:7] == \"er\" {\n\t\t\t\tif len(s) == 7 || s[7:8] == \"d\" || s[7:8] == \"e\" {\n\t\t\t\t\ts = s[7:]\n\t\t\t\t\tcheck = false\n\t\t\t\t} else if s[7:8] == \"a\" {\n\t\t\t\t\ts = s[5:]\n\t\t\t\t\tcheck = false\n\t\t\t\t}\n\t\t\t}\n\t\t} else if s[0:5] == \"erase\" {\n\t\t\tcheck = false\n\t\t\tif len(s) == 5 {\n\t\t\t\ts = s[5:]\n\t\t\t}\n\t\t\tif s[5:6] == \"r\" {\n\t\t\t\ts = s[6:]\n\t\t\t} else {\n\t\t\t\ts = s[5:]\n\t\t\t}\n\t\t}\n\t\tif check {\n\t\t\tfmt.Println(\"NO\")\n\t\t\tbreak\n\t\t}\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "sample_input": "erasedream\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03854", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 760, "cpu_time_ms": 56, "memory_kb": 1280}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s222263227", "group_id": "codeNet:p03854", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\ts = reverse(s)\n\n\tss := map[string]bool{\"maerd\": true, \"remaerd\": true, \"esare\": true, \"resare\": true}\n\n\tt := \"\"\n\tfor i := 0; i < len(s); i++ {\n\t\tt += string(s[i])\n\t\tif ss[t] {\n\t\t\tt = \"\"\n\t\t}\n\t\tif 7 < len(t) {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif t == \"\" {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n", "language": "Go", "metadata": {"date": 1578587848, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03854.html", "problem_id": "p03854", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03854/input.txt", "sample_output_relpath": "derived/input_output/data/p03854/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03854/Go/s222263227.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s222263227", "user_id": "u902409225"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\ts = reverse(s)\n\n\tss := map[string]bool{\"maerd\": true, \"remaerd\": true, \"esare\": true, \"resare\": true}\n\n\tt := \"\"\n\tfor i := 0; i < len(s); i++ {\n\t\tt += string(s[i])\n\t\tif ss[t] {\n\t\t\tt = \"\"\n\t\t}\n\t\tif 7 < len(t) {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif t == \"\" {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "sample_input": "erasedream\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03854", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 544, "cpu_time_ms": 72, "memory_kb": 2688}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s530871608", "group_id": "codeNet:p03854", "input_text": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tss := map[string]bool{\"maerd\": true, \"remaerd\": true, \"esare\": true, \"resare\": true}\n\tl := len(s)\n\tt := \"\"\n\tfor i := 0; i < l; i++ {\n\t\tt += string(s[l-i-1])\n\t\tif len(t) == 5 && ss[t] {\n\t\t\tt = \"\"\n\t\t} else if len(t) == 7 && ss[t] {\n\t\t\tt = \"\"\n\t\t} else if 7 < len(t) {\n\t\t\tfmt.Println(\"NO\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tif t == \"\" {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n\n}\n", "language": "Go", "metadata": {"date": 1578585238, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03854.html", "problem_id": "p03854", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03854/input.txt", "sample_output_relpath": "derived/input_output/data/p03854/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03854/Go/s530871608.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s530871608", "user_id": "u902409225"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport \"fmt\"\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tss := map[string]bool{\"maerd\": true, \"remaerd\": true, \"esare\": true, \"resare\": true}\n\tl := len(s)\n\tt := \"\"\n\tfor i := 0; i < l; i++ {\n\t\tt += string(s[l-i-1])\n\t\tif len(t) == 5 && ss[t] {\n\t\t\tt = \"\"\n\t\t} else if len(t) == 7 && ss[t] {\n\t\t\tt = \"\"\n\t\t} else if 7 < len(t) {\n\t\t\tfmt.Println(\"NO\")\n\t\t\treturn\n\t\t}\n\t}\n\n\tif t == \"\" {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "sample_input": "erasedream\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03854", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 447, "cpu_time_ms": 55, "memory_kb": 1280}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s995989318", "group_id": "codeNet:p03854", "input_text": "package main\n\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n)\n\nvar SC = bufio.NewScanner(os.Stdin)\n\nfunc main(){\n SC.Scan()\n S := SC.Text()\n // fmt.Scan(&S)\n\n // fmt.Println(S)\n //deramderam\n //dreamdreamer =>dreamdならdream\n //dreamerase\n //dreameraser => dreameraならdream\n\n //dreamerdream\n //dreamerdreamer => dreamerdならdreamer\n //dreamererase\n //dreamereraser => dreamereならdreamer\n\n //erasedream\n //erasedreamer => erasedならerase\n //eraseerase\n //eraseeraser => eraseeならerase\n\n //eraserdream\n //eraserdreamer => eraserdならeraser\n //erasererase\n //erasereraser => erasereならeraser\n\n var result string\n n := 0\n for {\n if len(S[n:]) == 5 && (S[n:] == \"dream\" || S[n:] == \"erase\") {\n result = \"YES\"\n break\n }else if len(S[n:]) == 6 && S[n:] == \"eraser\"{\n result = \"YES\"\n break\n }else if len(S[n:]) == 7 && S[n:] == \"dreamer\"{\n result = \"YES\"\n break\n }else if len(S[n:]) <= 8{\n result = \"NO\"\n break\n }else if S[n:n+7] == \"dreamer\" && S[n:n+8] != \"dreamera\"{\n n+=7 //dreamer\n }else if S[n:n+5] == \"dream\"{\n n+=5 //dream\n }else if S[n:n+5] == \"erase\" && S[n:n+6]!= \"eraser\"{\n n+=5 //erase\n }else if S[n:n+6] == \"eraser\"{\n n+=6\n }else{\n result = \"NO\"\n break\n }\n // fmt.Println(n)\n }\n fmt.Println(result)\n}\n\n// func saiki(S string){\n// if S[:5] == \"dreamd\"{ //dream\n// return saiki(S[5:])\n// }else if S[:7] == \"dreamera\"{ //dream\n// return saiki(S[5:])\n// }else if S[:7] == \"dreamerd\"{\n// return saiki(S[7:])\n// }else if S[:7] == \"dreamere\"{\n// return saiki(S[7:])\n// }else if S == \"\"{\n// return 'YES'\n// }else{\n// return 'NO'\n// }\n// }\n", "language": "Go", "metadata": {"date": 1575581245, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03854.html", "problem_id": "p03854", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03854/input.txt", "sample_output_relpath": "derived/input_output/data/p03854/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03854/Go/s995989318.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s995989318", "user_id": "u796789068"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n \"fmt\"\n \"bufio\"\n \"os\"\n)\n\nvar SC = bufio.NewScanner(os.Stdin)\n\nfunc main(){\n SC.Scan()\n S := SC.Text()\n // fmt.Scan(&S)\n\n // fmt.Println(S)\n //deramderam\n //dreamdreamer =>dreamdならdream\n //dreamerase\n //dreameraser => dreameraならdream\n\n //dreamerdream\n //dreamerdreamer => dreamerdならdreamer\n //dreamererase\n //dreamereraser => dreamereならdreamer\n\n //erasedream\n //erasedreamer => erasedならerase\n //eraseerase\n //eraseeraser => eraseeならerase\n\n //eraserdream\n //eraserdreamer => eraserdならeraser\n //erasererase\n //erasereraser => erasereならeraser\n\n var result string\n n := 0\n for {\n if len(S[n:]) == 5 && (S[n:] == \"dream\" || S[n:] == \"erase\") {\n result = \"YES\"\n break\n }else if len(S[n:]) == 6 && S[n:] == \"eraser\"{\n result = \"YES\"\n break\n }else if len(S[n:]) == 7 && S[n:] == \"dreamer\"{\n result = \"YES\"\n break\n }else if len(S[n:]) <= 8{\n result = \"NO\"\n break\n }else if S[n:n+7] == \"dreamer\" && S[n:n+8] != \"dreamera\"{\n n+=7 //dreamer\n }else if S[n:n+5] == \"dream\"{\n n+=5 //dream\n }else if S[n:n+5] == \"erase\" && S[n:n+6]!= \"eraser\"{\n n+=5 //erase\n }else if S[n:n+6] == \"eraser\"{\n n+=6\n }else{\n result = \"NO\"\n break\n }\n // fmt.Println(n)\n }\n fmt.Println(result)\n}\n\n// func saiki(S string){\n// if S[:5] == \"dreamd\"{ //dream\n// return saiki(S[5:])\n// }else if S[:7] == \"dreamera\"{ //dream\n// return saiki(S[5:])\n// }else if S[:7] == \"dreamerd\"{\n// return saiki(S[7:])\n// }else if S[:7] == \"dreamere\"{\n// return saiki(S[7:])\n// }else if S == \"\"{\n// return 'YES'\n// }else{\n// return 'NO'\n// }\n// }\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "sample_input": "erasedream\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03854", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1734, "cpu_time_ms": 1, "memory_kb": 768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s253024640", "group_id": "codeNet:p03854", "input_text": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc check(s string, d []string) bool {\n\tfor i := 0; i < len(d); i++ {\n\t\tif len(s) < len(d[i]) {\n\t\t\tcontinue\n\t\t}\n\n\t\tif s[0:len(d[i])] == d[i] {\n\t\t\tif s == d[i] {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn check(s[len(d[i]):], d)\n\t\t}\n\t}\n\treturn false\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\ts = reverse(s)\n\n\td := []string{\"esare\", \"resare\", \"maerd\", \"remaerd\"}\n\n\tif check(s, d) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1572455062, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03854.html", "problem_id": "p03854", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03854/input.txt", "sample_output_relpath": "derived/input_output/data/p03854/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03854/Go/s253024640.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s253024640", "user_id": "u468065539"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n)\n\nfunc check(s string, d []string) bool {\n\tfor i := 0; i < len(d); i++ {\n\t\tif len(s) < len(d[i]) {\n\t\t\tcontinue\n\t\t}\n\n\t\tif s[0:len(d[i])] == d[i] {\n\t\t\tif s == d[i] {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\treturn check(s[len(d[i]):], d)\n\t\t}\n\t}\n\treturn false\n}\n\nfunc reverse(s string) string {\n\trunes := []rune(s)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\ts = reverse(s)\n\n\td := []string{\"esare\", \"resare\", \"maerd\", \"remaerd\"}\n\n\tif check(s, d) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "sample_input": "erasedream\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03854", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 639, "cpu_time_ms": 61, "memory_kb": 5888}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s769858016", "group_id": "codeNet:p03854", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"regexp\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\ts := next()\n\t// phrases := []string{\"dream\", \"dreamer\", \"erase\", \"eraser\"}\n\tr := regexp.MustCompile(`^(dream(er)?|eraser?)*$`)\n\n\tif r.MatchString(s) {\n\t\tprintln(\"YES\")\n\t} else {\n\t\tprintln(\"NO\")\n\t}\n\treturn\n}\n\nfunc main() {\n\tdefer out.Flush()\n\tin.Buffer(make([]byte, scBufSize), scBufSize)\n\tin.Split(bufio.ScanWords)\n\n\tsolve()\n}\n\n// --- template ---\n\nconst scBufSize = 1e6\n\nvar (\n\tin = bufio.NewScanner(os.Stdin)\n\tout = bufio.NewWriter(os.Stdout)\n)\n\nfunc println(a ...interface{}) {\n\tfmt.Fprintln(out, a...)\n}\n\nfunc printf(format string, a ...interface{}) {\n\tfmt.Fprintf(out, format, a...)\n}\n\nfunc next() string {\n\tin.Scan()\n\treturn in.Text()\n}\n\nfunc nextInt() int {\n\ts := next()\n\ti, e := strconv.Atoi(s)\n\tif e != nil {\n\t\tfmt.Println(e)\n\t}\n\treturn i\n}\n\nfunc nextInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = nextInt()\n\t}\n\treturn res\n}\n\nfunc unique(list []int) []int {\n\tm := make(map[int]bool)\n\tuniq := make([]int, 0)\n\tfor _, e := range list {\n\t\tif !m[e] {\n\t\t\tm[e] = true\n\t\t\tuniq = append(uniq, e)\n\t\t}\n\t}\n\treturn uniq\n}\n", "language": "Go", "metadata": {"date": 1570484972, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03854.html", "problem_id": "p03854", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03854/input.txt", "sample_output_relpath": "derived/input_output/data/p03854/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03854/Go/s769858016.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s769858016", "user_id": "u608076573"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"regexp\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\ts := next()\n\t// phrases := []string{\"dream\", \"dreamer\", \"erase\", \"eraser\"}\n\tr := regexp.MustCompile(`^(dream(er)?|eraser?)*$`)\n\n\tif r.MatchString(s) {\n\t\tprintln(\"YES\")\n\t} else {\n\t\tprintln(\"NO\")\n\t}\n\treturn\n}\n\nfunc main() {\n\tdefer out.Flush()\n\tin.Buffer(make([]byte, scBufSize), scBufSize)\n\tin.Split(bufio.ScanWords)\n\n\tsolve()\n}\n\n// --- template ---\n\nconst scBufSize = 1e6\n\nvar (\n\tin = bufio.NewScanner(os.Stdin)\n\tout = bufio.NewWriter(os.Stdout)\n)\n\nfunc println(a ...interface{}) {\n\tfmt.Fprintln(out, a...)\n}\n\nfunc printf(format string, a ...interface{}) {\n\tfmt.Fprintf(out, format, a...)\n}\n\nfunc next() string {\n\tin.Scan()\n\treturn in.Text()\n}\n\nfunc nextInt() int {\n\ts := next()\n\ti, e := strconv.Atoi(s)\n\tif e != nil {\n\t\tfmt.Println(e)\n\t}\n\treturn i\n}\n\nfunc nextInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = nextInt()\n\t}\n\treturn res\n}\n\nfunc unique(list []int) []int {\n\tm := make(map[int]bool)\n\tuniq := make([]int, 0)\n\tfor _, e := range list {\n\t\tif !m[e] {\n\t\t\tm[e] = true\n\t\t\tuniq = append(uniq, e)\n\t\t}\n\t}\n\treturn uniq\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "sample_input": "erasedream\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03854", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1137, "cpu_time_ms": 13, "memory_kb": 896}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s037212252", "group_id": "codeNet:p03854", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"regexp\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\ts := next()\n\tr := regexp.MustCompile(`^(eraser|erase|dreamer|dream)+$`)\n\tif r.MatchString(s) {\n\t\tprintln(\"YES\")\n\t} else {\n\t\tprintln(\"NO\")\n\t}\n\treturn\n}\n\nfunc main() {\n\tdefer out.Flush()\n\tin.Split(bufio.ScanLines)\n\n\tsolve()\n}\n\n// --- template ---\n\nvar (\n\tin = bufio.NewScanner(os.Stdin)\n\tout = bufio.NewWriter(os.Stdout)\n)\n\nfunc println(a ...interface{}) {\n\tfmt.Fprintln(out, a...)\n}\n\nfunc printf(format string, a ...interface{}) {\n\tfmt.Fprintf(out, format, a...)\n}\n\nfunc next() string {\n\tin.Scan()\n\treturn in.Text()\n}\n\nfunc nextInt() int {\n\ts := next()\n\ti, e := strconv.Atoi(s)\n\tif e != nil {\n\t\tfmt.Println(e)\n\t}\n\treturn i\n}\n\nfunc nextInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = nextInt()\n\t}\n\treturn res\n}\n\nfunc unique(list []int) []int {\n\tm := make(map[int]bool)\n\tuniq := make([]int, 0)\n\tfor _, e := range list {\n\t\tif !m[e] {\n\t\t\tm[e] = true\n\t\t\tuniq = append(uniq, e)\n\t\t}\n\t}\n\treturn uniq\n}\n", "language": "Go", "metadata": {"date": 1570483771, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03854.html", "problem_id": "p03854", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03854/input.txt", "sample_output_relpath": "derived/input_output/data/p03854/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03854/Go/s037212252.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s037212252", "user_id": "u608076573"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"regexp\"\n\t\"strconv\"\n)\n\nfunc solve() {\n\ts := next()\n\tr := regexp.MustCompile(`^(eraser|erase|dreamer|dream)+$`)\n\tif r.MatchString(s) {\n\t\tprintln(\"YES\")\n\t} else {\n\t\tprintln(\"NO\")\n\t}\n\treturn\n}\n\nfunc main() {\n\tdefer out.Flush()\n\tin.Split(bufio.ScanLines)\n\n\tsolve()\n}\n\n// --- template ---\n\nvar (\n\tin = bufio.NewScanner(os.Stdin)\n\tout = bufio.NewWriter(os.Stdout)\n)\n\nfunc println(a ...interface{}) {\n\tfmt.Fprintln(out, a...)\n}\n\nfunc printf(format string, a ...interface{}) {\n\tfmt.Fprintf(out, format, a...)\n}\n\nfunc next() string {\n\tin.Scan()\n\treturn in.Text()\n}\n\nfunc nextInt() int {\n\ts := next()\n\ti, e := strconv.Atoi(s)\n\tif e != nil {\n\t\tfmt.Println(e)\n\t}\n\treturn i\n}\n\nfunc nextInts(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = nextInt()\n\t}\n\treturn res\n}\n\nfunc unique(list []int) []int {\n\tm := make(map[int]bool)\n\tuniq := make([]int, 0)\n\tfor _, e := range list {\n\t\tif !m[e] {\n\t\t\tm[e] = true\n\t\t\tuniq = append(uniq, e)\n\t\t}\n\t}\n\treturn uniq\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "sample_input": "erasedream\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03854", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1011, "cpu_time_ms": 1, "memory_kb": 896}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s142379060", "group_id": "codeNet:p03854", "input_text": "// ABC 049 C - Daydream\npackage main\n\nimport (\n \"fmt\"\n \"strings\"\n)\n\nfunc main() {\n\n var s string\n fmt.Scan(&s)\n\n s = reverse(s)\n s = strings.Replace(s, \"resare\", \"\", -1)\n s = strings.Replace(s, \"esare\", \"\", -1)\n s = strings.Replace(s, \"remaerd\", \"\", -1)\n s = strings.Replace(s, \"maerd\", \"\", -1)\n\n var res string\n if len(s) == 0 {\n res = \"YES\"\n } else {\n res = \"NO\"\n }\n fmt.Println(res)\n}\n\nfunc reverse(s string) string {\n bs := []byte(s)\n for i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 {\n bs[i], bs[j] = bs[j], bs[i]\n }\n return string(bs)\n}\n", "language": "Go", "metadata": {"date": 1568337851, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03854.html", "problem_id": "p03854", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03854/input.txt", "sample_output_relpath": "derived/input_output/data/p03854/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03854/Go/s142379060.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s142379060", "user_id": "u347640436"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "// ABC 049 C - Daydream\npackage main\n\nimport (\n \"fmt\"\n \"strings\"\n)\n\nfunc main() {\n\n var s string\n fmt.Scan(&s)\n\n s = reverse(s)\n s = strings.Replace(s, \"resare\", \"\", -1)\n s = strings.Replace(s, \"esare\", \"\", -1)\n s = strings.Replace(s, \"remaerd\", \"\", -1)\n s = strings.Replace(s, \"maerd\", \"\", -1)\n\n var res string\n if len(s) == 0 {\n res = \"YES\"\n } else {\n res = \"NO\"\n }\n fmt.Println(res)\n}\n\nfunc reverse(s string) string {\n bs := []byte(s)\n for i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 {\n bs[i], bs[j] = bs[j], bs[i]\n }\n return string(bs)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "sample_input": "erasedream\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03854", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 617, "cpu_time_ms": 57, "memory_kb": 1792}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s517841237", "group_id": "codeNet:p03854", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nvar (\n\tstdin = bufio.NewScanner(os.Stdin)\n\tt = []string{\"dream\", \"dreamer\", \"erase\", \"eraser\"}\n)\n\nfunc main() {\n\tstdin.Scan()\n\ts := stdin.Text()\n\ts = strings.Replace(s, t[0], \"D\", -1)\n\ts = strings.Replace(s, t[2], \"E\", -1)\n\ts = strings.Replace(s, \"Der\", \"\", -1)\n\ts = strings.Replace(s, \"Er\", \"\", -1)\n\ts = strings.Replace(s, \"D\", \"\", -1)\n\ts = strings.Replace(s, \"E\", \"\", -1)\n\tvar o = \"NO\"\n\tif s == \"\" {\n\t\to = \"YES\"\n\t}\n\tfmt.Println(o)\n}\n", "language": "Go", "metadata": {"date": 1567798515, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03854.html", "problem_id": "p03854", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03854/input.txt", "sample_output_relpath": "derived/input_output/data/p03854/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03854/Go/s517841237.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s517841237", "user_id": "u564244597"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nvar (\n\tstdin = bufio.NewScanner(os.Stdin)\n\tt = []string{\"dream\", \"dreamer\", \"erase\", \"eraser\"}\n)\n\nfunc main() {\n\tstdin.Scan()\n\ts := stdin.Text()\n\ts = strings.Replace(s, t[0], \"D\", -1)\n\ts = strings.Replace(s, t[2], \"E\", -1)\n\ts = strings.Replace(s, \"Der\", \"\", -1)\n\ts = strings.Replace(s, \"Er\", \"\", -1)\n\ts = strings.Replace(s, \"D\", \"\", -1)\n\ts = strings.Replace(s, \"E\", \"\", -1)\n\tvar o = \"NO\"\n\tif s == \"\" {\n\t\to = \"YES\"\n\t}\n\tfmt.Println(o)\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "sample_input": "erasedream\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03854", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 498, "cpu_time_ms": 1, "memory_kb": 768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s375302661", "group_id": "codeNet:p03854", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\n\tsc.Scan()\n\tS := sc.Bytes()\n\tif back(S) {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\n\tfmt.Println(\"NO\")\n\treturn\n\n\ti := 0\n\tfor i < len(S) {\n\t\tb, c := confirm(S[i:])\n\t\tif !b {\n\t\t\tfmt.Println(\"NO\")\n\t\t\treturn\n\t\t}\n\n\t\ti += c\n\t}\n\n\tfmt.Println(\"YES\")\n\n}\n\nfunc back(b []byte) bool {\n\tS := reverse(b)\n\tdivide := []([]byte){\n\t\treverse([]byte(\"dream\")), reverse([]byte(\"dreamer\")), reverse([]byte(\"erase\")), reverse([]byte(\"eraser\")),\n\t}\n\n\tcan := true\n\tfor i := 0; i < len(S); {\n\t\tcan2 := false\n\t\tfor j := range divide {\n\t\t\tif bytes.HasPrefix(S[i:], divide[j]) {\n\t\t\t\tcan2 = true\n\t\t\t\ti += len(divide[j])\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !can2 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn can\n}\n\nfunc reverse(b []byte) []byte {\n\tif len(b) == 1 {\n\t\treturn b\n\t}\n\tfor i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {\n\t\tb[i], b[j] = b[j], b[i]\n\t}\n\n\treturn b\n}\n\nfunc try2(b []byte) bool {\n\tfmt.Println(string(b))\n\tif len(b) == 0 {\n\t\treturn true\n\t}\n\n\tif len(b) < 5 {\n\t\treturn false\n\t}\n\n\tif bytes.HasSuffix(b, []byte{'d', 'r', 'e', 'a', 'm'}) {\n\t\treturn try2(b[:len(b)-5])\n\t} else if bytes.HasSuffix(b, []byte{'d', 'r', 'e', 'a', 'm', 'e', 'r'}) {\n\t\treturn try2(b[:len(b)-7])\n\t} else if bytes.HasSuffix(b, []byte{'e', 'r', 'a', 's', 'e'}) {\n\t\treturn try2(b[:len(b)-5])\n\t} else if bytes.HasSuffix(b, []byte{'e', 'r', 'a', 's', 'e', 'r'}) {\n\t\treturn try2(b[:len(b)-6])\n\t}\n\treturn false\n}\n\nfunc confirm(b []byte) (bool, int) {\n\tif has(b, []byte(\"dreamer\")) {\n\t\tif len(b) == 7 {\n\t\t\treturn true, 7\n\t\t}\n\n\t\tif b[7] == 'a' {\n\t\t\treturn true, 5\n\t\t}\n\n\t\treturn true, 7\n\t}\n\n\tif has(b, []byte(\"dream\")) {\n\t\treturn true, 5\n\t}\n\n\tif has(b, []byte(\"eraser\")) {\n\t\treturn true, 6\n\t}\n\n\tif has(b, []byte(\"erase\")) {\n\t\treturn true, 5\n\t}\n\n\treturn false, -1\n}\n\n// b の先頭が t かどうか\nfunc has(b []byte, t []byte) bool {\n\tif len(b) < len(t) {\n\t\treturn false\n\t}\n\n\tfor i := range t {\n\t\tif b[i] != t[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n", "language": "Go", "metadata": {"date": 1564024924, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03854.html", "problem_id": "p03854", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03854/input.txt", "sample_output_relpath": "derived/input_output/data/p03854/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03854/Go/s375302661.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s375302661", "user_id": "u911419846"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\n\tsc.Scan()\n\tS := sc.Bytes()\n\tif back(S) {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\n\tfmt.Println(\"NO\")\n\treturn\n\n\ti := 0\n\tfor i < len(S) {\n\t\tb, c := confirm(S[i:])\n\t\tif !b {\n\t\t\tfmt.Println(\"NO\")\n\t\t\treturn\n\t\t}\n\n\t\ti += c\n\t}\n\n\tfmt.Println(\"YES\")\n\n}\n\nfunc back(b []byte) bool {\n\tS := reverse(b)\n\tdivide := []([]byte){\n\t\treverse([]byte(\"dream\")), reverse([]byte(\"dreamer\")), reverse([]byte(\"erase\")), reverse([]byte(\"eraser\")),\n\t}\n\n\tcan := true\n\tfor i := 0; i < len(S); {\n\t\tcan2 := false\n\t\tfor j := range divide {\n\t\t\tif bytes.HasPrefix(S[i:], divide[j]) {\n\t\t\t\tcan2 = true\n\t\t\t\ti += len(divide[j])\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !can2 {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn can\n}\n\nfunc reverse(b []byte) []byte {\n\tif len(b) == 1 {\n\t\treturn b\n\t}\n\tfor i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {\n\t\tb[i], b[j] = b[j], b[i]\n\t}\n\n\treturn b\n}\n\nfunc try2(b []byte) bool {\n\tfmt.Println(string(b))\n\tif len(b) == 0 {\n\t\treturn true\n\t}\n\n\tif len(b) < 5 {\n\t\treturn false\n\t}\n\n\tif bytes.HasSuffix(b, []byte{'d', 'r', 'e', 'a', 'm'}) {\n\t\treturn try2(b[:len(b)-5])\n\t} else if bytes.HasSuffix(b, []byte{'d', 'r', 'e', 'a', 'm', 'e', 'r'}) {\n\t\treturn try2(b[:len(b)-7])\n\t} else if bytes.HasSuffix(b, []byte{'e', 'r', 'a', 's', 'e'}) {\n\t\treturn try2(b[:len(b)-5])\n\t} else if bytes.HasSuffix(b, []byte{'e', 'r', 'a', 's', 'e', 'r'}) {\n\t\treturn try2(b[:len(b)-6])\n\t}\n\treturn false\n}\n\nfunc confirm(b []byte) (bool, int) {\n\tif has(b, []byte(\"dreamer\")) {\n\t\tif len(b) == 7 {\n\t\t\treturn true, 7\n\t\t}\n\n\t\tif b[7] == 'a' {\n\t\t\treturn true, 5\n\t\t}\n\n\t\treturn true, 7\n\t}\n\n\tif has(b, []byte(\"dream\")) {\n\t\treturn true, 5\n\t}\n\n\tif has(b, []byte(\"eraser\")) {\n\t\treturn true, 6\n\t}\n\n\tif has(b, []byte(\"erase\")) {\n\t\treturn true, 5\n\t}\n\n\treturn false, -1\n}\n\n// b の先頭が t かどうか\nfunc has(b []byte, t []byte) bool {\n\tif len(b) < len(t) {\n\t\treturn false\n\t}\n\n\tfor i := range t {\n\t\tif b[i] != t[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "sample_input": "erasedream\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03854", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1979, "cpu_time_ms": 1, "memory_kb": 768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s955150499", "group_id": "codeNet:p03854", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\n\tsc.Scan()\n\tS := sc.Bytes()\n\n\tfor i := 0; i < len(S); {\n\t\tb, c := confirm(S[i:])\n\t\tif !b {\n\t\t\tfmt.Println(\"NO\")\n\t\t\treturn\n\t\t}\n\n\t\ti += c\n\t}\n\n\tfmt.Println(\"YES\")\n\n}\n\nfunc confirm(b []byte) (bool, int) {\n\tif has(b, []byte(\"dream\")) {\n\t\tif len(b) == 5 {\n\t\t\treturn true, 5\n\t\t}\n\n\t\tif has(b[5:], []byte(\"d\")) {\n\t\t\treturn true, 5\n\t\t}\n\n\t\tif !has(b[5:], []byte(\"er\")) {\n\t\t\treturn false, -1\n\t\t}\n\n\t\tif !has(b[5:], []byte(\"era\")) {\n\t\t\treturn true, 7\n\t\t}\n\t\treturn true, 5\n\t}\n\n\tif has(b, []byte(\"eraser\")) {\n\t\treturn true, 6\n\t}\n\n\tif has(b, []byte(\"erase\")) {\n\t\treturn true, 5\n\t}\n\n\treturn false, -1\n}\n\n// b の先頭が t かどうか\nfunc has(b []byte, t []byte) bool {\n\tif len(b) < len(t) {\n\t\treturn false\n\t}\n\n\tfor i := range t {\n\t\tif b[i] != t[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n", "language": "Go", "metadata": {"date": 1564017660, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03854.html", "problem_id": "p03854", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03854/input.txt", "sample_output_relpath": "derived/input_output/data/p03854/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03854/Go/s955150499.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s955150499", "user_id": "u911419846"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc main() {\n\n\tsc.Scan()\n\tS := sc.Bytes()\n\n\tfor i := 0; i < len(S); {\n\t\tb, c := confirm(S[i:])\n\t\tif !b {\n\t\t\tfmt.Println(\"NO\")\n\t\t\treturn\n\t\t}\n\n\t\ti += c\n\t}\n\n\tfmt.Println(\"YES\")\n\n}\n\nfunc confirm(b []byte) (bool, int) {\n\tif has(b, []byte(\"dream\")) {\n\t\tif len(b) == 5 {\n\t\t\treturn true, 5\n\t\t}\n\n\t\tif has(b[5:], []byte(\"d\")) {\n\t\t\treturn true, 5\n\t\t}\n\n\t\tif !has(b[5:], []byte(\"er\")) {\n\t\t\treturn false, -1\n\t\t}\n\n\t\tif !has(b[5:], []byte(\"era\")) {\n\t\t\treturn true, 7\n\t\t}\n\t\treturn true, 5\n\t}\n\n\tif has(b, []byte(\"eraser\")) {\n\t\treturn true, 6\n\t}\n\n\tif has(b, []byte(\"erase\")) {\n\t\treturn true, 5\n\t}\n\n\treturn false, -1\n}\n\n// b の先頭が t かどうか\nfunc has(b []byte, t []byte) bool {\n\tif len(b) < len(t) {\n\t\treturn false\n\t}\n\n\tfor i := range t {\n\t\tif b[i] != t[i] {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "sample_input": "erasedream\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03854", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 874, "cpu_time_ms": 1, "memory_kb": 768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s348519075", "group_id": "codeNet:p03854", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\tif len(os.Args) > 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(os.Stdout)\n\n\ts := getNextString(scanner)\n\tans := \"NO\"\n\tif able(s) {\n\t\tans = \"YES\"\n\t}\n\tfmt.Fprintln(writer, ans)\n\twriter.Flush()\n}\n\nfunc able(s string) bool {\n\tif s == \"\" {\n\t\treturn true\n\t}\n\n\tss := map[string]int{\n\t\t\"dream\": 5,\n\t\t\"dreamer\": 7,\n\t\t\"erase\": 5,\n\t\t\"eraser\": 6,\n\t}\n\n\tfor sss, l := range ss {\n\t\tif len(s) < l {\n\t\t\tcontinue\n\t\t}\n\t\tif s[0:l] == sss {\n\t\t\tif able(s[l:]) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false\n}\n", "language": "Go", "metadata": {"date": 1563408139, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03854.html", "problem_id": "p03854", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03854/input.txt", "sample_output_relpath": "derived/input_output/data/p03854/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03854/Go/s348519075.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s348519075", "user_id": "u150542210"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strconv\"\n)\n\nfunc getScanner(fp *os.File) *bufio.Scanner {\n\tscanner := bufio.NewScanner(fp)\n\tscanner.Split(bufio.ScanWords)\n\tscanner.Buffer(make([]byte, 500001), 500000)\n\treturn scanner\n}\n\nfunc getNextString(scanner *bufio.Scanner) string {\n\tscanner.Scan()\n\treturn scanner.Text()\n}\n\nfunc getNextInt(scanner *bufio.Scanner) int {\n\ti, _ := strconv.Atoi(getNextString(scanner))\n\treturn i\n}\n\nfunc getNextInt64(scanner *bufio.Scanner) int64 {\n\ti, _ := strconv.ParseInt(getNextString(scanner), 10, 64)\n\treturn i\n}\n\nfunc main() {\n\tfp := os.Stdin\n\tif len(os.Args) > 1 {\n\t\tfp, _ = os.Open(os.Args[1])\n\t}\n\n\tscanner := getScanner(fp)\n\twriter := bufio.NewWriter(os.Stdout)\n\n\ts := getNextString(scanner)\n\tans := \"NO\"\n\tif able(s) {\n\t\tans = \"YES\"\n\t}\n\tfmt.Fprintln(writer, ans)\n\twriter.Flush()\n}\n\nfunc able(s string) bool {\n\tif s == \"\" {\n\t\treturn true\n\t}\n\n\tss := map[string]int{\n\t\t\"dream\": 5,\n\t\t\"dreamer\": 7,\n\t\t\"erase\": 5,\n\t\t\"eraser\": 6,\n\t}\n\n\tfor sss, l := range ss {\n\t\tif len(s) < l {\n\t\t\tcontinue\n\t\t}\n\t\tif s[0:l] == sss {\n\t\t\tif able(s[l:]) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\n\treturn false\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "sample_input": "erasedream\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03854", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1123, "cpu_time_ms": 44, "memory_kb": 11392}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s913792262", "group_id": "codeNet:p03854", "input_text": "package main\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tif s[:1] != \"d\" && s[:1] != \"e\" {\n\t\tfmt.Println(\"NO\")\n\t\tos.Exit(0)\n\t}\n\n\tfor {\n\t\tvar err error\n\t\ts, err = removeMatchedStr(s)\n\t\tif err != nil {\n\t\t\tfmt.Println(\"NO\")\n\t\t\tos.Exit(0)\n\t\t}\n\t\tif len(s) == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(\"YES\")\n}\n\nfunc removeMatchedStr(s string) (string, error) {\n\tif s == \"dreamer\" || s == \"dream\" || s == \"eraser\" || s == \"erase\" {\n\t\treturn \"\", nil\n\t}\n\n\tif strings.HasSuffix(s, \"dreamer\") {\n\t\treturn strings.TrimSuffix(s, \"dreamer\"), nil\n\t}\n\n\tif strings.HasSuffix(s, \"dream\") {\n\t\treturn strings.TrimSuffix(s, \"dream\"), nil\n\t}\n\n\tif strings.HasSuffix(s, \"eraser\") {\n\t\treturn strings.TrimSuffix(s, \"eraser\"), nil\n\t}\n\n\tif strings.HasSuffix(s, \"erase\") {\n\t\treturn strings.TrimSuffix(s, \"erase\"), nil\n\t}\n\n\treturn \"\", errors.New(\"string is not found\")\n}\n", "language": "Go", "metadata": {"date": 1562796984, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03854.html", "problem_id": "p03854", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03854/input.txt", "sample_output_relpath": "derived/input_output/data/p03854/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03854/Go/s913792262.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s913792262", "user_id": "u950580836"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tvar s string\n\tfmt.Scan(&s)\n\n\tif s[:1] != \"d\" && s[:1] != \"e\" {\n\t\tfmt.Println(\"NO\")\n\t\tos.Exit(0)\n\t}\n\n\tfor {\n\t\tvar err error\n\t\ts, err = removeMatchedStr(s)\n\t\tif err != nil {\n\t\t\tfmt.Println(\"NO\")\n\t\t\tos.Exit(0)\n\t\t}\n\t\tif len(s) == 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\tfmt.Println(\"YES\")\n}\n\nfunc removeMatchedStr(s string) (string, error) {\n\tif s == \"dreamer\" || s == \"dream\" || s == \"eraser\" || s == \"erase\" {\n\t\treturn \"\", nil\n\t}\n\n\tif strings.HasSuffix(s, \"dreamer\") {\n\t\treturn strings.TrimSuffix(s, \"dreamer\"), nil\n\t}\n\n\tif strings.HasSuffix(s, \"dream\") {\n\t\treturn strings.TrimSuffix(s, \"dream\"), nil\n\t}\n\n\tif strings.HasSuffix(s, \"eraser\") {\n\t\treturn strings.TrimSuffix(s, \"eraser\"), nil\n\t}\n\n\tif strings.HasSuffix(s, \"erase\") {\n\t\treturn strings.TrimSuffix(s, \"erase\"), nil\n\t}\n\n\treturn \"\", errors.New(\"string is not found\")\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "sample_input": "erasedream\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03854", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 879, "cpu_time_ms": 54, "memory_kb": 1280}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s606935039", "group_id": "codeNet:p03854", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"regexp\"\n)\n\nvar S string\n\nfunc main() {\n\tfmt.Scan(&S)\n\tr := regexp.MustCompile(`^(eraser|erase|dreamer|dream)`)\n\tif r.MatchString(S) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n\n/* ---------------------------------------- */\n\nfunc gcd(x, y uint64) uint64 {\n\tif x%y == 0 {\n\t\treturn y\n\t} else {\n\t\tr := x % y\n\t\treturn gcd(y, r)\n\t}\n}\n\nfunc combination(x, y int) int {\n\treturn permutation(x, y) / permutation(y, y)\n}\n\nfunc permutation(x, y int) int {\n\tvar ans int = 1\n\tfor i := x - y; 0 < i; i-- {\n\t\tans *= i\n\t}\n\treturn ans\n}\n\nfunc max(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Max(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\n\nfunc min(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Min(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\nfunc pow(x, y int) int { return int(math.Pow(float64(x), float64(y))) }\nfunc abs(x int) int { return int(math.Abs(float64(x))) }\nfunc floor(x int) int { return int(math.Floor(float64(x))) }\n\ntype XY struct {\n\tx int\n\ty int\n}\n\ntype SortBy [][]int\n\nfunc (a SortBy) Len() int { return len(a) }\nfunc (a SortBy) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a SortBy) Less(i, j int) bool {\n\treturn a[i][1] < a[j][1]\n}\n", "language": "Go", "metadata": {"date": 1561416842, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03854.html", "problem_id": "p03854", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03854/input.txt", "sample_output_relpath": "derived/input_output/data/p03854/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03854/Go/s606935039.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s606935039", "user_id": "u266742706"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"math\"\n\t\"regexp\"\n)\n\nvar S string\n\nfunc main() {\n\tfmt.Scan(&S)\n\tr := regexp.MustCompile(`^(eraser|erase|dreamer|dream)`)\n\tif r.MatchString(S) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n\n/* ---------------------------------------- */\n\nfunc gcd(x, y uint64) uint64 {\n\tif x%y == 0 {\n\t\treturn y\n\t} else {\n\t\tr := x % y\n\t\treturn gcd(y, r)\n\t}\n}\n\nfunc combination(x, y int) int {\n\treturn permutation(x, y) / permutation(y, y)\n}\n\nfunc permutation(x, y int) int {\n\tvar ans int = 1\n\tfor i := x - y; 0 < i; i-- {\n\t\tans *= i\n\t}\n\treturn ans\n}\n\nfunc max(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Max(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\n\nfunc min(x ...int) int {\n\tvar res int = x[0]\n\tfor i := 1; i < len(x); i++ {\n\t\tres = int(math.Min(float64(x[i]), float64(res)))\n\t}\n\treturn res\n}\nfunc pow(x, y int) int { return int(math.Pow(float64(x), float64(y))) }\nfunc abs(x int) int { return int(math.Abs(float64(x))) }\nfunc floor(x int) int { return int(math.Floor(float64(x))) }\n\ntype XY struct {\n\tx int\n\ty int\n}\n\ntype SortBy [][]int\n\nfunc (a SortBy) Len() int { return len(a) }\nfunc (a SortBy) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\nfunc (a SortBy) Less(i, j int) bool {\n\treturn a[i][1] < a[j][1]\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "sample_input": "erasedream\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03854", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1290, "cpu_time_ms": 55, "memory_kb": 1408}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s384600062", "group_id": "codeNet:p03854", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"regexp\"\n)\n\nfunc main() {\n\tvar str string\n\tfmt.Scan(&str)\n\n\tfor 0 < len(str) {\n\t\tbefore := len(str)\n\n\t\trep := regexp.MustCompile(`eraser$|erase$|dreamer$|dream$`)\n\t\tstr = rep.ReplaceAllString(str, \"\")\n\n\t\tafter := len(str)\n\t\tif before == after {\n\t\t\tfmt.Println(\"NO\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"YES\")\n}\n", "language": "Go", "metadata": {"date": 1556508950, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03854.html", "problem_id": "p03854", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03854/input.txt", "sample_output_relpath": "derived/input_output/data/p03854/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03854/Go/s384600062.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s384600062", "user_id": "u463644733"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"regexp\"\n)\n\nfunc main() {\n\tvar str string\n\tfmt.Scan(&str)\n\n\tfor 0 < len(str) {\n\t\tbefore := len(str)\n\n\t\trep := regexp.MustCompile(`eraser$|erase$|dreamer$|dream$`)\n\t\tstr = rep.ReplaceAllString(str, \"\")\n\n\t\tafter := len(str)\n\t\tif before == after {\n\t\t\tfmt.Println(\"NO\")\n\t\t\treturn\n\t\t}\n\t}\n\tfmt.Println(\"YES\")\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "sample_input": "erasedream\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03854", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported 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": 2108, "memory_kb": 5504}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s973800633", "group_id": "codeNet:p03854", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Scan()\n\ts := sc.Text()\n\tif eraser(s, 0) {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\tfmt.Println(\"NO\")\n}\n\nfunc eraser(s string, i int) bool {\n\tif i == len(s) {\n\t\treturn true\n\t}\n\tswitch s[i] {\n\tcase 'd':\n\t\treturn eraseDream(s, i)\n\tcase 'e':\n\t\treturn eraseErase(s, i)\n\tdefault:\n\t\treturn false\n\t}\n\treturn false\n}\n\nfunc eraseDream(s string, i int) bool {\n\ti5 := i + 5\n\tif i5 < len(s) {\n\t\ti7 := i + 7\n\t\tif i7 < len(s) {\n\t\t\tif s[i7] == 'a' {\n\t\t\t\treturn eraseErase(s, i5)\n\t\t\t}\n\t\t\tif s[i:i7] == \"dreamer\" {\n\t\t\t\treturn eraser(s, i7)\n\t\t\t}\n\t\t\treturn s[i:i5] == \"dream\" && eraser(s, i5)\n\t\t}\n\t}\n\treturn i5 == len(s) && s[i:i5] == \"dream\"\n}\n\nfunc eraseErase(s string, i int) bool {\n\ti5 := i + 5\n\tif i5 < len(s) {\n\t\tif s[i5] == 'r' {\n\t\t\tif i5+1 < len(s) {\n\t\t\t\treturn s[i:i5+1] == \"eraser\" && eraser(s, i5+1)\n\t\t\t}\n\t\t\treturn i5+1 == len(s) && s[i:i5+1] == \"eraser\"\n\t\t}\n\t\treturn s[i:i5] == \"erase\" && eraser(s, i5)\n\t}\n\treturn i5 == len(s) && s[i:i5] == \"erase\"\n}\n", "language": "Go", "metadata": {"date": 1556501532, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03854.html", "problem_id": "p03854", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03854/input.txt", "sample_output_relpath": "derived/input_output/data/p03854/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03854/Go/s973800633.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s973800633", "user_id": "u917335111"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nfunc main() {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Scan()\n\ts := sc.Text()\n\tif eraser(s, 0) {\n\t\tfmt.Println(\"YES\")\n\t\treturn\n\t}\n\tfmt.Println(\"NO\")\n}\n\nfunc eraser(s string, i int) bool {\n\tif i == len(s) {\n\t\treturn true\n\t}\n\tswitch s[i] {\n\tcase 'd':\n\t\treturn eraseDream(s, i)\n\tcase 'e':\n\t\treturn eraseErase(s, i)\n\tdefault:\n\t\treturn false\n\t}\n\treturn false\n}\n\nfunc eraseDream(s string, i int) bool {\n\ti5 := i + 5\n\tif i5 < len(s) {\n\t\ti7 := i + 7\n\t\tif i7 < len(s) {\n\t\t\tif s[i7] == 'a' {\n\t\t\t\treturn eraseErase(s, i5)\n\t\t\t}\n\t\t\tif s[i:i7] == \"dreamer\" {\n\t\t\t\treturn eraser(s, i7)\n\t\t\t}\n\t\t\treturn s[i:i5] == \"dream\" && eraser(s, i5)\n\t\t}\n\t}\n\treturn i5 == len(s) && s[i:i5] == \"dream\"\n}\n\nfunc eraseErase(s string, i int) bool {\n\ti5 := i + 5\n\tif i5 < len(s) {\n\t\tif s[i5] == 'r' {\n\t\t\tif i5+1 < len(s) {\n\t\t\t\treturn s[i:i5+1] == \"eraser\" && eraser(s, i5+1)\n\t\t\t}\n\t\t\treturn i5+1 == len(s) && s[i:i5+1] == \"eraser\"\n\t\t}\n\t\treturn s[i:i5] == \"erase\" && eraser(s, i5)\n\t}\n\treturn i5 == len(s) && s[i:i5] == \"erase\"\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "sample_input": "erasedream\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03854", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1036, "cpu_time_ms": 1, "memory_kb": 768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s155592345", "group_id": "codeNet:p03854", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tr := bufio.NewReaderSize(os.Stdin, 200000)\n\ts, _, _ := r.ReadLine()\n\n\tif daydream(string(s)) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n\nfunc daydream(s string) bool {\n\tif s == \"\" {\n\t\treturn true\n\t}\n\n\tif strings.HasPrefix(s, \"dreamer\") {\n\t\treturn daydream(s[7:]) || daydream(s[5:])\n\t} else if strings.HasPrefix(s, \"dream\") {\n\t\treturn daydream(s[5:])\n\t} else if strings.HasPrefix(s, \"eraser\") {\n\t\treturn daydream(s[6:])\n\t} else if strings.HasPrefix(s, \"erase\") {\n\t\treturn daydream(s[5:])\n\t}\n\n\treturn false\n}", "language": "Go", "metadata": {"date": 1554573051, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03854.html", "problem_id": "p03854", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03854/input.txt", "sample_output_relpath": "derived/input_output/data/p03854/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03854/Go/s155592345.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s155592345", "user_id": "u723180465"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc main() {\n\tr := bufio.NewReaderSize(os.Stdin, 200000)\n\ts, _, _ := r.ReadLine()\n\n\tif daydream(string(s)) {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n\nfunc daydream(s string) bool {\n\tif s == \"\" {\n\t\treturn true\n\t}\n\n\tif strings.HasPrefix(s, \"dreamer\") {\n\t\treturn daydream(s[7:]) || daydream(s[5:])\n\t} else if strings.HasPrefix(s, \"dream\") {\n\t\treturn daydream(s[5:])\n\t} else if strings.HasPrefix(s, \"eraser\") {\n\t\treturn daydream(s[6:])\n\t} else if strings.HasPrefix(s, \"erase\") {\n\t\treturn daydream(s[5:])\n\t}\n\n\treturn false\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "sample_input": "erasedream\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03854", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 595, "cpu_time_ms": 10, "memory_kb": 8192}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s442515680", "group_id": "codeNet:p03854", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tlog.SetFlags(log.Lshortfile)\n\tnextReader = NewScanner()\n\tstr := nextString()[0]\n\twords := []string{\n\t\t\"eraser\",\n\t\t\"erase\",\n\t\t\"dreamer\",\n\t\t\"dream\",\n\t}\n\n\tfor {\n\t\tidx := -1\n\t\tfor _, w := range words {\n\t\t\tidx = strings.LastIndex(str, w)\n\t\t\t//fmt.Printf(\"index: %d\\n\", idx)\n\t\t\t//fmt.Printf(\"len(w): %d\\n\", len(w))\n\t\t\t//fmt.Printf(\"len(str): %d\\n\", len(str))\n\t\t\tif idx == -1 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif idx+len(w) != len(str) {\n\t\t\t\tfmt.Println(\"No\")\n\t\t\t\treturn\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif idx == -1 {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t\tstr = str[:idx]\n\t\tif len(str) == 0 {\n\t\t\tfmt.Println(\"Yes\")\n\t\t\treturn\n\t\t}\n\t}\n}\n\n// ------ Mathライブラリ ---------------------------------//\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\n\nfunc maxIdx(a ...int) int {\n\tr := a[0]\n\tindex := 0\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t\tindex = i\n\t\t}\n\t}\n\treturn index\n}\n\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\n\nfunc minIdx(a ...int) int {\n\tr := a[0]\n\tindex := 0\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t\tindex = i\n\t\t}\n\t}\n\treturn index\n}\n\nfunc sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// ------ Mathライブラリ ---------------------------------//\n\n// ----- 標準入力用の関数 ----------------------------------//\nvar nextReader func() []string\n\nfunc NewScanner() func() []string {\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\treturn func() []string {\n\t\tr.Scan()\n\t\treturn strings.Fields(r.Text())\n\t}\n}\n\nfunc nextString() []string {\n\treturn nextReader()\n}\n\nfunc nextInt() []int {\n\tvar intArray []int\n\tstrArray := nextReader()\n\tfor _, v := range strArray {\n\t\ti, _ := strconv.Atoi(v)\n\t\tintArray = append(intArray, i)\n\t}\n\treturn intArray\n}\n\nfunc nextFloat64() []float64 {\n\tvar floatArray []float64\n\tstrArray := nextReader()\n\tfor _, v := range strArray {\n\t\tf, _ := strconv.ParseFloat(v, 64)\n\t\tfloatArray = append(floatArray, f)\n\t}\n\treturn floatArray\n}\n\n// ------ 標準入力用の関数 ---------------------------------//\n\n// ------ あまり使わない -----------------------------------//\nfunc nextInt64() []int64 {\n\tvar int64Array []int64\n\tstrArray := nextReader()\n\tfor _, v := range strArray {\n\t\ti, _ := strconv.ParseInt(v, 10, 64)\n\t\tint64Array = append(int64Array, i)\n\t}\n\treturn int64Array\n}\n\n// ------ あまり使わない -----------------------------------//\n", "language": "Go", "metadata": {"date": 1550366120, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03854.html", "problem_id": "p03854", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03854/input.txt", "sample_output_relpath": "derived/input_output/data/p03854/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03854/Go/s442515680.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s442515680", "user_id": "u048735692"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\nfunc main() {\n\tlog.SetFlags(log.Lshortfile)\n\tnextReader = NewScanner()\n\tstr := nextString()[0]\n\twords := []string{\n\t\t\"eraser\",\n\t\t\"erase\",\n\t\t\"dreamer\",\n\t\t\"dream\",\n\t}\n\n\tfor {\n\t\tidx := -1\n\t\tfor _, w := range words {\n\t\t\tidx = strings.LastIndex(str, w)\n\t\t\t//fmt.Printf(\"index: %d\\n\", idx)\n\t\t\t//fmt.Printf(\"len(w): %d\\n\", len(w))\n\t\t\t//fmt.Printf(\"len(str): %d\\n\", len(str))\n\t\t\tif idx == -1 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif idx+len(w) != len(str) {\n\t\t\t\tfmt.Println(\"No\")\n\t\t\t\treturn\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif idx == -1 {\n\t\t\tfmt.Println(\"No\")\n\t\t\treturn\n\t\t}\n\t\tstr = str[:idx]\n\t\tif len(str) == 0 {\n\t\t\tfmt.Println(\"Yes\")\n\t\t\treturn\n\t\t}\n\t}\n}\n\n// ------ Mathライブラリ ---------------------------------//\nfunc max(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\n\nfunc maxIdx(a ...int) int {\n\tr := a[0]\n\tindex := 0\n\tfor i := 0; i < len(a); i++ {\n\t\tif r < a[i] {\n\t\t\tr = a[i]\n\t\t\tindex = i\n\t\t}\n\t}\n\treturn index\n}\n\nfunc min(a ...int) int {\n\tr := a[0]\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t}\n\t}\n\treturn r\n}\n\nfunc minIdx(a ...int) int {\n\tr := a[0]\n\tindex := 0\n\tfor i := 0; i < len(a); i++ {\n\t\tif r > a[i] {\n\t\t\tr = a[i]\n\t\t\tindex = i\n\t\t}\n\t}\n\treturn index\n}\n\nfunc sum(a []int) (r int) {\n\tfor i := range a {\n\t\tr += a[i]\n\t}\n\treturn r\n}\n\nfunc abs(a int) int {\n\tif a < 0 {\n\t\treturn -a\n\t}\n\treturn a\n}\n\n// ------ Mathライブラリ ---------------------------------//\n\n// ----- 標準入力用の関数 ----------------------------------//\nvar nextReader func() []string\n\nfunc NewScanner() func() []string {\n\tr := bufio.NewScanner(os.Stdin)\n\tr.Buffer(make([]byte, 1024), int(1e+11))\n\treturn func() []string {\n\t\tr.Scan()\n\t\treturn strings.Fields(r.Text())\n\t}\n}\n\nfunc nextString() []string {\n\treturn nextReader()\n}\n\nfunc nextInt() []int {\n\tvar intArray []int\n\tstrArray := nextReader()\n\tfor _, v := range strArray {\n\t\ti, _ := strconv.Atoi(v)\n\t\tintArray = append(intArray, i)\n\t}\n\treturn intArray\n}\n\nfunc nextFloat64() []float64 {\n\tvar floatArray []float64\n\tstrArray := nextReader()\n\tfor _, v := range strArray {\n\t\tf, _ := strconv.ParseFloat(v, 64)\n\t\tfloatArray = append(floatArray, f)\n\t}\n\treturn floatArray\n}\n\n// ------ 標準入力用の関数 ---------------------------------//\n\n// ------ あまり使わない -----------------------------------//\nfunc nextInt64() []int64 {\n\tvar int64Array []int64\n\tstrArray := nextReader()\n\tfor _, v := range strArray {\n\t\ti, _ := strconv.ParseInt(v, 10, 64)\n\t\tint64Array = append(int64Array, i)\n\t}\n\treturn int64Array\n}\n\n// ------ あまり使わない -----------------------------------//\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "sample_input": "erasedream\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03854", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2659, "cpu_time_ms": 4, "memory_kb": 1024}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s631327561", "group_id": "codeNet:p03854", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc readLine() []byte {\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn buf\n}\n\ntype TBytes []byte\n\nfunc (obj TBytes) HasSuffix(keys []TBytes) int {\n\tfor _, k := range keys {\n\t\tif bytes.HasSuffix(obj, k) {\n\t\t\treturn len(k)\n\t\t}\n\t}\n\treturn -1\n}\n\nfunc main() {\n\ts := TBytes(readLine())\n\tkeys := []TBytes{TBytes(\"dreamer\"), TBytes(\"eraser\"), TBytes(\"dream\"), TBytes(\"erase\")}\n\tfor klen := 0; klen >= 0; klen = s.HasSuffix(keys) {\n\t\ts = s[0 : len(s)-klen]\n\t}\n\tif len(s) == 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1481569342, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03854.html", "problem_id": "p03854", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03854/input.txt", "sample_output_relpath": "derived/input_output/data/p03854/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03854/Go/s631327561.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s631327561", "user_id": "u434748769"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar rdr = bufio.NewReaderSize(os.Stdin, 1000000)\n\nfunc readLine() []byte {\n\tbuf := make([]byte, 0, 1000000)\n\tfor {\n\t\tl, p, e := rdr.ReadLine()\n\t\tif e != nil {\n\t\t\tpanic(e)\n\t\t}\n\t\tbuf = append(buf, l...)\n\t\tif !p {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn buf\n}\n\ntype TBytes []byte\n\nfunc (obj TBytes) HasSuffix(keys []TBytes) int {\n\tfor _, k := range keys {\n\t\tif bytes.HasSuffix(obj, k) {\n\t\t\treturn len(k)\n\t\t}\n\t}\n\treturn -1\n}\n\nfunc main() {\n\ts := TBytes(readLine())\n\tkeys := []TBytes{TBytes(\"dreamer\"), TBytes(\"eraser\"), TBytes(\"dream\"), TBytes(\"erase\")}\n\tfor klen := 0; klen >= 0; klen = s.HasSuffix(keys) {\n\t\ts = s[0 : len(s)-klen]\n\t}\n\tif len(s) == 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "sample_input": "erasedream\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03854", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 747, "cpu_time_ms": 4, "memory_kb": 896}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s826770761", "group_id": "codeNet:p03854", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\ntype TBytes []byte\n\nfunc (obj TBytes) HasSuffix(keys []TBytes) int {\n\tfor _, k := range keys {\n\t\tif bytes.HasSuffix(obj, k) {\n\t\t\treturn len(k)\n\t\t}\n\t}\n\treturn -1\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\ts := TBytes(nextLine())\n\tkeys := []TBytes{TBytes(\"dreamer\"), TBytes(\"eraser\"), TBytes(\"dream\"), TBytes(\"erase\")}\n\tfor klen := 0; klen >= 0; klen = s.HasSuffix(keys) {\n\t\ts = s[0 : len(s)-klen]\n\t}\n\tif len(s) == 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "language": "Go", "metadata": {"date": 1481568410, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03854.html", "problem_id": "p03854", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03854/input.txt", "sample_output_relpath": "derived/input_output/data/p03854/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03854/Go/s826770761.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s826770761", "user_id": "u434748769"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"fmt\"\n\t\"os\"\n)\n\ntype TBytes []byte\n\nfunc (obj TBytes) HasSuffix(keys []TBytes) int {\n\tfor _, k := range keys {\n\t\tif bytes.HasSuffix(obj, k) {\n\t\t\treturn len(k)\n\t\t}\n\t}\n\treturn -1\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc nextLine() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc main() {\n\ts := TBytes(nextLine())\n\tkeys := []TBytes{TBytes(\"dreamer\"), TBytes(\"eraser\"), TBytes(\"dream\"), TBytes(\"erase\")}\n\tfor klen := 0; klen >= 0; klen = s.HasSuffix(keys) {\n\t\ts = s[0 : len(s)-klen]\n\t}\n\tif len(s) == 0 {\n\t\tfmt.Println(\"YES\")\n\t} else {\n\t\tfmt.Println(\"NO\")\n\t}\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "sample_input": "erasedream\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03854", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a string S consisting of lowercase English letters.\nAnother string T is initially empty.\nDetermine whether it is possible to obtain S = T by performing the following operation an arbitrary number of times:\n\nAppend one of the following at the end of T: dream, dreamer, erase and eraser.\n\nConstraints\n\n1≦|S|≦10^5\n\nS consists of lowercase English letters.\n\nInput\n\nThe input is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf it is possible to obtain S = T, print YES. Otherwise, print NO.\n\nSample Input 1\n\nerasedream\n\nSample Output 1\n\nYES\n\nAppend erase and dream at the end of T in this order, to obtain S = T.\n\nSample Input 2\n\ndreameraser\n\nSample Output 2\n\nYES\n\nAppend dream and eraser at the end of T in this order, to obtain S = T.\n\nSample Input 3\n\ndreamerer\n\nSample Output 3\n\nNO", "split": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 599, "cpu_time_ms": 3, "memory_kb": 768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s437614020", "group_id": "codeNet:p03945", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar bufin *bufio.Reader\nvar bufout *bufio.Writer\n\nfunc reverse(S string) string {\n\trunes := []rune(S)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\nfunc solve(S string) int {\n\tc := S[0]\n\tret := 0\n\tfor i := 1; i < len(S); i++ {\n\t\tif c != S[i] {\n\t\t\tret += 1\n\t\t\tc = S[i]\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tbufin = bufio.NewReader(os.Stdin)\n\tbufout = bufio.NewWriter(os.Stdout)\n\tdefer bufout.Flush()\n\tvar S string\n\tfmt.Fscanf(bufin, \"%s\\n\", &S)\n\ta := solve(S)\n\tT := reverse(S)\n\tb := solve(T)\n\tif a > b {\n\t\ta = b\n\t}\n\tfmt.Fprintf(bufout, \"%d\\n\", a)\n}\n", "language": "Go", "metadata": {"date": 1478635260, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03945.html", "problem_id": "p03945", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03945/input.txt", "sample_output_relpath": "derived/input_output/data/p03945/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03945/Go/s437614020.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s437614020", "user_id": "u453847760"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n)\n\nvar bufin *bufio.Reader\nvar bufout *bufio.Writer\n\nfunc reverse(S string) string {\n\trunes := []rune(S)\n\tfor i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {\n\t\trunes[i], runes[j] = runes[j], runes[i]\n\t}\n\treturn string(runes)\n}\nfunc solve(S string) int {\n\tc := S[0]\n\tret := 0\n\tfor i := 1; i < len(S); i++ {\n\t\tif c != S[i] {\n\t\t\tret += 1\n\t\t\tc = S[i]\n\t\t}\n\t}\n\treturn ret\n}\n\nfunc main() {\n\tbufin = bufio.NewReader(os.Stdin)\n\tbufout = bufio.NewWriter(os.Stdout)\n\tdefer bufout.Flush()\n\tvar S string\n\tfmt.Fscanf(bufin, \"%s\\n\", &S)\n\ta := solve(S)\n\tT := reverse(S)\n\tb := solve(T)\n\tif a > b {\n\t\ta = b\n\t}\n\tfmt.Fprintf(bufout, \"%d\\n\", a)\n}\n", "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": "p03945", "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": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 673, "cpu_time_ms": 10, "memory_kb": 1792}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s365299846", "group_id": "codeNet:p03945", "input_text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc nextLine(sc *bufio.Scanner) string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nvar fp *os.File\n\nfunc input() *os.File {\n\tvar err error\n\tfp, err = os.Open(\"input.txt\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn fp\n}\n\nfunc rmConseq(S string, p string) string {\n\tvar pp = p + p\n\tvar tmp = \"\"\n\n\tfor strings.Compare(S, tmp) != 0 {\n\t\ttmp = S\n\t\tS = strings.Replace(S, pp, p, -1)\n\t}\n\treturn S\n}\n\n// main\n\nfunc main() {\n\n\t//var sc = bufio.NewScanner(input())\n\tvar sc = bufio.NewScanner(os.Stdin)\n\n\tvar S = nextLine(sc)\n\tS = rmConseq(S, \"B\")\n\tS = rmConseq(S, \"W\")\n\n\tfmt.Println(len(S) - 1)\n\n\tdefer fp.Close()\n\n}\n", "language": "Go", "metadata": {"date": 1478489373, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p03945.html", "problem_id": "p03945", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03945/input.txt", "sample_output_relpath": "derived/input_output/data/p03945/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03945/Go/s365299846.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s365299846", "user_id": "u174620969"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"strings\"\n)\n\nfunc nextLine(sc *bufio.Scanner) string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nvar fp *os.File\n\nfunc input() *os.File {\n\tvar err error\n\tfp, err = os.Open(\"input.txt\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn fp\n}\n\nfunc rmConseq(S string, p string) string {\n\tvar pp = p + p\n\tvar tmp = \"\"\n\n\tfor strings.Compare(S, tmp) != 0 {\n\t\ttmp = S\n\t\tS = strings.Replace(S, pp, p, -1)\n\t}\n\treturn S\n}\n\n// main\n\nfunc main() {\n\n\t//var sc = bufio.NewScanner(input())\n\tvar sc = bufio.NewScanner(os.Stdin)\n\n\tvar S = nextLine(sc)\n\tS = rmConseq(S, \"B\")\n\tS = rmConseq(S, \"W\")\n\n\tfmt.Println(len(S) - 1)\n\n\tdefer fp.Close()\n\n}\n", "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": "p03945", "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": "test_out_of_distribution", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 654, "cpu_time_ms": 3, "memory_kb": 768}, "variant": "medium_resource"} {"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:Go:s010358813", "group_id": "codeNet:p04044", "input_text": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, l int\n\tfmt.Scan(&n, &l)\n\ts := make([]string, l)\n\tfor i := 0; i< l; i++{\n\t\tfmt.Scan(&s[i])\n\t}\n\tsort.Strings(s)\n\n\tvar ans string\n\tfor _, key := range\t s{\n\t\tans += key\n\t}\n\tfmt.Print(ans)\n}\n", "language": "Go", "metadata": {"date": 1600029731, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p04044.html", "problem_id": "p04044", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04044/input.txt", "sample_output_relpath": "derived/input_output/data/p04044/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04044/Go/s010358813.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s010358813", "user_id": "u950611195"}, "prompt_components": {"gold_output": "axxcxxdxx\n", "input_to_evaluate": "package main\n\nimport (\n\t\"fmt\"\n\t\"sort\"\n)\n\nfunc main() {\n\tvar n, l int\n\tfmt.Scan(&n, &l)\n\ts := make([]string, l)\n\tfor i := 0; i< l; i++{\n\t\tfmt.Scan(&s[i])\n\t}\n\tsort.Strings(s)\n\n\tvar ans string\n\tfor _, key := range\t s{\n\t\tans += key\n\t}\n\tfmt.Print(ans)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nIroha has a sequence of N strings S_1, S_2, ..., S_N. The length of each string is L.\n\nShe will concatenate all of the strings in some order, to produce a long string.\n\nAmong all strings that she can produce in this way, find the lexicographically smallest one.\n\nHere, a string s=s_1s_2s_3...s_n is lexicographically smaller than another string t=t_1t_2t_3...t_m if and only if one of the following holds:\n\nThere exists an index i(1≦i≦min(n,m)), such that s_j = t_j for all indices j(1≦j 0 {\n\t\tif n&1 == 1 {\n\t\t\tr = r * a % MOD\n\t\t}\n\t\ta = a * a % MOD\n\t\tn >>= 1\n\t}\n\treturn r\n}\n\nfunc ModInv(a int64) int64 {\n\tvar b, u, v int64 = MOD, 1, 0\n\tfor b > 0 {\n\t\tt := a / b\n\t\ta -= t * b\n\t\ta, b = b, a\n\t\tu -= t * v\n\t\tu, v = v, u\n\t}\n\tu %= MOD\n\tif u < 0 {\n\t\tu += MOD\n\t}\n\treturn u\n}\n\ntype Q struct {\n\tvalue int\n\tindex int\n\tA, B int\n}\n\ntype QS []*Q\n\nfunc (p QS) Len() int { return len(p) }\nfunc (p QS) Less(i, j int) bool { return p[i].value > p[j].value }\nfunc (pq QS) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n\tpq[i].index = i\n\tpq[j].index = j\n}\n\nfunc (pq *QS) Push(x interface{}) {\n\tn := len(*pq)\n\titem := x.(*Q)\n\titem.index = n\n\t*pq = append(*pq, item)\n}\n\nfunc (pq *QS) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\told[n-1] = nil // avoid memory leak\n\titem.index = -1 // for safety\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\nfunc GCD(a, b int64) int64 {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn GCD(b, a%b)\n}\n\nfunc LCM(a, b int64) int64 {\n\treturn a * b / GCD(a, b)\n}\n\ntype UnionFind struct {\n\tpar []int\n\tsize []int\n}\n\nfunc NewUnionFind(size int) *UnionFind {\n\treturn new(UnionFind).init(size)\n}\n\nfunc (uf *UnionFind) init(size int) *UnionFind {\n\tuf.par = make([]int, size)\n\tuf.size = make([]int, size)\n\n\tfor i := 0; i < size; i++ {\n\t\tuf.par[i] = i\n\t\tuf.size[i] = 1\n\t}\n\treturn uf\n}\n\nfunc (uf *UnionFind) Unite(p int, q int) {\n\trp := uf.Root(p)\n\trq := uf.Root(q)\n\tif rp == rq {\n\t\treturn\n\t}\n\tif uf.size[rp] < uf.size[rq] {\n\t\tuf.par[rp] = uf.par[rq]\n\t\tuf.size[rq] += uf.size[rp]\n\t} else {\n\t\tuf.par[rq] = uf.par[rp]\n\t\tuf.size[rp] += uf.size[rq]\n\t}\n}\n\nfunc (uf *UnionFind) Root(p int) int {\n\tfor uf.par[p] == p {\n\t\treturn p\n\t}\n\tuf.par[p] = uf.Root(uf.par[p])\n\treturn uf.par[p]\n}\n\nfunc (uf *UnionFind) Size(p int) int {\n\treturn uf.size[uf.Root(p)]\n}\n\nfunc (uf *UnionFind) Same(p int, q int) bool {\n\treturn uf.Root(p) == uf.Root(q)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tn, _ := strconv.Atoi(getStr())\n\treturn n\n}\n\nfunc getStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc factor(result map[int]int, num, pnum int) map[int]int {\n\tif pnum*pnum > num {\n\t\tif num != 1 {\n\t\t\tresult[num] += 1\n\t\t}\n\t\treturn result\n\t}\n\n\tif num%pnum == 0 {\n\t\tnum /= pnum\n\t\tresult[pnum]++\n\t} else {\n\t\tpnum++\n\t}\n\treturn factor(result, num, pnum)\n}\n\nfunc main() {\n\tN, _ := getInt(), getInt()\n\tS := make([]string, N)\n\tfor i := 0; i < N; i++ {\n\t\tS[i] = getStr()\n\t}\n\tsort.Strings(S)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Print(S[i])\n\t}\n\tfmt.Println()\n}\n\ntype IntHeap []int\n\nfunc (h IntHeap) Len() int { return len(h) }\nfunc (h IntHeap) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h IntHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\n\nfunc (h *IntHeap) Push(x interface{}) {\n\t// Push and Pop use pointer receivers because they modify the slice's length,\n\t// not just its contents.\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IntHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n", "language": "Go", "metadata": {"date": 1593707007, "filename_ext": "go", "original_language": "Go (1.14.1)", "problem_description_relpath": "problem_descriptions/p04044.html", "problem_id": "p04044", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04044/input.txt", "sample_output_relpath": "derived/input_output/data/p04044/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04044/Go/s209055158.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s209055158", "user_id": "u534481484"}, "prompt_components": {"gold_output": "axxcxxdxx\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\nvar (\n\tfinv, inv, fac [MAX]int\n)\n\nfunc COM(n, k int) int {\n\tif n < k {\n\t\treturn 0\n\t}\n\tif n < 0 || k < 0 {\n\t\treturn 0\n\t}\n\treturn fac[n] * (finv[k] * finv[n-k] % MOD) % MOD\n}\n\nfunc init() {\n\tfac[0] = 1\n\tfac[1] = 1\n\tfinv[0] = 1\n\tfinv[1] = 1\n\tinv[1] = 1\n\tfor i := 2; i < MAX; i++ {\n\t\tfac[i] = fac[i-1] * i % MOD\n\t\tinv[i] = MOD - inv[MOD%i]*(MOD/i)%MOD\n\t\tfinv[i] = finv[i-1] * inv[i] % MOD\n\t}\n\t//sc.Split(bufio.ScanLines)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer([]byte{}, 500100)\n}\n\nconst (\n\tMOD = 1000000007\n\tMAX = 510000\n)\n\nfunc ModAdd(a, b int64) int64 {\n\treturn (a + b) % MOD\n}\n\nfunc ModMul(a, b int64) int64 {\n\treturn a * b % MOD\n}\n\nfunc ModSub(a, b int64) int64 {\n\tr := (a%MOD - b%MOD) % MOD\n\tif r < 0 {\n\t\tr += MOD\n\t}\n\treturn r\n}\n\nfunc ModDiv(a, b int64) int64 {\n\treturn a % MOD * ModInv(b) % MOD\n}\n\nfunc ModPow(a, n int64) int64 {\n\tvar r int64 = 1\n\tfor n > 0 {\n\t\tif n&1 == 1 {\n\t\t\tr = r * a % MOD\n\t\t}\n\t\ta = a * a % MOD\n\t\tn >>= 1\n\t}\n\treturn r\n}\n\nfunc ModInv(a int64) int64 {\n\tvar b, u, v int64 = MOD, 1, 0\n\tfor b > 0 {\n\t\tt := a / b\n\t\ta -= t * b\n\t\ta, b = b, a\n\t\tu -= t * v\n\t\tu, v = v, u\n\t}\n\tu %= MOD\n\tif u < 0 {\n\t\tu += MOD\n\t}\n\treturn u\n}\n\ntype Q struct {\n\tvalue int\n\tindex int\n\tA, B int\n}\n\ntype QS []*Q\n\nfunc (p QS) Len() int { return len(p) }\nfunc (p QS) Less(i, j int) bool { return p[i].value > p[j].value }\nfunc (pq QS) Swap(i, j int) {\n\tpq[i], pq[j] = pq[j], pq[i]\n\tpq[i].index = i\n\tpq[j].index = j\n}\n\nfunc (pq *QS) Push(x interface{}) {\n\tn := len(*pq)\n\titem := x.(*Q)\n\titem.index = n\n\t*pq = append(*pq, item)\n}\n\nfunc (pq *QS) Pop() interface{} {\n\told := *pq\n\tn := len(old)\n\titem := old[n-1]\n\told[n-1] = nil // avoid memory leak\n\titem.index = -1 // for safety\n\t*pq = old[0 : n-1]\n\treturn item\n}\n\nfunc GCD(a, b int64) int64 {\n\tif b == 0 {\n\t\treturn a\n\t}\n\treturn GCD(b, a%b)\n}\n\nfunc LCM(a, b int64) int64 {\n\treturn a * b / GCD(a, b)\n}\n\ntype UnionFind struct {\n\tpar []int\n\tsize []int\n}\n\nfunc NewUnionFind(size int) *UnionFind {\n\treturn new(UnionFind).init(size)\n}\n\nfunc (uf *UnionFind) init(size int) *UnionFind {\n\tuf.par = make([]int, size)\n\tuf.size = make([]int, size)\n\n\tfor i := 0; i < size; i++ {\n\t\tuf.par[i] = i\n\t\tuf.size[i] = 1\n\t}\n\treturn uf\n}\n\nfunc (uf *UnionFind) Unite(p int, q int) {\n\trp := uf.Root(p)\n\trq := uf.Root(q)\n\tif rp == rq {\n\t\treturn\n\t}\n\tif uf.size[rp] < uf.size[rq] {\n\t\tuf.par[rp] = uf.par[rq]\n\t\tuf.size[rq] += uf.size[rp]\n\t} else {\n\t\tuf.par[rq] = uf.par[rp]\n\t\tuf.size[rp] += uf.size[rq]\n\t}\n}\n\nfunc (uf *UnionFind) Root(p int) int {\n\tfor uf.par[p] == p {\n\t\treturn p\n\t}\n\tuf.par[p] = uf.Root(uf.par[p])\n\treturn uf.par[p]\n}\n\nfunc (uf *UnionFind) Size(p int) int {\n\treturn uf.size[uf.Root(p)]\n}\n\nfunc (uf *UnionFind) Same(p int, q int) bool {\n\treturn uf.Root(p) == uf.Root(q)\n}\n\nvar sc = bufio.NewScanner(os.Stdin)\n\nfunc getInt() int {\n\tn, _ := strconv.Atoi(getStr())\n\treturn n\n}\n\nfunc getStr() string {\n\tsc.Scan()\n\treturn sc.Text()\n}\n\nfunc factor(result map[int]int, num, pnum int) map[int]int {\n\tif pnum*pnum > num {\n\t\tif num != 1 {\n\t\t\tresult[num] += 1\n\t\t}\n\t\treturn result\n\t}\n\n\tif num%pnum == 0 {\n\t\tnum /= pnum\n\t\tresult[pnum]++\n\t} else {\n\t\tpnum++\n\t}\n\treturn factor(result, num, pnum)\n}\n\nfunc main() {\n\tN, _ := getInt(), getInt()\n\tS := make([]string, N)\n\tfor i := 0; i < N; i++ {\n\t\tS[i] = getStr()\n\t}\n\tsort.Strings(S)\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Print(S[i])\n\t}\n\tfmt.Println()\n}\n\ntype IntHeap []int\n\nfunc (h IntHeap) Len() int { return len(h) }\nfunc (h IntHeap) Less(i, j int) bool { return h[i] < h[j] }\nfunc (h IntHeap) Swap(i, j int) { h[i], h[j] = h[j], h[i] }\n\nfunc (h *IntHeap) Push(x interface{}) {\n\t// Push and Pop use pointer receivers because they modify the slice's length,\n\t// not just its contents.\n\t*h = append(*h, x.(int))\n}\n\nfunc (h *IntHeap) Pop() interface{} {\n\told := *h\n\tn := len(old)\n\tx := old[n-1]\n\t*h = old[0 : n-1]\n\treturn x\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nIroha has a sequence of N strings S_1, S_2, ..., S_N. The length of each string is L.\n\nShe will concatenate all of the strings in some order, to produce a long string.\n\nAmong all strings that she can produce in this way, find the lexicographically smallest one.\n\nHere, a string s=s_1s_2s_3...s_n is lexicographically smaller than another string t=t_1t_2t_3...t_m if and only if one of the following holds:\n\nThere exists an index i(1≦i≦min(n,m)), such that s_j = t_j for all indices j(1≦j i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc pow(x, y int) int {\n\tres := 1\n\tfor i := 0; i < y; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\nfunc ceil(a, b int) int {\n\tif a%b == 0 {\n\t\treturn a / b\n\t} else {\n\t\treturn a/b + 1\n\t}\n}\n\n// Sort\ntype RuneSlice []rune\n\nfunc (a RuneSlice) Len() int { return len(a) }\nfunc (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }\nfunc (a RuneSlice) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\n\n// Main\nfunc main() {\n\tsc := NewScanner()\n\twtr := bufio.NewWriter(os.Stdout)\n\tN, _ := sc.nextInt(), sc.nextInt()\n\tS := make([]string, N)\n\tfor i := 0; i < N; i++ {\n\t\tS[i] = sc.nextStr()\n\t}\n\tsort.Strings(S)\n\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Fprint(wtr, S[i])\n\t}\n\tfmt.Fprintln(wtr)\n\twtr.Flush()\n}\n", "language": "Go", "metadata": {"date": 1578112816, "filename_ext": "go", "original_language": "Go (1.6)", "problem_description_relpath": "problem_descriptions/p04044.html", "problem_id": "p04044", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p04044/input.txt", "sample_output_relpath": "derived/input_output/data/p04044/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p04044/Go/s193248811.go", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s193248811", "user_id": "u924691798"}, "prompt_components": {"gold_output": "axxcxxdxx\n", "input_to_evaluate": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"sort\"\n\t\"strconv\"\n)\n\n// I/O\ntype Scanner struct {\n\tsc *bufio.Scanner\n}\n\nfunc NewScanner() *Scanner {\n\tsc := bufio.NewScanner(os.Stdin)\n\tsc.Split(bufio.ScanWords)\n\tsc.Buffer(make([]byte, 1024), int(1e+9))\n\treturn &Scanner{sc}\n}\n\nfunc (s *Scanner) nextStr() string {\n\ts.sc.Scan()\n\treturn s.sc.Text()\n}\n\nfunc (s *Scanner) nextInt() int {\n\ti, e := strconv.Atoi(s.nextStr())\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn i\n}\n\nfunc (s *Scanner) nextFloat() float64 {\n\tf, e := strconv.ParseFloat(s.nextStr(), 64)\n\tif e != nil {\n\t\tpanic(e)\n\t}\n\treturn f\n}\n\nfunc (s *Scanner) nextRuneSlice() []rune {\n\treturn []rune(s.nextStr())\n}\n\nfunc (s *Scanner) nextIntSlice(n int) []int {\n\tres := make([]int, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextInt()\n\t}\n\treturn res\n}\n\nfunc (s *Scanner) nextFloatSlice(n int) []float64 {\n\tres := make([]float64, n)\n\tfor i := 0; i < n; i++ {\n\t\tres[i] = s.nextFloat()\n\t}\n\treturn res\n}\n\n// Arithmetic\nfunc max(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m < i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc min(nums ...int) int {\n\tm := nums[0]\n\tfor _, i := range nums {\n\t\tif m > i {\n\t\t\tm = i\n\t\t}\n\t}\n\treturn m\n}\n\nfunc abs(x int) int {\n\tif x > 0 {\n\t\treturn x\n\t}\n\treturn -x\n}\n\nfunc pow(x, y int) int {\n\tres := 1\n\tfor i := 0; i < y; i++ {\n\t\tres *= x\n\t}\n\treturn res\n}\n\nfunc ceil(a, b int) int {\n\tif a%b == 0 {\n\t\treturn a / b\n\t} else {\n\t\treturn a/b + 1\n\t}\n}\n\n// Sort\ntype RuneSlice []rune\n\nfunc (a RuneSlice) Len() int { return len(a) }\nfunc (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }\nfunc (a RuneSlice) Swap(i, j int) { a[i], a[j] = a[j], a[i] }\n\n// Main\nfunc main() {\n\tsc := NewScanner()\n\twtr := bufio.NewWriter(os.Stdout)\n\tN, _ := sc.nextInt(), sc.nextInt()\n\tS := make([]string, N)\n\tfor i := 0; i < N; i++ {\n\t\tS[i] = sc.nextStr()\n\t}\n\tsort.Strings(S)\n\n\tfor i := 0; i < N; i++ {\n\t\tfmt.Fprint(wtr, S[i])\n\t}\n\tfmt.Fprintln(wtr)\n\twtr.Flush()\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nIroha has a sequence of N strings S_1, S_2, ..., S_N. The length of each string is L.\n\nShe will concatenate all of the strings in some order, to produce a long string.\n\nAmong all strings that she can produce in this way, find the lexicographically smallest one.\n\nHere, a string s=s_1s_2s_3...s_n is lexicographically smaller than another string t=t_1t_2t_3...t_m if and only if one of the following holds:\n\nThere exists an index i(1≦i≦min(n,m)), such that s_j = t_j for all indices j(1≦j